Skip to content

Commit 1065605

Browse files
committed
fix(wifi_remote): Update per breaking changes on v6.0
1 parent efc5686 commit 1065605

File tree

4 files changed

+83
-97
lines changed

4 files changed

+83
-97
lines changed

components/esp_wifi_remote/idf_v6.0/Kconfig.wifi.in

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,14 @@ menu "WPS Configuration Options"
792792
be shared to other devices, making it in readable format increases
793793
that risk, also passphrase requires pbkdf2 to convert in psk.
794794

795+
config WIFI_RMT_WPS_RECONNECT_ON_FAIL
796+
bool "Reconnect to previous SSID if WPS failed"
797+
default n
798+
help
799+
Select this option to enable reconnection to previous SSID if WPS fails.
800+
This option will only work if station was connected to a network
801+
when WPS was started.
802+
795803
endmenu # "WPS Configuration Options"
796804

797805

@@ -1266,6 +1274,12 @@ if WIFI_RMT_WPS_PASSPHRASE
12661274
default WIFI_RMT_WPS_PASSPHRASE
12671275
endif
12681276

1277+
if WIFI_RMT_WPS_RECONNECT_ON_FAIL
1278+
config ESP_WIFI_WPS_RECONNECT_ON_FAIL # ignore: multiple-definition
1279+
bool
1280+
default WIFI_RMT_WPS_RECONNECT_ON_FAIL
1281+
endif
1282+
12691283
if WIFI_RMT_DEBUG_PRINT
12701284
config ESP_WIFI_DEBUG_PRINT # ignore: multiple-definition
12711285
bool

components/esp_wifi_remote/idf_v6.0/include/injected/esp_now.h

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,31 @@ typedef wifi_tx_info_t esp_now_send_info_t;
102102
*/
103103
typedef wifi_tx_rate_config_t esp_now_rate_config_t;
104104

105+
/**
106+
* @brief ESPNOW switch channel information
107+
*/
108+
typedef struct {
109+
wifi_action_tx_t type; /**< ACTION TX operation type */
110+
uint8_t channel; /**< Channel on which to perform ESPNOW TX Operation */
111+
wifi_second_chan_t sec_channel; /**< Secondary channel */
112+
uint32_t wait_time_ms; /**< Duration to wait for on target channel */
113+
uint8_t op_id; /**< Unique Identifier for operation provided by wifi driver */
114+
uint8_t dest_mac[6]; /**< Destination MAC address */
115+
uint16_t data_len; /**< Length of the appended Data */
116+
uint8_t data[0]; /**< Appended Data payload */
117+
} esp_now_switch_channel_t;
118+
119+
/**
120+
* @brief ESPNOW remain on channel information
121+
*/
122+
typedef struct {
123+
wifi_roc_t type; /**< ROC operation type */
124+
uint8_t channel; /**< Channel on which to perform ESPNOW ROC Operation */
125+
wifi_second_chan_t sec_channel; /**< Secondary channel */
126+
uint32_t wait_time_ms; /**< Duration to wait for on target channel */
127+
uint8_t op_id; /**< ID of this specific ROC operation provided by wifi driver */
128+
} esp_now_remain_on_channel_t;
129+
105130
/**
106131
* @brief Callback function of receiving ESPNOW data
107132
* @param esp_now_info received ESPNOW packet information
@@ -258,25 +283,6 @@ esp_err_t esp_now_del_peer(const uint8_t *peer_addr);
258283
*/
259284
esp_err_t esp_now_mod_peer(const esp_now_peer_info_t *peer);
260285

