feat(openthread): use the actual receive sensitivity for link quality evaluation

This commit is contained in:
Shu Chen
2026-07-29 17:23:37 +08:00
committed by Xu Si Yu
parent 2440288f5b
commit f81ce9c44e
16 changed files with 22 additions and 13 deletions

View File

@@ -9,3 +9,4 @@
#include "hal/ieee802154_common_ll.h"
#define IEEE802154_RSSI_COMPENSATION_VALUE 0
#define IEEE802154_RX_SENSITIVITY -104

View File

@@ -9,3 +9,4 @@
#include "hal/ieee802154_common_ll.h"
#define IEEE802154_RSSI_COMPENSATION_VALUE 0
#define IEEE802154_RX_SENSITIVITY -104

View File

@@ -12,9 +12,10 @@
extern "C" {
#endif
extern uint32_t bt_bb_get_rssi_comp(void);
#define IEEE802154_RSSI_COMPENSATION_VALUE bt_bb_get_rssi_comp()
#define IEEE802154_RX_SENSITIVITY -102
extern uint32_t bt_bb_get_rssi_comp(void);
#ifdef __cplusplus
}

View File

@@ -14,6 +14,7 @@ extern "C" {
#endif
#define IEEE802154_RSSI_COMPENSATION_VALUE 0
#define IEEE802154_RX_SENSITIVITY -102
static inline uint32_t ieee802154_ll_get_rx_filter_not_work_cnt(void)
{

View File

@@ -13,6 +13,7 @@ extern "C" {
#endif
#define IEEE802154_RSSI_COMPENSATION_VALUE 0
#define IEEE802154_RX_SENSITIVITY -102
static inline uint32_t ieee802154_ll_get_rx_filter_not_work_cnt(void)
{

View File

@@ -13,6 +13,7 @@ extern "C" {
#endif
#define IEEE802154_RSSI_COMPENSATION_VALUE 0
#define IEEE802154_RX_SENSITIVITY -104
static inline uint32_t ieee802154_ll_get_rx_filter_not_work_cnt(void)
{

View File

@@ -5,7 +5,6 @@
*/
#include <string.h>
#include "hal/ieee802154_ll.h"
#include "esp_attr.h"
#include "esp_err.h"
#include "esp_ieee802154_ack.h"

View File

@@ -6,7 +6,6 @@
#include <stdio.h>
#include <string.h>
#include "hal/ieee802154_ll.h"
#include "esp_ieee802154_util.h"
#include "esp_log.h"

View File

@@ -24,7 +24,6 @@
#include "esp_ieee802154_sec.h"
#include "esp_ieee802154_util.h"
#include "esp_ieee802154_timer.h"
#include "hal/ieee802154_ll.h"
#include "esp_attr.h"
#include "esp_phy_init.h"

View File

@@ -7,7 +7,6 @@
#include <stdint.h>
#include <string.h>
#include "sdkconfig.h"
#include "hal/ieee802154_ll.h"
#include "esp_check.h"
#include "esp_ieee802154_pib.h"
#include "esp_ieee802154_util.h"

View File

@@ -7,7 +7,6 @@
#include "sdkconfig.h"
#include <string.h>
#include "esp_err.h"
#include "hal/ieee802154_ll.h"
#include "esp_ieee802154_frame.h"
#include "esp_ieee802154_sec.h"
#include "esp_ieee802154_util.h"

View File

@@ -5,7 +5,6 @@
*/
#include "soc/soc.h"
#include "hal/ieee802154_ll.h"
#include "esp_check.h"
#include "esp_ieee802154_timer.h"
#include "esp_ieee802154_util.h"

View File

@@ -7,7 +7,6 @@
#include "esp_private/esp_modem_clock.h"
#include "soc/soc.h"
#include "soc/periph_defs.h"
#include "hal/ieee802154_ll.h"
#include "esp_check.h"
#include "esp_coex_i154.h"
#include "esp_ieee802154_util.h"

View File

@@ -20,7 +20,6 @@
#include "esp_ieee802154_util.h"
#include "esp_log.h"
#include "esp_coex_i154.h"
#include "hal/ieee802154_ll.h"
#include "hal/ieee802154_common_ll.h"
esp_err_t esp_ieee802154_event_callback_list_register(esp_ieee802154_event_cb_list_t cb_list)
@@ -49,6 +48,11 @@ esp_err_t esp_ieee802154_disable(void)
return ieee802154_mac_deinit();
}
int8_t esp_ieee802154_get_receive_sensitivity(void)
{
return IEEE802154_RX_SENSITIVITY;
}
uint8_t esp_ieee802154_get_channel(void)
{
return ieee802154_pib_get_channel();

View File

@@ -39,6 +39,14 @@ esp_err_t esp_ieee802154_enable(void);
*/
esp_err_t esp_ieee802154_disable(void);
/**
* @brief Get the receive sensitivity.
*
* @return The receive sensitivity in dBm.
*
*/
int8_t esp_ieee802154_get_receive_sensitivity(void);
/**
* @brief Get the operational channel.
*

View File

@@ -10,7 +10,6 @@
#include "sdkconfig.h"
#include "esp_check.h"
#include "esp_ieee802154.h"
#include "esp_ieee802154_types.h"
#include "esp_mac.h"
#include "esp_openthread_common.h"
#include "esp_openthread_common_macro.h"
@@ -37,7 +36,6 @@
#include "esp_coex_i154.h"
#endif
#define ESP_RECEIVE_SENSITIVITY -120
#define ESP_OPENTHREAD_XTAL_ACCURACY CONFIG_OPENTHREAD_XTAL_ACCURACY
#define ESP_OPENTHREAD_CSL_ACCURACY CONFIG_OPENTHREAD_CSL_ACCURACY
#define ESP_OPENTHREAD_CSL_UNCERTAIN CONFIG_OPENTHREAD_CSL_UNCERTAIN
@@ -461,7 +459,7 @@ otError otPlatRadioSetCcaEnergyDetectThreshold(otInstance *aInstance, int8_t aTh
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
{
return ESP_RECEIVE_SENSITIVITY;
return esp_ieee802154_get_receive_sensitivity();
}
#if CONFIG_OPENTHREAD_DIAG