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:
co-authored by
Copilot Autofix powered by AI
parent
7d176f5034
commit
9e2de40b9b
+6
-3
@@ -77,12 +77,15 @@ bool bt_disconnect() {
|
||||
}
|
||||
|
||||
void bt_get_signal_strength(int8_t *rssi) {
|
||||
if (acl_handle != HCI_CON_HANDLE_INVALID) {
|
||||
gap_read_rssi(acl_handle);
|
||||
}
|
||||
// gap_read_rssi() completes asynchronously, so this function can only
|
||||
// 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) {
|
||||
*rssi = bt_rssi;
|
||||
}
|
||||
if (acl_handle != HCI_CON_HANDLE_INVALID) {
|
||||
gap_read_rssi(acl_handle);
|
||||
}
|
||||
}
|
||||
|
||||
void bt_l2cap_init() {
|
||||
|
||||
Reference in New Issue
Block a user