-
Notifications
You must be signed in to change notification settings - Fork 516
Add TCP client and ability to choose between TCP client and Server #292
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
Conversation
- server related functions moved from WiFiStream into WiFiServerStream - unified class interface for sketch file (no client/server defines) - WiFi and TCP configuration and connect split into individual methods (constructor, config, begin, maintain) - WiFi only initialized once at startup
- fixed client accept in WiFiServerStream - added host connection callback hook to notfiy connect and disconnect
- fixed missing update of _connected when accepting a client
WiFiClientStream added
- split wifi init and firmata init into separate functions - add hostConnectionCallback
- check member _connected first in connect_client() to prevent querying connected() of disconnected _client - added method status() to check TCP connection state (ESP8266 only)
connection state management modified
- use generic names for init functions - add clarifications to comments
refactor setup function
@jnsbyr I think this is in a good state to merge into master. Let me know if you agree and/or if you had anything else to add or any concerns. Next step IMO is to finalize the protocol definitions for state management (connect/reconnect and watchdog) and pin value reporting. |
Had a look at the diffs and they look pretty good to me. You already tested several possible configurations so there is nothing I could add at this point. It's agreed that we should continue with the protocol definitions. Maybe it is a good idea to create a watchdog test case both for a TCP and serial host link before finalizing the specifications. |
I hadn't thought of the watchdog being necessary for serial since it's less likely in my experience at least to lose the connection, but I guess it could be useful for long running processes where power could be lost for some period of time causing a lose in the serial connection. |
Adds ability to setup board as a TCP client or TCP server.