Socket
Socket
Sign inDemoInstall

@ionic-native/bluetooth-le

Package Overview
Dependencies
Maintainers
6
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic-native/bluetooth-le - npm Package Compare versions

Comparing version 5.0.0-beta.18 to 5.0.0-beta.19

145

index.d.ts

@@ -23,3 +23,2 @@ import { IonicNativePlugin } from '@ionic-native/core';

services?: string[];
/** True/false to allow duplicate advertisement packets, defaults to false (iOS) */
allowDuplicates?: boolean;

@@ -120,3 +119,2 @@ /** Defaults to Low Power. Available from API21 / API 23 (Android) */

export interface BondedStatus extends CommonInfo {
/** Bonded status */
isBonded: boolean;

@@ -242,3 +240,2 @@ }

service: string;
/** Array of characteristic objects */
characteristics: Characteristic[];

@@ -288,2 +285,10 @@ }

}
export interface AdapterInfo {
name: string;
address: string;
isInitialized: boolean;
isEnabled: boolean;
isScanning: boolean;
isDiscoverable: boolean;
}
/**

@@ -320,3 +325,3 @@ * @name BluetoothLE

* @name initialize
* @description Initialize Bluetooth on the device
* Initialize Bluetooth on the device
* @param {InitParams} [params]

@@ -330,3 +335,3 @@ * @returns {(Promise<{ status: 'enabled' | 'disabled'}>)} The callback that is passed initialize status (enabled/disabled)

* @name enable (Android)
* @description Enable Bluetooth on the device. Android support only
* Enable Bluetooth on the device. Android support only
* @returns {Promise<{ status: boolean }>}

@@ -339,3 +344,3 @@ */

* @name disable (Android)
* @description Disable Bluetooth on the device. Android support only
* Disable Bluetooth on the device. Android support only
* @returns void

@@ -346,16 +351,12 @@ */

* @name getAdapterInfo (Android)
* @description @todo
* @returns {Promise<{ name: string, address: string, isInitialized: boolean, isEnabled: boolean, isScanning: boolean, isDiscoverable: boolean}>}
* Retrieve useful information such as the address, name, and various states (initialized, enabled, scanning, discoverable).
* This can be very useful when the general state of the adapter has been lost, and we would otherwise need to go through a series of callbacks to get the correct state (first initialized, then enabled, then isScanning, and so forth).
* The result of this method allows us to take business logic decisions while avoiding a large part of the callback hell.
* Currently the discoverable state does not have any relevance because there is no "setDiscoverable" functionality in place. That may change in the future.
* @returns {Promise<AdapterInfo>}
*/
getAdapterInfo(): Promise<{
name: string;
address: string;
isInitialized: boolean;
isEnabled: boolean;
isScanning: boolean;
isDiscoverable: boolean;
}>;
getAdapterInfo(): Promise<AdapterInfo>;
/**
* @name startScan
* @description Scan for Bluetooth LE devices.
* Scan for Bluetooth LE devices.
* Since scanning is expensive, stop as soon as possible. The Cordova app should use a timer to limit the scan interval.

@@ -366,3 +367,3 @@ * Android API >= 23 requires ACCESS_COARSE_LOCATION permissions to find unpaired devices.

* If not enabled, use requestLocation to prompt the location services settings page.
* @param params Scan params
* @param {ScanParams} params Scan params
* @returns {(Observable<{ status: ScanStatus }>)}

@@ -375,3 +376,3 @@ */

* @name stopScan
* @description Stop scan for Bluetooth LE devices. Since scanning is expensive, stop as soon as possible
* Stop scan for Bluetooth LE devices. Since scanning is expensive, stop as soon as possible
* The app should use a timer to limit the scanning time.

@@ -385,3 +386,3 @@ * @returns {Promise<{status: 'scanStopped'}>}

* @name retrieveConnected
* @description Retrieved paired Bluetooth LE devices. In iOS, devices that are "paired" to will not return during a normal scan.
* Retrieved paired Bluetooth LE devices. In iOS, devices that are "paired" to will not return during a normal scan.
* Callback is "instant" compared to a scan.

@@ -398,3 +399,3 @@ * @param {{ services: string[] }} An array of service IDs to filter the retrieval by. If no service IDs are specified, no devices will be returned.

* @name bond (Android)
* @description Bond with a device.
* Bond with a device.
* The device doesn't need to be connected to initiate bonding. Android support only.

@@ -417,3 +418,3 @@ * @param {{ address: string }} params The address/identifier provided by the scan's return object

* @name unbond (Android)
* @description Unbond with a device. The device doesn't need to be connected to initiate bonding. Android support only.
* Unbond with a device. The device doesn't need to be connected to initiate bonding. Android support only.
* @param {{address: string}} params The address/identifier

@@ -431,3 +432,3 @@ * @returns {Promise<{ status: DeviceInfo }>}

* @name connect
* @description Connect to a Bluetooth LE device
* Connect to a Bluetooth LE device
* @param connectSuccess The success callback that is passed with device object

@@ -450,3 +451,3 @@ * @param connectError The callback that will be triggered when the connect operation fails

* @name reconnect
* @description Reconnect to a previously connected Bluetooth device
* Reconnect to a previously connected Bluetooth device
* @param {{address: string}} params The address/identifier

@@ -462,3 +463,3 @@ * @returns {(Observable<{ status: DeviceInfo }>)}

* @name disconnect
* @description Disconnect from a Bluetooth LE device.
* Disconnect from a Bluetooth LE device.
* Note: It's simpler to just call close(). Starting with iOS 10, disconnecting before closing seems required!

@@ -475,3 +476,3 @@ * @param {{address: string}} params The address/identifier

* @name close
* @description Close/dispose a Bluetooth LE device.
* Close/dispose a Bluetooth LE device.
* Prior to 2.7.0, you needed to disconnect to the device before closing, but this is no longer the case.

@@ -489,3 +490,3 @@ * Starting with iOS 10, disconnecting before closing seems required!

* @name discover
* @description Discover all the devices services, characteristics and descriptors.
* Discover all the devices services, characteristics and descriptors.
* Doesn't need to be called again after disconnecting and then reconnecting.