261-
/**
262-
* @brief Config ESPNOW rate of specified interface
263-
*
264-
* @deprecated please use esp_now_set_peer_rate_config() instead.
265-
*
266-
* @attention 1. This API should be called after esp_wifi_start().
267-
* @attention 2. This API only work when not use Wi-Fi 6 and esp_now_set_peer_rate_config() not called.
268-
*
269-
* @param ifx Interface to be configured.
270-
* @param rate Phy rate to be configured.
271-
*
272-
* @return
273-
* - ESP_OK: succeed
274-
* - others: failed
275-
*/
276-
esp_err_t esp_wifi_config_espnow_rate(wifi_interface_t ifx, wifi_phy_rate_t rate)
277-
__attribute__((deprecated("This API can be only used when rate is non-HE rate, \
278-
please use esp_now_set_peer_rate_config if you want full support of the rate.")));
279-
280286
/**
281287
* @brief Set ESPNOW rate config for each peer
282288
*
@@ -394,6 +400,32 @@ esp_err_t esp_now_set_user_oui(uint8_t *oui);
394400
*/
395401
esp_err_t esp_now_get_user_oui(uint8_t *oui);
396402

403+
/**
404+
* @brief ESPNOW switch to a specific channel for a required duration, and send one ESPNOW data.
405+
*
406+
* @param config ESPNOW switch channel relevant information
407+
*
408+
* @return
409+
* - ESP_OK : succeed
410+
* - ESP_ERR_NO_MEM: failed to allocate memory
411+
* - ESP_ERR_INVALID_ARG: the <channel, sec_channel> pair is invalid
412+
* - ESP_FAIL: failed to send frame
413+
*/
414+
esp_err_t esp_now_switch_channel_tx(esp_now_switch_channel_t *config);
415+
416+
/**
417+
* @brief ESPNOW remain on the target channel for required duration.
418+
*
419+
* @param config ESPNOW remain on channel relevant information
420+
*
421+
* @return
422+
* - ESP_OK : succeed
423+
* - ESP_ERR_NO_MEM: failed to allocate memory
424+
* - ESP_ERR_INVALID_ARG: the <channel, sec_channel> pair is invalid
425+
* - ESP_FAIL: failed to perform roc operation
426+
*/
427+
esp_err_t esp_now_remain_on_channel(esp_now_remain_on_channel_t *config);
428+
397429
/**
398430
* @}
399431
*/

components/esp_wifi_remote/idf_v6.0/include/injected/esp_wifi.h

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,54 +1288,6 @@ esp_err_t esp_wifi_get_csi_config(wifi_csi_config_t *config);
12881288
*/
12891289
esp_err_t esp_wifi_set_csi(bool en);
12901290

1291-
/**
1292-
* @brief Set antenna GPIO configuration
1293-
*
1294-
* @param config Antenna GPIO configuration.
1295-
*
1296-
* @return
1297-
* - ESP_OK: succeed
1298-
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
1299-
* - ESP_ERR_INVALID_ARG: Invalid argument, e.g. parameter is NULL, invalid GPIO number etc
1300-
*/
1301-
esp_err_t esp_wifi_set_ant_gpio(const wifi_ant_gpio_config_t *config) __attribute__((deprecated("Please use esp_phy_set_ant_gpio instead")));
1302-
1303-
/**
1304-
* @brief Get current antenna GPIO configuration
1305-
*
1306-
* @param config Antenna GPIO configuration.
1307-
*
1308-
* @return
1309-
* - ESP_OK: succeed
1310-
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
1311-
* - ESP_ERR_INVALID_ARG: invalid argument, e.g. parameter is NULL
1312-
*/
1313-
esp_err_t esp_wifi_get_ant_gpio(wifi_ant_gpio_config_t *config) __attribute__((deprecated("Please use esp_phy_get_ant_gpio instead")));
1314-
1315-
/**
1316-
* @brief Set antenna configuration
1317-
*
1318-
* @param config Antenna configuration.
1319-
*
1320-
* @return
1321-
* - ESP_OK: succeed
1322-
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
1323-
* - ESP_ERR_INVALID_ARG: Invalid argument, e.g. parameter is NULL, invalid antenna mode or invalid GPIO number
1324-
*/
1325-
esp_err_t esp_wifi_set_ant(const wifi_ant_config_t *config) __attribute__((deprecated("Please use esp_phy_set_ant instead")));
1326-
1327-
/**
1328-
* @brief Get current antenna configuration
1329-
*
1330-
* @param config Antenna configuration.
1331-
*
1332-
* @return
1333-
* - ESP_OK: succeed
1334-
* - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init
1335-
* - ESP_ERR_INVALID_ARG: invalid argument, e.g. parameter is NULL
1336-
*/
1337-
esp_err_t esp_wifi_get_ant(wifi_ant_config_t *config) __attribute__((deprecated("Please use esp_phy_get_ant instead")));
1338-
13391291
/**
13401292
* @brief Get the TSF time
13411293
* In Station mode or SoftAP+Station mode if station is not connected or station doesn't receive at least
@@ -1458,8 +1410,7 @@ esp_err_t esp_wifi_ftm_resp_set_offset(int16_t offset_cm);
14581410
* (sizeof(wifi_ftm_report_entry_t) * num_entries) where the API will fill up to num_entries
14591411
* valid FTM measurements in the buffer. Total number of entries can be found in the event
14601412
* WIFI_EVENT_FTM_REPORT as ftm_report_num_entries
1461-
* @attention 2. The internal FTM report is freed upon use of this API which means the API can only be used
1462-
* once after every FTM session initiated
1413+
* @attention 2. The internal FTM report is freed upon use of this API OR after initiating a fresh FTM session
14631414
* @attention 3. Passing the buffer as NULL merely frees the FTM report
14641415
*
14651416
* @param report Pointer to the buffer for receiving the FTM report
@@ -1829,6 +1780,7 @@ esp_err_t esp_wifi_get_bandwidths(wifi_interface_t ifx, wifi_bandwidths_t *bw);
18291780
* @return
18301781
* - ESP_OK: succeed
18311782
* - ESP_ERR_NO_MEM: failed to allocate memory
1783+
* - ESP_ERR_INVALID_ARG: the <channel, sec_channel> pair is invalid
18321784
* - ESP_FAIL: failed to send frame
18331785
*/
18341786
esp_err_t esp_wifi_action_tx_req(wifi_action_tx_req_t *req);
@@ -1841,6 +1793,7 @@ esp_err_t esp_wifi_action_tx_req(wifi_action_tx_req_t *req);
18411793
* @return
18421794
* - ESP_OK: succeed
18431795
* - ESP_ERR_NO_MEM: failed to allocate memory
1796+
* - ESP_ERR_INVALID_ARG: the <channel, sec_channel> pair is invalid
18441797
* - ESP_FAIL: failed to perform roc operation
18451798
*/
18461799
esp_err_t esp_wifi_remain_on_channel(wifi_roc_req_t * req);

0 commit comments

Comments
 (0)