Bluetooth: shell: Use UUID encode macro for 128-bit UUIDs Use UUID encode macro fro 128-bit UUIDs for readability. This makes it easier to see which service you are working with as the bt_uuid_to_str prints the 128-bit UUIDs in this format. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
diff --git a/subsys/bluetooth/shell/gatt.c b/subsys/bluetooth/shell/gatt.c index e1c398e..46af078 100644 --- a/subsys/bluetooth/shell/gatt.c +++ b/subsys/bluetooth/shell/gatt.c
@@ -726,28 +726,26 @@ #if defined(CONFIG_BT_GATT_DYNAMIC_DB) /* Custom Service Variables */ + static struct bt_uuid_128 vnd_uuid = BT_UUID_INIT_128( - 0xf0, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12, - 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12); + BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcdef0)); + static struct bt_uuid_128 vnd_auth_uuid = BT_UUID_INIT_128( - 0xf2, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12, - 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12); + BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcdef2)); + static const struct bt_uuid_128 vnd_long_uuid1 = BT_UUID_INIT_128( - 0xf3, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12, - 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12); + BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcdef3)); + static const struct bt_uuid_128 vnd_long_uuid2 = BT_UUID_INIT_128( - 0xde, 0xad, 0xfa, 0xce, 0x78, 0x56, 0x34, 0x12, - 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12); + BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x12340, 0x5678cefaadde)); static uint8_t vnd_value[] = { 'V', 'e', 'n', 'd', 'o', 'r' }; static struct bt_uuid_128 vnd1_uuid = BT_UUID_INIT_128( - 0xf4, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12, - 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12); + BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x12340, 0x56789abcdef4)); static const struct bt_uuid_128 vnd1_echo_uuid = BT_UUID_INIT_128( - 0xf5, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12, - 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12); + BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x12340, 0x56789abcdef5)); static uint8_t echo_enabled; @@ -923,12 +921,9 @@ } static struct bt_uuid_128 met_svc_uuid = BT_UUID_INIT_128( - 0x01, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12, - 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12); - + BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcde01)); static const struct bt_uuid_128 met_char_uuid = BT_UUID_INIT_128( - 0x02, 0xde, 0xbc, 0x9a, 0x78, 0x56, 0x34, 0x12, - 0x78, 0x56, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12); + BT_UUID_128_ENCODE(0x12345678, 0x1234, 0x5678, 0x1234, 0x56789abcde02)); static uint8_t met_char_value[CHAR_SIZE_MAX] = { 'M', 'e', 't', 'r', 'i', 'c', 's' };