@capacitor-community/bluetooth-le 6.1.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CapacitorCommunityBluetoothLe.podspec +17 -17
  2. package/LICENSE +21 -21
  3. package/README.md +97 -27
  4. package/android/build.gradle +68 -68
  5. package/android/src/main/AndroidManifest.xml +22 -22
  6. package/android/src/main/java/com/capacitorjs/community/plugins/bluetoothle/BluetoothLe.kt +1061 -1009
  7. package/android/src/main/java/com/capacitorjs/community/plugins/bluetoothle/Conversion.kt +51 -50
  8. package/android/src/main/java/com/capacitorjs/community/plugins/bluetoothle/Device.kt +720 -718
  9. package/android/src/main/java/com/capacitorjs/community/plugins/bluetoothle/DeviceList.kt +28 -28
  10. package/android/src/main/java/com/capacitorjs/community/plugins/bluetoothle/DeviceScanner.kt +189 -189
  11. package/dist/docs.json +892 -78
  12. package/dist/esm/bleClient.d.ts +277 -277
  13. package/dist/esm/bleClient.js +349 -349
  14. package/dist/esm/bleClient.js.map +1 -1
  15. package/dist/esm/config.d.ts +53 -53
  16. package/dist/esm/config.js +2 -2
  17. package/dist/esm/config.js.map +1 -1
  18. package/dist/esm/conversion.d.ts +34 -34
  19. package/dist/esm/conversion.js +84 -84
  20. package/dist/esm/conversion.js.map +1 -1
  21. package/dist/esm/definitions.d.ts +301 -292
  22. package/dist/esm/definitions.js +42 -42
  23. package/dist/esm/definitions.js.map +1 -1
  24. package/dist/esm/index.d.ts +5 -5
  25. package/dist/esm/index.js +5 -5
  26. package/dist/esm/index.js.map +1 -1
  27. package/dist/esm/plugin.d.ts +2 -2
  28. package/dist/esm/plugin.js +4 -4
  29. package/dist/esm/plugin.js.map +1 -1
  30. package/dist/esm/queue.d.ts +3 -3
  31. package/dist/esm/queue.js +17 -17
  32. package/dist/esm/queue.js.map +1 -1
  33. package/dist/esm/timeout.d.ts +1 -1
  34. package/dist/esm/timeout.js +9 -9
  35. package/dist/esm/timeout.js.map +1 -1
  36. package/dist/esm/validators.d.ts +1 -1
  37. package/dist/esm/validators.js +11 -11
  38. package/dist/esm/validators.js.map +1 -1
  39. package/dist/esm/web.d.ts +56 -56
  40. package/dist/esm/web.js +340 -335
  41. package/dist/esm/web.js.map +1 -1
  42. package/dist/plugin.cjs.js +839 -834
  43. package/dist/plugin.cjs.js.map +1 -1
  44. package/dist/plugin.js +839 -834
  45. package/dist/plugin.js.map +1 -1
  46. package/ios/Plugin/Conversion.swift +83 -74
  47. package/ios/Plugin/Device.swift +423 -423
  48. package/ios/Plugin/DeviceManager.swift +401 -349
  49. package/ios/Plugin/Info.plist +24 -24
  50. package/ios/Plugin/Logging.swift +8 -8
  51. package/ios/Plugin/Plugin.h +10 -10
  52. package/ios/Plugin/Plugin.m +41 -41
  53. package/ios/Plugin/Plugin.swift +682 -636
  54. package/ios/Plugin/ThreadSafeDictionary.swift +13 -13
  55. package/package.json +101 -101