@@ -510,3 +511,3 @@ * If using iOS, you shouldn't use discover and services/characteristics/descriptors on the same device.

* @name services (iOS)
* @description Discover the device's services.
* Discover the device's services.
* Not providing an array of services will return all services and take longer to discover. iOS support only.

@@ -524,3 +525,3 @@ * @param {{address: string, services: string[]}} params

* @name characteristics (iOS)
* @description Discover the service's characteristics.
* Discover the service's characteristics.
* Not providing an array of characteristics will return all characteristics and take longer to discover. iOS support only.

@@ -535,3 +536,3 @@ * @param {CharacteristicParams} params Characteristic params

* @name descriptors (iOS)
* @description Discover the characteristic's descriptors. iOS support only.
* Discover the characteristic's descriptors. iOS support only.
* @param {DescriptorParams} params

@@ -545,19 +546,23 @@ * @returns {Promise<{ descriptors: Descriptors }>}

* @name read
* @description Read a particular service's characteristic once
* Read a particular service's characteristic once
* @param {DescriptorParams} params
* @returns {Promise<OperationResult>}
*/
read(params: DescriptorParams): Promise<OperationResult>;
read(params: DescriptorParams): Promise<{
result: OperationResult;
}>;
/**
* @name subscribe
* @description Subscribe to a particular service's characteristic.
* Subscribe to a particular service's characteristic.
* Once a subscription is no longer needed, execute unsubscribe in a similar fashion.
* The Client Configuration descriptor will automatically be written to enable notification/indication based on the characteristic's properties.
* @param {DescriptorParams} params
* @returns {Promise<OperationResult>}
* @returns {(Observable<{ result: OperationResult }>)}
*/
subscribe(params: DescriptorParams): Observable<OperationResult>;
subscribe(params: DescriptorParams): Observable<{
result: OperationResult;
}>;
/**
* @name unsubscribe
* @description Unsubscribe to a particular service's characteristic.
* Unsubscribe to a particular service's characteristic.
* @param {DescriptorParams} params

@@ -569,3 +574,3 @@ * @returns {Promise<UnsubscribeResult>}

* @name write (limitation on iOS, read below)
* @description Write a particular service's characteristic
* Write a particular service's characteristic
* Note: no callback will occur on write without response on iOS.

@@ -578,3 +583,3 @@ * @param {WriteCharacteristicParams} params

* @name write (limitation on iOS, read below)
* @description Write Quick / Queue, use this method to quickly execute write without response commands when writing more than 20 bytes at a time.
* Write Quick / Queue, use this method to quickly execute write without response commands when writing more than 20 bytes at a time.
* Note: no callback will occur on write without response on iOS.

@@ -587,3 +592,3 @@ * @param {WriteCharacteristicParams} params

* @name readDescriptor
* @description Read a particular characterist's descriptor
* Read a particular characterist's descriptor
* @param {OperationDescriptorParams} params

@@ -595,3 +600,3 @@ * @returns {Promise<DescriptorResult>}

* @name writeDescriptor
* @description Write a particular characteristic's descriptor. Unable to write characteristic configuration directly to keep in line with iOS implementation.
* Write a particular characteristic's descriptor. Unable to write characteristic configuration directly to keep in line with iOS implementation.
* Instead use subscribe/unsubscribe, which will automatically enable/disable notification.

@@ -604,3 +609,3 @@ * @param {WriteDescriptorParams} params

* @name rssi
* @description Read RSSI of a connected device. RSSI is also returned with scanning.
* Read RSSI of a connected device. RSSI is also returned with scanning.
* @param {{ address: string }} params

@@ -616,3 +621,3 @@ * @returns {Promise<{ rssi: RSSI }>}

* @name mtu (Android, Android 5+)
* @description Set MTU of a connected device. Android only.
* Set MTU of a connected device. Android only.
* @param {{ address: string, mtu: number }} params

@@ -629,3 +634,3 @@ * @returns {Promise<{ mtu: MTU }>}

* @name requestConnectionPriority (Android, Android 5+)
* @description Request a change in the connection priority to improve throughput when transfer large amounts of data via BLE.
* Request a change in the connection priority to improve throughput when transfer large amounts of data via BLE.
* Android support only. iOS will return error.

@@ -641,3 +646,3 @@ * @param {{ address: string, connectionPriority: ConnectionPriority }} params

* @name isInitialized
* @description Determine whether the adapter is initialized. No error callback. Returns true or false
* Determine whether the adapter is initialized. No error callback. Returns true or false
* @returns {Promise<{ isInitialized: boolean }>}

@@ -650,3 +655,3 @@ */

* @name isEnabled
* @description Determine whether the adapter is enabled. No error callback
* Determine whether the adapter is enabled. No error callback
* @returns {Promise<{ isEnabled: boolean }>}

@@ -659,3 +664,3 @@ */

* @name isScanning
* @description Determine whether the adapter is scanning. No error callback. Returns true or false
* Determine whether the adapter is scanning. No error callback. Returns true or false
* @returns {Promise<{ isScanning: boolean }>}

@@ -668,3 +673,3 @@ */

* @name isBonded (Android)
* @description Determine whether the device is bonded or not, or error if not initialized. Android support only.
* Determine whether the device is bonded or not, or error if not initialized. Android support only.
* @param {{ address: string }} params

@@ -678,3 +683,3 @@ * @returns {Promise<BondedStatus>}

* @name wasConnected
* @description Determine whether the device was connected, or error if not initialized.
* Determine whether the device was connected, or error if not initialized.
* @param {{ address: string }} params

@@ -688,3 +693,3 @@ * @returns {Promise<PrevConnectionStatus>}

* @name isConnected
* @description Determine whether the device is connected, or error if not initialized or never connected to device
* Determine whether the device is connected, or error if not initialized or never connected to device
* @param {{ address: string }} params

@@ -698,3 +703,3 @@ * @returns {Promise<CurrConnectionStatus>}

* @name isDiscovered
* @description Determine whether the device's characteristics and descriptors have been discovered, or error if not initialized or not connected to device.
* Determine whether the device's characteristics and descriptors have been discovered, or error if not initialized or not connected to device.
* @param {{ address: string }} params

