Initializer

init(accessory:forProtocol:)

Initializes the session for the specified accessory and protocol.

Declaration

init?(accessory: EAAccessory, forProtocol protocolString: String)

Parameters

accessory

The accessory with which you want to communicate. You can get a list of accessory objects from the EAAccessoryManager object.

protocolString

The protocol to use when communicating with the accessory. This protocol must be one that the accessory understands. All communications with the accessory are expected to use this protocol.

Return Value

The initialized session object. This method may return nil if the accessory does not recognize the specified protocol or there was an error communicating with the accessory.

Discussion

There can be only one session object at a time for a given accessory and protocol combination.