@@ -1,17 +1,17 @@
1
- require 'json'
2
-
3
- package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
-
5
- Pod::Spec.new do |s|
6
- s.name = 'CapacitorCommunityBluetoothLe'
7
- s.version = package['version']
8
- s.summary = package['description']
9
- s.license = package['license']
10
- s.homepage = package['repository']['url']
11
- s.author = package['author']
12
- s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
- s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '13.0'
15
- s.dependency 'Capacitor'
16
- s.swift_version = '5.1'
17
- end
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = 'CapacitorCommunityBluetoothLe'
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.license = package['license']
10
+ s.homepage = package['repository']['url']
11
+ s.author = package['author']
12
+ s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
+ s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14
+ s.ios.deployment_target = '14.0'
15
+ s.dependency 'Capacitor'
16
+ s.swift_version = '5.1'
17
+ end
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Capacitor plugin for Bluetooth Low Energy
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Capacitor plugin for Bluetooth Low Energy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -6,14 +6,14 @@
6
6
  </p>
7
7
 
8
8
  <p align="center">
9
- <img src="https://img.shields.io/maintenance/yes/2024?style=flat-square" />
9
+ <img src="https://img.shields.io/maintenance/yes/2025?style=flat-square" />
10
10
  <a href="https://github.com/capacitor-community/bluetooth-le/actions?query=workflow%3A%22CI%22"><img src="https://img.shields.io/github/actions/workflow/status/capacitor-community/bluetooth-le/main.yml?branch=main&style=flat-square" /></a>
11
11
  <a href="https://www.npmjs.com/package/@capacitor-community/bluetooth-le"><img src="https://img.shields.io/npm/l/@capacitor-community/bluetooth-le?style=flat-square" /></a>
12
12
  <br>
13
13
  <a href="https://www.npmjs.com/package/@capacitor-community/bluetooth-le"><img src="https://img.shields.io/npm/dw/@capacitor-community/bluetooth-le?style=flat-square" /></a>
14
14
  <a href="https://www.npmjs.com/package/@capacitor-community/bluetooth-le"><img src="https://img.shields.io/npm/v/@capacitor-community/bluetooth-le?style=flat-square" /></a>
15
15
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
16
- <a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-20-orange?style=flat-square" /></a>
16
+ <a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-22-orange?style=flat-square" /></a>
17
17
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
18
18
  </p>
19
19
 
@@ -28,7 +28,8 @@
28
28
 
29
29
  | Plugin | Capacitor | Documentation |
30
30
  | ------ | --------- | --------------------------------------------------------------------------------- |
