KTKDeviceConnectionDelegate Protocol Reference

Conforms to NSObject
Declared in KTKDeviceConnection.h

Overview

It is possible if read and/or write operations are scheduled one after another that connection will happen only once, so any delegate’s methods would be called just once, even with few configuration operations scheduled.

Connection Delegate Methods

– deviceConnectionDidConnect:

Tells the delegate that a device connection was successful.

- (void)deviceConnectionDidConnect:(KTKDeviceConnection *)connection

Parameters

connection

The device connection object reporting the event.

Discussion

Tells the delegate that a device connection was successful.

Declared In

KTKDeviceConnection.h

– deviceConnection:operation:progress:

Tells the delegate what is the progress of a read or write operation.

- (void)deviceConnection:(KTKDeviceConnection *)connection operation:(KTKDeviceConnectionOperationType)operation progress:(double)progress

Parameters

connection

The device connection object reporting the event.

operation

An operation type.

progress

An operation type.

Discussion

Tells the delegate what is the progress of a read or write operation.

Declared In

KTKDeviceConnection.h

– deviceConnection:didFailWithError:connectionAttemptsLeft:

Tells the delegate that a device connection error occurred.

- (void)deviceConnection:(KTKDeviceConnection *)connection didFailWithError:(NSError *_Nullable)error connectionAttemptsLeft:(NSInteger)attemptsLeft

Parameters

connection

The device connection object reporting the event.

error

An error object containing the error that indicates why the connection failed.

attemptsLeft

A number of reconnection attempts left. If attemptsLeft is 0, it will report final error.

Discussion

Tells the delegate that a device connection error occurred.

Declared In

KTKDeviceConnection.h

– deviceConnectionDidDisconnect:withError:

Tells the delegate that a devices connection was ended.

- (void)deviceConnectionDidDisconnect:(KTKDeviceConnection *)connection withError:(NSError *_Nullable)error

Parameters

connection

The device connection object reporting the event.

error

An error object containing the error that indicates why the device disconnected.

Discussion

Tells the delegate that a devices connection was ended.

Declared In

KTKDeviceConnection.h