Interface ISerialConnection
interface ISerialConnection
Extends com.amazon.apmf.IStandard
Methods
connect()
void connect()
Attempt to connect.
The connect() blocks until either the connection is successful
or the connection failed.
Privilege: com.amazon.bluetooth.privilege.serial
Throws
BluetoothUnsupported— if called for a server connection because a server can’t be the one initiating a connection (For RFCOMM type of connection).BluetoothFail— if connection failed.BluetoothConnectionFailed— if connection fails due to internal error.
disconnect()
void disconnect()
Disconnect the connection.
Privilege: com.amazon.bluetooth.privilege.serial
sendData()
Send data. Privilege: com.amazon.bluetooth.privilege.serialvoidsendData(u8[]data)
Parameters
data
u8[] — Required
Array of bytes.
Throws
BluetoothTryAgain— if data can’t be sent due to the connection being congested.BluetoothNotConnected— if connection is not established.
getDevice()
Return the device related to this connection interface.IDevice*getDevice()
Returns
IDevice*
Returns pointer to IDevice.

