@yoda/bluetooth

The YodaOS includes support for the Bluetooth network stack, which allows a device to wirelessly exchange data with other Bluetooth devices. Using the Bluetooth APIs, your application can perform the followings:

  • Control Bluetooth playback.
  • Transfer data to and from other devices.

Classes

BluetoothA2dp
BluetoothHfp
BluetoothPlayer
BluetoothMessageStream

Members

(static) protocol

Get bluetooth protocol constant difinitions.

Example
var bluetooth = require('@yoda/bluetooth')
var protocol = bluetooth.protocol
var a2dp = bluetooth.getAdapter(protocol.PROFILE.A2DP)

Methods

(static) getMessageStream() → {module:@yoda/bluetooth.BluetoothMessageStream}

get the BluetoothMessageStream instance for messaging.

(static) getPlayer() → {module:@yoda/bluetooth.BluetoothPlayer}

get the BluetoothPlayer instance for multimedia.

(static) disconnect() → {module:@yoda/bluetooth.BluetoothPlayer}

disconnect all the bluetooth.

(static) getAdapter(profile)

Get bluetooth adapter by profile name.

Parameters:
Name Type Description
profile PROFILE

The profile name.

Type Definitions

PROFILE

Properties:
Name Type Description
BLE string

Bluetooth low energy profile.

A2DP string

Bluetooth advanced audio distribution profile.

HFP string

Bluetooth hands-free profile.