Closed bhuvanchandra closed 5 months ago
@bhuvanchandra Yes, you're correct. Could you provide an example for show how to encounter some unexpected behavior?
@bhuvanchandra Closing this issue since there has been no update on this. Please feel free to reopen if required.
I've been working with the ESP-NOW library for ESP32 devices, and I've noticed that the esp_now_peer_info_t structure includes a field called priv. However, I'm curious about the specific purpose and use case of this field.
Here's the structure definition I'm referring to:
From my understanding, it's used for storing custom data associated with a peer, but I've encountered some unexpected behavior and have questions:
Observation: I've observed that when adding or updating peers, the memory address pointed to by priv seems to differ from the address I initially assigned. For instance, when I print the address before and after adding a peer, they are different.
Unexpected Behavior: Interestingly, the memory address pointed to by priv appears to be the same for different peer instances. Even when I add peers for the first time, the priv field points to the same address.
I'm interested in learning more about the intended use and behavior of the priv field within the ESP-NOW library. Does it get copied internally when peers are added or updated? Is it intended for user-defined data?