Class

EASession

The object you use to manage communications between your app and a connected hardware accessory.

Declaration

@interface EASession : NSObject

Overview

An EASession object creates a communications channel between your application and a connected hardware accessory. When creating a session, specify the protocol to use to communicate with the accessory. After initializing an EASession object, use the provided output and input streams to transfer data to and from the accessory according to that protocol.

After creating a session object, immediately retrieve and configure the stream objects provided by the session. Streams send events to their associated delegate to notify it of changes in the stream status. For example, streams notify the delegate when data is waiting to be read or when more space is available for writing data. For more information about how to use stream objects, see Stream Programming Guide.

When sending and receiving data using the provided streams, it is your responsibility to ensure the data is formatted according to the specified protocol. The EASession class has no knowledge of specific accessory protocols and doesn't attempt to format the data in any way before or after transferring it.

Topics

Creating the Session Object

- initWithAccessory:forProtocol:

Initializes the session for the specified accessory and protocol.

Getting Session Information

accessory

The accessory attached to the session.

protocolString

The protocol being used for communication with the accessory.

Getting the Communication Streams

inputStream

The stream to use for receiving data from the accessory.

outputStream

The stream to use for sending data to the accessory.

Relationships

Inherits From

See Also

Accessory Communication

EAAccessory

An object containing information about a single, connected hardware accessory.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software