@@ -708,3 +713,3 @@ * @returns {Promise<DiscoverStatus>}

* @name hasPermission (useful only for Android 6+ / API 23)
* @description Determine whether coarse location privileges are granted since scanning for unpaired devices requires it in Android API 23
* Determine whether coarse location privileges are granted since scanning for unpaired devices requires it in Android API 23
* @returns {Promise<{ hasPermission: boolean }>}

@@ -717,3 +722,3 @@ */

* @name requestPermission (useful only for Android 6+ / API 23)
* @description Request coarse location privileges since scanning for unpaired devices requires it in Android API 23.
* Request coarse location privileges since scanning for unpaired devices requires it in Android API 23.
* Will return an error if called on iOS or Android versions prior to 6.0.

@@ -727,3 +732,3 @@ * @returns {Promise<{ requestPermission: boolean }>}

* @name isLocationEnabled (useful only for Android 6+ / API 23)
* @description Determine if location services are enabled or not. Location Services are required to find devices in Android API 23
* Determine if location services are enabled or not. Location Services are required to find devices in Android API 23
* @returns {Promise<{ isLocationEnabled: boolean }>}

@@ -736,3 +741,3 @@ */

* @name requestLocation (useful only for Android 6+ / API 23)
* @description Prompt location services settings pages. requestLocation property returns whether location services are enabled or disabled.
* Prompt location services settings pages. requestLocation property returns whether location services are enabled or disabled.
* Location Services are required to find devices in Android API 23.

@@ -746,3 +751,3 @@ * @returns {Promise<{ requestLocation: boolean }>}

* @name initializePeripheral
* @description Initialize Bluetooth on the device. Must be called before anything else.
* Initialize Bluetooth on the device. Must be called before anything else.
* Callback will continuously be used whenever Bluetooth is enabled or disabled.

@@ -755,3 +760,3 @@ * @param {InitPeripheralParams} [params]

* @name addService
* @description Add a service with characteristics and descriptors. If more than one service is added, add them sequentially
* Add a service with characteristics and descriptors. If more than one service is added, add them sequentially
* @param {{ service: string, characteristics: Characteristic[] }} params

@@ -769,3 +774,3 @@ * @returns {Promise<{ service: string, status: Status }>}

* @name removeService
* @description Remove a service
* Remove a service
* @param {{ service: string }} params

@@ -782,3 +787,3 @@ * @returns {Promise<{ service: string, status: Status }>}

* @name removeAllServices
* @description Remove all services
* Remove all services
* @returns {Promise<{ status: Status }>}

@@ -791,3 +796,3 @@ */

* @name startAdvertising (different behavior on Android/iOS, read below)
* @description Start advertising as a BLE device.
* Start advertising as a BLE device.
* Note: This needs to be improved so services can be used for both Android and iOS.

@@ -803,3 +808,3 @@ * On iOS, the advertising devices likes to rename itself back to the name of the device, i.e. Rand' iPhone

* @name stopAdvertising
* @description Stop advertising
* Stop advertising
* @returns {Promise<{ status: Status }>}

@@ -812,3 +817,3 @@ */

* @name isAdvertising
* @description Determine if app is advertising or not.
* Determine if app is advertising or not.
* @returns {Promise<{ status: boolean }>}

@@ -821,3 +826,3 @@ */

* @name respond
* @description Respond to a read or write request
* Respond to a read or write request
* @param {RespondParams} params

@@ -831,3 +836,3 @@ * @returns {Promise<{ status: Status }>}

* @name notify
* @description Update a value for a subscription. Currently all subscribed devices will receive update.
* Update a value for a subscription. Currently all subscribed devices will receive update.
* Device specific updates will be added in the future.

@@ -844,3 +849,3 @@ * If sent equals false in the return value, you must wait for the peripheralManagerIsReadyToUpdateSubscribers event before sending more updates.

* @name encodedStringToBytes
* @description Helper function to convert a base64 encoded string from a characteristic or descriptor value into a uint8Array object
* Helper function to convert a base64 encoded string from a characteristic or descriptor value into a uint8Array object
* @param {string} str

@@ -852,3 +857,3 @@ * @returns {Uint8Array}

* @name bytesToEncodedString
* @description Helper function to convert a unit8Array to a base64 encoded string for a characteric or descriptor write
* Helper function to convert a unit8Array to a base64 encoded string for a characteric or descriptor write
* @param {Uint8Array} bytes

@@ -860,10 +865,10 @@ * @returns {string}

* @name stringToBytes
* @description Helper function to convert a string to bytes
* @param {Uint8Array} value
* @returns {string}
* Helper function to convert a string to bytes
* @param {string} value
* @returns {Uint8Array}
*/
stringToBytes(value: Uint8Array): string;
stringToBytes(value: string): Uint8Array;
/**
* @name bytesToString
* @description Helper function to convert bytes to a string.
* Helper function to convert bytes to a string.
* @param {Uint8Array} value

@@ -870,0 +875,0 @@ * @returns {string}

@@ -23,3 +23,2 @@ import { IonicNativePlugin } from '@ionic-native/core';

services?: string[];
/** True/false to allow duplicate advertisement packets, defaults to false (iOS) */
allowDuplicates?: boolean;

@@ -120,3 +119,2 @@ /** Defaults to Low Power. Available from API21 / API 23 (Android) */

export interface BondedStatus extends CommonInfo {
/** Bonded status */
isBonded: boolean;

@@ -242,3 +240,2 @@ }

service: string;
/** Array of characteristic objects */
characteristics: Characteristic[];

@@ -288,2 +285,10 @@ }

}
export interface AdapterInfo {
name: string;
address: string;
isInitialized: boolean;
isEnabled: boolean;
isScanning: boolean;
isDiscoverable: boolean;
}
/**

@@ -320,3 +325,3 @@ * @name BluetoothLE

* @name initialize
* @description Initialize Bluetooth on the device
* Initialize Bluetooth on the device
* @param {InitParams} [params]

@@ -330,3 +335,3 @@ * @returns {(Promise<{ status: 'enabled' | 'disabled'}>)} The callback that is passed initialize status (enabled/disabled)

* @name enable (Android)
* @description Enable Bluetooth on the device. Android support only
* Enable Bluetooth on the device. Android support only
* @returns {Promise<{ status: boolean }>}

@@ -339,3 +344,3 @@ */

