@@ -102,6 +102,31 @@ typedef wifi_tx_info_t esp_now_send_info_t;
102102 */
103103typedef 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 */
259284esp_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 */
395401esp_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 */
0 commit comments