Overview
Gets and changes the charging status of the terminal, using srfidGetChargeTerminalStatus and srfidEnableChargeTerminal.
Get Charge Terminal Status
The requestChargeTerminalStatus method retrieves the charging status of the terminal, using srfidGetChargeTerminalStatus.
- (SRFID_RESULT)requestChargeTerminalStatus
{
SRFID_RESULT srfid_result = SRFID_RESULT_FAILURE;
BOOL chargeTerminalStatus = NO;
for(int i = 0; i < 1; i++)
{
srfid_result = [apiInstance srfidGetChargeTerminalStatus:readerID chargeTerminalStatus:&chargeTerminalStatus];
if ((srfid_result != SRFID_RESULT_RESPONSE_TIMEOUT) && (srfid_result != SRFID_RESULT_FAILURE)) {
break;
}
}
if (srfid_result == SRFID_RESULT_SUCCESS)
{
NSLog(@"Charge terminal status: %d", chargeTerminalStatus);
}
return srfid_result;
}
Enable/Disable Charge Terminal Status
The requestChargeTerminalStatusEnable: method enables or disables the charging status of the terminal, using srfidEnableChargeTerminal. It initiates a request to change the charging status for the active RFID reader.
- (SRFID_RESULT)requestChargeTerminalStatusEnable:(BOOL)status
{
SRFID_RESULT srfid_result = SRFID_RESULT_FAILURE;
for(int i = 0; i < 1; i++)
{
srfid_result = [apiInstance srfidEnableChargeTerminal:readerID enableStatus:status];
if ((srfid_result != SRFID_RESULT_RESPONSE_TIMEOUT) && (srfid_result != SRFID_RESULT_FAILURE)) {
break;
}
}
if (srfid_result == SRFID_RESULT_SUCCESS)
{
// SUCCESS
}
else if(srfid_result == SRFID_RESULT_RESPONSE_ERROR)
{
// ERROR
}
else if(srfid_result == SRFID_RESULT_FAILURE || srfid_result == SRFID_RESULT_RESPONSE_TIMEOUT)
{
// do TIMEOUT/ FAILURE
}
return srfid_result;
}