From d410bf96d15438e01a68fe83172f48203f10faca Mon Sep 17 00:00:00 2001 From: Christopher Collins Date: Mon, 5 Jun 2017 14:34:14 -0700 Subject: [PATCH] MYNEWT-751 - Slight change to internal function. This change affects the ble_sm_chk_store_overflow_once() function as follows: 1. Rename to ble_sm_chk_store_overflow_by_type() 2. Change first parameter from a boolean (is_our_sec) to a numeric code (obj_type). X-Original-Commit: db4d5a18615f4a3a0e8633299be3268689446480 --- nimble/host/src/ble_sm.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/nimble/host/src/ble_sm.c b/nimble/host/src/ble_sm.c index e65c5f172..820b42078 100644 --- a/nimble/host/src/ble_sm.c +++ b/nimble/host/src/ble_sm.c @@ -975,23 +975,16 @@ ble_sm_key_dist(struct ble_sm_proc *proc, } static int -ble_sm_chk_store_overflow_once(int is_our_sec, uint16_t conn_handle) +ble_sm_chk_store_overflow_by_type(int obj_type, uint16_t conn_handle) { #if !MYNEWT_VAL(BLE_SM_BONDING) return 0; #endif struct ble_store_status_event event; - int obj_type; int count; int rc; - if (is_our_sec) { - obj_type = BLE_STORE_OBJ_TYPE_OUR_SEC; - } else { - obj_type = BLE_STORE_OBJ_TYPE_PEER_SEC; - } - rc = ble_store_util_count(obj_type, &count); if (rc != 0) { return rc; @@ -1027,12 +1020,14 @@ ble_sm_chk_store_overflow(uint16_t conn_handle) { int rc; - rc = ble_sm_chk_store_overflow_once(0, conn_handle); + rc = ble_sm_chk_store_overflow_by_type(BLE_STORE_OBJ_TYPE_PEER_SEC, + conn_handle); if (rc != 0) { return rc; } - rc = ble_sm_chk_store_overflow_once(1, conn_handle); + rc = ble_sm_chk_store_overflow_by_type(BLE_STORE_OBJ_TYPE_OUR_SEC, + conn_handle); if (rc != 0) { return rc; }