Overview
Configures an endpoint on an RFID reader, using srfidSetEndPointConfig.
Details
The addEndPointConfig method configures an RFID reader’s endpoint using the Zebra RFID SDK. It returns the success, handles response errors, and failures or timeouts.
Creating RfidSetEndPointConfig object
RfidSetEndPointConfig * config = [[RfidSetEndPointConfig alloc] init];
//if activate
[config setOperation:@"activate"];
//if update endpoint settings
[config setOperation:@"update"];
//if add new endpoint settings
[config setOperation:@"new"];
[config setepname:@"endpoint name"];
[config setType:@"MDM"];
[config setProtocol:@"MQTT"];
[config setURL:@"url"];
[config setPort:@"port number"];
[config setKeepalive:@"Keep-alive time"];
[config setTenantid:@"tenant id"];
//if enable clean session
[config setEncleanss:1];
// or disable clean session
[config setDscleanss:1];
[config setRcdelaymin:@"reconnect delay min time"];
[config setRcdelaymax:@"reconnect delay max time"];
[config setHostvfy:@"host verify"];
[config setUserName:@"username"];
[config setPassword:@"password"];
//If setType MDM
//If setType SOTI no need to do below steps
//if setType MDM and setProtocol MQTT
[config setSubname:@"sub name"];
[config setPub1name:@"command topic"];
[config setPub2name:@"event topic"];
//if setType MDM and setProtocol MQTT_TLS
[config setCacertname:@"ca certificate name"];
[config setCertname:@"certificate name"];
[config setKeyname:@"key name"];
-(SRFID_RESULT)addEndPointConfig:(int)readerID endPointConfig:(RfidSetEndPointConfig*)endpointConfig aStatusMessage:(NSString**)statusMessage
{
SRFID_RESULT srfid_result = SRFID_RESULT_FAILURE;
for(int i = 0; i < 3; i++)
{
srfid_result = [apiInstance srfidSetEndPointConfig:readerID endPointConfig:endpointConfig aStatusMessage:statusMessage];
if ((srfid_result != SRFID_RESULT_RESPONSE_TIMEOUT) && (srfid_result != SRFID_RESULT_FAILURE))
{
break;
}
}
if (srfid_result == SRFID_RESULT_SUCCESS)
{
NSLog(@"Add endpoint config success");
}
else if(srfid_result == SRFID_RESULT_RESPONSE_ERROR)
{
NSLog(@"Add endpoint config SRFID_RESULT_RESPONSE_ERROR");
// do nothing
}
else if(srfid_result == SRFID_RESULT_FAILURE || srfid_result == SRFID_RESULT_RESPONSE_TIMEOUT)
{
NSLog(@"Timeout or Failure");
}
return srfid_result;
}