mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-09-30 23:31:05 +00:00
ESP-IDF Robot ESP NOW
This commit is contained in:
@@ -396,13 +396,19 @@ static void espnow_task (void *pvParameter) {
|
|||||||
memcpy(send_param->dest_mac, send_cb->mac_addr, ESP_NOW_ETH_ALEN);
|
memcpy(send_param->dest_mac, send_cb->mac_addr, ESP_NOW_ETH_ALEN);
|
||||||
// Append data struct to the parameters struct.
|
// Append data struct to the parameters struct.
|
||||||
espnow_data_prepare(send_param);
|
espnow_data_prepare(send_param);
|
||||||
|
|
||||||
/* Send the next data after the previous data is sent. */
|
/* Send the next data after the previous data is sent. */
|
||||||
if (esp_now_send(send_param->dest_mac, send_param->buffer, send_param->len) != ESP_OK) {
|
if (esp_now_send(send_param->dest_mac, send_param->buffer, send_param->len) != ESP_OK) {
|
||||||
ESP_LOGE(TAG, "Send error");
|
ESP_LOGE(TAG, "Send error");
|
||||||
espnow_deinit(send_param);
|
espnow_deinit(send_param);
|
||||||
vTaskDelete(NULL);
|
vTaskDelete(NULL);
|
||||||
}
|
}
|
||||||
|
task_status = esp_now_send(send_param->dest_mac, send_param->buffer, send_param->len);
|
||||||
|
if (task_status != ESP_OK) {
|
||||||
|
ESP_LOGE(TAG, "Send error");
|
||||||
|
espnow_deinit(send_param);
|
||||||
|
vTaskDelete(NULL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ESPNOW_RECV_CB:
|
case ESPNOW_RECV_CB:
|
||||||
|
Reference in New Issue
Block a user