Rapid Read

Applicable Devices : RFD40, RFD90, RFD8500

Overview

Performs a rapid read, a simple inventory without reading from a particular memory bank, using srfidStartRapidRead and srfidStopRapidRead.

Details

Rapid read operation is a simple inventory operation without performing a read from a particular memory bank.

The srfidStartRapidRead API function is used to request performing of rapid read operation. Aborting of rapid read operation is requested via srfidStopRapidRead API function. When performing of rapid read operation is requested the actual operation will be started once conditions specified by start trigger parameters are met. The on-going operation will be stopped in accordance with configured stop trigger parameters. If repeat monitoring option is enabled in start trigger configuration the actual operation will be started again after it has stopped once conditions of start trigger configuration are met. On starting and stopping of the actual operation the SDK will deliver asynchronous notifications to the application if the application has subscribed for events of this type.

The SDK will deliver asynchronous notifications to inform the application about tag data received from the RFID reader during the on-going operation if the application has subscribed for events of this type. Fields to be reported during asynchronous tag data related notification are configured via reportConfig parameter of srfidStartRapidRead API function.

The following examples demonstrate performing of rapid read operation that starts and stops immediately after requested operation performing and aborting.

Start and Stop Rapid Read


 -(void)startStopRapidRead{

    /* subscribe for tag data related events */
    [apiInstance srfidSubsribeForEvents:SRFID_EVENT_MASK_READ];
    /* subscribe for operation start/stop related events */
    [apiInstance srfidSubsribeForEvents:SRFID_EVENT_MASK_STATUS];

    /* allocate object for start trigger settings */
    srfidStartTriggerConfig *start_trigger_cfg = [[srfidStartTriggerConfig alloc] init];
    /* allocate object for stop trigger settings */
    srfidStopTriggerConfig *stop_trigger_cfg = [[srfidStopTriggerConfig alloc] init];

    /* allocate object for report parameters of rapid read operation */
    srfidReportConfig *report_cfg = [[srfidReportConfig alloc] init];

    /* allocate object for access parameters of rapid read operation */
    srfidAccessConfig *access_cfg = [[srfidAccessConfig alloc] init];

    /* an object for storage of error response received from RFID reader */
    NSString *error_response = nil;
    do {
            /* configure start and stop triggers parameters to start and stop actual operation immediately on a corresponding response */
            [start_trigger_cfg setStartOnHandheldTrigger:NO];
            [start_trigger_cfg setStartDelay:0];
            [start_trigger_cfg setRepeatMonitoring:NO];

            [stop_trigger_cfg setStopOnHandheldTrigger:NO];
            [stop_trigger_cfg setStopOnTimeout:NO];
            [stop_trigger_cfg setStopOnTagCount:NO];
            [stop_trigger_cfg setStopOnInventoryCount:NO];
            [stop_trigger_cfg setStopOnAccessCount:NO];
            /* set start trigger parameters */
            SRFID_RESULT result = [apiInstance srfidSetStartTriggerConfiguration:readerID aStartTriggeConfig:start_trigger_cfg aStatusMessage:&error_response];
            if (SRFID_RESULT_SUCCESS == result) {
                /* start trigger configuration applied */
                NSLog(@"Start trigger configuration has been set\n");
            }
            else {
                NSLog(@"Failed to set start trigger parameters\n");
                break;
            }
            /* set stop trigger parameters */
            result = [apiInstance srfidSetStopTriggerConfiguration:readerID aStopTriggeConfig:stop_trigger_cfg aStatusMessage:&error_response];
            if (SRFID_RESULT_SUCCESS == result) {
                /* stop trigger configuration applied */
                NSLog(@"Stop trigger configuration has been set\n");
            }
            else {
                NSLog(@"Failed to set stop trigger parameters\n");
                break;
            }

            /* start and stop triggers have been configured */
            error_response = nil;

            /* configure report parameters to report RSSI, Channel Index, Phase and PC fields */
            [report_cfg setIncPC:YES];
            [report_cfg setIncPhase:YES];
            [report_cfg setIncChannelIndex:YES];
            [report_cfg setIncRSSI:YES];
            [report_cfg setIncTagSeenCount:NO];
            [report_cfg setIncFirstSeenTime:NO];
            [report_cfg setIncLastSeenTime:NO];

            /* configure access parameters to perform the operation with 27.0 dBm antenna power level without application of pre-filters */
            [access_cfg setPower:270];
            [access_cfg setDoSelect:NO];


            /* request performing of rapid read operation */
            result = [apiInstance srfidStartRapidRead:readerID aReportConfig:report_cfg aAccessConfig:access_cfg aStatusMessage:&error_response];
            if (SRFID_RESULT_SUCCESS == result) {
                NSLog(@"Request succeed\n");

                /* stop an operation after 1 minute */

                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(60 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                    [apiInstance srfidStopRapidRead:self->readerID aStatusMessage:nil];
                });
            }
            else if (SRFID_RESULT_RESPONSE_ERROR == result) {
                NSLog(@"Error response from RFID reader: %@\n", error_response);
            }
            else {
                NSLog(@"Request failed\n");
            }

    } while (0);

}

Operation Status Event

The SDK calls srfidEventStatusNotify: when the radio operation starts and stops.


- (void)srfidEventStatusNotify:(int)readerID aEvent:(SRFID_EVENT_STATUS)event aNotification:(id)notificationData {
    NSLog(@"Radio operation has %@\n", ((SRFID_EVENT_STATUS_OPERATION_START == event) ? @"started" : @"stopped"));
}

Tag Data Event

The SDK calls srfidEventReadNotify: for each tag received from the reader.


- (void)srfidEventReadNotify:(int)readerID aTagData:(srfidTagData *)tagData {
    /* print the received tag data */
    NSLog(@"Tag data received from RFID reader with ID = %d\n", readerID);
    NSLog(@"Tag id: %@\n", [tagData getTagId]);

}