Description
Currently StandardFirmataWiFi has no WiFiClient option and there was a request for contribution in #280 (comment).
I have compared the 3 versions of WiFiStream (WiFi, WiFi100 and ESP). They are nearly identical and they can easily be combined into a single WiFiStream class without changing the interface for WiFi and WiFi100 using defines for the ESP subset and making the appropriate changes to the StandardFirmataWiFi example. Reducing the variants first will help providing a WiFiClient option for all variants.
The new version of WiFiStream has been successfully compiled for an Arduino with WiFi and for an ESP8266. I could commit and push this intermediary solution for further discussion. It still needs testing though, because I have a host application that can only be a server.
For adding the WiFiClient there are at least two options:
- adding a separate class WiFiClientStream using a copy of WiFiStream as a starting point
- integrating the WiFiClient into WiFiStream by using separate constructors for client and server