Hi,
I am trying to use WiFiUDP class. When I try to send the data using the function wifiudp.write(buf, l), I get compiler error. Which says:
error: macro "write" requires 3 arguments, but only 2 given wifiudp.write
https://github.com/espressif/arduino-es ... /WiFiUdp.h
Do you have any ideas why this happening, it somehow bypassing the overloaded function in WiFiUDP class and going straight to lwip macro ?
Please let me know if you know why this happening, what am I missing.
Objective is to send the byte packets via UDP. Please note that I can send the data fine if I use wifiudp.printf function. I would prefer to send bytes.
Thanks,
Avi
ESP32 UDP - WiFiUDP how to send bytes using udp protocol?
Re: ESP32 UDP - WiFiUDP how to send bytes using udp protocol?
I noticed, that in the esp-idf repository on github there is a macro named "write", which takes 3 arguments. You can find it in /components/lwip/include/lwip/lwip/sockets.h at line 561. https://github.com/espressif/esp-idf/bl ... /sockets.h
This #define interferes with the mehtod "write" as decalred in WiFiUdp.h. The compiler takes the macro from sockets.h rather than the WiFiUdp one.
I only encountered this problem when I explicitly #include the sockets.h in an Arduino project.
To work around this problem I would manually change the name of the method "write" in the WiFiUdp files.
Kind regards
This #define interferes with the mehtod "write" as decalred in WiFiUdp.h. The compiler takes the macro from sockets.h rather than the WiFiUdp one.
I only encountered this problem when I explicitly #include the sockets.h in an Arduino project.
To work around this problem I would manually change the name of the method "write" in the WiFiUdp files.
Kind regards
Who is online
Users browsing this forum: axellin, Google [Bot] and 131 guests