-
-
Notifications
You must be signed in to change notification settings - Fork 442
Update esp-now document #2104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update esp-now document #2104
Conversation
the callback function of receiving the ESPNOW data is "esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t cb)",and the define of esp_now_recv_cb_t is "typedef void (*esp_now_recv_cb_t)(const esp_now_recv_info_t *esp_now_info, const uint8_t *data, int data_len)"which is not"typedef void (*esp_now_recv_cb_t)(const uint8_t *macAddress, const uint8_t *data, int data_len)"
Hello @Hannes7eicher when you have a moment please take a look at this pull request, thanks! |
Thanks for the PR @buhuihongshide-sdjjd! I've had a quick look and it looks alright to me. But if you try to compile the sketch you will see that |
Sorry that I didn't do well test on this code. |
I had a chat with our engineering team and as you correctly pointed out, the signature for Current Implementation: According to our currently supported version of the Arduino ESP32 Boards core, which is based on the 2.x branch of the arduino-esp32 core and uses ESP-IDF v5.1, the correct callback function signature for typedef void (*esp_now_recv_cb_t)(const uint8_t *macAddress, const uint8_t *data, int data_len); This is consistent with the documentation for version ESP-IDF v5.1.4. typedef void (*esp_now_recv_cb_t)(const esp_now_recv_info_t *esp_now_info, const uint8_t *data, int data_len); What This Means for Our Core: Since our current core still depends on the 2.x branch, the existing callback signature with For our users who are working with the Nano ESP32 and our supported core version, there is no need to patch or change the existing callback signature. The migration to the newer 3.x API involves several changes, as highlighted in Espressif's extensive migration guide. We advise sticking to the functionality provided by our current core unless you are planning to migrate your entire project to a newer version of the ESP-IDF. I hope this clarifies your concern. If you have any more questions or need further assistance, feel free to ask! Otherwise I will go ahead and close the PR. |
What This PR Changes
the callback function of receiving the ESPNOW data is "esp_err_t esp_now_register_recv_cb(esp_now_recv_cb_t cb)",and the define of esp_now_recv_cb_t is "typedef void (*esp_now_recv_cb_t)(const esp_now_recv_info_t *esp_now_info, const uint8_t *data, int data_len)"which is not"typedef void (*esp_now_recv_cb_t)(const uint8_t *macAddress, const uint8_t *data, int data_len)"
Contribution Guidelines