Get a specific adapter (one of available in adapters())
Adapter
Method
Description
Promise<String> getAddress()
The Bluetooth device address.
Promise<String> getAddressType()
The Bluetooth Address Type. One of public or random.
Promise<String> getName()
The Bluetooth system name (pretty hostname).
Promise<String> getAlias()
The Bluetooth friendly name.
Promise<bool> isPowered()
Adapter power status.
Promise<bool> isDiscovering()
Indicates that a device discovery procedure is active.
Promise<void> startDiscovery()
Starts the device discovery session.
Promise<void> stopDiscovery()
Cancel any previous StartDiscovery transaction.
Promise<String[]> devices()
List of discovered Bluetooth Low Energy devices
Promise<Device> getDevice(String uuid)
Returns an available Bluetooth Low Energy (waitDevice is preferred)
Promise<Device> waitDevice(String uuid)
Returns a Bluetooth Low Energy device as soon as it is available
Promise<String> toString()
User friendly adapter name
Device extends EventEmitter
Method
Description
Promise<String> getName()
The Bluetooth remote name.
Promise<String> getAddress()
The Bluetooth device address of the remote device.
Promise<String> getAddressType()
The Bluetooth Address Type. One of public or random.
Promise<String> getAlias()
The name alias for the remote device.
Promise<String> getRSSI()
Received Signal Strength Indicator of the remote device.
Promise<String> isPaired()
Indicates if the remote device is paired.
Promise<String> isConnected()
Indicates if the remote device is currently connected.
Promise<void> pair()
Connects to the remote device, initiate pairing and then retrieve GATT primary services (needs a default agent to handle wizard).
Promise<void> cancelPair()
This method can be used to cancel a pairing operation initiated by the Pair method.
Promise<void> connect()
This is a generic method to connect any profiles the remote device supports that can be connected to and have been flagged as auto-connectable on our side.
Promise<void> disconnect()
This method gracefully disconnects all connected profiles and then terminates low-level ACL connection.
Promise<GattServer> gatt()
Waits services resolving, then returns a connection to the remote Gatt Server