SCPReconnectionDelegate

Objective-C

@protocol SCPReconnectionDelegate <NSObject>

Swift

protocol ReconnectionDelegate : NSObjectProtocol

Implement this protocol to handle bluetooth auto-reconnection.

  • The reader has lost Bluetooth connection to the SDK and reconnection attempts have been started.

    In your implementation of this method, you should notify your user that the reader disconnected and that reconnection attempts are being made.

    Requires autoReconnectOnUnexpectedDisconnect is set to true in the SCPBluetoothConnectionConfig

    Declaration

    Objective-C

    - (void)terminal:(nonnull SCPTerminal *)terminal
        didStartReaderReconnect:(nonnull SCPCancelable *)cancelable;

    Swift

    func terminal(_ terminal: Terminal, didStartReaderReconnect cancelable: SCPCancelable)

    Parameters

    terminal

    The originating terminal.

    cancelable

    A cancelable that can be used to stop reconnection

  • The SDK was able to reconnect to the previously connected Bluetooth reader.

    In your implementation of this method, you should notify your user that reader connection has been re-established.

    Requires autoReconnectOnUnexpectedDisconnect is set to true in the SCPBluetoothConnectionConfig

    Declaration

    Objective-C

    - (void)terminalDidSucceedReaderReconnect:(nonnull SCPTerminal *)terminal;

    Swift

    func terminalDidSucceedReaderReconnect(_ terminal: Terminal)

    Parameters

    terminal

    The originating terminal.

  • The SDK was not able to reconnect to the previously connected bluetooth reader. The SDK is now disconnected from any readers.

    In your implementation of this method, you should notify your user that the reader has disconnected.

    Requires autoReconnectOnUnexpectedDisconnect is set to true in the SCPBluetoothConnectionConfig

    Declaration

    Objective-C

    - (void)terminalDidFailReaderReconnect:(nonnull SCPTerminal *)terminal;

    Swift

    func terminalDidFailReaderReconnect(_ terminal: Terminal)

    Parameters

    terminal

    The originating terminal.