* @name disable (Android)
* @description Disable Bluetooth on the device. Android support only
* Disable Bluetooth on the device. Android support only
* @returns void

@@ -346,16 +351,12 @@ */

* @name getAdapterInfo (Android)
* @description @todo
* @returns {Promise<{ name: string, address: string, isInitialized: boolean, isEnabled: boolean, isScanning: boolean, isDiscoverable: boolean}>}
* Retrieve useful information such as the address, name, and various states (initialized, enabled, scanning, discoverable).
* This can be very useful when the general state of the adapter has been lost, and we would otherwise need to go through a series of callbacks to get the correct state (first initialized, then enabled, then isScanning, and so forth).
* The result of this method allows us to take business logic decisions while avoiding a large part of the callback hell.
* Currently the discoverable state does not have any relevance because there is no "setDiscoverable" functionality in place. That may change in the future.
* @returns {Promise<AdapterInfo>}
*/
getAdapterInfo(): Promise<{
name: string;
address: string;
isInitialized: boolean;
isEnabled: boolean;
isScanning: boolean;
isDiscoverable: boolean;
}>;
getAdapterInfo(): Promise<AdapterInfo>;
/**
* @name startScan
* @description Scan for Bluetooth LE devices.
* Scan for Bluetooth LE devices.
* Since scanning is expensive, stop as soon as possible. The Cordova app should use a timer to limit the scan interval.

@@ -366,3 +367,3 @@ * Android API >= 23 requires ACCESS_COARSE_LOCATION permissions to find unpaired devices.

* If not enabled, use requestLocation to prompt the location services settings page.
* @param params Scan params
* @param {ScanParams} params Scan params
* @returns {(Observable<{ status: ScanStatus }>)}

@@ -375,3 +376,3 @@ */

* @name stopScan
* @description Stop scan for Bluetooth LE devices. Since scanning is expensive, stop as soon as possible
* Stop scan for Bluetooth LE devices. Since scanning is expensive, stop as soon as possible
* The app should use a timer to limit the scanning time.

@@ -385,3 +386,3 @@ * @returns {Promise<{status: 'scanStopped'}>}

* @name retrieveConnected
* @description Retrieved paired Bluetooth LE devices. In iOS, devices that are "paired" to will not return during a normal scan.
* Retrieved paired Bluetooth LE devices. In iOS, devices that are "paired" to will not return during a normal scan.
* Callback is "instant" compared to a scan.

@@ -398,3 +399,3 @@ * @param {{ services: string[] }} An array of service IDs to filter the retrieval by. If no service IDs are specified, no devices will be returned.

* @name bond (Android)
* @description Bond with a device.
* Bond with a device.
* The device doesn't need to be connected to initiate bonding. Android support only.

@@ -417,3 +418,3 @@ * @param {{ address: string }} params The address/identifier provided by the scan's return object

* @name unbond (Android)
* @description Unbond with a device. The device doesn't need to be connected to initiate bonding. Android support only.
* Unbond with a device. The device doesn't need to be connected to initiate bonding. Android support only.
* @param {{address: string}} params The address/identifier

@@ -431,3 +432,3 @@ * @returns {Promise<{ status: DeviceInfo }>}

* @name connect
* @description Connect to a Bluetooth LE device
* Connect to a Bluetooth LE device
* @param connectSuccess The success callback that is passed with device object

@@ -450,3 +451,3 @@ * @param connectError The callback that will be triggered when the connect operation fails

* @name reconnect
* @description Reconnect to a previously connected Bluetooth device
* Reconnect to a previously connected Bluetooth device
* @param {{address: string}} params The address/identifier

@@ -462,3 +463,3 @@ * @returns {(Observable<{ status: DeviceInfo }>)}

* @name disconnect
* @description Disconnect from a Bluetooth LE device.
* Disconnect from a Bluetooth LE device.
* Note: It's simpler to just call close(). Starting with iOS 10, disconnecting before closing seems required!

@@ -475,3 +476,3 @@ * @param {{address: string}} params The address/identifier

* @name close
* @description Close/dispose a Bluetooth LE device.
* Close/dispose a Bluetooth LE device.
* Prior to 2.7.0, you needed to disconnect to the device before closing, but this is no longer the case.

@@ -489,3 +490,3 @@ * Starting with iOS 10, disconnecting before closing seems required!

* @name discover
* @description Discover all the devices services, characteristics and descriptors.
* Discover all the devices services, characteristics and descriptors.
* Doesn't need to be called again after disconnecting and then reconnecting.

@@ -510,3 +511,3 @@ * If using iOS, you shouldn't use discover and services/characteristics/descriptors on the same device.

* @name services (iOS)
* @description Discover the device's services.
* Discover the device's services.
* Not providing an array of services will return all services and take longer to discover. iOS support only.

@@ -524,3 +525,3 @@ * @param {{address: string, services: string[]}} params

* @name characteristics (iOS)
* @description Discover the service's characteristics.
* Discover the service's characteristics.
* Not providing an array of characteristics will return all characteristics and take longer to discover. iOS support only.

@@ -535,3 +536,3 @@ * @param {CharacteristicParams} params Characteristic params

* @name descriptors (iOS)
* @description Discover the characteristic's descriptors. iOS support only.
* Discover the characteristic's descriptors. iOS support only.
* @param {DescriptorParams} params

@@ -545,19 +546,23 @@ * @returns {Promise<{ descriptors: Descriptors }>}

