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?
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?
Hi,
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.
Is there a routine example of how to use the memory management library?
Hi,
the only thing you need is to define some number of memory blocks in sdk_config.h, there are several sizes of memory blocks. Since I don't know neither the length and count of your json strings, nor the logic of your program, I cannot suggest you an optimal configuration. You can enable logging of memory manager in sdk_config and see how much memory is requested. Try to configure as much memory as possible, then run your build/parse tasks and call nrf_mem_diagnose(), it will show some memory usage statistics.
cJSON with memory manager is used by background_dfu example in SDK, you can look at its config.
Sorry, I still have doubts. I still don't understand the relationship between the memory management module and the cJSON library in the background_dfu example. Under extreme conditions, I need to parse 8192 bytes of data and build 47077 bytes of data (not including 3637 bytes of data in JSON format). What should I do?
Sorry, I still have doubts. I still don't understand the relationship between the memory management module and the cJSON library in the background_dfu example. Under extreme conditions, I need to parse 8192 bytes of data and build 47077 bytes of data (not including 3637 bytes of data in JSON format). What should I do?