B2G/Bluetooth/WebBluetooth-v2/BluetoothSocket
< B2G | Bluetooth | WebBluetooth-v2
Jump to navigation
Jump to search
- Under Construction *
Overview
BluetoothSocket is used to send and receive data to Bluetooth devices using RFCOMM connections.
Interfaces
BluetoothSocket
[CheckPermissions="bluetoothSocket"]
interface BluetoothSocket: EventTarget
{
readonly attribute BluetoothSocketState state;
readonly attribute DOMString serviceUuid;
readonly attribute DOMString address;
attribute EventHandler onmessage; // ArrayBuffer aData
attribute EventHandler onclose; // DOMString aErrorMsg
attribute EventHandler onconnect;
[NewObject, Throws] Promise<void> send(ArrayBuffer aData); [NewObject, Throws] Promise<void> close(); };
BluetoothSocketState
[CheckPermissions="bluetoothSocket"]
enum BluetoothSocketState
{
"connecting",
"open",
"closing",
"closed"
};