LogicalLabs External Accessories Module

API Docs for: 1.0.0
Show:

Session Class

Module: Readme

Objects of this class represent communication sessions between the iOS device and the accessory.

Item Index

Methods

Properties

Methods

close

() Void

Available since 1.0.0

Closes the session.

Returns:

Void:

write

(
  • params
)
Void

Available since 1.0.0

Writes data to the session.

Parameters:

  • params Object

    An object with the following properties:

    • data TiBuffer

      The data to be written.

Returns:

Void:

Properties

accessory

Accessory read-only

Available since 1.0.0

The accessory of the session

protocol

String read-only

Available since 1.0.0

The protocol of the session

Events

receivedData

Available since 1.0.0

Fired whenever the module receives data through the session.

Event Payload:

  • data TiBuffer

    The data received.

  • errorCode Number

    The error code; only present if an error occurred.

  • errorDomain String

    The error domain; only present if an error occurred.

  • errorDescription String

    The error description; only peresent if an error occurred.

writeProgress

Available since 1.0.0

Fired whenever the module, either successfully or unsuccessfully, attempted to write to the session.

Event Payload:

  • bytesWritten Number

    The number of bytes written. If an error occurred, this number will be -1.