Skip to content

Commit

Permalink
allowlist: add remove_all
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesada committed Jan 6, 2024
1 parent b1dd688 commit 4f60198
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/bluepad32/bt/uni_bt_allowlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ bool uni_bt_allowlist_remove_addr(bd_addr_t addr) {
return false;
}

bool uni_bt_allowlist_remove_all(void) {
for (size_t i = 0; i < ARRAY_SIZE(addr_allow_list); i++) {
bd_addr_copy(addr_allow_list[i], zero_addr);
}
update_allowlist_to_property();
return true;
}

void uni_bt_allowlist_list(void) {
logi("Bluetooth allowlist addresses:\n");
for (size_t i = 0; i < ARRAY_SIZE(addr_allow_list); i++) {
Expand Down
3 changes: 3 additions & 0 deletions src/components/bluepad32/include/bt/uni_bt_allowlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ bool uni_bt_allowlist_add_addr(bd_addr_t addr);
// Remove an existing address from the allow list.
bool uni_bt_allowlist_remove_addr(bd_addr_t addr);

// Remove all entries from the allow list.
bool uni_bt_allowlist_remove_all(void);

// Print the allowed-address to the console.
void uni_bt_allowlist_list(void);

Expand Down

0 comments on commit 4f60198

Please sign in to comment.