31
- | 6.x | 6.x | [README](https://github.com/capacitor-community/bluetooth-le/blob/main/README.md) |
31
+ | 7.x | 7.x | [README](https://github.com/capacitor-community/bluetooth-le/blob/main/README.md) |
32
+ | 6.x | 6.x | [README](https://github.com/capacitor-community/bluetooth-le/blob/6.x/README.md) |
32
33
  | 3.x | 5.x | [README](https://github.com/capacitor-community/bluetooth-le/blob/3.x/README.md) |
33
34
  | 2.x | 4.x | [README](https://github.com/capacitor-community/bluetooth-le/blob/2.x/README.md) |
34
35
  | 1.x | 3.x | [README](https://github.com/capacitor-community/bluetooth-le/blob/1.x/README.md) |
@@ -88,6 +89,7 @@ Below is an index of all the methods available.
88
89
  - [`startNotifications(...)`](#startnotifications)
89
90
  - [`stopNotifications(...)`](#stopnotifications)
90
91
  - [Interfaces](#interfaces)
92
+ - [Type Aliases](#type-aliases)
91
93
  - [Enums](#enums)
92
94
 
93
95
  </docgen-index>
@@ -344,6 +346,7 @@ _Note_: web support depends on the browser, see [implementation status](https://
344
346
  | [`requestLEScan(...)`](#requestlescan) | ✅ | ✅ | 🚩 |
345
347
  | [`stopLEScan()`](#stoplescan) | ✅ | ✅ | 🚩 |
346
348
  | [`getDevices(...)`](#getdevices) | ✅ | ✅ | 🚩 |
349
+ | [`getBondedDevices(...)`](#getbondeddevices) | ✅ | ❌ | ❌ |
347
350
  | [`getConnectedDevices(...)`](#getconnecteddevices) | ✅ | ✅ | 🚩 |
348
351
  | [`connect(...)`](#connect) | ✅ | ✅ | ✅ |
349
352
  | [`createBond(...)`](#createbond) | ✅ | ❌ | ❌ |
@@ -925,14 +928,86 @@ Stop listening to the changes of the value of a characteristic. For an example,
925
928
 
926
929
  #### RequestBleDeviceOptions
927
930
 
928
- | Prop | Type | Description |
929
- | ---------------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
930
- | **`services`** | <code>string[]</code> | Filter devices by service UUIDs. UUIDs have to be specified as 128 bit UUID strings, e.g. ['0000180d-0000-1000-8000-00805f9b34fb'] There is a helper function to convert numbers to UUIDs. e.g. [numberToUUID(0x180f)]. (see [UUID format](#uuid-format)) |
931
- | **`name`** | <code>string</code> | Filter devices by name |
932
- | **`namePrefix`** | <code>string</code> | Filter devices by name prefix |
933
- | **`optionalServices`** | <code>string[]</code> | For **web**, all services that will be used have to be listed under services or optionalServices, e.g. [numberToUUID(0x180f)] (see [UUID format](#uuid-format)) |
934
- | **`allowDuplicates`** | <code>boolean</code> | Normally scans will discard the second and subsequent advertisements from a single device. If you need to receive them, set allowDuplicates to true (only applicable in `requestLEScan`). (default: false) |
935
- | **`scanMode`** | <code><a href="#scanmode">ScanMode</a></code> | Android scan mode (default: <a href="#scanmode">ScanMode.SCAN_MODE_BALANCED</a>) |
931
+ | Prop | Type | Description |
932
+ | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
933
+ | **`services`** | <code>string[]</code> | Filter devices by service UUIDs. UUIDs have to be specified as 128 bit UUID strings, e.g. ['0000180d-0000-1000-8000-00805f9b34fb'] There is a helper function to convert numbers to UUIDs. e.g. [numberToUUID(0x180f)]. (see [UUID format](#uuid-format)) |
934
+ | **`name`** | <code>string</code> | Filter devices by name |
935
+ | **`namePrefix`** | <code>string</code> | Filter devices by name prefix |
936
+ | **`optionalServices`** | <code>string[]</code> | For **web**, all services that will be used have to be listed under services or optionalServices, e.g. [numberToUUID(0x180f)] (see [UUID format](#uuid-format)) |
937
+ | **`allowDuplicates`** | <code>boolean</code> | Normally scans will discard the second and subsequent advertisements from a single device. If you need to receive them, set allowDuplicates to true (only applicable in `requestLEScan`). (default: false) |
938
+ | **`scanMode`** | <code><a href="#scanmode">ScanMode</a></code> | Android scan mode (default: <a href="#scanmode">ScanMode.SCAN_MODE_BALANCED</a>) |
939
+ | **`manufacturerData`** | <code>{ companyIdentifier: number; dataPrefix?: <a href="#uint8array">Uint8Array</a>; mask?: <a href="#uint8array">Uint8Array</a>; }[]</code> | Allow scanning for devices with a specific manufacturer data https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice#manufacturerdata |
940
+
941
+ #### Uint8Array
942
+
943
+ A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
944
+ requested number of bytes could not be allocated an exception is raised.
945
+
946
+ | Prop | Type | Description |
947
+ | ----------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------- |
948
+ | **`BYTES_PER_ELEMENT`** | <code>number</code> | The size in bytes of each element in the array. |
949
+ | **`buffer`** | <code><a href="#arraybufferlike">ArrayBufferLike</a></code> | The <a href="#arraybuffer">ArrayBuffer</a> instance referenced by the array. |
950
+ | **`byteLength`** | <code>number</code> | The length in bytes of the array. |
951
+ | **`byteOffset`** | <code>number</code> | The offset in bytes of the array. |
952
+ | **`length`** | <code>number</code> | The length of the array. |
953
+
954
+ | Method | Signature | Description |
955
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
956
+ | **copyWithin** | (target: number, start: number, end?: number \| undefined) =&gt; this | Returns the this object after copying a section of the array identified by start and end to the same array starting at position target |
957
+ | **every** | (predicate: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; unknown, thisArg?: any) =&gt; boolean | Determines whether all the members of an array satisfy the specified test. |
958
+ | **fill** | (value: number, start?: number \| undefined, end?: number \| undefined) =&gt; this | Returns the this object after filling the section identified by start and end with value |
959
+ | **filter** | (predicate: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; any, thisArg?: any) =&gt; <a href="#uint8array">Uint8Array</a> | Returns the elements of an array that meet the condition specified in a callback function. |
960
+ | **find** | (predicate: (value: number, index: number, obj: <a href="#uint8array">Uint8Array</a>) =&gt; boolean, thisArg?: any) =&gt; number \| undefined | Returns the value of the first element in the array where predicate is true, and undefined otherwise. |
961
+ | **findIndex** | (predicate: (value: number, index: number, obj: <a href="#uint8array">Uint8Array</a>) =&gt; boolean, thisArg?: any) =&gt; number | Returns the index of the first element in the array where predicate is true, and -1 otherwise. |
962
+ | **forEach** | (callbackfn: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; void, thisArg?: any) =&gt; void | Performs the specified action for each element in an array. |
963
+ | **indexOf** | (searchElement: number, fromIndex?: number \| undefined) =&gt; number | Returns the index of the first occurrence of a value in an array. |
964
+ | **join** | (separator?: string \| undefined) =&gt; string | Adds all the elements of an array separated by the specified separator string. |
965
+ | **lastIndexOf** | (searchElement: number, fromIndex?: number \| undefined) =&gt; number | Returns the index of the last occurrence of a value in an array. |
966
+ | **map** | (callbackfn: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number, thisArg?: any) =&gt; <a href="#uint8array">Uint8Array</a> | Calls a defined callback function on each element of an array, and returns an array that contains the results. |
967
+ | **reduce** | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number) =&gt; number | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
968
+ | **reduce** | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number, initialValue: number) =&gt; number | |
969
+ | **reduce** | &lt;U&gt;(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; U, initialValue: U) =&gt; U | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
970
+ | **reduceRight** | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number) =&gt; number | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
971
+ | **reduceRight** | (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; number, initialValue: number) =&gt; number | |
972
+ | **reduceRight** | &lt;U&gt;(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; U, initialValue: U) =&gt; U | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. |
973
+ | **reverse** | () =&gt; <a href="#uint8array">Uint8Array</a> | Reverses the elements in an Array. |
974
+ | **set** | (array: <a href="#arraylike">ArrayLike</a>&lt;number&gt;, offset?: number \| undefined) =&gt; void | Sets a value or an array of values. |
975
+ | **slice** | (start?: number \| undefined, end?: number \| undefined) =&gt; <a href="#uint8array">Uint8Array</a> | Returns a section of an array. |
976
+ | **some** | (predicate: (value: number, index: number, array: <a href="#uint8array">Uint8Array</a>) =&gt; unknown, thisArg?: any) =&gt; boolean | Determines whether the specified callback function returns true for any element of an array. |
977
+ | **sort** | (compareFn?: ((a: number, b: number) =&gt; number) \| undefined) =&gt; this | Sorts an array. |
978
+ | **subarray** | (begin?: number \| undefined, end?: number \| undefined) =&gt; <a href="#uint8array">Uint8Array</a> | Gets a new <a href="#uint8array">Uint8Array</a> view of the <a href="#arraybuffer">ArrayBuffer</a> store for this array, referencing the elements at begin, inclusive, up to end, exclusive. |
979
+ | **toLocaleString** | () =&gt; string | Converts a number to a string by using the current locale. |
980
+ | **toString** | () =&gt; string | Returns a string representation of an array. |
981
+ | **valueOf** | () =&gt; <a href="#uint8array">Uint8Array</a> | Returns the primitive value of the specified object. |
982
+
983
+ #### ArrayLike
984
+
985
+ | Prop | Type |
986
+ | ------------ | ------------------- |
987
+ | **`length`** | <code>number</code> |
988
+
989
+ #### ArrayBufferTypes
990
+
991
+ Allowed <a href="#arraybuffer">ArrayBuffer</a> types for the buffer of an ArrayBufferView and related Typed Arrays.
992
+
993
+ | Prop | Type |
994
+ | ----------------- | --------------------------------------------------- |
995
+ | **`ArrayBuffer`** | <code><a href="#arraybuffer">ArrayBuffer</a></code> |
996
+
997
+ #### ArrayBuffer
998
+
999
+ Represents a raw buffer of binary data, which is used to store data for the
1000
+ different typed arrays. ArrayBuffers cannot be read from or written to directly,
1001
+ but can be passed to a typed array or <a href="#dataview">DataView</a> Object to interpret the raw
1002
+ buffer as needed.
1003
+
1004
+ | Prop | Type | Description |
1005
+ | ---------------- | ------------------- | ------------------------------------------------------------------------------- |
1006
+ | **`byteLength`** | <code>number</code> | Read-only. The length of the <a href="#arraybuffer">ArrayBuffer</a> (in bytes). |
1007
+
1008
+ | Method | Signature | Description |
1009
+ | --------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
1010
+ | **slice** | (begin: number, end?: number \| undefined) =&gt; <a href="#arraybuffer">ArrayBuffer</a> | Returns a section of an <a href="#arraybuffer">ArrayBuffer</a>. |
936
1011
 
937
1012
  #### ScanResult
938
1013
 
@@ -974,21 +1049,6 @@ Stop listening to the changes of the value of a characteristic. For an example,
974
1049
  | **setUint16** | (byteOffset: number, value: number, littleEndian?: boolean \| undefined) =&gt; void | Stores an Uint16 value at the specified byte offset from the start of the view. |
975
1050
  | **setUint32** | (byteOffset: number, value: number, littleEndian?: boolean \| undefined) =&gt; void | Stores an Uint32 value at the specified byte offset from the start of the view. |
976
1051
 
977
- #### ArrayBuffer
978
-
979
- Represents a raw buffer of binary data, which is used to store data for the
980
- different typed arrays. ArrayBuffers cannot be read from or written to directly,
981
- but can be passed to a typed array or <a href="#dataview">DataView</a> Object to interpret the raw
982
- buffer as needed.
983
-
984
- | Prop | Type | Description |
985
- | ---------------- | ------------------- | ------------------------------------------------------------------------------- |
986
- | **`byteLength`** | <code>number</code> | Read-only. The length of the <a href="#arraybuffer">ArrayBuffer</a> (in bytes). |
987
-
988
- | Method | Signature | Description |
989
- | --------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
990
- | **slice** | (begin: number, end?: number \| undefined) =&gt; <a href="#arraybuffer">ArrayBuffer</a> | Returns a section of an <a href="#arraybuffer">ArrayBuffer</a>. |
991
-
992
1052
  #### TimeoutOptions
993
1053
 
994
1054
  | Prop | Type | Description |
@@ -1033,6 +1093,12 @@ buffer as needed.
1033
1093
  | ---------- | ------------------- |
1034
1094
  | **`uuid`** | <code>string</code> |
1035
1095
 
1096
+ ### Type Aliases
1097
+
1098
+ #### ArrayBufferLike
1099
+
1100
+ <code>ArrayBufferTypes[keyof ArrayBufferTypes]</code>
1101
+
1036
1102
  ### Enums
1037
1103
 
1038
1104
  #### ScanMode
@@ -1087,7 +1153,7 @@ On Android, the `initialize` call requests the location permission. However, if
1087
1153
  ```typescript
1088
1154
  async function initialize() {
1089
1155
  // Check if location is enabled
1090
- if (this.platform.is('android')) {
1156
+ if (Capacitor.getPlatform() === 'android') {
1091
1157
  const isLocationEnabled = await BleClient.isLocationEnabled();
1092
1158
  if (!isLocationEnabled) {
1093
1159
  await BleClient.openLocationSettings();
@@ -1131,6 +1197,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
1131
1197
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/peitschie"><img src="https://avatars.githubusercontent.com/u/1052079?v=4?s=100" width="100px;" alt="Philip Peitsch"/><br /><sub><b>Philip Peitsch</b></sub></a><br /><a href="https://github.com/capacitor-community/bluetooth-le/commits?author=peitschie" title="Code">💻</a> <a href="#question-peitschie" title="Answering Questions">💬</a></td>
1132
1198
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/NaterGator"><img src="https://avatars.githubusercontent.com/u/2575?v=4?s=100" width="100px;" alt="Nate Weibley"/><br /><sub><b>Nate Weibley</b></sub></a><br /><a href="https://github.com/capacitor-community/bluetooth-le/commits?author=NaterGator" title="Code">💻</a></td>
1133
1199
  <td align="center" valign="top" width="14.28%"><a href="http://www.enesi.it"><img src="https://avatars.githubusercontent.com/u/2611534?v=4?s=100" width="100px;" alt="Emanuele Toffolon"/><br /><sub><b>Emanuele Toffolon</b></sub></a><br /><a href="https://github.com/capacitor-community/bluetooth-le/commits?author=emanueletoffolon" title="Code">💻</a></td>
1200
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/steinerjakob"><img src="https://avatars.githubusercontent.com/u/23446667?v=4?s=100" width="100px;" alt="Jakob Steiner"/><br /><sub><b>Jakob Steiner</b></sub></a><br /><a href="https://github.com/capacitor-community/bluetooth-le/commits?author=steinerjakob" title="Code">💻</a></td>
1201
+ </tr>
1202
+ <tr>
1203
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/gion-andri"><img src="https://avatars.githubusercontent.com/u/540998?v=4?s=100" width="100px;" alt="Gion-Andri Cantieni"/><br /><sub><b>Gion-Andri Cantieni</b></sub></a><br /><a href="https://github.com/capacitor-community/bluetooth-le/commits?author=gion-andri" title="Code">💻</a></td>
1134
1204
  </tr>
1135
1205
  </tbody>
1136
1206
  </table>
@@ -1,68 +1,68 @@
1
- ext {
2
- junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
6
- }
7
-
8
- buildscript {
9
- ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.10'
10
- ext.coreKtx = project.hasProperty('coreKtx') ? rootProject.ext.coreKtx : '1.12.0'
11
-
12
- repositories {
13
- google()
14
- mavenCentral()
15
- }
16
- dependencies {
17
- classpath 'com.android.tools.build:gradle:8.2.1'
18
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
19
- }
20
- }
21
-
22
- apply plugin: 'com.android.library'
23
- apply plugin: 'kotlin-android'
24
-
25
- android {
26
- namespace "com.capacitorjs.community.plugins.bluetoothle"
27
- compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
28
- defaultConfig {
29
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
30
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
31
- versionCode 1
32
- versionName "1.0"
33
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
34
- }
35
- buildTypes {
36
- release {
37
- minifyEnabled false
38
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
39
- }
40
- }
41
- lintOptions {
42
- abortOnError false
43
- }
44
- compileOptions {
45
- sourceCompatibility JavaVersion.VERSION_17
46
- targetCompatibility JavaVersion.VERSION_17
47
- }
48
- kotlinOptions {
49
- jvmTarget = 17
50
- }
51
- }
52
-
53
- repositories {
54
- google()
55
- mavenCentral()
56
- }
57
-
58
-
59
- dependencies {
60
- implementation fileTree(dir: 'libs', include: ['*.jar'])
61
- implementation project(':capacitor-android')
62
- implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
63
- testImplementation "junit:junit:$junitVersion"
64
- androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
65
- androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
66
- implementation "androidx.core:core-ktx:$coreKtx"
67
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
68
- }
1
+ ext {
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
6
+ }
7
+
8
+ buildscript {
9
+ ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '1.9.25'
10
+ ext.coreKtx = project.hasProperty('coreKtx') ? rootProject.ext.coreKtx : '1.12.0'
11
+
12
+ repositories {
13
+ google()
14
+ mavenCentral()
15
+ }
16
+ dependencies {
17
+ classpath 'com.android.tools.build:gradle:8.7.2'
18
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
19
+ }
20
+ }
21
+
22
+ apply plugin: 'com.android.library'
23
+ apply plugin: 'kotlin-android'
24
+
25
+ android {
26
+ namespace "com.capacitorjs.community.plugins.bluetoothle"
27
+ compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
28
+ defaultConfig {
29
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
30
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
31
+ versionCode 1
32
+ versionName "1.0"
33
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
34
+ }
35
+ buildTypes {
36
+ release {
37
+ minifyEnabled false
38
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
39
+ }
40
+ }
41
+ lintOptions {
42
+ abortOnError false
43
+ }
44
+ compileOptions {
45
+ sourceCompatibility JavaVersion.VERSION_21
46
+ targetCompatibility JavaVersion.VERSION_21
47
+ }
48
+ kotlinOptions {
49
+ jvmTarget = 21
50
+ }
51
+ }
52
+
53
+ repositories {
54
+ google()
55
+ mavenCentral()
56
+ }
57
+
58
+
59
+ dependencies {
60
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
61
+ implementation project(':capacitor-android')
62
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
63
+ testImplementation "junit:junit:$junitVersion"
64
+ androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
65
+ androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
66
+ implementation "androidx.core:core-ktx:$coreKtx"
67
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
68
+ }
@@ -1,23 +1,23 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- xmlns:tools="http://schemas.android.com/tools">
3
- <!-- Bluetooth -->
4
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
5
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
6
- <uses-permission
7
- android:name="android.permission.BLUETOOTH"
8
- android:maxSdkVersion="30" />
9
- <uses-permission
10
- android:name="android.permission.BLUETOOTH_ADMIN"
11
- android:maxSdkVersion="30" />
12
- <uses-permission
13
- android:name="android.permission.BLUETOOTH_SCAN"
14
- tools:targetApi="s" />
15
- <uses-permission
16
- android:name="android.permission.BLUETOOTH_CONNECT"
17
- tools:targetApi="s" />
18
-
19
- <uses-feature
20
- android:name="android.hardware.bluetooth_le"
21
- android:required="false" />
22
- </manifest>
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ xmlns:tools="http://schemas.android.com/tools">
3
+ <!-- Bluetooth -->
4
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
5
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
6
+ <uses-permission
7
+ android:name="android.permission.BLUETOOTH"
8
+ android:maxSdkVersion="30" />
9
+ <uses-permission
10
+ android:name="android.permission.BLUETOOTH_ADMIN"
11
+ android:maxSdkVersion="30" />
12
+ <uses-permission
13
+ android:name="android.permission.BLUETOOTH_SCAN"
14
+ tools:targetApi="s" />
15
+ <uses-permission
16
+ android:name="android.permission.BLUETOOTH_CONNECT"
17
+ tools:targetApi="s" />
18
+
19
+ <uses-feature
20
+ android:name="android.hardware.bluetooth_le"
21
+ android:required="false" />
22
+ </manifest>
23
23