Overview
Saves the current reader configuration as persistent and restores a stored configuration, using srfidSaveReaderConfiguration and srfidRestoreReaderConfiguration.
Details
Various parameters of a particular RFID reader configured via SDK are lost after the next power down. The SDK provides an ability to store and restore a persistent configuration of RFID reader. The srfidSaveReaderConfiguration API function could be used to either make current configuration persistent over power down and power up cycles or store current configuration to custom defaults area. The configuration stored to custom defaults area could be restored via srfidRestoreReaderConfiguration API function. The same API function is used to restore the factory defined configuration. The following examples demonstrate utilization of mentioned API functions.
Make Configuration Persistent
The saveReaderCurrentConfigurationPersistent method makes the current configuration persistent over power down and power up cycles.
-(void)saveReaderCurrentConfigurationPersistent {
/* an object for storage of error response received from RFID reader */
NSString *error_response = nil;
/* cause the RFID reader to make the current configuration persistent */
SRFID_RESULT result = [apiInstance srfidSaveReaderConfiguration:readerID aSaveCustomDefaults:NO aStatusMessage:&error_response];
if (SRFID_RESULT_SUCCESS == result) {
NSLog(@"Current configuration became persistent\n");
}
else {
NSLog(@"Request failed\n");
}
}
Save Configuration to Custom Defaults
The saveReaderCurrentConfigurationWithCustomDefaults method stores the current configuration in the custom defaults area.
-(void)saveReaderCurrentConfigurationWithCustomDefaults {
/* an object for storage of error response received from RFID reader */
NSString *error_response = nil;
/* cause the RFID reader to save current configuration in custom defaults area */
SRFID_RESULT result = [apiInstance srfidSaveReaderConfiguration:readerID aSaveCustomDefaults:YES aStatusMessage:&error_response];
if (SRFID_RESULT_SUCCESS == result) {
NSLog(@"Current configuration stored in custom defaults\n");
}
else
{
NSLog(@"Request failed\n");
}
}
Restore Configuration from Custom Defaults
The restoreReaderConfigurationFromCustomDefaults method restores the configuration stored in the custom defaults area.
-(void)restoreReaderConfigurationFromCustomDefaults {
/* an object for storage of error response received from RFID reader */
NSString *error_response = nil;
/* cause the RFID reader to restore configuration from custom defaults */
SRFID_RESULT result = [apiInstance srfidRestoreReaderConfiguration:readerID aRestoreFactoryDefaults:NO aStatusMessage:&error_response];
if (SRFID_RESULT_SUCCESS == result) {
NSLog(@"Request Success\n");
}
else {
NSLog(@"Request failed\n");
}
}
Restore Factory Defined Configuration
The restoreReaderConfigurationWithFactoryDefinedConfiguration method restores the factory defined configuration.
-(void)restoreReaderConfigurationWithFactoryDefinedConfiguration {
/* an object for storage of error response received from RFID reader */
NSString *error_response = nil;
/* cause the RFID reader to restore factory defined configuration */
SRFID_RESULT result = [apiInstance srfidRestoreReaderConfiguration:readerID aRestoreFactoryDefaults:YES aStatusMessage:&error_response];
if (SRFID_RESULT_SUCCESS == result) {
NSLog(@"Request Success\n");
}
else {
NSLog(@"Request failed\n");
}
}