Part Number: MSP432E401Y
Hello,
We are using the JSON lib included in the SDK and we see a property parsing issue.
It was possible to reproduce it on the EVM board reworking the example included in the MSP432E401Y SDK as well.
Basically, we have:
1- a template
2- a working piece of JSON that is parsed correctly by the library
3- a non working piece of the JSON with the same semantics, but with a property just moved 2 lines down at the same tree level.
When we use 3 instead of 2 the same property reads as random value rather than the expected one.
The other values seem to read as expected instead.
Here below the template, the working JSON, the same non working JSON, and the output on the UART.
--> the property that holds the random value in 3 but not in 2 is "\"wifi\".\"WiFiOn\"".
We can provide the full .c rewoked example if needed.
Any suggestion? Could this be a corner case bug in the library?
Thanks,
Giuseppe
------------------------------------------------------------------------------------------------------------------------
#define EXAMPLE_TEMPLATE \
"{ "\
" \"ethIPv4Conf\": { "\
" \"ipv4Addr\" : string, "\
" \"ipv4Netmask\" : string, "\
" \"ipv4Gateway\" : string, "\
" \"ipv4socketTimeout\" : uint32, "\
" \"DHCPenable\" : boolean "\
" }, "\
" "\
" \"wifi\" : { "\
" \"SSID\" : string, "\
" \"passwd\" : string, "\
" \"WiFiOn\" : boolean "\
" } "\
"}"
---------------------------------------------------------------------
#define EXAMPLE_JSONBUF_WORKING \
"{ "\
" \"ethIPv4Conf\": { "\
" \"ipv4Addr\" : \"192.168.1.100\", "\
" \"ipv4Netmask\" : \"255.255.255.0\", "\
" \"ipv4Gateway\" : \"192.168.1.1\", "\
" \"ipv4socketTimeout\" : 10, "\
" \"DHCPenable\" : false "\
" }, "\
" "\
" \"wifi\" : { "\
" \"WiFiOn\" : false, "\
" \"SSID\" : \"mynetwork\", "\
" \"passwd\" : \"abcdefghil\" "\
" } "\
"}"
-------------------------------------------------------------------------------------------------
#define EXAMPLE_JSONBUF_NON_WORKING \
"{ "\
" \"ethIPv4Conf\": { "\
" \"ipv4Addr\" : \"192.168.1.100\", "\
" \"ipv4Netmask\" : \"255.255.255.0\", "\
" \"ipv4Gateway\" : \"192.168.1.1\", "\
" \"ipv4socketTimeout\" : 10, "\
" \"DHCPenable\" : false "\
" }, "\
" "\
" \"wifi\" : { "\
" \"SSID\" : \"mynetwork\", "\
" \"passwd\" : \"abcdefghil\", "\
" \"WiFiOn\" : false "\
" } "\
"}"
********************* OUTPUT ********************************
USING(2)
JSON object created from template
JSON buffer parsed
DHCPenable value: 0
SSID value: mynetwork
passwd value: abcdefghil
WiFiOn value: 0
Finished JSON example
****************************************************************
USING (3)
JSON object created from template
JSON buffer parsed
DHCPenable value: 0
SSID value: mynetwork
passwd value: abcdefghil
WiFiOn value: 768
Finished JSON example