I would be quite happy to read them all at once, but only the last 2 or 3 will actually be of interest to me. I mention this because I will not mind if the oldest backtraces are overwritten by newer ones. I am not intending to transmit or compile the backtraces anywhere else.
Is there a simple way I could read the number of backtraces currently in the log and then if they are too high, erase them? Or could I just keep using adl_errHalt and it will just keep working?
Also, if I want to read them to a terminal emulator, could I use this:
void MyAnalysisFunction ()
// Start analysis
s8 AnalysisHandle = adl_errStartBacktraceAnalysis();
// Get state
adl_errAnalysisState_e State = adl_errGetAnalysisState();
// Retrieve next backtrace size
u8 * Buffer = NULL;
u32 Size = adl_errRetrieveNextBacktrace ( AnalysisHandle, Buffer, 0 );
// Retrieve next backtrace buffer
Buffer = adl_memGet ( Size );
adl_errRetrieveNextBacktrace ( AnalysisHandle, Buffer, Size );
// Erase all backtraces
// Return backtrace buffer
adl_atSendResponse(ADL_AT_UNS, "Backtrace:|%s|", Buffer);
If I build it into my application with a way to trigger it (for a diagnostic situation).
Obviously I have copied this from the “nominal use case of the ADL Error service” in the ADL User Guide (except rather than returning the buffer I am attempting to output it to the console - not sure if this way of referring to the Buffer is sensible though?). There seems to be something unexplained here though; does adl_errRetrieveNextBacktrace retrieve all the backtraces at once? If not why is there no loop? And if so how do you separate each backtrace entry?
All I really want is the easiest way to read the strings from the backtrace logs. Can this be done in M2M studio or something?