Add bt_get_signal_strength Comment

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
awalol
2026-05-16 13:51:29 +08:00
committed by GitHub
co-authored by Copilot Autofix powered by AI
parent 7d176f5034
commit 9e2de40b9b
+6 -3
View File
@@ -77,12 +77,15 @@ bool bt_disconnect() {
} }
void bt_get_signal_strength(int8_t *rssi) { void bt_get_signal_strength(int8_t *rssi) {
if (acl_handle != HCI_CON_HANDLE_INVALID) { // gap_read_rssi() completes asynchronously, so this function can only
gap_read_rssi(acl_handle); // return the last cached RSSI value. Trigger a refresh afterwards so a
} // subsequent call can observe the updated value once the RSSI event arrives.
if (rssi != nullptr) { if (rssi != nullptr) {
*rssi = bt_rssi; *rssi = bt_rssi;
} }
if (acl_handle != HCI_CON_HANDLE_INVALID) {
gap_read_rssi(acl_handle);
}
} }
void bt_l2cap_init() { void bt_l2cap_init() {