From 2fadb3e6e289f972fdb2110e34e3d61ff2c7c73f Mon Sep 17 00:00:00 2001 From: "j.foucher" Date: Wed, 18 Feb 2026 13:49:34 +0100 Subject: [PATCH] =?UTF-8?q?Calibration=20tool=20:=20lecture=20config=20XIA?= =?UTF-8?q?O=20au=20d=C3=A9marrage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lit la caractéristique configChar au démarrage de la connexion BLE pour synchroniser les seuils Python avec les valeurs sauvegardées en flash sur le XIAO (accel, gyro, audio). Co-Authored-By: Claude Opus 4.6 --- Python/Xiao_BLE_tools/xiao_calibration_tool.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Python/Xiao_BLE_tools/xiao_calibration_tool.py b/Python/Xiao_BLE_tools/xiao_calibration_tool.py index 917017f..015a787 100644 --- a/Python/Xiao_BLE_tools/xiao_calibration_tool.py +++ b/Python/Xiao_BLE_tools/xiao_calibration_tool.py @@ -142,7 +142,18 @@ async def ble_loop(): await client.start_notify(DEBUG_CHAR_UUID, debug_callback) await client.start_notify(SHOT_CHAR_UUID, shot_callback) ble_status = f"✅ {display_name} ({addr})" - # À la connexion : envoyer config + activer debug FULL automatiquement + # À la connexion : lire la config sauvegardée dans le XIAO (flash) + try: + raw = await client.read_gatt_char(CONFIG_CHAR_UUID) + if len(raw) >= 22: + vals = struct.unpack_from('