diff --git a/apps/btshell/pkg.yml b/apps/btshell/pkg.yml index 9b4f7c715..be6d68548 100644 --- a/apps/btshell/pkg.yml +++ b/apps/btshell/pkg.yml @@ -33,6 +33,7 @@ pkg.deps: - nimble/host/services/gap - nimble/host/services/gatt - nimble/host/store/config + - nimble/host/util - nimble/transport pkg.deps.BTSHELL_ANS: diff --git a/apps/btshell/src/main.c b/apps/btshell/src/main.c index b70318368..99f0a7979 100644 --- a/apps/btshell/src/main.c +++ b/apps/btshell/src/main.c @@ -43,6 +43,7 @@ #include "host/ble_gatt.h" #include "host/ble_store.h" #include "host/ble_sm.h" +#include "host/util/util.h" /* Mandatory services. */ #include "services/gap/ble_svc_gap.h" @@ -2105,6 +2106,11 @@ btshell_on_reset(int reason) static void btshell_on_sync(void) { + /* Make sure we have proper identity address set (public preferred) */ + if (ble_hs_util_ensure_addr(0) != 0) { + console_printf("Failed to set identity address\n"); + } + #if MYNEWT_VAL(BLE_SM_SC) int rc;