Interface ISerial
interface ISerial
Extends com.amazon.apmf.IStandard
Methods
makeSerialSettingBuilder()
Make serial settings builder. This represents the settings used to create a serial connection or server.ISerialSettingsBuilder*makeSerialSettingBuilder()
Returns
ISerialSettingsBuilder*
Returns pointer to this ISerialSettingsBuilder.
Throws
OutOfMemoryError— if make an instance of [ISerialSettingsBuilder] failed.
makeServer()
Create a serial server based on the provided settings. A serial server provides services for a designated UUID. The server accepts an incoming connection from a serial client connecting to that service. Privilege: com.amazon.bluetooth.privilege.serialISerialServer*makeServer(ISerialSettings*settings,ISerialServerListener*listener)
Parameters
settings
ISerialSettings* — Required
Settings for the serial server, see [ISerialSettings].
listener
ISerialServerListener* — Required
Callback for receiving event related to this server,
see [ISerialServerListener].
Returns
ISerialServer*
Returns a server interface, see [ISerialServer]. The
server interface is a smart pointer and it should be stored as long as the
caller wants to use this server. If the reference to the server is dropped,
all the connections related to this server are automatically
disconnected if they were connected and becomes invalid.
Throws
OutOfMemoryError— if make an instance of IBluetoothPairingResponseBuilder failed.BluetoothBusy— if a server for this service already exist.BluetoothFail— if listener or settings are not provided.
makeConnectionInterface()
Create a serial connection interface for a specific device using the provided settings. This does not connect to the device directly, the method connect of the [ISerialConnection] interface must be called to perform the connection.ISerialConnection*makeConnectionInterface(IDevice*device,ISerialSettings*settings,ISerialConnectionListener*listener)
Parameters
device
IDevice* — Required
The device to create the connection to.
settings
ISerialSettings* — Required
Settings for the serial connection, see [ISerialSettings].
listener
ISerialConnectionListener* — Required
Callback for receiving event related to this
connection, see [ISerialConnectionListener]. If the connection is
successful, the listener is called and provides the connection
interface.
Returns
ISerialConnection*
Returns a connection interface, see [ISerialConnection]. The
connection interface is a smart pointer and it should be stored as long as
the caller wants to use this connection. If the reference to the connection
is dropped, the connection is automatically disconnected if it was
connected.
Throws
BluetoothFail— if listener or settings are not provided.