* @name read
* @description Read a particular service's characteristic once
* Read a particular service's characteristic once
* @param {DescriptorParams} params
* @returns {Promise<OperationResult>}
*/
read(params: DescriptorParams): Promise<OperationResult>;
read(params: DescriptorParams): Promise<{
result: OperationResult;
}>;
/**
* @name subscribe
* @description Subscribe to a particular service's characteristic.
* Subscribe to a particular service's characteristic.
* Once a subscription is no longer needed, execute unsubscribe in a similar fashion.
* The Client Configuration descriptor will automatically be written to enable notification/indication based on the characteristic's properties.
* @param {DescriptorParams} params
* @returns {Promise<OperationResult>}
* @returns {(Observable<{ result: OperationResult }>)}
*/
subscribe(params: DescriptorParams): Observable<OperationResult>;
subscribe(params: DescriptorParams): Observable<{
result: OperationResult;
}>;
/**
* @name unsubscribe
* @description Unsubscribe to a particular service's characteristic.
* Unsubscribe to a particular service's characteristic.
* @param {DescriptorParams} params

@@ -569,3 +574,3 @@ * @returns {Promise<UnsubscribeResult>}

* @name write (limitation on iOS, read below)
* @description Write a particular service's characteristic
* Write a particular service's characteristic
* Note: no callback will occur on write without response on iOS.

@@ -578,3 +583,3 @@ * @param {WriteCharacteristicParams} params

* @name write (limitation on iOS, read below)
* @description Write Quick / Queue, use this method to quickly execute write without response commands when writing more than 20 bytes at a time.
* Write Quick / Queue, use this method to quickly execute write without response commands when writing more than 20 bytes at a time.
* Note: no callback will occur on write without response on iOS.

@@ -587,3 +592,3 @@ * @param {WriteCharacteristicParams} params

* @name readDescriptor
* @description Read a particular characterist's descriptor
* Read a particular characterist's descriptor
* @param {OperationDescriptorParams} params

@@ -595,3 +600,3 @@ * @returns {Promise<DescriptorResult>}

* @name writeDescriptor
* @description Write a particular characteristic's descriptor. Unable to write characteristic configuration directly to keep in line with iOS implementation.
* Write a particular characteristic's descriptor. Unable to write characteristic configuration directly to keep in line with iOS implementation.
* Instead use subscribe/unsubscribe, which will automatically enable/disable notification.

@@ -604,3 +609,3 @@ * @param {WriteDescriptorParams} params

* @name rssi
* @description Read RSSI of a connected device. RSSI is also returned with scanning.
* Read RSSI of a connected device. RSSI is also returned with scanning.
* @param {{ address: string }} params

@@ -616,3 +621,3 @@ * @returns {Promise<{ rssi: RSSI }>}

* @name mtu (Android, Android 5+)
* @description Set MTU of a connected device. Android only.
* Set MTU of a connected device. Android only.
* @param {{ address: string, mtu: number }} params

@@ -629,3 +634,3 @@ * @returns {Promise<{ mtu: MTU }>}

* @name requestConnectionPriority (Android, Android 5+)
* @description Request a change in the connection priority to improve throughput when transfer large amounts of data via BLE.
* Request a change in the connection priority to improve throughput when transfer large amounts of data via BLE.
* Android support only. iOS will return error.

@@ -641,3 +646,3 @@ * @param {{ address: string, connectionPriority: ConnectionPriority }} params

* @name isInitialized
* @description Determine whether the adapter is initialized. No error callback. Returns true or false
* Determine whether the adapter is initialized. No error callback. Returns true or false
* @returns {Promise<{ isInitialized: boolean }>}

@@ -650,3 +655,3 @@ */

* @name isEnabled
* @description Determine whether the adapter is enabled. No error callback
* Determine whether the adapter is enabled. No error callback
* @returns {Promise<{ isEnabled: boolean }>}

@@ -659,3 +664,3 @@ */

* @name isScanning
* @description Determine whether the adapter is scanning. No error callback. Returns true or false
* Determine whether the adapter is scanning. No error callback. Returns true or false
* @returns {Promise<{ isScanning: boolean }>}

@@ -668,3 +673,3 @@ */

* @name isBonded (Android)
* @description Determine whether the device is bonded or not, or error if not initialized. Android support only.
* Determine whether the device is bonded or not, or error if not initialized. Android support only.
* @param {{ address: string }} params

@@ -678,3 +683,3 @@ * @returns {Promise<BondedStatus>}

* @name wasConnected
* @description Determine whether the device was connected, or error if not initialized.
* Determine whether the device was connected, or error if not initialized.
* @param {{ address: string }} params

@@ -688,3 +693,3 @@ * @returns {Promise<PrevConnectionStatus>}

* @name isConnected
* @description Determine whether the device is connected, or error if not initialized or never connected to device
* Determine whether the device is connected, or error if not initialized or never connected to device
* @param {{ address: string }} params

@@ -698,3 +703,3 @@ * @returns {Promise<CurrConnectionStatus>}

* @name isDiscovered
* @description Determine whether the device's characteristics and descriptors have been discovered, or error if not initialized or not connected to device.
* Determine whether the device's characteristics and descriptors have been discovered, or error if not initialized or not connected to device.
* @param {{ address: string }} params

@@ -708,3 +713,3 @@ * @returns {Promise<DiscoverStatus>}

* @name hasPermission (useful only for Android 6+ / API 23)
* @description Determine whether coarse location privileges are granted since scanning for unpaired devices requires it in Android API 23
* Determine whether coarse location privileges are granted since scanning for unpaired devices requires it in Android API 23
* @returns {Promise<{ hasPermission: boolean }>}

@@ -717,3 +722,3 @@ */

* @name requestPermission (useful only for Android 6+ / API 23)
* @description Request coarse location privileges since scanning for unpaired devices requires it in Android API 23.
* Request coarse location privileges since scanning for unpaired devices requires it in Android API 23.
* Will return an error if called on iOS or Android versions prior to 6.0.

@@ -727,3 +732,3 @@ * @returns {Promise<{ requestPermission: boolean }>}

* @name isLocationEnabled (useful only for Android 6+ / API 23)
* @description Determine if location services are enabled or not. Location Services are required to find devices in Android API 23
* Determine if location services are enabled or not. Location Services are required to find devices in Android API 23
* @returns {Promise<{ isLocationEnabled: boolean }>}

@@ -736,3 +741,3 @@ */

* @name requestLocation (useful only for Android 6+ / API 23)
* @description Prompt location services settings pages. requestLocation property returns whether location services are enabled or disabled.
* Prompt location services settings pages. requestLocation property returns whether location services are enabled or disabled.
* Location Services are required to find devices in Android API 23.

@@ -746,3 +751,3 @@ * @returns {Promise<{ requestLocation: boolean }>}

