Device

Device

Class representing a Bluetooth device.

Constructor

new Device(address, role)

Create a Bluetooth device.
Source:
Parameters:
Name Type Description
address string | Object The local Bluetooth identity address.
role string The BLE role of this device.

Members

address

Get the bluetooth address of this device. 'local.server': local/adapter, non-'local.server': other device.
Source:

addressType

Get the BLE address type. 'BLE_GAP_ADDR_TYPE_RANDOM_STATIC' (default) or `BLE_GAP_ADDR_TYPE_PUBLIC`.
Source:

connectionHandle

Method that sets `_connectionHandle` and `_instanceId` upon establishing a BLE connection. Called on `BLE_GAP_EVT_CONNECTED`.
Source:

connectionHandle

Get the BLE connection handle of this device.
Source:

instanceId

Get the instanceId of this device.
Source:

role

Get the BLE role of this device. `BLE_GAP_ROLE_CENTRAL` or `BLE_GAP_ROLE_PERIPH`.
Source:

Methods

processEventData(event) → {void}

Method that initializes `Device` as a discovered BLE peripheral. Called on `BLE_GAP_EVT_ADV_REPORT`.
Source:
Parameters:
Name Type Description
event Object Advertising report event received from SoftDevice.
Returns:
Type:
void