Skip to content

Commit

Permalink
feat(ble): signal full bond memory when advertising
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
TychoVrahe committed Mar 4, 2025
1 parent 4394992 commit c5d9b14
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nordic/trezor/trezor-ble/src/ble/advertising.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ void advertising_start(bool wl, uint8_t color, uint32_t device_code,
name_len = DEVICE_NAME_LEN;
}

int bonds_count = bonds_get_count();

manufacturer_data[3] = color;
manufacturer_data[4] = (device_code >> 24) & 0xff;
manufacturer_data[5] = (device_code >> 16) & 0xff;
Expand Down Expand Up @@ -115,7 +117,11 @@ void advertising_start(bool wl, uint8_t color, uint32_t device_code,
} else {
LOG_INF("Advertising no whitelist");

manufacturer_data[2] = 0x01;
if (CONFIG_BT_MAX_PAIRED == bonds_count) {
manufacturer_data[2] = 0x02;
} else {
manufacturer_data[2] = 0x01;
}

uint32_t options = BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_SCANNABLE;
if (static_addr) {
Expand Down

0 comments on commit c5d9b14

Please sign in to comment.