Version: Smart Feature Phone 3.0

Bluetooth

Description#

The Bluetooth API lets a packaged app discover, pair with, and connect to Bluetooth devices. As it is a experimental and non-standard API, the API is currently available for certified and privileged apps only. Notice that 'bluetooth' permission is required for using Bluetooth API.

Note: App developers who wish to send data to a Bluetooth device can use the share activity. This activity allows sharing of images, audio, video and vCard content only.

API overview#

The main entry point for the API is the navigator.b2g.bluetooth property, which returns a BluetoothManager object.

Basic interfaces#

The following interfaces provide an app with basic Bluetooth functionality

  • BluetoothManager Allows access to all Bluetooth adapters available on the device. Adapters are the connection interface to connect another Bluetooth-enabled device to the current device.
  • BluetoothAdapter Used to handle all the operations requested by Bluetooth networks.
  • BluetoothClassOfDevice Provides identifying/classification information about a given remote Bluetooth device, available at discovery stage.
  • BluetoothDevice Provides information regarding a given remote Bluetooth device.
  • BluetoothDiscoveryHandle Used to notify the current application about the discovery of a remote Bluetooth device.

Gatt interfaces#

The following interfaces allow KaiOS to communicate with and consume Gatt (Generic Attribute Profile)-based services on remote Smart/LE (low energy) devices.

  • BluetoothGatt Handles initial communications and connections with Gatt services.
  • BluetoothGattService Represents a service provided by a GATT server, including the service definition, a list of included services, and a list of the characteristics of this service.
  • BluetoothGattCharacteristic Represents a GATT service characteristic, which includes characteristic definition, value, properties and configuration info, and a list of descriptors that provide related information.
  • BluetoothGattDescriptor Represents a GATT descriptor, which contains related information about a characteristic value.

Bluetooth event interfaces#

These objects represent different events occuring within a Bluetooth interaction.

Reference: MozillaWiki by Mozilla Contributors is licensed under CC-BY-SA 3.0.#