* @name initializePeripheral
* @description Initialize Bluetooth on the device. Must be called before anything else.
* Initialize Bluetooth on the device. Must be called before anything else.
* Callback will continuously be used whenever Bluetooth is enabled or disabled.

@@ -755,3 +760,3 @@ * @param {InitPeripheralParams} [params]

* @name addService
* @description Add a service with characteristics and descriptors. If more than one service is added, add them sequentially
* Add a service with characteristics and descriptors. If more than one service is added, add them sequentially
* @param {{ service: string, characteristics: Characteristic[] }} params

@@ -769,3 +774,3 @@ * @returns {Promise<{ service: string, status: Status }>}

* @name removeService
* @description Remove a service
* Remove a service
* @param {{ service: string }} params

@@ -782,3 +787,3 @@ * @returns {Promise<{ service: string, status: Status }>}

* @name removeAllServices
* @description Remove all services
* Remove all services
* @returns {Promise<{ status: Status }>}

@@ -791,3 +796,3 @@ */

* @name startAdvertising (different behavior on Android/iOS, read below)
* @description Start advertising as a BLE device.
* Start advertising as a BLE device.
* Note: This needs to be improved so services can be used for both Android and iOS.

@@ -803,3 +808,3 @@ * On iOS, the advertising devices likes to rename itself back to the name of the device, i.e. Rand' iPhone

* @name stopAdvertising
* @description Stop advertising
* Stop advertising
* @returns {Promise<{ status: Status }>}

@@ -812,3 +817,3 @@ */

* @name isAdvertising
* @description Determine if app is advertising or not.
* Determine if app is advertising or not.
* @returns {Promise<{ status: boolean }>}

@@ -821,3 +826,3 @@ */

* @name respond
* @description Respond to a read or write request
* Respond to a read or write request
* @param {RespondParams} params

@@ -831,3 +836,3 @@ * @returns {Promise<{ status: Status }>}

* @name notify
* @description Update a value for a subscription. Currently all subscribed devices will receive update.
* Update a value for a subscription. Currently all subscribed devices will receive update.
* Device specific updates will be added in the future.

@@ -844,3 +849,3 @@ * If sent equals false in the return value, you must wait for the peripheralManagerIsReadyToUpdateSubscribers event before sending more updates.

* @name encodedStringToBytes
* @description Helper function to convert a base64 encoded string from a characteristic or descriptor value into a uint8Array object
* Helper function to convert a base64 encoded string from a characteristic or descriptor value into a uint8Array object
* @param {string} str

@@ -852,3 +857,3 @@ * @returns {Uint8Array}

* @name bytesToEncodedString
* @description Helper function to convert a unit8Array to a base64 encoded string for a characteric or descriptor write
* Helper function to convert a unit8Array to a base64 encoded string for a characteric or descriptor write
* @param {Uint8Array} bytes

@@ -860,10 +865,10 @@ * @returns {string}

