Hi,
How could I parse a floating number with the JSON library?
when I add type with real32 in the template I got the Error: " -25, Couldn't create the template"
Best regards
Ahmad
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
How could I parse a floating number with the JSON library?
when I add type with real32 in the template I got the Error: " -25, Couldn't create the template"
Best regards
Ahmad
with template file like this:
{
"requestId":string,
"command":int32,
"status":boolean,
"temp":real32
}
in the json_engine.h in the library in the notes wrote that the library supports the below basics types:
\sa
\note
Currently supports only basic types: int32, real32, boolean, string, raw
best regards
Do you get the error when you create the template or when parsing the incoming data?
If possible split the FP to 2 integers (mantissa and exponent).
Yes, i was able to see the error myself.
I will try to debug this later this week.
You can also try to debug if you need this earlier (the json-parser sources are available in the SDK) or you can pass the FP number through two int32.
real32 (and ureal32) property needs to be defined as:
"property_name":real32<Q_LEFT,Q_RIGHT>
e.g. "temp":real32<28,4>