Hi There,
Can I update the record only by adding content based on the former record?
Best,
Gaosheng
Hi,
The answer to this question depends on what SDK and what library in that SDK we are talking about. What SDK, and what flash writing library, are you using?
nRF5 SDK v17.1.0 and Flash Data Storage (FDS)?
nRF5 SDK for Mesh v5.0.0 and the Mesh configuration module?
Other?
Regards,
Terje
Hi,
The answer to this question depends on what SDK and what library in that SDK we are talking about. What SDK, and what flash writing library, are you using?
nRF5 SDK v17.1.0 and Flash Data Storage (FDS)?
nRF5 SDK for Mesh v5.0.0 and the Mesh configuration module?
Other?
Regards,
Terje
Hi Terje,
Thank you for your reply. In FDS, I can find the operations about deleting, adding, updating, and queries. About the updating, it says it only delete the former then update the new one. I am not sure if the former info exists.
Best,
Gaosheng
Hi,
In order to use fds_record_update(), you need a record descriptor to tell FDS which record you want to update. This means you do need to search for the existing record, for instance through use of fds_record_find(). If you do not find an existing record, you should use fds_record_write() instead.
See for instance how this is done for the Flash Data Storage Example. There you will find relevant code in the function record_update() in the file cli.c. There is also use of fds_record_find() in the main() funciton of main.c, where the record is read, modified and updated (if it exists) or written (if it does not exist, in the else branch.)
Regards,
Terje