B2G/Bluetooth/WebBluetooth-v2/BluetoothSocket

From MozillaWiki
< B2G‎ | Bluetooth‎ | WebBluetooth-v2
Revision as of 08:21, 5 March 2015 by Jamin Liu (talk | contribs) (→‎BluetoothSocket: adjust layout)
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;
           attribute EventHandler onclose;
           attribute EventHandler onconnect;

  [NewObject, Throws] Promise<void> send(ArrayBuffer aData);
  [NewObject, Throws] Promise<void> close();
};

BluetoothSocketState

[CheckPermissions="bluetoothSocket"]
enum BluetoothSocketState
{
  "connecting",
  "open",
  "closing",
  "closed"
};

Properties

Event Handlers

Methods

See Also