menu
DeviceBluetoothBinding
import { DeviceBluetoothBinding } from "destack:device/binding";
Bluetooth binding family.
1export interface DeviceBluetoothBinding {2 listBluetoothAdapters(): Result<BluetoothAdapter[], HostError>;3 openBluetoothAdapterWatch(): Result<BluetoothAdapterWatchHandle, HostError>;4 closeBluetoothAdapterWatch(watch: BluetoothAdapterWatchHandle): Result<void, HostError>;5 readBluetoothAdapterWatch(watch: BluetoothAdapterWatchHandle, timeoutNs?: uint64 | undefined): Result<BluetoothAdapterEvent, HostError>;6 openBluetoothScan(options: &'a readonly BluetoothScanOptions): Result<BluetoothScanHandle, HostError>;7 closeBluetoothScan(scan: BluetoothScanHandle): Result<void, HostError>;8 readBluetoothScan(scan: BluetoothScanHandle, timeoutNs?: uint64 | undefined): Result<BluetoothScanEvent, HostError>;9 openBluetoothDevice(id: &'a readonly string): Result<BluetoothDeviceHandle, HostError>;10 closeBluetoothDevice(device: BluetoothDeviceHandle): Result<void, HostError>;11 describeBluetoothDevice(device: BluetoothDeviceHandle): Result<BluetoothDevice, HostError>;12 readBluetoothEvent(device: BluetoothDeviceHandle, timeoutNs?: uint64 | undefined): Result<BluetoothSessionEvent, HostError>;13 pairBluetoothDevice(device: BluetoothDeviceHandle): Result<void, HostError>;14 unpairBluetoothDevice(device: BluetoothDeviceHandle): Result<void, HostError>;15 readBluetoothRssi(device: BluetoothDeviceHandle): Result<int32, HostError>;16 listBluetoothGattServices(device: BluetoothDeviceHandle): Result<BluetoothGattService[], HostError>;17 listBluetoothGattCharacteristics(device: BluetoothDeviceHandle, serviceId: &'a readonly string): Result<BluetoothGattCharacteristic[], HostError>;18 listBluetoothGattDescriptors(device: BluetoothDeviceHandle, characteristicId: &'a readonly string): Result<BluetoothGattDescriptor[], HostError>;19 readBluetoothGattCharacteristic(device: BluetoothDeviceHandle, characteristicId: &'a readonly string, buffer: &'b [uint8]): Result<uint64, HostError>;20 writeBluetoothGattCharacteristic(device: BluetoothDeviceHandle, characteristicId: &'a readonly string, value: &'b readonly [uint8], mode: BluetoothGattWriteMode): Result<void, HostError>;21 readBluetoothGattDescriptor(device: BluetoothDeviceHandle, descriptorId: &'a readonly string, buffer: &'b [uint8]): Result<uint64, HostError>;22 writeBluetoothGattDescriptor(device: BluetoothDeviceHandle, descriptorId: &'a readonly string, value: &'b readonly [uint8]): Result<void, HostError>;23 subscribeBluetoothGatt(device: BluetoothDeviceHandle, characteristicId: &'a readonly string): Result<BluetoothSubscriptionHandle, HostError>;24 unsubscribeBluetoothGatt(subscription: BluetoothSubscriptionHandle): Result<void, HostError>;25 readBluetoothGattEvent(subscription: BluetoothSubscriptionHandle, buffer: &'a [uint8], timeoutNs?: uint64 | undefined): Result<BluetoothGattValueEvent, HostError>;26}Members
listBluetoothAdapters(): Result<BluetoothAdapter[], HostError>List Bluetooth adapters.
openBluetoothAdapterWatch(): Result<BluetoothAdapterWatchHandle, HostError>Open a Bluetooth adapter topology watch.
closeBluetoothAdapterWatch(watch: BluetoothAdapterWatchHandle): Result<void, HostError>Close a Bluetooth adapter topology watch.
readBluetoothAdapterWatch(watch: BluetoothAdapterWatchHandle, timeoutNs?: uint64 | undefined): Result<BluetoothAdapterEvent, HostError>Read one Bluetooth adapter topology event.
openBluetoothScan(options: &'a readonly BluetoothScanOptions): Result<BluetoothScanHandle, HostError>Open a Bluetooth LE scan.
closeBluetoothScan(scan: BluetoothScanHandle): Result<void, HostError>Close a Bluetooth LE scan.
readBluetoothScan(scan: BluetoothScanHandle, timeoutNs?: uint64 | undefined): Result<BluetoothScanEvent, HostError>Read one Bluetooth scan event.
openBluetoothDevice(id: &'a readonly string): Result<BluetoothDeviceHandle, HostError>Open a Bluetooth device session.
closeBluetoothDevice(device: BluetoothDeviceHandle): Result<void, HostError>Close a Bluetooth device session.
describeBluetoothDevice(device: BluetoothDeviceHandle): Result<BluetoothDevice, HostError>Describe a Bluetooth device session.
readBluetoothEvent(device: BluetoothDeviceHandle, timeoutNs?: uint64 | undefined): Result<BluetoothSessionEvent, HostError>Read one Bluetooth session event.
pairBluetoothDevice(device: BluetoothDeviceHandle): Result<void, HostError>Pair a Bluetooth device.
unpairBluetoothDevice(device: BluetoothDeviceHandle): Result<void, HostError>Unpair a Bluetooth device.
readBluetoothRssi(device: BluetoothDeviceHandle): Result<int32, HostError>Read Bluetooth signal strength.
listBluetoothGattServices(device: BluetoothDeviceHandle): Result<BluetoothGattService[], HostError>List Bluetooth GATT services.
listBluetoothGattCharacteristics(device: BluetoothDeviceHandle, serviceId: &'a readonly string): Result<BluetoothGattCharacteristic[], HostError>List Bluetooth GATT characteristics.
listBluetoothGattDescriptors(device: BluetoothDeviceHandle, characteristicId: &'a readonly string): Result<BluetoothGattDescriptor[], HostError>List Bluetooth GATT descriptors.
readBluetoothGattCharacteristic(device: BluetoothDeviceHandle, characteristicId: &'a readonly string, buffer: &'b [uint8]): Result<uint64, HostError>Read a Bluetooth GATT characteristic.
writeBluetoothGattCharacteristic(device: BluetoothDeviceHandle, characteristicId: &'a readonly string, value: &'b readonly [uint8], mode: BluetoothGattWriteMode): Result<void, HostError>Write a Bluetooth GATT characteristic.
readBluetoothGattDescriptor(device: BluetoothDeviceHandle, descriptorId: &'a readonly string, buffer: &'b [uint8]): Result<uint64, HostError>Read a Bluetooth GATT descriptor.
writeBluetoothGattDescriptor(device: BluetoothDeviceHandle, descriptorId: &'a readonly string, value: &'b readonly [uint8]): Result<void, HostError>Write a Bluetooth GATT descriptor.
subscribeBluetoothGatt(device: BluetoothDeviceHandle, characteristicId: &'a readonly string): Result<BluetoothSubscriptionHandle, HostError>Subscribe to Bluetooth GATT value notifications.
unsubscribeBluetoothGatt(subscription: BluetoothSubscriptionHandle): Result<void, HostError>Unsubscribe from Bluetooth GATT value notifications.
readBluetoothGattEvent(subscription: BluetoothSubscriptionHandle, buffer: &'a [uint8], timeoutNs?: uint64 | undefined): Result<BluetoothGattValueEvent, HostError>Read one Bluetooth GATT value notification.