@capacitor-community/bluetooth-le 6.1.0 → 7.0.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.
- package/CapacitorCommunityBluetoothLe.podspec +1 -1
- package/README.md +6 -5
- package/android/build.gradle +11 -11
- package/android/src/main/java/com/capacitorjs/community/plugins/bluetoothle/Conversion.kt +5 -4
- package/dist/esm/bleClient.js.map +1 -1
- package/dist/esm/conversion.js +1 -1
- package/dist/esm/conversion.js.map +1 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/validators.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +39 -41
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +39 -41
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Conversion.swift +13 -4
- package/ios/Plugin/Plugin.swift +1 -1
- package/package.json +18 -18
|
@@ -48,10 +48,19 @@ func dataToString(_ data: Data) -> String {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
func stringToData(_ dataString: String) -> Data {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
guard dataString.count % 2 == 0 else {
|
|
52
|
+
fatalError("Input string must have an even length, not \(dataString.count)")
|
|
53
|
+
}
|
|
54
|
+
var data = Data(capacity: dataString.count / 2)
|
|
55
|
+
for i in stride(from: 0, to: dataString.count, by: 2) {
|
|
56
|
+
let start = dataString.index(dataString.startIndex, offsetBy: i)
|
|
57
|
+
let end = dataString.index(start, offsetBy: 2)
|
|
58
|
+
let hexPair = dataString[start..<end]
|
|
59
|
+
if let byte = UInt8(hexPair, radix: 16) {
|
|
60
|
+
data.append(byte)
|
|
61
|
+
} else {
|
|
62
|
+
fatalError("Invalid hexadecimal value: \(hexPair)")
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
return data
|
|
57
66
|
}
|
package/ios/Plugin/Plugin.swift
CHANGED
|
@@ -496,7 +496,7 @@ public class BluetoothLe: CAPPlugin {
|
|
|
496
496
|
}
|
|
497
497
|
|
|
498
498
|
private func getDisplayStrings() -> [String: String] {
|
|
499
|
-
let configDisplayStrings =
|
|
499
|
+
let configDisplayStrings = getConfig().getObject("displayStrings") as? [String: String] ?? [String: String]()
|
|
500
500
|
var displayStrings = [String: String]()
|
|
501
501
|
displayStrings["noDeviceFound"] = configDisplayStrings["noDeviceFound"] ?? "No device found"
|
|
502
502
|
displayStrings["availableDevices"] = configDisplayStrings["availableDevices"] ?? "Available devices"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor-community/bluetooth-le",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Capacitor plugin for Bluetooth Low Energy ",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"unpkg": "dist/plugin.js",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
11
|
-
"verify:ios": "set -o pipefail && cd ios && pod install && xcodebuild clean build test -workspace Plugin.xcworkspace -scheme Plugin -destination \"platform=iOS Simulator,name=iPhone
|
|
11
|
+
"verify:ios": "set -o pipefail && cd ios && pod install && xcodebuild clean build test -workspace Plugin.xcworkspace -scheme Plugin -destination \"platform=iOS Simulator,name=iPhone 16\" | xcpretty && cd ..",
|
|
12
12
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
13
13
|
"verify:web": "npm run test:coverage && npm run build",
|
|
14
14
|
"lint": "npm run eslint && npm run prettier -- --check && npm run lint:ios",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"swiftlint": "node-swiftlint",
|
|
21
21
|
"docgen": "docgen --api BleClientInterface --output-readme README.md --output-json dist/docs.json",
|
|
22
22
|
"postdocgen": "prettier README.md --write",
|
|
23
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.
|
|
23
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
24
24
|
"clean": "rimraf ./dist",
|
|
25
25
|
"watch": "tsc --watch",
|
|
26
26
|
"prepublishOnly": "npm run build",
|
|
@@ -38,28 +38,28 @@
|
|
|
38
38
|
"@types/web-bluetooth": "^0.0.20"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@capacitor/android": "^
|
|
42
|
-
"@capacitor/cli": "^
|
|
43
|
-
"@capacitor/core": "^
|
|
44
|
-
"@capacitor/docgen": "0.
|
|
45
|
-
"@capacitor/ios": "^
|
|
41
|
+
"@capacitor/android": "^7.0.0",
|
|
42
|
+
"@capacitor/cli": "^7.0.0",
|
|
43
|
+
"@capacitor/core": "^7.0.0",
|
|
44
|
+
"@capacitor/docgen": "^0.3.0",
|
|
45
|
+
"@capacitor/ios": "^7.0.0",
|
|
46
46
|
"@ionic/eslint-config": "^0.4.0",
|
|
47
|
-
"@ionic/prettier-config": "^
|
|
48
|
-
"@ionic/swiftlint-config": "^
|
|
47
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
48
|
+
"@ionic/swiftlint-config": "^2.0.0",
|
|
49
49
|
"@types/jest": "^29.2.5",
|
|
50
|
-
"eslint": "^8.
|
|
50
|
+
"eslint": "^8.57.0",
|
|
51
51
|
"jest": "^29.3.1",
|
|
52
52
|
"jest-environment-jsdom": "^29.3.1",
|
|
53
|
-
"prettier": "^
|
|
54
|
-
"rimraf": "^
|
|
55
|
-
"rollup": "^
|
|
53
|
+
"prettier": "^3.4.2",
|
|
54
|
+
"rimraf": "^6.0.1",
|
|
55
|
+
"rollup": "^4.30.1",
|
|
56
56
|
"standard-version": "^9.5.0",
|
|
57
|
-
"swiftlint": "^
|
|
57
|
+
"swiftlint": "^2.0.0",
|
|
58
58
|
"ts-jest": "^29.0.3",
|
|
59
59
|
"typescript": "~4.9.4"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@capacitor/core": "
|
|
62
|
+
"@capacitor/core": ">=7.0.0"
|
|
63
63
|
},
|
|
64
64
|
"files": [
|
|
65
65
|
"android/src/main/",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"url": "https://github.com/capacitor-community/bluetooth-le/issues"
|
|
96
96
|
},
|
|
97
97
|
"volta": {
|
|
98
|
-
"node": "
|
|
99
|
-
"npm": "
|
|
98
|
+
"node": "22.13.1",
|
|
99
|
+
"npm": "11.0.0"
|
|
100
100
|
}
|
|
101
101
|
}
|