KPN Things Device SDK
senml_json_parser.h
Go to the documentation of this file.
1/* _ __ ____ _ _
2 * | |/ / | _ \ | \ | |
3 * | ' / | |_) | | \| |
4 * | . \ | __/ | |\ |
5 * |_|\_\ |_| |_| \_|
6 *
7 * (c) 2020 KPN
8 * License: MIT License.
9 * Author: Joseph Verburg, Jan Bogaerts
10 *
11 * parse json header
12 */
13
14#ifndef THINGSML_SENML_JSON_PARSER
15#define THINGSML_SENML_JSON_PARSER
16
17#include "senml_jsonlistener.h"
18#include "senml_base_parser.h"
19
24
25 public:
27
28 virtual void key(String key);
29 virtual void value(String value);
30
31 private:
32 int expected; // name of key who's value is expected next
33 double baseValue; // if the current pack defined a base value, add it to all values that we find
34
35 void setValue(const void *value, int length, SenMLDataType dataType);
36};
37
38#endif // THINGSML_SENML_JSON_PARSER
Definition: senml_jsonlistener.h:34
Definition: senml_basepack.h:24
Definition: senml_base_parser.h:24
SenMLBasePack * root
Definition: senml_base_parser.h:27
Definition: senml_json_parser.h:23
SenMLJsonListener(SenMLBasePack *root)
Definition: senml_json_parser.h:26
virtual void key(String key)
Definition: senml_json_parser.cpp:38
virtual void value(String value)
Definition: senml_json_parser.cpp:97
#define String
Definition: defaults.h:47
SenMLDataType
Definition: senml_enums.h:25