TODO: this is not up to date
Contains most management functions.
options:
bus: DBus | undefined
: an existing DBus connection. Default: create new connectionservice: DBus.Service | string | null | undefined
: service where to register default Profiles / Agents. Default: null (connection local service)objectPath: string | undefined
: object path where to register default Profiles / Agents. Default: "/org/node/bluez"
Initializes DBus and interfaces. MUST be called bevor any bluetooth interaction is done. Attach device event listeners first, because calling init() will emit device events for paired devices.
Registers a Profile Bluetooth Service.
For available options see Bluez Docs.
Registers a Agent required for pairing.
For available options see Bluez Docs.
Returns a Device for a given address.
address can be a adress in format XX:XX:XX:XX:XX:XX
or XX_XX_XX_XX_XX_XX
or /org/bluez/hciX/dev_XX_XX_XX_XX_XX_XX
Search for a Device given a custom filter function
Returns a Adapter either by name or of not supplied the first one available.
Search for a Adapter given a custom filter function
Emitted if a device was discovered.
Note that for paired devices this will be emitted no matter if the devices are in range or not.
An Adapter represents a local Bluetooth adapter.
interface is the DBus Interface corresponding the the Adapter.
Should not be called directly. Use Bluez.getAdapter()
.
For available methods and properties see Bluez Docs.
An Agent is required for pairing with devices.
This default implementation accepts every pair request and has the passkey 1234
DBusObject is the DBus Object under witch the interface should be registerd.
For available methods and properties see Bluez Docs.
A Device represents a remote Bluetooth device.
For available methods and properties see Bluez Docs.
interface is the DBus Interface corresponding the the Device.
Should not be called directly. Use Bluez.getDevice()
.
Get a GATT Service of the Device.
For available methods and properties see Bluez Docs.
Get a GATT Characteristic of the Service.
For available methods and properties see Bluez Docs.
Get a GATT Descriptor of the Characteristic.
For available methods and properties see Bluez Docs.
A Profile is a service provided by this Bluetooth device.
DBusObject is the DBus Object under witch the interface should be registerd.
For available methods and properties see Bluez Docs.
A Profile implementation for Serial communication.
constructor(bluez: Bluez, DBusObject: DBus.ServiceObject, listener: (device: Device, socket: RawFdSocket)=>void): SerialProfile
listener is a callback that is called for each new connection to the Profile. Its socket parameter is the established channel between the two devices.