I'm looking to integrate logging to the EEPROM in my custom movesense firmware. Reading the docs on the logging service, I've verified that I have the logging system configured with my custom whiteboard objects, and that logging is enabled (logging state is set to 3), with the following code:
WB_RES::DataLoggerConfig dConfig;
WB_RES::DataEntry dEntry, dEntry1;
WB_RES::DataLoggerStateValues::Type dlstate = WB_RES::DataLoggerStateValues::Type::DATALOGGER_LOGGING;
dEntry.path = "/App/Object1";
dEntry1.path = "/App/Object2";
dConfig.dataEntries.dataEntry = {dEntry, dEntry1};
result = asyncPut(WB_RES::LOCAL::MEM_DATALOGGER_CONFIG(), AsyncRequestOptions::Empty, dConfig);
if(!wb::RETURN_OKC(result))
DebugLogger::info("asyncPut::datalogger config threw error: %u", result);
result = asyncPut(WB_RES::LOCAL::MEM_DATALOGGER_STATE(), AsyncRequestOptions::Empty, dlstate);
if(!wb::RETURN_OKC(result))
DebugLogger::info("asyncPut::datalogger start threw error: %u", result);
The whiteboard object paths I have configured in the yaml file are:
paths: /App/Object1/Subscription:
<blah, post/delete actions defined>
paths: /App/Object2/Subscription:
<blah, post/delete actions defined>
First off, is this correct, in getting the movesense firmware to log these whiteboard objects? What is the relationship between the whiteboard path defined in the yaml file to the data entry path that we configure in the code? Do they have to match exactly?
Second, if I have the above correct, then are will the entries be automatically logged when I post a notification to the subscribed consumers (currently done in the onNotify() method), or will I have to create a specific wb::LogEntry object, and populate that, and then do an asyncPost to the MEM_LOGBOOK_ENTRIES() target, like so:
wb::LogEntry foo;
result = asyncPost(WB_RES::LOCAL::MEM_LOGBOOK_ENTRIES(), AsyncRequestOptions::Empty, foo);
If that is the case, are they any helper functions to help populate the wb::LogEntry object, since it looks like you need an id, timestamp, and then the whiteboard data object? Or do we have to generate those on our own?