* @name stringToBytes
* @description Helper function to convert a string to bytes
* @param {Uint8Array} value
* @returns {string}
* Helper function to convert a string to bytes
* @param {string} value
* @returns {Uint8Array}
*/
stringToBytes(value: Uint8Array): string;
stringToBytes(value: string): Uint8Array;
/**
* @name bytesToString
* @description Helper function to convert bytes to a string.
* Helper function to convert bytes to a string.
* @param {Uint8Array} value

@@ -870,0 +875,0 @@ * @returns {string}

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":4,"metadata":{"Status":{"__symbolic":"interface"},"ConnectionPriority":{"__symbolic":"interface"},"Params":{"__symbolic":"interface"},"InitPeripheralParams":{"__symbolic":"interface"},"InitParams":{"__symbolic":"interface"},"ScanParams":{"__symbolic":"interface"},"NotifyParams":{"__symbolic":"interface"},"RespondParams":{"__symbolic":"interface"},"CharacteristicParams":{"__symbolic":"interface"},"DescriptorParams":{"__symbolic":"interface"},"OperationDescriptorParams":{"__symbolic":"interface"},"WriteCharacteristicParams":{"__symbolic":"interface"},"WriteDescriptorParams":{"__symbolic":"interface"},"AdvertisingParams":{"__symbolic":"interface"},"AdvertiseMode":{"__symbolic":"interface"},"TxPowerLevel":{"__symbolic":"interface"},"AdvertisingParamsAndroid":{"__symbolic":"interface"},"AdvertisingParamsIOS":{"__symbolic":"interface"},"CommonInfo":{"__symbolic":"interface"},"DeviceInfo":{"__symbolic":"interface"},"RSSI":{"__symbolic":"interface"},"MTU":{"__symbolic":"interface"},"BondedStatus":{"__symbolic":"interface"},"PrevConnectionStatus":{"__symbolic":"interface"},"CurrConnectionStatus":{"__symbolic":"interface"},"DiscoverStatus":{"__symbolic":"interface"},"ScanStatus":{"__symbolic":"interface"},"Service":{"__symbolic":"interface"},"Characteristic":{"__symbolic":"interface"},"Descriptor":{"__symbolic":"interface"},"Device":{"__symbolic":"interface"},"Services":{"__symbolic":"interface"},"Descriptors":{"__symbolic":"interface"},"OperationResult":{"__symbolic":"interface"},"UnsubscribeResult":{"__symbolic":"interface"},"DescriptorResult":{"__symbolic":"interface"},"Characteristics":{"__symbolic":"interface"},"InitializeResult":{"__symbolic":"interface"},"BluetoothScanMode":{"SCAN_MODE_OPPORTUNISTIC":-1,"SCAN_MODE_LOW_POWER":0,"SCAN_MODE_BALANCED":1,"SCAN_MODE_LOW_LATENCY":2},"BluetoothMatchMode":{"MATCH_MODE_AGRESSIVE":1,"MATCH_MODE_STICKY":2},"BluetoothMatchNum":{"MATCH_NUM_ONE_ADVERTISEMENT":1,"MATCH_NUM_FEW_ADVERTISEMENT":2,"MATCH_NUM_MAX_ADVERTISEMENT":3},"BluetoothCallbackType":{"CALLBACK_TYPE_ALL_MATCHES":1,"CALLBACK_TYPE_FIRST_MATCH":2,"CALLBACK_TYPE_MATCH_LOST":4},"Error":{"__symbolic":"interface"},"BluetoothLE":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@ionic-native/core","name":"IonicNativePlugin","line":414,"character":33},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":413,"character":1}}],"members":{"initialize":[{"__symbolic":"method"}],"enable":[{"__symbolic":"method"}],"disable":[{"__symbolic":"method"}],"getAdapterInfo":[{"__symbolic":"method"}],"startScan":[{"__symbolic":"method"}],"stopScan":[{"__symbolic":"method"}],"retrieveConnected":[{"__symbolic":"method"}],"bond":[{"__symbolic":"method"}],"unbond":[{"__symbolic":"method"}],"connect":[{"__symbolic":"method"}],"reconnect":[{"__symbolic":"method"}],"disconnect":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"discover":[{"__symbolic":"method"}],"services":[{"__symbolic":"method"}],"characteristics":[{"__symbolic":"method"}],"descriptors":[{"__symbolic":"method"}],"read":[{"__symbolic":"method"}],"subscribe":[{"__symbolic":"method"}],"unsubscribe":[{"__symbolic":"method"}],"write":[{"__symbolic":"method"}],"writeQ":[{"__symbolic":"method"}],"readDescriptor":[{"__symbolic":"method"}],"writeDescriptor":[{"__symbolic":"method"}],"rssi":[{"__symbolic":"method"}],"mtu":[{"__symbolic":"method"}],"requestConnectionPriority":[{"__symbolic":"method"}],"isInitialized":[{"__symbolic":"method"}],"isEnabled":[{"__symbolic":"method"}],"isScanning":[{"__symbolic":"method"}],"isBonded":[{"__symbolic":"method"}],"wasConnected":[{"__symbolic":"method"}],"isConnected":[{"__symbolic":"method"}],"isDiscovered":[{"__symbolic":"method"}],"hasPermission":[{"__symbolic":"method"}],"requestPermission":[{"__symbolic":"method"}],"isLocationEnabled":[{"__symbolic":"method"}],"requestLocation":[{"__symbolic":"method"}],"initializePeripheral":[{"__symbolic":"method"}],"addService":[{"__symbolic":"method"}],"removeService":[{"__symbolic":"method"}],"removeAllServices":[{"__symbolic":"method"}],"startAdvertising":[{"__symbolic":"method"}],"stopAdvertising":[{"__symbolic":"method"}],"isAdvertising":[{"__symbolic":"method"}],"respond":[{"__symbolic":"method"}],"notify":[{"__symbolic":"method"}],"encodedStringToBytes":[{"__symbolic":"method"}],"bytesToEncodedString":[{"__symbolic":"method"}],"stringToBytes":[{"__symbolic":"method"}],"bytesToString":[{"__symbolic":"method"}],"SCAN_MODE_OPPORTUNISTIC":[{"__symbolic":"property"}],"SCAN_MODE_LOW_POWER":[{"__symbolic":"property"}],"SCAN_MODE_BALANCED":[{"__symbolic":"property"}],"SCAN_MODE_LOW_LATENCY":[{"__symbolic":"property"}],"MATCH_MODE_AGRESSIVE":[{"__symbolic":"property"}],"MATCH_MODE_STICKY":[{"__symbolic":"property"}],"MATCH_NUM_ONE_ADVERTISEMENT":[{"__symbolic":"property"}],"MATCH_NUM_FEW_ADVERTISEMENT":[{"__symbolic":"property"}],"MATCH_NUM_MAX_ADVERTISEMENT":[{"__symbolic":"property"}],"CALLBACK_TYPE_ALL_MATCHES":[{"__symbolic":"property"}],"CALLBACK_TYPE_FIRST_MATCH":[{"__symbolic":"property"}],"CALLBACK_TYPE_MATCH_LOST":[{"__symbolic":"property"}]}}}}]
[{"__symbolic":"module","version":4,"metadata":{"Status":{"__symbolic":"interface"},"ConnectionPriority":{"__symbolic":"interface"},"Params":{"__symbolic":"interface"},"InitPeripheralParams":{"__symbolic":"interface"},"InitParams":{"__symbolic":"interface"},"ScanParams":{"__symbolic":"interface"},"NotifyParams":{"__symbolic":"interface"},"RespondParams":{"__symbolic":"interface"},"CharacteristicParams":{"__symbolic":"interface"},"DescriptorParams":{"__symbolic":"interface"},"OperationDescriptorParams":{"__symbolic":"interface"},"WriteCharacteristicParams":{"__symbolic":"interface"},"WriteDescriptorParams":{"__symbolic":"interface"},"AdvertisingParams":{"__symbolic":"interface"},"AdvertiseMode":{"__symbolic":"interface"},"TxPowerLevel":{"__symbolic":"interface"},"AdvertisingParamsAndroid":{"__symbolic":"interface"},"AdvertisingParamsIOS":{"__symbolic":"interface"},"CommonInfo":{"__symbolic":"interface"},"DeviceInfo":{"__symbolic":"interface"},"RSSI":{"__symbolic":"interface"},"MTU":{"__symbolic":"interface"},"BondedStatus":{"__symbolic":"interface"},"PrevConnectionStatus":{"__symbolic":"interface"},"CurrConnectionStatus":{"__symbolic":"interface"},"DiscoverStatus":{"__symbolic":"interface"},"ScanStatus":{"__symbolic":"interface"},"Service":{"__symbolic":"interface"},"Characteristic":{"__symbolic":"interface"},"Descriptor":{"__symbolic":"interface"},"Device":{"__symbolic":"interface"},"Services":{"__symbolic":"interface"},"Descriptors":{"__symbolic":"interface"},"OperationResult":{"__symbolic":"interface"},"UnsubscribeResult":{"__symbolic":"interface"},"DescriptorResult":{"__symbolic":"interface"},"Characteristics":{"__symbolic":"interface"},"InitializeResult":{"__symbolic":"interface"},"BluetoothScanMode":{"SCAN_MODE_OPPORTUNISTIC":-1,"SCAN_MODE_LOW_POWER":0,"SCAN_MODE_BALANCED":1,"SCAN_MODE_LOW_LATENCY":2},"BluetoothMatchMode":{"MATCH_MODE_AGRESSIVE":1,"MATCH_MODE_STICKY":2},"BluetoothMatchNum":{"MATCH_NUM_ONE_ADVERTISEMENT":1,"MATCH_NUM_FEW_ADVERTISEMENT":2,"MATCH_NUM_MAX_ADVERTISEMENT":3},"BluetoothCallbackType":{"CALLBACK_TYPE_ALL_MATCHES":1,"CALLBACK_TYPE_FIRST_MATCH":2,"CALLBACK_TYPE_MATCH_LOST":4},"Error":{"__symbolic":"interface"},"AdapterInfo":{"__symbolic":"interface"},"BluetoothLE":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@ionic-native/core","name":"IonicNativePlugin","line":428,"character":33},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":427,"character":1}}],"members":{"initialize":[{"__symbolic":"method"}],"enable":[{"__symbolic":"method"}],"disable":[{"__symbolic":"method"}],"getAdapterInfo":[{"__symbolic":"method"}],"startScan":[{"__symbolic":"method"}],"stopScan":[{"__symbolic":"method"}],"retrieveConnected":[{"__symbolic":"method"}],"bond":[{"__symbolic":"method"}],"unbond":[{"__symbolic":"method"}],"connect":[{"__symbolic":"method"}],"reconnect":[{"__symbolic":"method"}],"disconnect":[{"__symbolic":"method"}],"close":[{"__symbolic":"method"}],"discover":[{"__symbolic":"method"}],"services":[{"__symbolic":"method"}],"characteristics":[{"__symbolic":"method"}],"descriptors":[{"__symbolic":"method"}],"read":[{"__symbolic":"method"}],"subscribe":[{"__symbolic":"method"}],"unsubscribe":[{"__symbolic":"method"}],"write":[{"__symbolic":"method"}],"writeQ":[{"__symbolic":"method"}],"readDescriptor":[{"__symbolic":"method"}],"writeDescriptor":[{"__symbolic":"method"}],"rssi":[{"__symbolic":"method"}],"mtu":[{"__symbolic":"method"}],"requestConnectionPriority":[{"__symbolic":"method"}],"isInitialized":[{"__symbolic":"method"}],"isEnabled":[{"__symbolic":"method"}],"isScanning":[{"__symbolic":"method"}],"isBonded":[{"__symbolic":"method"}],"wasConnected":[{"__symbolic":"method"}],"isConnected":[{"__symbolic":"method"}],"isDiscovered":[{"__symbolic":"method"}],"hasPermission":[{"__symbolic":"method"}],"requestPermission":[{"__symbolic":"method"}],"isLocationEnabled":[{"__symbolic":"method"}],"requestLocation":[{"__symbolic":"method"}],"initializePeripheral":[{"__symbolic":"method"}],"addService":[{"__symbolic":"method"}],"removeService":[{"__symbolic":"method"}],"removeAllServices":[{"__symbolic":"method"}],"startAdvertising":[{"__symbolic":"method"}],"stopAdvertising":[{"__symbolic":"method"}],"isAdvertising":[{"__symbolic":"method"}],"respond":[{"__symbolic":"method"}],"notify":[{"__symbolic":"method"}],"encodedStringToBytes":[{"__symbolic":"method"}],"bytesToEncodedString":[{"__symbolic":"method"}],"stringToBytes":[{"__symbolic":"method"}],"bytesToString":[{"__symbolic":"method"}],"SCAN_MODE_OPPORTUNISTIC":[{"__symbolic":"property"}],"SCAN_MODE_LOW_POWER":[{"__symbolic":"property"}],"SCAN_MODE_BALANCED":[{"__symbolic":"property"}],"SCAN_MODE_LOW_LATENCY":[{"__symbolic":"property"}],"MATCH_MODE_AGRESSIVE":[{"__symbolic":"property"}],"MATCH_MODE_STICKY":[{"__symbolic":"property"}],"MATCH_NUM_ONE_ADVERTISEMENT":[{"__symbolic":"property"}],"MATCH_NUM_FEW_ADVERTISEMENT":[{"__symbolic":"property"}],"MATCH_NUM_MAX_ADVERTISEMENT":[{"__symbolic":"property"}],"CALLBACK_TYPE_ALL_MATCHES":[{"__symbolic":"property"}],"CALLBACK_TYPE_FIRST_MATCH":[{"__symbolic":"property"}],"CALLBACK_TYPE_MATCH_LOST":[{"__symbolic":"property"}]}}}}]

@@ -1,1 +0,1 @@

{"description":"Ionic Native - Native plugins for ionic apps","module":"index.js","typings":"index.d.ts","author":"ionic","license":"MIT","repository":{"type":"git","url":"https://github.com/ionic-team/ionic-native.git"},"name":"@ionic-native/bluetooth-le","dependencies":{"@types/cordova":"latest"},"peerDependencies":{"rxjs":"*","@ionic-native/core":"5.0.0-beta.18"},"version":"5.0.0-beta.18"}
{"description":"Ionic Native - Native plugins for ionic apps","module":"index.js","typings":"index.d.ts","author":"ionic","license":"MIT","repository":{"type":"git","url":"https://github.com/ionic-team/ionic-native.git"},"name":"@ionic-native/bluetooth-le","dependencies":{"@types/cordova":"latest"},"peerDependencies":{"rxjs":"*","@ionic-native/core":"5.0.0-beta.19"},"version":"5.0.0-beta.19"}

@@ -1,2 +0,2 @@

<a style="float:right;font-size:12px;" href="http://github.com/ionic-team/ionic-native/edit/master/src/@ionic-native/plugins/bluetooth-le/index.ts#L374">
<a style="float:right;font-size:12px;" href="http://github.com/ionic-team/ionic-native/edit/master/src/@ionic-native/plugins/bluetooth-le/index.ts#L388">
Improve this doc

@@ -9,3 +9,3 @@ </a>

$ ionic cordova plugin add cordova-plugin-bluetoothle
$ npm install --save @ionic-native/bluetooth-le
$ npm install @ionic-native/bluetooth-le@beta
```

@@ -12,0 +12,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc