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:
-
params
ObjectAn object with the following properties:
-
data
TiBufferThe 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:
-
data
TiBufferThe data received.
-
errorCode
NumberThe error code; only present if an error occurred.
-
errorDomain
StringThe error domain; only present if an error occurred.
-
errorDescription
StringThe 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:
-
bytesWritten
NumberThe number of bytes written. If an error occurred, this number will be -1.