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 totrue
in theSCPBluetoothConnectionConfig
Declaration
Objective-C
- (void)reader:(nonnull SCPReader *)reader didStartReconnect:(nonnull SCPCancelable *)cancelable;
Swift
func reader(_ reader: SCPReader, didStartReconnect cancelable: SCPCancelable)
Parameters
reader
The reader that is attempting to be reconnected to.
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 totrue
in theSCPBluetoothConnectionConfig
Declaration
Objective-C
- (void)readerDidSucceedReconnect:(nonnull SCPReader *)reader;
Swift
func readerDidSucceedReconnect(_ reader: SCPReader)
Parameters
reader
The reader that has now been reconnected to.
-
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 totrue
in theSCPBluetoothConnectionConfig
Declaration
Objective-C
- (void)readerDidFailReconnect:(nonnull SCPReader *)reader;
Swift
func readerDidFailReconnect(_ reader: SCPReader)
Parameters
reader
The reader that failed to be reconnected to.