Lora-net / sx1302_hal

SX1302/SX1303 Hardware Abstraction Layer and Tools (packet forwarder...)
Other
219 stars 272 forks source link

How to know the starting position of string in JSON using the prason library? #43

Closed wong-hao closed 3 years ago

wong-hao commented 3 years ago

As shown here, If I want to get the position of string 'data' in the JSON array rxpk, how to program?

I know that this library can get the content with code below, but I can't find the function of the position.

const char data= json_object_get_string(json_array_get_object(json_object_get_array(json_value_get_object(json_parse_string_with_comments((const char)(original string))), "rxpk"), 0), "data");

All I want to do is replace the original content with a new string to fill in.