Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions nimble/controller/src/ble_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,9 @@ ble_ll_rx_end(uint8_t *rxbuf, struct ble_mbuf_hdr *rxhdr)
ble_ll_trace_u32x3(BLE_LL_TRACE_ID_RX_END, pdu_type, len,
rxhdr->rxinfo.flags);

/* Update RSSI */
rxhdr->rxinfo.rssi -= ble_ll_rx_gain();

#if MYNEWT_VAL(BLE_LL_EXT)
if (BLE_MBUF_HDR_RX_STATE(rxhdr) == BLE_LL_STATE_EXTERNAL) {
rc = ble_ll_ext_rx_isr_end(rxbuf, rxhdr);
Expand Down
2 changes: 1 addition & 1 deletion nimble/controller/src/ble_ll_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3580,7 +3580,7 @@ ble_ll_conn_rx_data_pdu(struct os_mbuf *rxpdu, struct ble_mbuf_hdr *hdr)
#endif

/* Update RSSI */
connsm->conn_rssi = hdr->rxinfo.rssi - ble_ll_rx_gain();
connsm->conn_rssi = hdr->rxinfo.rssi;

/*
* If we are a peripheral, we can only start to use peripheral latency
Expand Down
6 changes: 3 additions & 3 deletions nimble/controller/src/ble_ll_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ ble_ll_scan_send_adv_report(uint8_t pdu_type,
if (scansm->ext_scanning) {
rc = ble_ll_hci_send_legacy_ext_adv_report(evtype,
adva, adva_type,
hdr->rxinfo.rssi - ble_ll_rx_gain(),
hdr->rxinfo.rssi,
adv_data_len, om,
inita, inita_type);
goto done;
Expand All @@ -727,12 +727,12 @@ goto done;

if (subev == BLE_HCI_LE_SUBEV_DIRECT_ADV_RPT) {
rc = ble_ll_hci_send_dir_adv_report(adva, adva_type, inita, inita_type,
hdr->rxinfo.rssi - ble_ll_rx_gain());
hdr->rxinfo.rssi);
goto done;
}

rc = ble_ll_hci_send_adv_report(evtype, adva, adva_type,
hdr->rxinfo.rssi - ble_ll_rx_gain(),
hdr->rxinfo.rssi,
adv_data_len, om);
done:
if (!rc && scansm->scan_filt_dups) {
Expand Down
4 changes: 2 additions & 2 deletions nimble/controller/src/ble_ll_scan_aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ ble_ll_hci_ev_update_ext_adv_report_from_ext(struct ble_hci_ev *hci_ev,
report->pri_phy = rxinfo->phy;
report->sec_phy = 0;
report->sid = 0xff;
report->rssi = rxhdr->rxinfo.rssi - ble_ll_rx_gain();
report->rssi = rxhdr->rxinfo.rssi;
report->periodic_itvl = 0;
report->data_len = 0;

Expand Down Expand Up @@ -564,7 +564,7 @@ ble_ll_hci_ev_send_ext_adv_report(struct os_mbuf *rxpdu,
hci_subev = (void *)(*hci_ev)->data;
report = hci_subev->reports;

report->rssi = rxinfo->rssi - ble_ll_rx_gain();
report->rssi = rxinfo->rssi;

report->data_len = MIN(max_data_len, data_len - offset);
os_mbuf_copydata(rxpdu, offset, report->data_len, report->data);
Expand Down
Loading