columba/python/ble_modules
torlando-tech 019f88ea2b fix: convert Chaquopy jarray to Python bytes in BLE callbacks
When Kotlin passes ByteArray to Python via Chaquopy, it arrives as a
jarray('B') (Java array), not Python bytes. Java arrays don't have
Python methods like .hex(), so calling .hex() on identity bytes
caused "jarray('B')' object has no attribute 'hex'" errors.

Add ensure_bytes() helper function and apply it to:
- _handle_data_received: data parameter
- _handle_duplicate_identity_detected: identity_bytes parameter

This fixes the duplicate identity detection callback which was failing
silently and allowing connections that should have been rejected.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 01:10:23 -05:00
..
__init__.py initial commit 2025-11-30 19:59:14 -05:00
android_ble_driver.py fix: convert Chaquopy jarray to Python bytes in BLE callbacks 2026-01-18 01:10:23 -05:00
android_ble_interface.py initial commit 2025-11-30 19:59:14 -05:00