Overview
Helps support and engineering diagnose RFID reader behaviour in the field: stream live diagnostics while work is happening, and pull stored log files from the reader for deeper analysis.
Retrieves the log data stored on the RFID reader, from its RAM and FLASH log files, using srfidGetReaderLog.
Details
Start retrieval of the log data stored in the reader RAM and FLASH log files in one operation. The call needs an administrator login first (see Login Support for E8 Devices). Without it the call fails with the message "User has not logged as an admin".
The log text is not returned by the call. The reader sends it as debug events, first the RAM log and then the FLASH log. To receive them, subscribe to SRFID_EVENT_MASK_DEBUG_INFO and handle SRFID_EVENT_STATUS_DEBUG_INFO in srfidEventStatusNotify:aEvent:aNotification:. The event data is an srfidNotificationDebugEvent: read the text with getMessage and the level with getLevel.
- (SRFID_RESULT)getReaderLog:(NSString**)statusMessage
{
// Subscribe to the reader's log lines
[apiInstance srfidSubsribeForEvents:SRFID_EVENT_MASK_DEBUG_INFO];
SRFID_RESULT srfid_result = [apiInstance srfidGetReaderLog:readerID
logState:SRFID_LOGSTATE_INTERNALRAMANDFLASHLOGSTATE
aStatusMessage:statusMessage];
if (srfid_result == SRFID_RESULT_FAILURE || srfid_result == SRFID_RESULT_RESPONSE_TIMEOUT)
{
NSLog(@"Failure");
}
return srfid_result;
}
Add this to your srfidEventStatusNotify:aEvent:aNotification: to receive the log lines:
- (void)srfidEventStatusNotify:(int)readerID aEvent:(SRFID_EVENT_STATUS)event aNotification:(id)notificationData {
if (SRFID_EVENT_STATUS_DEBUG_INFO == event) {
srfidNotificationDebugEvent *logEvent = (srfidNotificationDebugEvent *)notificationData;
NSLog(@"Reader log [level %d]: %@", [logEvent getLevel], [logEvent getMessage]);
}
}