Tool/software: TI-RTOS
Hi everybody!
Could you clarify me one point in your JSON library? My question relates the last parameter "uint16_t *maxValueSize" of this function:
int16_t Json_getValue(Json_Handle objHandle, const char *pKey, void *pValue, uint16_t *maxValueSize);
Which value should I pass by reference here?
As I understand, in case of string and raw data types I should pass pointer to a number of bytes, allocated for its value.
In case of "int32", "uint32", "real32", "ureal32" I should pass pointer to its type size in bytes, "sizeof(int32_t)", "sizeof(uint32_t)", "sizeof(real32_t)", "sizeof(ureal32_t)", respectively, as I understand.
But in case of "boolean" type, why "maxValueSize" variable should be no less than 2? If I pass pointer to variable, equals 1, then the function returns error code "-101" ("JSON_RC__PARSING_BUFFER_SIZE_EXCEEDED"), althoug internal representation of boolean type is "uint8_t". And if to follow my logic, "maxValueSize" variable should be 1. So, I would like to clarify this point to pass correct values.
And if I understand correctly, your description of "__JSON_GetValue()" function in json_engine.h file is a bit outdated. In note section you forgot to mention about unsigned types ("uint32_t" and "ureal32_t"), which are supported, it seems.
And sorry, if I misunderstood something, since I've not found complete documentation with examples.
Best regards,
Roman