@react-native-ohos/react-native-ble-plx 3.2.1-rc.1 → 3.2.1
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/LICENSE +202 -202
- package/README.OpenSource +10 -10
- package/README.md +9 -9
- package/app.plugin.js +1 -1
- package/harmony/rn_bleplx/build-profile.json5 +7 -7
- package/harmony/rn_bleplx/hvigorfile.ts +1 -1
- package/harmony/rn_bleplx/index.ets +26 -26
- package/harmony/rn_bleplx/obfuscation-rules.txt +17 -17
- package/harmony/rn_bleplx/oh-package.json5 +13 -13
- package/harmony/rn_bleplx/src/main/cpp/BlePlxPackage.h +36 -36
- package/harmony/rn_bleplx/src/main/cpp/CMakeLists.txt +9 -9
- package/harmony/rn_bleplx/src/main/cpp/generated/RNOH/generated/BaseReactNativeBlePlxPackage.h +65 -65
- package/harmony/rn_bleplx/src/main/cpp/generated/RNOH/generated/turbo_modules/BlePlx.cpp +59 -59
- package/harmony/rn_bleplx/src/main/cpp/generated/RNOH/generated/turbo_modules/BlePlx.h +16 -16
- package/harmony/rn_bleplx/src/main/cpp/generated/react/renderer/components/react_native_ble_plx/ComponentDescriptors.h +22 -22
- package/harmony/rn_bleplx/src/main/cpp/generated/react/renderer/components/react_native_ble_plx/EventEmitters.cpp +18 -18
- package/harmony/rn_bleplx/src/main/cpp/generated/react/renderer/components/react_native_ble_plx/EventEmitters.h +19 -19
- package/harmony/rn_bleplx/src/main/cpp/generated/react/renderer/components/react_native_ble_plx/Props.cpp +21 -21
- package/harmony/rn_bleplx/src/main/cpp/generated/react/renderer/components/react_native_ble_plx/Props.h +20 -20
- package/harmony/rn_bleplx/src/main/cpp/generated/react/renderer/components/react_native_ble_plx/ShadowNodes.cpp +19 -19
- package/harmony/rn_bleplx/src/main/cpp/generated/react/renderer/components/react_native_ble_plx/ShadowNodes.h +25 -25
- package/harmony/rn_bleplx/src/main/cpp/generated/react/renderer/components/react_native_ble_plx/States.cpp +18 -18
- package/harmony/rn_bleplx/src/main/cpp/generated/react/renderer/components/react_native_ble_plx/States.h +22 -22
- package/harmony/rn_bleplx/src/main/ets/BleDevice.ts +98 -98
- package/harmony/rn_bleplx/src/main/ets/BleModule.ts +1219 -1219
- package/harmony/rn_bleplx/src/main/ets/BlePlxInterface.ts +26 -26
- package/harmony/rn_bleplx/src/main/ets/BlePlxModule.ts +246 -246
- package/harmony/rn_bleplx/src/main/ets/BlePlxPackage.ets +46 -46
- package/harmony/rn_bleplx/src/main/ets/Characteristic.ts +179 -179
- package/harmony/rn_bleplx/src/main/ets/CommonConstants.ts +29 -29
- package/harmony/rn_bleplx/src/main/ets/Descriptor.ts +143 -143
- package/harmony/rn_bleplx/src/main/ets/Service.ts +85 -85
- package/harmony/rn_bleplx/src/main/ets/common/BleError.ts +90 -90
- package/harmony/rn_bleplx/src/main/ets/common/BleErrorToJsObjectConverter.ts +62 -62
- package/harmony/rn_bleplx/src/main/ets/common/BleEvent.ts +32 -32
- package/harmony/rn_bleplx/src/main/ets/common/BleUtils.ts +86 -86
- package/harmony/rn_bleplx/src/main/ets/common/IdGenerator.ts +49 -49
- package/harmony/rn_bleplx/src/main/ets/common/IdGeneratorKey.ts +70 -70
- package/harmony/rn_bleplx/src/main/ets/common/InstanceIdGenerator.ts +36 -36
- package/harmony/rn_bleplx/src/main/ets/common/Logger.ts +64 -64
- package/harmony/rn_bleplx/src/main/ets/common/PermissionHandler.ts +98 -98
- package/harmony/rn_bleplx/src/main/ets/common/ServiceFactory.ts +37 -37
- package/harmony/rn_bleplx/src/main/ets/generated/components/ts.ts +5 -5
- package/harmony/rn_bleplx/src/main/ets/generated/index.ets +5 -5
- package/harmony/rn_bleplx/src/main/ets/generated/ts.ts +6 -6
- package/harmony/rn_bleplx/src/main/ets/generated/turboModules/BlePlx.ts +100 -100
- package/harmony/rn_bleplx/src/main/ets/generated/turboModules/ts.ts +5 -5
- package/harmony/rn_bleplx/src/main/module.json5 +6 -6
- package/harmony/rn_bleplx/ts.ets +25 -25
- package/harmony/rn_bleplx.har +0 -0
- package/package.json +185 -185
- package/src/BleError.js +555 -555
- package/src/BleManager.js +1287 -1287
- package/src/BleModule.js +847 -847
- package/src/Characteristic.js +166 -166
- package/src/Descriptor.js +82 -82
- package/src/Device.js +370 -370
- package/src/NativeBlePlx.ts +121 -121
- package/src/Service.js +188 -188
- package/src/TypeDefinition.js +360 -360
- package/src/Utils.js +26 -26
- package/src/index.d.ts +2113 -2113
- package/src/index.js +20 -20
- package/harmony/rn_bleplx/src/main/ets/BlePlxPackage.ts +0 -46
- package/harmony/rn_bleplx/ts.ts +0 -26
package/src/Utils.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
'use strict'
|
|
3
|
-
|
|
4
|
-
import type { UUID } from './TypeDefinition'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Converts UUID to full 128bit, lowercase format which should be used to compare UUID values.
|
|
8
|
-
*
|
|
9
|
-
* @param {UUID} uuid 16bit, 32bit or 128bit UUID.
|
|
10
|
-
* @returns {UUID} 128bit lowercase UUID.
|
|
11
|
-
*/
|
|
12
|
-
export function fullUUID(uuid: UUID): UUID {
|
|
13
|
-
if (uuid.length === 4) {
|
|
14
|
-
return '0000' + uuid.toLowerCase() + '-0000-1000-8000-00805f9b34fb'
|
|
15
|
-
}
|
|
16
|
-
if (uuid.length === 8) {
|
|
17
|
-
return uuid.toLowerCase() + '-0000-1000-8000-00805f9b34fb'
|
|
18
|
-
}
|
|
19
|
-
return uuid.toLowerCase()
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function fillStringWithArguments(value: string, object: Object): string {
|
|
23
|
-
return value.replace(/\{([^}]+)\}/g, function (_, arg: string) {
|
|
24
|
-
return object[arg] || '?'
|
|
25
|
-
})
|
|
26
|
-
}
|
|
1
|
+
// @flow
|
|
2
|
+
'use strict'
|
|
3
|
+
|
|
4
|
+
import type { UUID } from './TypeDefinition'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Converts UUID to full 128bit, lowercase format which should be used to compare UUID values.
|
|
8
|
+
*
|
|
9
|
+
* @param {UUID} uuid 16bit, 32bit or 128bit UUID.
|
|
10
|
+
* @returns {UUID} 128bit lowercase UUID.
|
|
11
|
+
*/
|
|
12
|
+
export function fullUUID(uuid: UUID): UUID {
|
|
13
|
+
if (uuid.length === 4) {
|
|
14
|
+
return '0000' + uuid.toLowerCase() + '-0000-1000-8000-00805f9b34fb'
|
|
15
|
+
}
|
|
16
|
+
if (uuid.length === 8) {
|
|
17
|
+
return uuid.toLowerCase() + '-0000-1000-8000-00805f9b34fb'
|
|
18
|
+
}
|
|
19
|
+
return uuid.toLowerCase()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function fillStringWithArguments(value: string, object: Object): string {
|
|
23
|
+
return value.replace(/\{([^}]+)\}/g, function (_, arg: string) {
|
|
24
|
+
return object[arg] || '?'
|
|
25
|
+
})
|
|
26
|
+
}
|