Hello i read RSSI in beacon_evt_handler() hrs_scanner project:
printf("RSSI: %d\n\n\n",p_evt->rcv_adv_packet.adv_data.rssi);
but he show me a wrong value of RSSI: 4539
how i can fix this??
Best Regards
Nelson
Hello i read RSSI in beacon_evt_handler() hrs_scanner project:
printf("RSSI: %d\n\n\n",p_evt->rcv_adv_packet.adv_data.rssi);
but he show me a wrong value of RSSI: 4539
how i can fix this??
Best Regards
Nelson
What SDK version is this? Could you post some code?
You are looking for the rssi in the adv_data
field? It should be in the rssi
field:
/**@brief Event structure for @ref BLE_GAP_EVT_ADV_REPORT. */
typedef struct
{
ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1
and the address is the device's identity address. */
ble_gap_addr_t direct_addr; /**< Set when the scanner is unable to resolve the private resolvable address of the initiator
field of a directed advertisement packet and the scanner has been enabled to report this in @ref ble_gap_scan_params_t::adv_dir_report. */
int8_t rssi; /**< Received Signal Strength Indication in dBm. */
uint8_t scan_rsp : 1; /**< If 1, the report corresponds to a scan response and the type field may be ignored. */
uint8_t type : 2; /**< See @ref BLE_GAP_ADV_TYPES. Only valid if the scan_rsp field is 0. */
uint8_t dlen : 5; /**< Advertising or scan response data length. */
uint8_t data[BLE_GAP_ADV_MAX_SIZE]; /**< Advertising or scan response data. */
} ble_gap_evt_adv_report_t;
What SDK version is this? Could you post some code?
You are looking for the rssi in the adv_data
field? It should be in the rssi
field:
/**@brief Event structure for @ref BLE_GAP_EVT_ADV_REPORT. */
typedef struct
{
ble_gap_addr_t peer_addr; /**< Bluetooth address of the peer device. If the peer_addr resolved: @ref ble_gap_addr_t::addr_id_peer is set to 1
and the address is the device's identity address. */
ble_gap_addr_t direct_addr; /**< Set when the scanner is unable to resolve the private resolvable address of the initiator
field of a directed advertisement packet and the scanner has been enabled to report this in @ref ble_gap_scan_params_t::adv_dir_report. */
int8_t rssi; /**< Received Signal Strength Indication in dBm. */
uint8_t scan_rsp : 1; /**< If 1, the report corresponds to a scan response and the type field may be ignored. */
uint8_t type : 2; /**< See @ref BLE_GAP_ADV_TYPES. Only valid if the scan_rsp field is 0. */
uint8_t dlen : 5; /**< Advertising or scan response data length. */
uint8_t data[BLE_GAP_ADV_MAX_SIZE]; /**< Advertising or scan response data. */
} ble_gap_evt_adv_report_t;