From fffc51af1c78a3f757e243c078983b788adc72ee Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Tue, 7 Mar 2023 20:18:29 +1100 Subject: [PATCH 1/9] Change to 128bit UUID's --- .../Core/BSP/Pinecilv2/ble_characteristics.h | 124 +++++++++--------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/source/Core/BSP/Pinecilv2/ble_characteristics.h b/source/Core/BSP/Pinecilv2/ble_characteristics.h index abba04c04c..4ff3869e88 100644 --- a/source/Core/BSP/Pinecilv2/ble_characteristics.h +++ b/source/Core/BSP/Pinecilv2/ble_characteristics.h @@ -19,75 +19,75 @@ */ // d85efab4-168e-4a71-affd-33e27f9bc533 -#define BT_UUID_SVC_LIVE_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9bc533)) +#define BT_UUID_SVC_LIVE_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) // f6d75f91-5a10-4eba-a233-47d3f26a907f -#define BT_UUID_SVC_SETTINGS_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a907f)) +#define BT_UUID_SVC_SETTINGS_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xAA55, 0x47d3f26a907f)) // 9eae1adb-9d0d-48c5-a6e7-ae93f0ea37b0 -#define BT_UUID_SVC_BULK_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xa6e7, 0xae93f0ea37b0)) +#define BT_UUID_SVC_BULK_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xAA55, 0xae93f0ea37b0)) -#define BT_UUID_CHAR_BLE_LIVE_LIVE_TEMP BT_UUID_DECLARE_16(0x0001) -#define BT_UUID_CHAR_BLE_LIVE_SETPOINT_TEMP BT_UUID_DECLARE_16(0x0002) -#define BT_UUID_CHAR_BLE_LIVE_DC_INPUT BT_UUID_DECLARE_16(0x0003) -#define BT_UUID_CHAR_BLE_LIVE_HANDLE_TEMP BT_UUID_DECLARE_16(0x0004) -#define BT_UUID_CHAR_BLE_LIVE_POWER_LEVEL BT_UUID_DECLARE_16(0x0005) -#define BT_UUID_CHAR_BLE_LIVE_POWER_SRC BT_UUID_DECLARE_16(0x0006) -#define BT_UUID_CHAR_BLE_LIVE_TIP_RES BT_UUID_DECLARE_16(0x0007) -#define BT_UUID_CHAR_BLE_LIVE_UPTIME BT_UUID_DECLARE_16(0x0008) -#define BT_UUID_CHAR_BLE_LIVE_MOVEMENT BT_UUID_DECLARE_16(0x0009) -#define BT_UUID_CHAR_BLE_LIVE_MAX_TEMP BT_UUID_DECLARE_16(0x000A) -#define BT_UUID_CHAR_BLE_LIVE_RAW_TIP BT_UUID_DECLARE_16(0x000B) -#define BT_UUID_CHAR_BLE_LIVE_HALL_SENSOR BT_UUID_DECLARE_16(0x000C) -#define BT_UUID_CHAR_BLE_LIVE_OP_MODE BT_UUID_DECLARE_16(0x000D) -#define BT_UUID_CHAR_BLE_LIVE_EST_WATTS BT_UUID_DECLARE_16(0x000E) +#define BT_UUID_CHAR_BLE_LIVE_LIVE_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0001)) +#define BT_UUID_CHAR_BLE_LIVE_SETPOINT_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0002)) +#define BT_UUID_CHAR_BLE_LIVE_DC_INPUT BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0003)) +#define BT_UUID_CHAR_BLE_LIVE_HANDLE_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0004)) +#define BT_UUID_CHAR_BLE_LIVE_POWER_LEVEL BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0005)) +#define BT_UUID_CHAR_BLE_LIVE_POWER_SRC BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0006)) +#define BT_UUID_CHAR_BLE_LIVE_TIP_RES BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0007)) +#define BT_UUID_CHAR_BLE_LIVE_UPTIME BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0008)) +#define BT_UUID_CHAR_BLE_LIVE_MOVEMENT BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0009)) +#define BT_UUID_CHAR_BLE_LIVE_MAX_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000A)) +#define BT_UUID_CHAR_BLE_LIVE_RAW_TIP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000B)) +#define BT_UUID_CHAR_BLE_LIVE_HALL_SENSOR BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000C)) +#define BT_UUID_CHAR_BLE_LIVE_OP_MODE BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000D)) +#define BT_UUID_CHAR_BLE_LIVE_EST_WATTS BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000E)) // Bulk data that returns non-fixed sized objects -#define BT_UUID_CHAR_BLE_LIVE_BULK_LIVE_DATA BT_UUID_DECLARE_16(0x0001) -#define BT_UUID_CHAR_BLE_LIVE_ACCEL_NAME BT_UUID_DECLARE_16(0x0002) -#define BT_UUID_CHAR_BLE_LIVE_BUILD BT_UUID_DECLARE_16(0x0003) -#define BT_UUID_CHAR_BLE_LIVE_DEV_ID BT_UUID_DECLARE_16(0x0004) +#define BT_UUID_CHAR_BLE_LIVE_BULK_LIVE_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xa6e7, 0xae93f0ea0001)) +#define BT_UUID_CHAR_BLE_LIVE_ACCEL_NAME BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xa6e7, 0xae93f0ea0002)) +#define BT_UUID_CHAR_BLE_LIVE_BUILD BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xa6e7, 0xae93f0ea0003)) +#define BT_UUID_CHAR_BLE_LIVE_DEV_ID BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xa6e7, 0xae93f0ea0004)) // Settings -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_SAVE BT_UUID_DECLARE_16(0xFFFF) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_RESET BT_UUID_DECLARE_16(0xFFFE) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_0 BT_UUID_DECLARE_16(0) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_1 BT_UUID_DECLARE_16(1) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_2 BT_UUID_DECLARE_16(2) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_3 BT_UUID_DECLARE_16(3) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_4 BT_UUID_DECLARE_16(4) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_5 BT_UUID_DECLARE_16(5) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_6 BT_UUID_DECLARE_16(6) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_7 BT_UUID_DECLARE_16(7) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_8 BT_UUID_DECLARE_16(8) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_9 BT_UUID_DECLARE_16(9) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_10 BT_UUID_DECLARE_16(10) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_11 BT_UUID_DECLARE_16(11) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_12 BT_UUID_DECLARE_16(12) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_13 BT_UUID_DECLARE_16(13) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_14 BT_UUID_DECLARE_16(14) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_15 BT_UUID_DECLARE_16(15) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_16 BT_UUID_DECLARE_16(16) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_17 BT_UUID_DECLARE_16(17) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_18 BT_UUID_DECLARE_16(18) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_19 BT_UUID_DECLARE_16(19) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_20 BT_UUID_DECLARE_16(20) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_21 BT_UUID_DECLARE_16(21) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_22 BT_UUID_DECLARE_16(22) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_23 BT_UUID_DECLARE_16(23) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_24 BT_UUID_DECLARE_16(24) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_25 BT_UUID_DECLARE_16(25) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_26 BT_UUID_DECLARE_16(26) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_27 BT_UUID_DECLARE_16(27) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_28 BT_UUID_DECLARE_16(28) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_29 BT_UUID_DECLARE_16(29) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_30 BT_UUID_DECLARE_16(30) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_31 BT_UUID_DECLARE_16(31) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_32 BT_UUID_DECLARE_16(32) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_33 BT_UUID_DECLARE_16(33) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_34 BT_UUID_DECLARE_16(34) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_35 BT_UUID_DECLARE_16(35) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_36 BT_UUID_DECLARE_16(36) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_37 BT_UUID_DECLARE_16(37) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_38 BT_UUID_DECLARE_16(38) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_SAVE BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26aFFFF)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_RESET BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26aFFFE)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_0 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a000)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_1 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a001)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_2 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a002)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_3 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a003)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_4 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a004)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_5 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a005)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_6 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a006)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_7 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a007)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_8 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a008)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_9 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a009)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_10 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0010)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_11 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0011)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_12 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0012)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_13 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0013)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_14 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0014)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_15 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0015)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_16 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0016)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_17 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0017)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_18 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0018)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_19 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0019)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_20 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0020)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_21 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0021)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_22 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0022)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_23 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0023)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_24 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0024)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_25 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0025)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_26 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0026)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_27 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0027)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_28 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0028)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_29 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0029)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_30 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0030)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_31 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0031)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_32 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0032)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_33 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0033)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_34 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0034)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_35 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0035)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_36 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0036)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_37 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0037)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_38 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0038)) #endif From 490a4fbe0256fa39ae8da1c3633c8c1aa02d1b35 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Tue, 7 Mar 2023 20:23:42 +1100 Subject: [PATCH 2/9] Make attrs const for BLE --- source/Core/BSP/Pinecilv2/ble_peripheral.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Core/BSP/Pinecilv2/ble_peripheral.c b/source/Core/BSP/Pinecilv2/ble_peripheral.c index de7090f597..8863fbca01 100644 --- a/source/Core/BSP/Pinecilv2/ble_peripheral.c +++ b/source/Core/BSP/Pinecilv2/ble_peripheral.c @@ -142,7 +142,7 @@ static void ble_tp_ind_ccc_changed(const struct bt_gatt_attr *attr, u16_t value) /************************************************************************* * DEFINE : attrs */ -static struct bt_gatt_attr attrs[] = { +static const struct bt_gatt_attr attrs[] = { BT_GATT_PRIMARY_SERVICE(BT_UUID_SVC_LIVE_DATA), BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_LIVE_TEMP, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_status_callback, NULL, NULL), From ae8c2f0b201376fa05b5761c08fb95e56f9c16e7 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sun, 26 Mar 2023 12:42:54 +1100 Subject: [PATCH 3/9] Forcefully set docker project name --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 9a029eae7d..83e749479d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,5 @@ version: "3" +name: "ironos" services: builder: stdin_open: true From c3192609a27a880f9f93bc1288c78d94b5490ba7 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sun, 26 Mar 2023 13:14:25 +1100 Subject: [PATCH 4/9] Cleaner UUIDS --- .../Core/BSP/Pinecilv2/ble_characteristics.h | 124 +++++++++--------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/source/Core/BSP/Pinecilv2/ble_characteristics.h b/source/Core/BSP/Pinecilv2/ble_characteristics.h index 4ff3869e88..8d3db454c8 100644 --- a/source/Core/BSP/Pinecilv2/ble_characteristics.h +++ b/source/Core/BSP/Pinecilv2/ble_characteristics.h @@ -19,75 +19,75 @@ */ // d85efab4-168e-4a71-affd-33e27f9bc533 -#define BT_UUID_SVC_LIVE_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_SVC_LIVE_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef000, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) // f6d75f91-5a10-4eba-a233-47d3f26a907f -#define BT_UUID_SVC_SETTINGS_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xAA55, 0x47d3f26a907f)) +#define BT_UUID_SVC_SETTINGS_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75000, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) // 9eae1adb-9d0d-48c5-a6e7-ae93f0ea37b0 -#define BT_UUID_SVC_BULK_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xAA55, 0xae93f0ea37b0)) +#define BT_UUID_SVC_BULK_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1000, 0x9d0d, 0x48c5, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_LIVE_LIVE_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0001)) -#define BT_UUID_CHAR_BLE_LIVE_SETPOINT_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0002)) -#define BT_UUID_CHAR_BLE_LIVE_DC_INPUT BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0003)) -#define BT_UUID_CHAR_BLE_LIVE_HANDLE_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0004)) -#define BT_UUID_CHAR_BLE_LIVE_POWER_LEVEL BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0005)) -#define BT_UUID_CHAR_BLE_LIVE_POWER_SRC BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0006)) -#define BT_UUID_CHAR_BLE_LIVE_TIP_RES BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0007)) -#define BT_UUID_CHAR_BLE_LIVE_UPTIME BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0008)) -#define BT_UUID_CHAR_BLE_LIVE_MOVEMENT BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b0009)) -#define BT_UUID_CHAR_BLE_LIVE_MAX_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000A)) -#define BT_UUID_CHAR_BLE_LIVE_RAW_TIP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000B)) -#define BT_UUID_CHAR_BLE_LIVE_HALL_SENSOR BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000C)) -#define BT_UUID_CHAR_BLE_LIVE_OP_MODE BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000D)) -#define BT_UUID_CHAR_BLE_LIVE_EST_WATTS BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85efab4, 0x168e, 0x4a71, 0xaffd, 0x33e27f9b000E)) +#define BT_UUID_CHAR_BLE_LIVE_LIVE_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef001, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_SETPOINT_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef002, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_DC_INPUT BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef003, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_HANDLE_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef004, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_POWER_LEVEL BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef005, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_POWER_SRC BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef006, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_TIP_RES BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef007, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_UPTIME BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef008, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_MOVEMENT BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef009, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_MAX_TEMP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef00A, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_RAW_TIP BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef00B, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_HALL_SENSOR BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef00C, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_OP_MODE BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef00D, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_EST_WATTS BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef00E, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) // Bulk data that returns non-fixed sized objects -#define BT_UUID_CHAR_BLE_LIVE_BULK_LIVE_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xa6e7, 0xae93f0ea0001)) -#define BT_UUID_CHAR_BLE_LIVE_ACCEL_NAME BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xa6e7, 0xae93f0ea0002)) -#define BT_UUID_CHAR_BLE_LIVE_BUILD BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xa6e7, 0xae93f0ea0003)) -#define BT_UUID_CHAR_BLE_LIVE_DEV_ID BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1adb, 0x9d0d, 0x48c5, 0xa6e7, 0xae93f0ea0004)) +#define BT_UUID_CHAR_BLE_LIVE_BULK_LIVE_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1001, 0x9d0d, 0x48c5, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_ACCEL_NAME BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1002, 0x9d0d, 0x48c5, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_BUILD BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1003, 0x9d0d, 0x48c5, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_LIVE_DEV_ID BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1004, 0x9d0d, 0x48c5, 0xAA55, 0x33e27f9bc533)) // Settings -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_SAVE BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26aFFFF)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_RESET BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26aFFFE)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_0 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a000)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_1 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a001)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_2 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a002)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_3 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a003)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_4 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a004)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_5 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a005)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_6 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a006)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_7 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a007)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_8 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a008)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_9 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a009)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_10 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0010)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_11 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0011)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_12 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0012)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_13 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0013)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_14 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0014)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_15 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0015)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_16 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0016)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_17 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0017)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_18 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0018)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_19 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0019)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_20 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0020)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_21 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0021)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_22 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0022)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_23 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0023)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_24 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0024)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_25 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0025)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_26 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0026)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_27 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0027)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_28 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0028)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_29 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0029)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_30 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0030)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_31 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0031)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_32 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0032)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_33 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0033)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_34 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0034)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_35 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0035)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_36 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0036)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_37 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0037)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_38 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75f91, 0x5a10, 0x4eba, 0xa233, 0x47d3f26a0038)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_SAVE BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75001, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_RESET BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75002, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_0 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75003, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_1 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75004, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_2 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75005, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_3 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75006, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_4 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75007, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_5 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75008, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_6 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75009, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_7 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500a, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_8 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500b, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_9 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500c, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_10 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500d, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_11 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500e, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_12 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500f, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_13 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75010, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_14 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75011, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_15 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75012, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_16 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75013, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_17 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75014, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_18 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75015, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_19 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75016, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_20 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75017, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_21 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75018, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_22 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75019, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_23 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501a, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_24 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501b, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_25 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501c, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_26 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501d, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_27 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501e, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_28 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501f, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_29 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75020, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_30 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75021, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_31 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75022, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_32 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75023, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_33 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75024, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_34 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75025, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_35 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75026, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_36 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75027, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_37 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75029, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_38 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7502a, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) #endif From c7397fd0f5b591c4ef766cc367cd13274131eb52 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sun, 26 Mar 2023 13:14:32 +1100 Subject: [PATCH 5/9] Cant use const attrs --- source/Core/BSP/Pinecilv2/ble_peripheral.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Core/BSP/Pinecilv2/ble_peripheral.c b/source/Core/BSP/Pinecilv2/ble_peripheral.c index 8863fbca01..51801b7b49 100644 --- a/source/Core/BSP/Pinecilv2/ble_peripheral.c +++ b/source/Core/BSP/Pinecilv2/ble_peripheral.c @@ -142,7 +142,7 @@ static void ble_tp_ind_ccc_changed(const struct bt_gatt_attr *attr, u16_t value) /************************************************************************* * DEFINE : attrs */ -static const struct bt_gatt_attr attrs[] = { +static struct bt_gatt_attr ble_attrs_declaration[] = { BT_GATT_PRIMARY_SERVICE(BT_UUID_SVC_LIVE_DATA), BT_GATT_CHARACTERISTIC(BT_UUID_CHAR_BLE_LIVE_LIVE_TEMP, BT_GATT_CHRC_READ, BT_GATT_PERM_READ, ble_char_read_status_callback, NULL, NULL), @@ -257,9 +257,9 @@ static const struct bt_gatt_attr attrs[] = { NAME get_attr */ -struct bt_gatt_attr *get_attr(u8_t index) { return &attrs[index]; } +struct bt_gatt_attr *get_attr(u8_t index) { return &ble_attrs_declaration[index]; } -static struct bt_gatt_service ble_tp_server = BT_GATT_SERVICE(attrs); +static struct bt_gatt_service ble_tp_server = BT_GATT_SERVICE(ble_attrs_declaration); // Start advertising with expected default values int ble_start_adv(void) { From 11d6622197d2467925b5cf7e93771f664e9b09d0 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Sun, 26 Mar 2023 13:23:22 +1100 Subject: [PATCH 6/9] Adjust ram sections --- .../bl_mcu_sdk/drivers/bl702_driver/bl702_flash.ld | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Core/BSP/Pinecilv2/bl_mcu_sdk/drivers/bl702_driver/bl702_flash.ld b/source/Core/BSP/Pinecilv2/bl_mcu_sdk/drivers/bl702_driver/bl702_flash.ld index e14b21facb..e7c66d226b 100644 --- a/source/Core/BSP/Pinecilv2/bl_mcu_sdk/drivers/bl702_driver/bl702_flash.ld +++ b/source/Core/BSP/Pinecilv2/bl_mcu_sdk/drivers/bl702_driver/bl702_flash.ld @@ -17,16 +17,16 @@ OUTPUT_ARCH( "riscv" ) /* configure the entry point */ ENTRY(_enter) -StackSize = 0x1000; /* 4KB */ -HeapSize = 0x1000; /* 4KB */ +StackSize = 0x800; /* 2KB */ +HeapSize = 0x800; /* 2KB */ __EM_SIZE = DEFINED(ble_controller_init) ? 8K : 0K; MEMORY { xip_memory (rx) : ORIGIN = 0x23000000, LENGTH = 1022K itcm_memory (rx) : ORIGIN = 0x22014000, LENGTH = 16K - dtcm_memory (rx) : ORIGIN = 0x42018000, LENGTH = 32K - ram_memory (!rx) : ORIGIN = 0x42020000, LENGTH = 32K + dtcm_memory (rx) : ORIGIN = 0x42017000, LENGTH = 4K + ram_memory (!rx) : ORIGIN = 0x42018000, LENGTH = 64K rsvd_memory (!rx) : ORIGIN = 0x42028000, LENGTH = 1K ram2_memory (!rx) : ORIGIN = 0x42028400, LENGTH = (31K - __EM_SIZE) hbn_memory (rx) : ORIGIN = 0x40010000, LENGTH = 0xE00 /* hbn ram 4K used 3.5K*/ From 136d0e490a466965e187d7653c06bfafbbc3e28f Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Mon, 27 Mar 2023 17:02:45 +1100 Subject: [PATCH 7/9] Update UUID decode --- source/Core/BSP/Pinecilv2/ble_handlers.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/source/Core/BSP/Pinecilv2/ble_handlers.cpp b/source/Core/BSP/Pinecilv2/ble_handlers.cpp index 2f7f2518b8..41fc088e74 100644 --- a/source/Core/BSP/Pinecilv2/ble_handlers.cpp +++ b/source/Core/BSP/Pinecilv2/ble_handlers.cpp @@ -20,14 +20,14 @@ #include "log.h" #include "uuid.h" -#include "OperatingModes.h" +#include "../../version.h" #include "OLED.hpp" +#include "OperatingModes.h" #include "USBPD.h" #include "ble_characteristics.h" #include "ble_handlers.h" #include "pd.h" #include "power.hpp" -#include "../../version.h" #if POW_PD #include "USBPD.h" #include "pd.h" @@ -40,7 +40,9 @@ int ble_char_read_status_callback(struct bt_conn *conn, const struct bt_gatt_att if (attr == NULL || attr->uuid == NULL) { return 0; } - uint16_t uuid_value = ((struct bt_uuid_16 *)attr->uuid)->val; + // Decode the uuid + // Byte 12 has the lowest part of the first UUID chunk + uint16_t uuid_value = ((struct bt_uuid_128 *)attr->uuid)->val[12]; uint32_t temp = 0; switch (uuid_value) { case 1: // Live temp @@ -138,7 +140,8 @@ int ble_char_read_bulk_value_callback(struct bt_conn *conn, const struct bt_gatt if (attr == NULL || attr->uuid == NULL) { return 0; } - uint16_t uuid_value = ((struct bt_uuid_16 *)attr->uuid)->val; + // Byte 12 has the lowest part of the first UUID chunk + uint16_t uuid_value = ((struct bt_uuid_128 *)attr->uuid)->val[12]; // Bulk is the non-const size service switch (uuid_value) { case 1: @@ -195,7 +198,8 @@ int ble_char_read_setting_value_callback(struct bt_conn *conn, const struct bt_g if (attr == NULL || attr->uuid == NULL) { return 0; } - uint16_t uuid_value = ((struct bt_uuid_16 *)attr->uuid)->val; + // Byte 12 has the lowest part of the first UUID chunk + uint16_t uuid_value = ((struct bt_uuid_128 *)attr->uuid)->val[12]; uint16_t temp = 0xFFFF; if (uuid_value <= SettingsOptions::SettingsOptionsLength) { temp = getSettingValue((SettingsOptions)(uuid_value)); @@ -248,10 +252,10 @@ int ble_char_write_setting_value_callback(struct bt_conn *conn, const struct bt_ if (uuid_value == SettingsOptions::OLEDInversion) { OLED::setInverseDisplay(getSettingValue(SettingsOptions::OLEDInversion)); } - if (uuid_value == SettingsOptions::OLEDBrightness){ + if (uuid_value == SettingsOptions::OLEDBrightness) { OLED::setBrightness(getSettingValue(SettingsOptions::OLEDBrightness)); } - if (uuid_value == SettingsOptions::OrientationMode){ + if (uuid_value == SettingsOptions::OrientationMode) { OLED::setRotation(getSettingValue(SettingsOptions::OrientationMode) & 1); } return len; From 247f2d592da4e260db19a2c31a3cbc2c6f267ea0 Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Mon, 27 Mar 2023 17:07:33 +1100 Subject: [PATCH 8/9] Settings uuids --- .../Core/BSP/Pinecilv2/ble_characteristics.h | 85 +++++++++---------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/source/Core/BSP/Pinecilv2/ble_characteristics.h b/source/Core/BSP/Pinecilv2/ble_characteristics.h index 8d3db454c8..2e24a82ddf 100644 --- a/source/Core/BSP/Pinecilv2/ble_characteristics.h +++ b/source/Core/BSP/Pinecilv2/ble_characteristics.h @@ -21,7 +21,7 @@ // d85efab4-168e-4a71-affd-33e27f9bc533 #define BT_UUID_SVC_LIVE_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xd85ef000, 0x168e, 0x4a71, 0xAA55, 0x33e27f9bc533)) // f6d75f91-5a10-4eba-a233-47d3f26a907f -#define BT_UUID_SVC_SETTINGS_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75000, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_SVC_SETTINGS_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d80000, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) // 9eae1adb-9d0d-48c5-a6e7-ae93f0ea37b0 #define BT_UUID_SVC_BULK_DATA BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0x9eae1000, 0x9d0d, 0x48c5, 0xAA55, 0x33e27f9bc533)) @@ -48,46 +48,45 @@ // Settings -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_SAVE BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75001, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_RESET BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75002, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_0 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75003, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_1 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75004, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_2 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75005, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_3 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75006, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_4 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75007, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_5 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75008, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_6 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75009, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_7 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500a, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_8 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500b, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_9 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500c, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_10 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500d, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_11 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500e, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_12 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7500f, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_13 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75010, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_14 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75011, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_15 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75012, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_16 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75013, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_17 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75014, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_18 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75015, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_19 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75016, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_20 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75017, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_21 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75018, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_22 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75019, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_23 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501a, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_24 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501b, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_25 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501c, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_26 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501d, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_27 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501e, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_28 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7501f, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_29 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75020, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_30 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75021, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_31 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75022, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_32 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75023, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_33 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75024, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_34 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75025, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_35 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75026, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_36 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75027, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_37 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d75029, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) -#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_38 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7502a, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) - +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_SAVE BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7FFFF, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_RESET BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7FFFE, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_0 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70000, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_1 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70001, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_2 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70002, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_3 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70003, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_4 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70004, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_5 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70005, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_6 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70006, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_7 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70007, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_8 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70008, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_9 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70009, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_10 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7000a, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_11 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7000b, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_12 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7000c, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_13 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7000d, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_14 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7000e, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_15 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7000f, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_16 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70010, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_17 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70011, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_18 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70012, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_19 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70013, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_20 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70014, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_21 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70015, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_22 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70016, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_23 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70017, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_24 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70018, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_25 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70019, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_26 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7001a, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_27 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7001b, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_28 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7001c, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_29 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7001d, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_30 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7001e, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_31 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d7001f, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_32 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70020, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_33 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70021, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_34 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70022, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_35 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70023, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_36 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70024, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_37 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70025, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) +#define BT_UUID_CHAR_BLE_SETTINGS_VALUE_38 BT_UUID_DECLARE_128(BT_UUID_128_ENCODE(0xf6d70026, 0x5a10, 0x4eba, 0xAA55, 0x33e27f9bc533)) #endif From c903396f26b957a957c1ee78b9eaa4a9735af99d Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Wed, 29 Mar 2023 09:06:13 +1100 Subject: [PATCH 9/9] Fix missed decoder for writing --- source/Core/BSP/Pinecilv2/ble_handlers.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Core/BSP/Pinecilv2/ble_handlers.cpp b/source/Core/BSP/Pinecilv2/ble_handlers.cpp index 41fc088e74..eac616a9e4 100644 --- a/source/Core/BSP/Pinecilv2/ble_handlers.cpp +++ b/source/Core/BSP/Pinecilv2/ble_handlers.cpp @@ -232,16 +232,16 @@ int ble_char_write_setting_value_callback(struct bt_conn *conn, const struct bt_ // Use write request / execute write data. BT_WARN((char *)"recv write request / exce write\n"); } - uint16_t uuid_value = ((struct bt_uuid_16 *)attr->uuid)->val; + uint8_t uuid_value = ((struct bt_uuid_128 *)attr->uuid)->val[12]; if (len == 2) { uint16_t new_value = 0; memcpy(&new_value, buf, sizeof(new_value)); - if (uuid_value == 0xFFFF) { + if (uuid_value == 0xFF) { if (new_value == 1) { saveSettings(); return len; } - } else if (uuid_value == 0xFFFE) { + } else if (uuid_value == 0xFE) { if (new_value == 1) { resetSettings(); return len;