Open peitschie opened 1 week ago
Describe the bug
A byte array is encoded to a hex strings in two different ways, depending on the direction of flow.
Generally
AE B1 11
AEB111
This inconsistency was introduced in performance optimisations added as part of https://github.com/capacitor-community/bluetooth-le/pull/701 and was noticed in https://github.com/capacitor-community/bluetooth-le/issues/717#issuecomment-2477119844
There is no defective behaviour here. However, the inconsistency is likely to be confusing for developers and people debugging.
To Reproduce The inconsistency can be seen in the JavaScript side by comparing the hex string conversion functions
Native => JS
toHexString
hexStringToDataView
JS => native
dataViewToHexString
stringToBytes
Expected behavior A consistent hex-encoding format should be used throughout.
Plugin version:
Describe the bug
A byte array is encoded to a hex strings in two different ways, depending on the direction of flow.
Generally
AE B1 11
)AEB111
)This inconsistency was introduced in performance optimisations added as part of https://github.com/capacitor-community/bluetooth-le/pull/701 and was noticed in https://github.com/capacitor-community/bluetooth-le/issues/717#issuecomment-2477119844
There is no defective behaviour here. However, the inconsistency is likely to be confusing for developers and people debugging.
To Reproduce The inconsistency can be seen in the JavaScript side by comparing the hex string conversion functions
Native => JS
toHexString
- contains no spaces - android and iOShexStringToDataView
- expects no spaces - JSJS => native
dataViewToHexString
- contains spaces - JSstringToBytes
- expects spaces - android and iOSExpected behavior A consistent hex-encoding format should be used throughout.
Plugin version: