mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-18 06:59:55 +00:00
NimBLE host: Modify ble_gap_wl_set to support clearing complete whitelist
* Modify test case `*_wl_bad_args` to accept 0 whitelist entries.
This commit is contained in:
committed by
Rahul Tank
parent
aa3b1fa3ca
commit
0ced3efc11
@@ -2018,11 +2018,6 @@ ble_gap_wl_set(const ble_addr_t *addrs, uint8_t white_list_count)
|
|||||||
|
|
||||||
ble_hs_lock();
|
ble_hs_lock();
|
||||||
|
|
||||||
if (white_list_count == 0) {
|
|
||||||
rc = BLE_HS_EINVAL;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < white_list_count; i++) {
|
for (i = 0; i < white_list_count; i++) {
|
||||||
if (addrs[i].type != BLE_ADDR_PUBLIC &&
|
if (addrs[i].type != BLE_ADDR_PUBLIC &&
|
||||||
addrs[i].type != BLE_ADDR_RANDOM) {
|
addrs[i].type != BLE_ADDR_RANDOM) {
|
||||||
|
|||||||
@@ -440,9 +440,10 @@ TEST_CASE_SELF(ble_gap_test_case_wl_bad_args)
|
|||||||
|
|
||||||
ble_gap_test_util_init();
|
ble_gap_test_util_init();
|
||||||
|
|
||||||
/*** 0 white list entries. */
|
/*** 0 white list entries. This is acceptable now with the wl_set API
|
||||||
|
* change. */
|
||||||
rc = ble_hs_test_util_wl_set(NULL, 0, 0, 0);
|
rc = ble_hs_test_util_wl_set(NULL, 0, 0, 0);
|
||||||
TEST_ASSERT(rc == BLE_HS_EINVAL);
|
TEST_ASSERT(rc == 0);
|
||||||
|
|
||||||
/*** Invalid address type. */
|
/*** Invalid address type. */
|
||||||
rc = ble_hs_test_util_wl_set(
|
rc = ble_hs_test_util_wl_set(
|
||||||
|
|||||||
Reference in New Issue
Block a user