esp_wifi: Add esp_wifi_get_tsf_time() API to get the tsf time of specified interface.
This commit is contained in:
committed by
Kapil Gupta
parent
e3cc2e8a0d
commit
c616d9014e
@@ -201,6 +201,11 @@ static void IRAM_ATTR wifi_int_restore_wrapper(void *wifi_int_mux, uint32_t tmp)
|
||||
}
|
||||
}
|
||||
|
||||
static bool IRAM_ATTR is_from_isr_wrapper(void)
|
||||
{
|
||||
return xPortInIsrContext();
|
||||
}
|
||||
|
||||
static void IRAM_ATTR task_yield_from_isr_wrapper(void)
|
||||
{
|
||||
portYIELD_FROM_ISR();
|
||||
@@ -608,6 +613,7 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
|
||||
._coex_condition_set = coex_condition_set_wrapper,
|
||||
._coex_wifi_request = coex_wifi_request_wrapper,
|
||||
._coex_wifi_release = coex_wifi_release_wrapper,
|
||||
._is_from_isr = is_from_isr_wrapper,
|
||||
._magic = ESP_WIFI_OS_ADAPTER_MAGIC,
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000004
|
||||
#define ESP_WIFI_OS_ADAPTER_VERSION 0x00000005
|
||||
#define ESP_WIFI_OS_ADAPTER_MAGIC 0xDEADBEAF
|
||||
|
||||
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff
|
||||
@@ -126,6 +126,7 @@ typedef struct {
|
||||
void (* _coex_condition_set)(uint32_t type, bool dissatisfy);
|
||||
int32_t (* _coex_wifi_request)(uint32_t event, uint32_t latency, uint32_t duration);
|
||||
int32_t (* _coex_wifi_release)(uint32_t event);
|
||||
bool (* _is_from_isr)(void);
|
||||
int32_t _magic;
|
||||
} wifi_osi_funcs_t;
|
||||
|
||||
|
||||
@@ -1115,6 +1115,19 @@ esp_err_t esp_wifi_get_inactive_time(wifi_interface_t ifx, uint16_t *sec);
|
||||
*/
|
||||
esp_err_t esp_wifi_statis_dump(uint32_t modules);
|
||||
|
||||
/**
|
||||
* @brief Get the TSF time
|
||||
* In Station mode or SoftAP+Station mode if station is not connected or station doesn't receive at least
|
||||
* one beacon after connected, will return 0
|
||||
*
|
||||
* @attention Enabling power save may cause the return value inaccurate, except WiFi modem sleep
|
||||
*
|
||||
* @param interface The interface whose tsf_time is to be retrieved.
|
||||
*
|
||||
* @return 0 or the TSF time
|
||||
*/
|
||||
int64_t esp_wifi_get_tsf_time(wifi_interface_t interface);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user