Skip to content

Commit

Permalink
Monitor: Avoid printing stale address on connection event
Browse files Browse the repository at this point in the history
We now remove potentially stale handle when assigning a new handle.
However, that is done after printing the handle and the stale address
associated with it.

Directly use print_field instead of print_handle to avoid printing the
stale address. We still print the correct address on the following
line anyway.
  • Loading branch information
apusaka authored and Vudentz committed Jan 30, 2024
1 parent 12ccf5e commit e98bbe3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions monitor/packet.c
Expand Up @@ -10083,7 +10083,7 @@ static void conn_complete_evt(struct timeval *tv, uint16_t index,
const struct bt_hci_evt_conn_complete *evt = data;

print_status(evt->status);
print_handle(evt->handle);
print_field("Handle: %d", le16_to_cpu(evt->handle));
print_bdaddr(evt->bdaddr);
print_link_type(evt->link_type);
print_enable("Encryption", evt->encr_mode);
Expand Down Expand Up @@ -10655,7 +10655,7 @@ static void sync_conn_complete_evt(struct timeval *tv, uint16_t index,
const struct bt_hci_evt_sync_conn_complete *evt = data;

print_status(evt->status);
print_handle(evt->handle);
print_field("Handle: %d", le16_to_cpu(evt->handle));
print_bdaddr(evt->bdaddr);
print_link_type(evt->link_type);
print_field("Transmission interval: 0x%2.2x", evt->tx_interval);
Expand Down Expand Up @@ -11084,7 +11084,7 @@ static void le_conn_complete_evt(struct timeval *tv, uint16_t index,
const struct bt_hci_evt_le_conn_complete *evt = data;

print_status(evt->status);
print_handle(evt->handle);
print_field("Handle: %d", le16_to_cpu(evt->handle));
print_role(evt->role);
print_peer_addr_type("Peer address type", evt->peer_addr_type);
print_addr("Peer address", evt->peer_addr, evt->peer_addr_type);
Expand Down Expand Up @@ -11213,7 +11213,7 @@ static void le_enhanced_conn_complete_evt(struct timeval *tv, uint16_t index,
const struct bt_hci_evt_le_enhanced_conn_complete *evt = data;

print_status(evt->status);
print_handle(evt->handle);
print_field("Handle: %d", le16_to_cpu(evt->handle));
print_role(evt->role);
print_peer_addr_type("Peer address type", evt->peer_addr_type);
print_addr("Peer address", evt->peer_addr, evt->peer_addr_type);
Expand Down

0 comments on commit e98bbe3

Please sign in to comment.