AdapterState

AdapterState

Class that provides state management for an `Adapter`.

Constructor

new AdapterState(instanceId, port, serialNumber)

Create an object to store `Adapter's` state.
Source:
Parameters:
Name Type Description
instanceId string The unique Id of this adapter.
port string The port this adapter uses. For example it can be 'COM1', '/dev/ttyUSB0' or similar.
serialNumber Number The serial number of the hardware device being controlled by this adapter.

Members

address

Get the Bluetooth address.
Source:

address

Set the Bluetooth address.
Source:

addressType

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

advertising :boolean

Whether the adapter is currently advertising.
Source:
Type:
  • boolean

available :boolean

Whether the adapter is available and successfully opened.
Source:
Type:
  • boolean

baudRate :number

The baud rate that the adapter's serial port is configured with.
Source:
Type:
  • number

bleEnabled :boolean

Whether the BLE stack has been enabled.
Source:
Type:
  • boolean

connecting :boolean

Whether the adapter is currently connecting to a device.
Source:
Type:
  • boolean

firmwareVersion :string

The SoftDevice firmware version used by this adapter.
Source:
Type:
  • string

flowControl :string

Whether flow control is configured for this adapter's serial port. Can be either 'none' or 'hw'.
Source:
Type:
  • string

instanceId

Get the instanceId of this adapter.
Source:

name :string

The device name that is related to this adapter.
Source:
Type:
  • string

opening :boolean

Whether the adapter is in the process of being opened.
Source:
Type:
  • boolean

parity :string

The parity that the adapter's serial port is configured with. Can be either 'none' or 'even'.
Source:
Type:
  • string

port

Get the port this adapter uses.
Source:

scanning :boolean

Whether the adapter is currently scanning for devices.
Source:
Type:
  • boolean

serialNumber

Get the serial number of the hardware device this adapter controls.
Source: