I need to use cJSON to parse the uart data. I found the file in SDK15.3 but how can I use the related function?
just add sources and headers to your project and call functions as usual... you also need to add mem_manager library from SDK. cJSON has a good README with detailed instructions how to use this library.
I have already used the cJSON library, but now there is a problem. When the data length is too long, the parsing fails. (The data format is normal.) I suspect that the heap size is not enough. Can you tell me how to use the mem_manager library to manage the space size, and Meaning of the parameter？
Now, I am using cJSON_malloc, cJSON_free (equivalent to the C standard function malloc, free) to manage the space size.
Now I can successfully parse the json data and successfully create the json data. But as long as the data is too long, it will fail to build or parse. I suspect that using the standard library malloc will cause a memory leak. Is my suspicion correct? How to use the memory management library? And What should I do next?
Is there a routine example of how to use the memory management library?