#if ESP_IDF_VERSION >=
ESP_IDF_VERSION_VAL(5, 5, 0)
static void example_espnow_send_cb(const
esp_now_send_info_t *tx_info, esp_now_send_status_t
status)
#else
static void example_espnow_send_cb(const uint8_t
*mac_addr, esp_now_send_status_t status)
#endif
{
example_espnow_event_t evt;
example_espnow_event_send_cb_t *send_cb
= &evt.info.send_cb;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 0)
const uint8_t *mac_addr =
tx_info->des_addr;
#endif
if (mac_addr == NULL) {
ESP_LOGE(__FUNCTION__, "Send cb arg error");
return;
}
evt.id = EXAMPLE_ESPNOW_SEND_CB;
memcpy(send_cb->mac_addr, mac_addr,
ESP_NOW_ETH_ALEN);
send_cb->status = status;
if (xQueueSend(xQueueESPNOWSend,
&evt, ESPNOW_MAXDELAY) != pdTRUE) {
ESP_LOGW(__FUNCTION__, "xQueueSend fail");
}
}
|