UNPKG

@ermitsrl/bluetooth-le

Version:

Capacitor plugin for Bluetooth Low Energy

1,394 lines (1,393 loc) 68.4 kB
{ "api": { "name": "BleClientInterface", "slug": "bleclientinterface", "docs": "", "tags": [], "methods": [ { "name": "initialize", "signature": "(options?: InitializeOptions | undefined) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "InitializeOptions | undefined" } ], "returns": "Promise<void>", "tags": [], "docs": "Initialize Bluetooth Low Energy (BLE). If it fails, BLE might be unavailable on this device.\nOn **Android** it will ask for the location permission. On **iOS** it will ask for the Bluetooth permission.\nFor an example, see [usage](#usage).", "complexTypes": [ "InitializeOptions" ], "slug": "initialize" }, { "name": "isEnabled", "signature": "() => Promise<boolean>", "parameters": [], "returns": "Promise<boolean>", "tags": [], "docs": "Reports whether Bluetooth is enabled on this device.\nAlways returns `true` on **web**.", "complexTypes": [], "slug": "isenabled" }, { "name": "enable", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Enable Bluetooth.\nOnly available on **Android**.", "complexTypes": [], "slug": "enable" }, { "name": "disable", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Disable Bluetooth.\nOnly available on **Android**.", "complexTypes": [], "slug": "disable" }, { "name": "startEnabledNotifications", "signature": "(callback: (value: boolean) => void) => Promise<void>", "parameters": [ { "name": "callback", "docs": "Callback function to use when the Bluetooth state changes.", "type": "(value: boolean) => void" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "callback Callback function to use when the Bluetooth state changes." } ], "docs": "Register a callback function that will be invoked when Bluetooth is enabled (true) or disabled (false) on this device.\nNot available on **web** (the callback will never be invoked).", "complexTypes": [], "slug": "startenablednotifications" }, { "name": "stopEnabledNotifications", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Stop the enabled notifications registered with `startEnabledNotifications`.", "complexTypes": [], "slug": "stopenablednotifications" }, { "name": "isLocationEnabled", "signature": "() => Promise<boolean>", "parameters": [], "returns": "Promise<boolean>", "tags": [], "docs": "Reports whether Location Services are enabled on this device.\nOnly available on **Android**.", "complexTypes": [], "slug": "islocationenabled" }, { "name": "openLocationSettings", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Open Location settings.\nOnly available on **Android**.", "complexTypes": [], "slug": "openlocationsettings" }, { "name": "openBluetoothSettings", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Open Bluetooth settings.\nOnly available on **Android**.", "complexTypes": [], "slug": "openbluetoothsettings" }, { "name": "openAppSettings", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Open App settings.\nNot available on **web**.\nOn **iOS** when a user declines the request to use Bluetooth on the first call of `initialize`, it is not possible\nto request for Bluetooth again from within the app. In this case Bluetooth has to be enabled in the app settings\nfor the app to be able use it.", "complexTypes": [], "slug": "openappsettings" }, { "name": "setDisplayStrings", "signature": "(displayStrings: DisplayStrings) => Promise<void>", "parameters": [ { "name": "displayStrings", "docs": "", "type": "DisplayStrings" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "displayStrings" } ], "docs": "Set the strings that are displayed in the `requestDevice` dialog.", "complexTypes": [ "DisplayStrings" ], "slug": "setdisplaystrings" }, { "name": "requestDevice", "signature": "(options?: RequestBleDeviceOptions | undefined) => Promise<BleDevice>", "parameters": [ { "name": "options", "docs": "Device filters, see [RequestBleDeviceOptions](#RequestBleDeviceOptions)", "type": "RequestBleDeviceOptions | undefined" } ], "returns": "Promise<BleDevice>", "tags": [ { "name": "param", "text": "options Device filters, see [RequestBleDeviceOptions](#RequestBleDeviceOptions)" } ], "docs": "Request a peripheral BLE device to interact with. This will scan for available devices according to the filters in the options and show a dialog to pick a device.\nFor an example, see [usage](#usage).", "complexTypes": [ "BleDevice", "RequestBleDeviceOptions" ], "slug": "requestdevice" }, { "name": "requestLEScan", "signature": "(options: RequestBleDeviceOptions, callback: (result: ScanResult) => void) => Promise<void>", "parameters": [ { "name": "options", "docs": "", "type": "RequestBleDeviceOptions" }, { "name": "callback", "docs": "", "type": "(result: ScanResult) => void" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "options" }, { "name": "param", "text": "callback" } ], "docs": "Start scanning for BLE devices to interact with according to the filters in the options. The callback will be invoked on each device that is found.\nScanning will continue until `stopLEScan` is called. For an example, see [usage](#usage).\n**NOTE**: Use with care on **web** platform, the required API is still behind a flag in most browsers.", "complexTypes": [ "RequestBleDeviceOptions", "ScanResult" ], "slug": "requestlescan" }, { "name": "stopLEScan", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [], "docs": "Stop scanning for BLE devices. For an example, see [usage](#usage).", "complexTypes": [], "slug": "stoplescan" }, { "name": "getDevices", "signature": "(deviceIds: string[]) => Promise<BleDevice[]>", "parameters": [ { "name": "deviceIds", "docs": "List of device IDs, e.g. saved from a previous app run. No used on **web**.", "type": "string[]" } ], "returns": "Promise<BleDevice[]>", "tags": [ { "name": "param", "text": "deviceIds List of device IDs, e.g. saved from a previous app run. No used on **web**." } ], "docs": "On iOS and web, if you want to connect to a previously connected device without scanning first, you can use `getDevice`.\nUses [retrievePeripherals](https://developer.apple.com/documentation/corebluetooth/cbcentralmanager/1519127-retrieveperipherals) on iOS and\n[getDevices](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/getDevices) on web.\nOn Android, you can directly connect to the device with the deviceId.", "complexTypes": [ "BleDevice" ], "slug": "getdevices" }, { "name": "getConnectedDevices", "signature": "(services: string[]) => Promise<BleDevice[]>", "parameters": [ { "name": "services", "docs": "List of services to filter the devices by. If no service is specified, no devices will be returned. Only applies to iOS.", "type": "string[]" } ], "returns": "Promise<BleDevice[]>", "tags": [ { "name": "param", "text": "services List of services to filter the devices by. If no service is specified, no devices will be returned. Only applies to iOS." } ], "docs": "Get a list of currently connected devices.\nUses [retrieveConnectedPeripherals](https://developer.apple.com/documentation/corebluetooth/cbcentralmanager/1518924-retrieveconnectedperipherals) on iOS,\n[getConnectedDevices](https://developer.android.com/reference/android/bluetooth/BluetoothManager#getConnectedDevices(int)) on Android\nand [getDevices](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/getDevices) on web.", "complexTypes": [ "BleDevice" ], "slug": "getconnecteddevices" }, { "name": "scanNetworks", "signature": "(deviceId: string) => Promise<any[]>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" } ], "returns": "Promise<any[]>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" } ], "docs": "Get a list of wifi networks from the device.", "complexTypes": [], "slug": "scannetworks" }, { "name": "provision", "signature": "(deviceId: string, ssid: string, password?: string | undefined) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" }, { "name": "ssid", "docs": "The SSID of the network to connect to", "type": "string" }, { "name": "password", "docs": "The password of the network to connect to", "type": "string | undefined" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" }, { "name": "param", "text": "ssid The SSID of the network to connect to" }, { "name": "param", "text": "password The password of the network to connect to" } ], "docs": "Connect to a peripheral BLE device. For an example, see [usage](#usage).", "complexTypes": [], "slug": "provision" }, { "name": "connect", "signature": "(deviceId: string, proofOfPossession: string, onDisconnect?: ((deviceId: string) => void) | undefined, options?: TimeoutOptions | undefined) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" }, { "name": "proofOfPossession", "docs": "The proofOfPossession code to connect with security level 4. Only available on **Android**.", "type": "string" }, { "name": "onDisconnect", "docs": "Optional disconnect callback function that will be used when the device disconnects", "type": "((deviceId: string) => void) | undefined" }, { "name": "options", "docs": "Options for plugin call", "type": "TimeoutOptions | undefined" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" }, { "name": "param", "text": "proofOfPossession The proofOfPossession code to connect with security level 4. Only available on **Android**." }, { "name": "param", "text": "onDisconnect Optional disconnect callback function that will be used when the device disconnects" }, { "name": "param", "text": "options Options for plugin call" } ], "docs": "Connect to a peripheral BLE device. For an example, see [usage](#usage).", "complexTypes": [ "TimeoutOptions" ], "slug": "connect" }, { "name": "createBond", "signature": "(deviceId: string) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" } ], "docs": "Create a bond with a peripheral BLE device.\nOnly available on **Android**. On iOS bonding is handled by the OS.", "complexTypes": [], "slug": "createbond" }, { "name": "isBonded", "signature": "(deviceId: string) => Promise<boolean>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" } ], "returns": "Promise<boolean>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" } ], "docs": "Report whether a peripheral BLE device is bonded.\nOnly available on **Android**. On iOS bonding is handled by the OS.", "complexTypes": [], "slug": "isbonded" }, { "name": "setPin", "signature": "(deviceId: string) => Promise<boolean>", "parameters": [ { "name": "deviceId", "docs": "", "type": "string" } ], "returns": "Promise<boolean>", "tags": [], "docs": "", "complexTypes": [], "slug": "setpin" }, { "name": "disconnect", "signature": "(deviceId: string) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" } ], "docs": "Disconnect from a peripheral BLE device. For an example, see [usage](#usage).", "complexTypes": [], "slug": "disconnect" }, { "name": "getServices", "signature": "(deviceId: string) => Promise<BleService[]>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" } ], "returns": "Promise<BleService[]>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" } ], "docs": "Get services, characteristics and descriptors of a device.", "complexTypes": [ "BleService" ], "slug": "getservices" }, { "name": "discoverServices", "signature": "(deviceId: string) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" } ], "docs": "Discover services, characteristics and descriptors of a device.\nYou only need this method if your peripheral device changes its services and characteristics at runtime.\nIf the discovery was successful, the remote services can be retrieved using the getServices function.\nNot available on **web**.", "complexTypes": [], "slug": "discoverservices" }, { "name": "readRssi", "signature": "(deviceId: string) => Promise<number>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" } ], "returns": "Promise<number>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" } ], "docs": "Read the RSSI value of a connected device.\nNot available on **web**.", "complexTypes": [], "slug": "readrssi" }, { "name": "read", "signature": "(deviceId: string, service: string, characteristic: string, options?: TimeoutOptions | undefined) => Promise<DataView>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" }, { "name": "service", "docs": "UUID of the service (see [UUID format](#uuid-format))", "type": "string" }, { "name": "characteristic", "docs": "UUID of the characteristic (see [UUID format](#uuid-format))", "type": "string" }, { "name": "options", "docs": "Options for plugin call", "type": "TimeoutOptions | undefined" } ], "returns": "Promise<DataView>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" }, { "name": "param", "text": "service UUID of the service (see [UUID format](#uuid-format))" }, { "name": "param", "text": "characteristic UUID of the characteristic (see [UUID format](#uuid-format))" }, { "name": "param", "text": "options Options for plugin call" } ], "docs": "Read the value of a characteristic. For an example, see [usage](#usage).", "complexTypes": [ "DataView", "TimeoutOptions" ], "slug": "read" }, { "name": "write", "signature": "(deviceId: string, service: string, characteristic: string, value: DataView, options?: TimeoutOptions | undefined) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" }, { "name": "service", "docs": "UUID of the service (see [UUID format](#uuid-format))", "type": "string" }, { "name": "characteristic", "docs": "UUID of the characteristic (see [UUID format](#uuid-format))", "type": "string" }, { "name": "value", "docs": "The value to write as a DataView. To create a DataView from an array of numbers, there is a helper function, e.g. numbersToDataView([1, 0])", "type": "DataView" }, { "name": "options", "docs": "Options for plugin call", "type": "TimeoutOptions | undefined" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" }, { "name": "param", "text": "service UUID of the service (see [UUID format](#uuid-format))" }, { "name": "param", "text": "characteristic UUID of the characteristic (see [UUID format](#uuid-format))" }, { "name": "param", "text": "value The value to write as a DataView. To create a DataView from an array of numbers, there is a helper function, e.g. numbersToDataView([1, 0])" }, { "name": "param", "text": "options Options for plugin call" } ], "docs": "Write a value to a characteristic. For an example, see [usage](#usage).", "complexTypes": [ "DataView", "TimeoutOptions" ], "slug": "write" }, { "name": "writeWithoutResponse", "signature": "(deviceId: string, service: string, characteristic: string, value: DataView, options?: TimeoutOptions | undefined) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" }, { "name": "service", "docs": "UUID of the service (see [UUID format](#uuid-format))", "type": "string" }, { "name": "characteristic", "docs": "UUID of the characteristic (see [UUID format](#uuid-format))", "type": "string" }, { "name": "value", "docs": "The value to write as a DataView. To create a DataView from an array of numbers, there is a helper function, e.g. numbersToDataView([1, 0])", "type": "DataView" }, { "name": "options", "docs": "Options for plugin call", "type": "TimeoutOptions | undefined" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" }, { "name": "param", "text": "service UUID of the service (see [UUID format](#uuid-format))" }, { "name": "param", "text": "characteristic UUID of the characteristic (see [UUID format](#uuid-format))" }, { "name": "param", "text": "value The value to write as a DataView. To create a DataView from an array of numbers, there is a helper function, e.g. numbersToDataView([1, 0])" }, { "name": "param", "text": "options Options for plugin call" } ], "docs": "Write a value to a characteristic without waiting for a response.", "complexTypes": [ "DataView", "TimeoutOptions" ], "slug": "writewithoutresponse" }, { "name": "readDescriptor", "signature": "(deviceId: string, service: string, characteristic: string, descriptor: string, options?: TimeoutOptions | undefined) => Promise<DataView>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" }, { "name": "service", "docs": "UUID of the service (see [UUID format](#uuid-format))", "type": "string" }, { "name": "characteristic", "docs": "UUID of the characteristic (see [UUID format](#uuid-format))", "type": "string" }, { "name": "descriptor", "docs": "UUID of the descriptor (see [UUID format](#uuid-format))", "type": "string" }, { "name": "options", "docs": "Options for plugin call", "type": "TimeoutOptions | undefined" } ], "returns": "Promise<DataView>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" }, { "name": "param", "text": "service UUID of the service (see [UUID format](#uuid-format))" }, { "name": "param", "text": "characteristic UUID of the characteristic (see [UUID format](#uuid-format))" }, { "name": "param", "text": "descriptor UUID of the descriptor (see [UUID format](#uuid-format))" }, { "name": "param", "text": "options Options for plugin call" } ], "docs": "Read the value of a descriptor.", "complexTypes": [ "DataView", "TimeoutOptions" ], "slug": "readdescriptor" }, { "name": "writeDescriptor", "signature": "(deviceId: string, service: string, characteristic: string, descriptor: string, value: DataView, options?: TimeoutOptions | undefined) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" }, { "name": "service", "docs": "UUID of the service (see [UUID format](#uuid-format))", "type": "string" }, { "name": "characteristic", "docs": "UUID of the characteristic (see [UUID format](#uuid-format))", "type": "string" }, { "name": "descriptor", "docs": "UUID of the descriptor (see [UUID format](#uuid-format))", "type": "string" }, { "name": "value", "docs": "The value to write as a DataView. To create a DataView from an array of numbers, there is a helper function, e.g. numbersToDataView([1, 0])", "type": "DataView" }, { "name": "options", "docs": "Options for plugin call", "type": "TimeoutOptions | undefined" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" }, { "name": "param", "text": "service UUID of the service (see [UUID format](#uuid-format))" }, { "name": "param", "text": "characteristic UUID of the characteristic (see [UUID format](#uuid-format))" }, { "name": "param", "text": "descriptor UUID of the descriptor (see [UUID format](#uuid-format))" }, { "name": "param", "text": "value The value to write as a DataView. To create a DataView from an array of numbers, there is a helper function, e.g. numbersToDataView([1, 0])" }, { "name": "param", "text": "options Options for plugin call" } ], "docs": "Write a value to a descriptor.", "complexTypes": [ "DataView", "TimeoutOptions" ], "slug": "writedescriptor" }, { "name": "startNotifications", "signature": "(deviceId: string, service: string, characteristic: string, callback: (value: DataView) => void) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" }, { "name": "service", "docs": "UUID of the service (see [UUID format](#uuid-format))", "type": "string" }, { "name": "characteristic", "docs": "UUID of the characteristic (see [UUID format](#uuid-format))", "type": "string" }, { "name": "callback", "docs": "Callback function to use when the value of the characteristic changes", "type": "(value: DataView) => void" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" }, { "name": "param", "text": "service UUID of the service (see [UUID format](#uuid-format))" }, { "name": "param", "text": "characteristic UUID of the characteristic (see [UUID format](#uuid-format))" }, { "name": "param", "text": "callback Callback function to use when the value of the characteristic changes" } ], "docs": "Start listening to changes of the value of a characteristic.\nNote that you should only start the notifications once per characteristic in your app and share the data and\nnot call `startNotifications` in every component that needs the data.\nFor an example, see [usage](#usage).", "complexTypes": [ "DataView" ], "slug": "startnotifications" }, { "name": "stopNotifications", "signature": "(deviceId: string, service: string, characteristic: string) => Promise<void>", "parameters": [ { "name": "deviceId", "docs": "The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))", "type": "string" }, { "name": "service", "docs": "UUID of the service (see [UUID format](#uuid-format))", "type": "string" }, { "name": "characteristic", "docs": "UUID of the characteristic (see [UUID format](#uuid-format))", "type": "string" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan))" }, { "name": "param", "text": "service UUID of the service (see [UUID format](#uuid-format))" }, { "name": "param", "text": "characteristic UUID of the characteristic (see [UUID format](#uuid-format))" } ], "docs": "Stop listening to the changes of the value of a characteristic. For an example, see [usage](#usage).", "complexTypes": [], "slug": "stopnotifications" } ], "properties": [] }, "interfaces": [ { "name": "InitializeOptions", "slug": "initializeoptions", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "androidNeverForLocation", "tags": [ { "text": "false", "name": "default" } ], "docs": "If your app doesn't use Bluetooth scan results to derive physical\nlocation information, you can strongly assert that your app\ndoesn't derive physical location. (Android only)\nRequires adding 'neverForLocation' to AndroidManifest.xml\nhttps://developer.android.com/guide/topics/connectivity/bluetooth/permissions#assert-never-for-location", "complexTypes": [], "type": "boolean | undefined" } ] }, { "name": "DisplayStrings", "slug": "displaystrings", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "scanning", "tags": [ { "text": "0.0.1", "name": "since" }, { "text": "\"Scanning...\"", "name": "default" }, { "text": "\"Am Scannen...\"", "name": "example" } ], "docs": "", "complexTypes": [], "type": "string | undefined" }, { "name": "cancel", "tags": [ { "text": "0.0.1", "name": "since" }, { "text": "\"Cancel\"", "name": "default" }, { "text": "\"Abbrechen\"", "name": "example" } ], "docs": "", "complexTypes": [], "type": "string | undefined" }, { "name": "availableDevices", "tags": [ { "text": "0.0.1", "name": "since" }, { "text": "\"Available devices\"", "name": "default" }, { "text": "\"Verfügbare Geräte\"", "name": "example" } ], "docs": "", "complexTypes": [], "type": "string | undefined" }, { "name": "noDeviceFound", "tags": [ { "text": "0.0.1", "name": "since" }, { "text": "\"No device found\"", "name": "default" }, { "text": "\"Kein Gerät gefunden\"", "name": "example" } ], "docs": "", "complexTypes": [], "type": "string | undefined" } ] }, { "name": "BleDevice", "slug": "bledevice", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "deviceId", "tags": [], "docs": "ID of the device, which will be needed for further calls.\nOn **Android** this is the BLE MAC address.\nOn **iOS** and **web** it is an identifier.", "complexTypes": [], "type": "string" }, { "name": "name", "tags": [], "docs": "Name of the peripheral device.", "complexTypes": [], "type": "string | undefined" }, { "name": "uuids", "tags": [], "docs": "", "complexTypes": [], "type": "string[] | undefined" } ] }, { "name": "RequestBleDeviceOptions", "slug": "requestbledeviceoptions", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "services", "tags": [], "docs": "Filter devices by service UUIDs.\nUUIDs have to be specified as 128 bit UUID strings,\ne.g. ['0000180d-0000-1000-8000-00805f9b34fb']\nThere is a helper function to convert numbers to UUIDs.\ne.g. [numberToUUID(0x180f)]. (see [UUID format](#uuid-format))", "complexTypes": [], "type": "string[] | undefined" }, { "name": "name", "tags": [], "docs": "Filter devices by name", "complexTypes": [], "type": "string | undefined" }, { "name": "namePrefix", "tags": [], "docs": "Filter devices by name prefix", "complexTypes": [], "type": "string | undefined" }, { "name": "optionalServices", "tags": [], "docs": "For **web**, all services that will be used have to be listed under services or optionalServices,\ne.g. [numberToUUID(0x180f)] (see [UUID format](#uuid-format))", "complexTypes": [], "type": "string[] | undefined" }, { "name": "allowDuplicates", "tags": [], "docs": "Normally scans will discard the second and subsequent advertisements from a single device.\nIf you need to receive them, set allowDuplicates to true (only applicable in `requestLEScan`).\n(default: false)", "complexTypes": [], "type": "boolean | undefined" }, { "name": "scanMode", "tags": [], "docs": "Android scan mode (default: ScanMode.SCAN_MODE_BALANCED)", "complexTypes": [ "ScanMode" ], "type": "ScanMode" } ] }, { "name": "ScanResult", "slug": "scanresult", "docs": "", "tags": [], "methods": [], "properties": [ { "name": "device", "tags": [], "docs": "The peripheral device that was found in the scan.\n**Android** and **web**: `device.name` is always identical to `localName`.\n**iOS**: `device.name` is identical to `localName` the first time a device is discovered, but after connecting `device.name` is the cached GAP name in subsequent scans.", "complexTypes": [ "BleDevice" ], "type": "BleDevice" }, { "name": "localName", "tags": [], "docs": "The name of the peripheral device from the advertisement data.", "complexTypes": [], "type": "string | undefined" }, { "name": "rssi", "tags": [], "docs": "Received Signal Strength Indication.", "complexTypes": [], "type": "number | undefined" }, { "name": "txPower", "tags": [], "docs": "Transmit power in dBm. A value of 127 indicates that it is not available.", "complexTypes": [], "type": "number | undefined" }, { "name": "manufacturerData", "tags": [], "docs": "Manufacturer data, key is a company identifier and value is the data.", "complexTypes": [ "DataView" ], "type": "{ [key: string]: DataView; } | undefined" }, { "name": "serviceData", "tags": [], "docs": "Service data, key is a service UUID and value is the data.", "complexTypes": [ "DataView" ], "type": "{ [key: string]: DataView; } | undefined" }, { "name": "uuids", "tags": [], "docs": "Advertised services.", "complexTypes": [], "type": "string[] | undefined" }, { "name": "rawAdvertisement", "tags": [], "docs": "Raw advertisement data (**Android** only).", "complexTypes": [ "DataView" ], "type": "DataView" } ] }, { "name": "DataView", "slug": "dataview", "docs": "", "tags": [], "methods": [ { "name": "getFloat32", "signature": "(byteOffset: number, littleEndian?: boolean | undefined) => number", "parameters": [ { "name": "byteOffset", "docs": "The place in the buffer at which the value should be retrieved.", "type": "number" }, { "name": "littleEndian", "docs": "", "type": "boolean | undefined" } ], "returns": "number", "tags": [ { "name": "param", "text": "byteOffset The place in the buffer at which the value should be retrieved." } ], "docs": "Gets the Float32 value at the specified byte offset from the start of the view. There is\r\nno alignment constraint; multi-byte values may be fetched from any offset.", "complexTypes": [], "slug": "getfloat32" }, { "name": "getFloat64", "signature": "(byteOffset: number, littleEndian?: boolean | undefined) => number", "parameters": [ { "name": "byteOffset", "docs": "The place in the buffer at which the value should be retrieved.", "type": "number" }, { "name": "littleEndian", "docs": "", "type": "boolean | undefined" } ], "returns": "number", "tags": [ { "name": "param", "text": "byteOffset The place in the buffer at which the value should be retrieved." } ], "docs": "Gets the Float64 value at the specified byte offset from the start of the view. There is\r\nno alignment constraint; multi-byte values may be fetched from any offset.", "complexTypes": [], "slug": "getfloat64" }, { "name": "getInt8", "signature": "(byteOffset: number) => number", "parameters": [ { "name": "byteOffset", "docs": "The place in the buffer at which the value should be retrieved.", "type": "number" } ], "returns": "number", "tags": [ { "name": "param", "text": "byteOffset The place in the buffer at which the value should be retrieved." } ], "docs": "Gets the Int8 value at the specified byte offset from the start of the view. There is\r\nno alignment constraint; multi-byte values may be fetched from any offset.", "complexTypes": [], "slug": "getint8" }, { "name": "getInt16", "signature": "(byteOffset: number, littleEndian?: boolean | undefined) => number", "parameters": [ { "name": "byteOffset", "docs": "The place in the buffer at which the value should be retrieved.", "type": "number" }, { "name": "littleEndian", "docs": "", "type": "boolean | undefined" } ], "returns": "number", "tags": [ { "name": "param", "text": "byteOffset The place in the buffer at which the value should be retrieved." } ], "docs": "Gets the Int16 value at the specified byte offset from the start of the view. There is\r\nno alignment constraint; multi-byte values may be fetched from any offset.", "complexTypes": [], "slug": "getint16" }, { "name": "getInt32", "signature": "(byteOffset: number, littleEndian?: boolean | undefined) => number", "parameters": [ { "name": "byteOffset", "docs": "The place in the buffer at which the value should be retrieved.", "type": "number" }, { "name": "littleEndian", "docs": "", "type": "boolean | undefined" } ], "returns": "number", "tags": [ { "name": "param", "text": "byteOffset The place in the buffer at which the value should be retrieved." } ], "docs": "Gets the Int32 value at the specified byte offset from the start of the view. There is\r\nno alignment constraint; multi-byte values may be fetched from any offset.", "complexTypes": [], "slug": "getint32" }, { "name": "getUint8", "signature": "(byteOffset: number) => number", "parameters": [ { "name": "byteOffset", "docs": "The place in the buffer at which the value should be retrieved.", "type": "number" } ], "returns": "number", "tags": [ { "name": "param", "text": "byteOffset The place in the buffer at which the value should be retrieved." } ], "docs": "Gets the Uint8 value at the specified byte offset from the start of the view. There is\r\nno alignment constraint; multi-byte values may be fetched from any offset.", "complexTypes": [], "slug": "getuint8" }, { "name": "getUint16", "signature": "(byteOffset: number, littleEndian?: boolean | undefined) => number", "parameters": [ { "name": "byteOffset", "docs": "The place in the buffer at which the value should be retrieved.", "type": "number" }, { "name": "littleEndian", "docs": "", "type": "boolean | undefined" } ], "returns": "number", "tags": [ { "name": "param", "text": "byteOffset The place in the buffer at which the value should be retrieved." } ], "docs": "Gets the Uint16 value at the specified byte offset from the start of the view. There is\r\nno alignment constraint; multi-byte values may be fetched from any offset.", "complexTypes": [], "slug": "getuint16" }, { "name": "getUint32", "signature": "(byteOffset: number, littleEndian?: boolean | undefined) => number", "parameters": [ { "name": "byteOffset", "docs": "The place in the buffer at which the value should be retrieved.", "type": "number" }, { "name": "littleEndian", "docs": "", "type": "boolean | undefined" } ], "returns": "number", "tags": [ { "name": "param", "text": "byteOffset The place in the buffer at which the value should be retrieved." } ], "docs": "Gets the Uint32 value at the specified byte offset from the start of the view. There is\r\nno alignment constraint; multi-byte values may be fetched from any offset.", "complexTypes": [], "slug": "getuint32" }, { "name": "setFloat32", "signature": "(byteOffset: number, value: number, littleEndian?: boolean | undefined) => void", "parameters": [ { "name": "byteOffset", "docs": "The place in the buffer at which the value should be set.", "type": "number" }, { "name": "value", "docs": "The value to set.", "type": "number" },