Skip to content

Commit d3d3f66

Browse files
mkapala-nordicrlubos
authored andcommitted
[nrf fromtree] mgmt: mcumgr: Add SMP SVC and CHR UUIDs to header
Added the SMP service and characteristic UUIDs to the smp_bt module header and used those definitions. Signed-off-by: Mateusz Kapala <[email protected]> (cherry picked from commit 7755589)
1 parent ed62533 commit d3d3f66

File tree

2 files changed

+21
-14
lines changed
  • include/zephyr/mgmt/mcumgr/transport
  • subsys/mgmt/mcumgr/transport/src

2 files changed

+21
-14
lines changed

include/zephyr/mgmt/mcumgr/transport/smp_bt.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,32 @@
1111
#ifndef ZEPHYR_INCLUDE_MGMT_SMP_BT_H_
1212
#define ZEPHYR_INCLUDE_MGMT_SMP_BT_H_
1313

14+
#include <zephyr/bluetooth/uuid.h>
1415
#include <zephyr/types.h>
1516
struct bt_conn;
1617

1718
#ifdef __cplusplus
1819
extern "C" {
1920
#endif
2021

22+
/** SMP service UUID value. */
23+
#define SMP_BT_SVC_UUID_VAL \
24+
BT_UUID_128_ENCODE(0x8d53dc1d, 0x1db7, 0x4cd3, 0x868b, 0x8a527460aa84)
25+
26+
/** SMP service UUID. */
27+
#define SMP_BT_SVC_UUID \
28+
BT_UUID_DECLARE_128(SMP_BT_SVC_UUID_VAL)
29+
30+
/** SMP characteristic UUID value. */
31+
#define SMP_BT_CHR_UUID_VAL \
32+
BT_UUID_128_ENCODE(0xda2e7828, 0xfbce, 0x4e01, 0xae9e, 0x261174997c48)
33+
34+
/** SMP characteristic UUID
35+
* Used for both requests and responses.
36+
*/
37+
#define SMP_BT_CHR_UUID \
38+
BT_UUID_DECLARE_128(SMP_BT_CHR_UUID_VAL)
39+
2140
/**
2241
* @brief Registers the SMP Bluetooth service. Should only be called if the Bluetooth
2342
* transport has been unregistered by calling smp_bt_unregister().

subsys/mgmt/mcumgr/transport/src/smp_bt.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,6 @@ static uint8_t next_id;
109109
static struct smp_transport smp_bt_transport;
110110
static struct conn_param_data conn_data[CONFIG_BT_MAX_CONN];
111111

112-
/* SMP service.
113-
* {8D53DC1D-1DB7-4CD3-868B-8A527460AA84}
114-
*/
115-
static const struct bt_uuid_128 smp_bt_svc_uuid = BT_UUID_INIT_128(
116-
BT_UUID_128_ENCODE(0x8d53dc1d, 0x1db7, 0x4cd3, 0x868b, 0x8a527460aa84));
117-
118-
/* SMP characteristic; used for both requests and responses.
119-
* {DA2E7828-FBCE-4E01-AE9E-261174997C48}
120-
*/
121-
static const struct bt_uuid_128 smp_bt_chr_uuid = BT_UUID_INIT_128(
122-
BT_UUID_128_ENCODE(0xda2e7828, 0xfbce, 0x4e01, 0xae9e, 0x261174997c48));
123-
124112
static void connected(struct bt_conn *conn, uint8_t err);
125113
static void disconnected(struct bt_conn *conn, uint8_t reason);
126114

@@ -375,8 +363,8 @@ static void smp_bt_ccc_changed(const struct bt_gatt_attr *attr, uint16_t value)
375363
}
376364

377365
#define SMP_BT_ATTRS \
378-
BT_GATT_PRIMARY_SERVICE(&smp_bt_svc_uuid), \
379-
BT_GATT_CHARACTERISTIC(&smp_bt_chr_uuid.uuid, \
366+
BT_GATT_PRIMARY_SERVICE(SMP_BT_SVC_UUID), \
367+
BT_GATT_CHARACTERISTIC(SMP_BT_CHR_UUID, \
380368
BT_GATT_CHRC_WRITE_WITHOUT_RESP | \
381369
BT_GATT_CHRC_NOTIFY, \
382370
SMP_GATT_PERM & SMP_GATT_PERM_WRITE_MASK, \

0 commit comments

Comments
 (0)