ESP-IDF Robot ESP NOW

This commit is contained in:
2024-12-24 21:35:25 -05:00
parent 87c29dee39
commit 579c23f717
4 changed files with 161 additions and 2 deletions

View File

@@ -281,7 +281,7 @@ static void espnow_recv_cb (const esp_now_recv_info_t *recv_info, const uint8_t
evt.id = ESPNOW_RECV_CB;
memcpy(recv_cb->mac_addr, mac_addr, ESP_NOW_ETH_ALEN);
recv_cb->data = malloc(len);
ESP_LOGW(TAG, "Received payload: %i", recv_cb->data);
ESP_LOGW(TAG, "Received payload: %u", recv_cb->data);
if (recv_cb->data == NULL) {
ESP_LOGE(TAG, "Malloc receive data fail");
return;