capacitor-community / bluetooth-le

Capacitor plugin for Bluetooth Low Energy
MIT License
284 stars 86 forks source link

Formatting of hex encoded data views is inconsistent between interfaces #719

Open peitschie opened 1 week ago

peitschie commented 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

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

JS => native

Expected behavior A consistent hex-encoding format should be used throughout.

Plugin version: