From 4653f9cdc387adbce968c89577a7ad2bb404ce33 Mon Sep 17 00:00:00 2001 From: hathach Date: Sat, 14 Mar 2020 14:07:31 +0700 Subject: [PATCH] save key dfr don't need malloc --- libraries/Bluefruit52Lib/src/utility/bonding.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/Bluefruit52Lib/src/utility/bonding.cpp b/libraries/Bluefruit52Lib/src/utility/bonding.cpp index 653f633e..cf26812c 100644 --- a/libraries/Bluefruit52Lib/src/utility/bonding.cpp +++ b/libraries/Bluefruit52Lib/src/utility/bonding.cpp @@ -95,7 +95,7 @@ void bond_init(void) /*------------------------------------------------------------------*/ /* Keys *------------------------------------------------------------------*/ -static void bond_save_keys_dfr (uint8_t role, uint16_t conn_hdl, bond_keys_t* bkeys) +static void bond_save_keys_dfr (uint8_t role, uint16_t conn_hdl, bond_keys_t const * bkeys) { uint16_t const ediv = (role == BLE_GAP_ROLE_PERIPH) ? bkeys->own_enc.master_id.ediv : bkeys->peer_enc.master_id.ediv; uint8_t const * mac = bkeys->peer_id.id_addr_info.addr; @@ -133,7 +133,7 @@ static void bond_save_keys_dfr (uint8_t role, uint16_t conn_hdl, bond_keys_t* bk bool bond_save_keys (uint8_t role, uint16_t conn_hdl, bond_keys_t const* bkeys) { // queue to execute in Ada Callback thread - return ada_callback(bkeys, sizeof(bond_keys_t), bond_save_keys_dfr, role, conn_hdl, bkeys); + return ada_callback(NULL, 0, bond_save_keys_dfr, role, conn_hdl, bkeys); } bool bond_load_keys(uint8_t role, ble_gap_addr_t* addr, bond_keys_t* bkeys)