Get Available Readers

Applicable Devices : RFD40, RFD90, RFD8500

Overview

Retrieves the lists of available and active RFID readers known to the SDK, using srfidGetAvailableReadersList and srfidGetActiveReadersList.

Details

Following terms are introduced to distinguish RFID readers that are seen by the SDK via OS API and RFID readers with which the SDK has established a logical communication session and thus is able to interact. A RFID reader is called available if it is already connected to the iOS device via Bluetooth. Such RFID reader is seen by the SDK and the SDK can establish a logical communication session to interact with the RFID reader. If a logical communication session is established with already connected via Bluetooth RFID reader the RFID reader is called active.

The SDK supports simultaneous interaction with multiple active RFID readers. To distinguish various RFID readers the SDK assigns the unique integer identifier for each RFID reader when it becomes available first time.

The SDK maintains internal lists of active and available RFID readers. Following example demonstrates reception of lists of active and available RFID readers from the SDK.


-(void)getAvailableReaderList {
    /* allocate an array for storage of list of available RFID readers */
    NSMutableArray *available_readers = [[NSMutableArray alloc] init];

    /* allocate an array for storage of list of active RFID readers */
    NSMutableArray *active_readers = [[NSMutableArray alloc] init];

    /* retrieve a list of available readers */
    [apiInstance srfidGetAvailableReadersList:&available_readers];

    /* retrieve a list of active readers */
    [apiInstance srfidGetActiveReadersList:&active_readers];

    /* merge active and available readers to a single list */
    NSMutableArray *readers = [[NSMutableArray alloc] init];

    [readers addObjectsFromArray:active_readers];
    [readers addObjectsFromArray:available_readers];
    for (srfidReaderInfo *info in readers) {
        /* print the information about RFID reader represented by srfidReaderInfo object */
        NSLog(@"RFID reader is %@: ID = %d name = %@\n", (([info isActive] == YES) ? @"active" : @"available"), [info getReaderID], [info getReaderName]);
        readerID = [info getReaderID];
    }
}