aboutsummaryrefslogtreecommitdiff
path: root/ports/nrf/drivers/bluetooth/ble_drv.c
diff options
context:
space:
mode:
authorGlenn Ruben Bakke2019-02-19 20:48:50 +0100
committerGlenn Ruben Bakke2019-02-20 07:25:51 +0100
commit0c6f5bc5293dc7292654f373cbc94c505b069492 (patch)
tree26aa091e8f98c1ba4d977023907f8b0ff38f303b /ports/nrf/drivers/bluetooth/ble_drv.c
parentee3a01f25cb2c5de00f9bd5d915a66c142be2e5f (diff)
nrf/bluetooth: Improve advertisment behavior for nrf52 targets.
This patch makes sure that advertisment data is located in persistent static RAM memory throughout the advertisment. Also, setting m_adv_handle to predifined BLE_GAP_ADV_SET_HANDLE_NOT_SET value to indicate first time usage of the handle. Upon first advertisment configuration this will be populated with a handle value returned by the stack (s132/s140).
Diffstat (limited to 'ports/nrf/drivers/bluetooth/ble_drv.c')
-rw-r--r--ports/nrf/drivers/bluetooth/ble_drv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/nrf/drivers/bluetooth/ble_drv.c b/ports/nrf/drivers/bluetooth/ble_drv.c
index f18a57156..be2f6138e 100644
--- a/ports/nrf/drivers/bluetooth/ble_drv.c
+++ b/ports/nrf/drivers/bluetooth/ble_drv.c
@@ -109,7 +109,7 @@ static mp_obj_t mp_gattc_char_data_observer;
#define BLE_GAP_ADV_MAX_SIZE 31
#define BLE_DRV_CONN_CONFIG_TAG 1
-static uint8_t m_adv_handle;
+static uint8_t m_adv_handle = BLE_GAP_ADV_SET_HANDLE_NOT_SET;
static uint8_t m_scan_buffer[BLE_GAP_SCAN_BUFFER_MIN];
nrf_nvic_state_t nrf_nvic_state = {0};
@@ -407,7 +407,7 @@ bool ble_drv_advertise_data(ubluepy_advertise_data_t * p_adv_params) {
uint8_t byte_pos = 0;
- uint8_t adv_data[BLE_GAP_ADV_MAX_SIZE];
+ static uint8_t adv_data[BLE_GAP_ADV_MAX_SIZE];
if (p_adv_params->device_name_len > 0) {
ble_gap_conn_sec_mode_t sec_mode;