SCPReconnectionDelegate
Objective-C
@protocol SCPReconnectionDelegate <NSObject>
Swift
protocol ReconnectionDelegate : NSObjectProtocol
Implement this protocol to handle Bluetooth auto-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
autoReconnectOnUnexpectedDisconnectis set totruein theSCPBluetoothConnectionConfigDeclaration
Objective-C
- (void)readerDidSucceedReconnect:(nonnull SCPReader *)reader;Swift
func readerDidSucceedReconnect(_ reader: SCPReader)Parameters
readerThe 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
autoReconnectOnUnexpectedDisconnectis set totruein theSCPBluetoothConnectionConfigDeclaration
Objective-C
- (void)readerDidFailReconnect:(nonnull SCPReader *)reader;Swift
func readerDidFailReconnect(_ reader: SCPReader)Parameters
readerThe reader that failed to be reconnected to.
-
Deprecated
Use reader:didStartReconnect:disconnectReason: instead.
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
autoReconnectOnUnexpectedDisconnectis set totruein theSCPBluetoothConnectionConfigNote
Update to
reader:didStartReconnect:disconnectReason:to get the reason the reader disconnected. If that method is not implemented, this method will be not be called. This method will be removed in 4.0.Declaration
Objective-C
- (void)reader:(nonnull SCPReader *)reader didStartReconnect:(nonnull SCPCancelable *)cancelable;Swift
optional func reader(_ reader: SCPReader, didStartReconnect cancelable: SCPCancelable)Parameters
readerThe reader that is attempting to be reconnected to.
cancelableA cancelable that can be used to stop 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
autoReconnectOnUnexpectedDisconnectis set totruein theSCPBluetoothConnectionConfigDeclaration
Objective-C
- (void)reader:(nonnull SCPReader *)reader didStartReconnect:(nonnull SCPCancelable *)cancelable disconnectReason:(SCPDisconnectReason)disconnectReason;Swift
optional func reader(_ reader: SCPReader, didStartReconnect cancelable: SCPCancelable, disconnectReason: DisconnectReason)Parameters
readerThe reader that is attempting to be reconnected to
cancelableA cancelable that can be used to stop reconnection
disconnectReasonThe reason the reader disconnected