Add support for FTM operation

Add FTM support for below configuration -
1. Station(connected) as Initiator with AP as responder
2. SoftAP as responder with the connected Station
Added Station example with runtime FTM configurations.
This commit is contained in:
Nachiket Kukade
2021-01-21 19:55:39 +05:30
parent f7a8593a3b
commit acb1143409
14 changed files with 743 additions and 2 deletions

View File

@@ -56,6 +56,12 @@ uint64_t g_wifi_feature_caps =
#if (CONFIG_ESP32_SPIRAM_SUPPORT | CONFIG_ESP32S2_SPIRAM_SUPPORT)
CONFIG_FEATURE_CACHE_TX_BUF_BIT |
#endif
#if CONFIG_ESP32S2_WIFI_FTM_INITIATOR_SUPPORT
CONFIG_FEATURE_FTM_INITIATOR_BIT |
#endif
#if CONFIG_ESP32S2_WIFI_FTM_RESPONDER_SUPPORT
CONFIG_FEATURE_FTM_RESPONDER_BIT |
#endif
0;
static bool s_wifi_adc_xpd_flag;
@@ -248,6 +254,25 @@ esp_err_t esp_wifi_init(const wifi_init_config_t *config)
}
}
adc2_cal_include(); //This enables the ADC2 calibration constructor at start up.
#if CONFIG_IDF_TARGET_ESP32S2
#ifdef CONFIG_ESP32S2_WIFI_FTM_REPORT_LOG_ENABLE
ftm_report_log_level_t log_lvl = {0};
#ifdef CONFIG_ESP32S2_WIFI_FTM_REPORT_SHOW_RTT
log_lvl.show_rtt = 1;
#endif
#ifdef CONFIG_ESP32S2_WIFI_FTM_REPORT_SHOW_DIAG
log_lvl.show_diag = 1;
#endif
#ifdef CONFIG_ESP32S2_WIFI_FTM_REPORT_SHOW_T1T2T3T4
log_lvl.show_t1t2t3t4 = 1;
#endif
#ifdef CONFIG_ESP32S2_WIFI_FTM_REPORT_SHOW_RSSI
log_lvl.show_rxrssi = 1;
#endif
esp_wifi_set_ftm_report_log_level(&log_lvl);
#endif
#endif
esp_wifi_config_info();
return result;
}