Skip to content

Commit

Permalink
samples: bluetooth: fast_pair: locator_tag: Use SMP UUIDs from header
Browse files Browse the repository at this point in the history
Replace the custom mcumgr SMP BT UUIDs with the ones available
in the smp_bt.h header file from Zephyr.

Jira: NCSDK-28457

Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
  • Loading branch information
mkapala-nordic authored and rlubos committed Oct 9, 2024
1 parent e8efc84 commit 4229268
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions samples/bluetooth/fast_pair/locator_tag/src/dfu.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <bluetooth/services/fast_pair/fast_pair.h>
#include <bluetooth/services/fast_pair/fmdn.h>

#include <zephyr/mgmt/mcumgr/transport/smp_bt.h>

#include "app_dfu.h"
#include "app_factory_reset.h"
#include "app_fp_adv.h"
Expand All @@ -25,17 +27,7 @@ LOG_MODULE_DECLARE(fp_fmdn, LOG_LEVEL_INF);
/* DFU mode timeout in minutes. */
#define DFU_MODE_TIMEOUT_MIN (5)

/* UUID of the SMP service used for the DFU. */
#define BT_UUID_SMP_SVC_VAL \
BT_UUID_128_ENCODE(0x8d53dc1d, 0x1db7, 0x4cd3, 0x868b, 0x8a527460aa84)

/* UUID of the SMP characteristic used for the DFU. */
#define BT_UUID_SMP_CHAR_VAL \
BT_UUID_128_ENCODE(0xda2e7828, 0xfbce, 0x4e01, 0xae9e, 0x261174997c48)

#define BT_UUID_SMP_CHAR BT_UUID_DECLARE_128(BT_UUID_SMP_CHAR_VAL)

static const struct bt_data data = BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_SMP_SVC_VAL);
static const struct bt_data data = BT_DATA_BYTES(BT_DATA_UUID128_ALL, SMP_BT_SVC_UUID_VAL);
static bool dfu_mode;

APP_FP_ADV_TRIGGER_REGISTER(fp_adv_trigger_dfu, "dfu");
Expand Down Expand Up @@ -83,7 +75,7 @@ APP_FACTORY_RESET_CALLBACKS_REGISTER(factory_reset_cbs, dfu_factory_reset_prepar

bool app_dfu_bt_gatt_operation_allow(const struct bt_uuid *uuid)
{
if (bt_uuid_cmp(uuid, BT_UUID_SMP_CHAR) != 0) {
if (bt_uuid_cmp(uuid, SMP_BT_CHR_UUID) != 0) {
return true;
}

Expand Down

0 comments on commit 4229268

Please sign in to comment.