From 4a688bd119d5f93d3b78af6b014d2525ba34c10f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 22 Aug 2022 16:40:47 +0200 Subject: [PATCH] sm: use static random address after power up --- CHANGELOG.md | 3 ++- src/ble/sm.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8b63e734..edd71b409 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - embedded audio: mono audio is played on both channels if HAVE_HAL_AUDIO_SINK_STEREO_ONLY is defined ### Fixed - +- GAP: use static random address after power up + ### Changed - HCI Dump: provide log level to log_message implementation - GAP: replace BTSTACK_EVENT_DISCOVERABLE_ENABLED with BTSTACK_EVENT_SCAN_MODE_CHANGED diff --git a/src/ble/sm.c b/src/ble/sm.c index bb220e367..2af94b150 100644 --- a/src/ble/sm.c +++ b/src/ble/sm.c @@ -3692,7 +3692,11 @@ static void sm_event_packet_handler (uint8_t packet_type, uint16_t channel, uint #endif // restart random address updates after power cycle - gap_random_address_set_mode(gap_random_adress_type); + if (gap_random_adress_type == GAP_RANDOM_ADDRESS_TYPE_STATIC){ + gap_random_address_set(sm_random_address); + } else { + gap_random_address_set_mode(gap_random_adress_type); + } break; case HCI_STATE_OFF: