WLAN Status, Scan and Certificates

Applicable Devices : RFD40 Premium, RFD40 Premium Plus, RFD90

Overview

Gets the WLAN status of an RFID reader, the list of WLANs it can see and the list of WLAN certificates, using srfidGetWifiStatus, srfidGetWlanScanList, srfidGetWlanCertificatesList.

Get WLAN Status

The getWifiStatus method queries the WiFi status of an RFID reader using the reader’s ID. It attempts to retrieve the status information and a status message, handling different outcomes such as success, response errors, and timeouts. The method logs success, response errors, and failures or timeouts.


/// Get wifi status
/// @param readerID The reader id
/// @param wifiStatusInfo The wifi status info
/// @param statusMessage The status message
- (SRFID_RESULT)getWifiStatus:(int)readerID wifiStatusInfo:(srfidGetWifiStatusInfo **)wifiStatusInfo status:(NSString **)statusMessage
{

    SRFID_RESULT srfid_result = SRFID_RESULT_FAILURE;

    for(int i = 0; i < 1; i++){
        srfid_result = [apiInstance srfidGetWifiStatus:readerID wifiStatusInfo:wifiStatusInfo aStatusMessage:statusMessage];

        if ((srfid_result != SRFID_RESULT_RESPONSE_TIMEOUT) && (srfid_result != SRFID_RESULT_FAILURE )) {
            break;
        }
    }

    if (srfid_result == SRFID_RESULT_SUCCESS){

        NSLog(@"getWifiStatus success");


    }else if(srfid_result == SRFID_RESULT_RESPONSE_ERROR){

        NSLog(@"SRFID_RESULT_RESPONSE_ERROR");

    }else if(srfid_result == SRFID_RESULT_FAILURE || srfid_result == SRFID_RESULT_RESPONSE_TIMEOUT){

        NSLog(@"Timeout or Failure");

    }


    return srfid_result;
}

Get WLAN Scan List

The getWlanScanList method retrieves WLAN list from an RFID reader using the Zebra RFID SDK. It returns the result of the operation and updates the statusMessage with relevant information.


/// Get wlan scan list data.
/// @param readerID The reader id.
/// @param statusMessage The status message.
- (SRFID_RESULT)getWlanScanList:(int)readerID status:(NSString **)statusMessage {

    SRFID_RESULT srfid_result = SRFID_RESULT_FAILURE;

    for(int i = 0; i < 3; i++)
    {
        srfid_result = [apiInstance srfidGetWlanScanList:readerID aStatusMessage:statusMessage];

        if ((srfid_result != SRFID_RESULT_RESPONSE_TIMEOUT) && (srfid_result != SRFID_RESULT_FAILURE))
        {
            break;
        }
    }

    if (srfid_result == SRFID_RESULT_SUCCESS)
    {
        NSLog(@"reader scan Wlan success");
    }
    else if(srfid_result == 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;
}

Get WLAN Certificate List

The getWlanCertificatesList method retrieves WLAN certificates from an RFID reader using the Zebra RFID SDK. It returns the operation’s result and populates the provided array with certificates if successful.


- (SRFID_RESULT)getWlanCertificatesList:(int)readerID wlanCertificatesList:(NSMutableArray **)wlanCertificatesList status:(NSString **)statusMessage
{
    SRFID_RESULT srfid_result = SRFID_RESULT_FAILURE;

    for(int i = 0; i < 3; i++)
    {
        srfid_result = [apiInstance srfidGetWlanCertificatesList:readerID wlanCertificatesList:wlanCertificatesList aStatusMessage:statusMessage];

        if ((srfid_result != SRFID_RESULT_RESPONSE_TIMEOUT) && (srfid_result != SRFID_RESULT_FAILURE))
        {
            break;
        }
    }
    if (srfid_result == SRFID_RESULT_SUCCESS)
    {
        NSLog(@"Get WLAN certificate list success");
    }
    else if(srfid_result == SRFID_RESULT_RESPONSE_ERROR)
    {
        NSLog(@"Get WLAN certificate list 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;
}