Session Class
Objects of this class represent communication sessions between the iOS device and the accessory.
Methods
close
()
Void
Closes the session.
Returns:
Void:
write
(
Void
-
params
Writes data to the session.
Parameters:
-
paramsObjectAn object with the following properties:
-
dataTiBufferThe data to be written.
-
Returns:
Void:
Properties
protocol
String
read-only
The protocol of the session
Events
receivedData
Fired whenever the module receives data through the session.
Event Payload:
-
dataTiBufferThe data received.
-
errorCodeNumberThe error code; only present if an error occurred.
-
errorDomainStringThe error domain; only present if an error occurred.
-
errorDescriptionStringThe error description; only peresent if an error occurred.
writeProgress
Fired whenever the module, either successfully or unsuccessfully, attempted to write to the session.
Event Payload:
-
bytesWrittenNumberThe number of bytes written. If an error occurred, this number will be -1.
