-
Notifications
You must be signed in to change notification settings - Fork 23
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
The used network controller should be configurable from the sketch #58
Comments
I've been thinking about refactoring into templates. WebSocketServer<WifiServer, WiFiClient> server;
WebSocketClient<EthernetClient> client; Additionally you could use multiple network controllers in a single (more powerful) board. |
Initial commit pushed into the meta branch. |
thanks for your library, sorry for my noob questions:
2): did you merge that to the main branch as for sure this would be much better than using #define
thanks for your feedback |
|
Thanks for your rapid answer, I guess the main which is more recent has some improvement that meta do not have ? if that's the case would you be ok to merge your code from meta to main after if I sucessfully test templates with my code and provide you feedback, or is anything preventing to merge now ? thanks! |
Why do you insist on merging to BTW the library (also the |
I can leave with that, it's just in term of maintenance, I guess it's better to always stick to the main whenever possible, and TBH I am not so familiar in using git... Quick practical question, I have this line in my platformIO.ini |
Looks like a branch/tag should be put after |
great, I am able to compile using the meta branch. .pio/libdeps/proto/mWebSockets/src/WebSocket.hpp:298:28: error: passing 'const EthernetClient' as 'this' argument discards qualifiers [-fpermissive] #if 0 |
Which MCU? |
PLATFORM: Espressif 32 (6.4.0) > Seeed Studio XIAO ESP32C3
|
Fixed. |
Yes, it works, thanks a lot for your work and support. I understood that my case to have both WiFi and Eth is not the most common so I don't want to bother. Still, would you route me to a possible solution to instantiate the proper object (Eth / WiFi) at run time and not at compilation time, as simple example ? |
I believe, this is a good question for a separate discussion :) |
OK, added the discussion, I think this issue can therefore be closed ? |
The approach with selecting the network controller inside the library's
config.h
is hardly usable in real projects - it is impossible to tweak it for every build.There are several approaches which can address this issue:
#define NETWORK_CONTROLLER ETHERNET_CONTROLLER_W5X00
with#ifnded NETWORK_CONTROLLER
and#endif
so if the build system support global defines, the project will choose the proper network controller.ESP8266
orESP32
is defined, the chances are high that WiFi is used), so for rigid build systems (like the one in Arduino IDE) the library can be used as is.Environment info
The text was updated successfully, but these errors were encountered: