Skip to content

Commit ad68489

Browse files
Update esp-now.md
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)"
1 parent 702a064 commit ad68489

File tree

1 file changed

+2
-2
lines changed
  • content/hardware/03.nano/boards/nano-esp32/tutorials/esp-now

1 file changed

+2
-2
lines changed

content/hardware/03.nano/boards/nano-esp32/tutorials/esp-now/esp-now.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ typedef struct struct_message {
235235
struct_message myData;
236236
237237
// callback function that will be executed when data is received
238-
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
238+
void OnDataRecv(const esp_now_recv_info_t *info, const uint8_t *incomingData, int len) {
239239
memcpy(&myData, incomingData, sizeof(myData));
240240
Serial.print("Bytes received: ");
241241
Serial.println(len);
@@ -281,4 +281,4 @@ You can also read more about the `esp_now` library over at [https://docs.espress
281281
## Summary
282282
In this article we covered the basics of the ESP-NOW protocol and how it works. We also provided example code serving as a starting point for your project. Overall, ESP-NOW is a powerful communication protocol for local and low-latency applications, particularly when using ESP8266 and ESP32 microcontrollers.
283283

284-
However, it comes with certain limitations that you should be aware of when designing projects.
284+
However, it comes with certain limitations that you should be aware of when designing projects.

0 commit comments

Comments
 (0)