Disconnect

Applicable Devices : RFD40, RFD90, RFD8500

Note: The code on this page is for tutorial purposes only. It shows how to call the SDK and is not production-ready: it leaves out error handling, threading and app lifecycle management. Review and adapt it before you use it in your app.

Overview

Closes the communication session with an RFID reader, using srfidTerminateCommunicationSession.

Details

Pass the reader ID of the connected reader to srfidTerminateCommunicationSession.


- (void)disconnectRfidReader:(int)selectedReaderID {
    SRFID_RESULT result = [apiInstance srfidTerminateCommunicationSession:selectedReaderID];
    if (SRFID_RESULT_SUCCESS != result) {
        NSLog(@"Could not disconnect from reader %d", selectedReaderID);
    }
}

The SDK reports that the session is closed through srfidEventCommunicationSessionTerminated: of your delegate, so subscribe to SRFID_EVENT_SESSION_TERMINATION. Do not send further commands to that reader after this callback.