mlesniew / PicoMQTT

ESP MQTT client and broker library
GNU Lesser General Public License v3.0
219 stars 25 forks source link

Ethernet library support #5

Closed lukaszt-pcs closed 11 months ago

lukaszt-pcs commented 1 year ago

Hi, congrats! Your library works brilliantly over wifi. I wonder if there is an easy implementation possible for the ethernet module. e.g. w5500wisnet. please advise.

mlesniew commented 1 year ago

Hey, thanks, great that it works for you too.

Although I wrote it mainly with WiFi in mind, adding support for Ethernet should be possible and relatively easy. Currently the library relies internally on the WiFiClient and WiFiServer server classes. Ethernet libs provide equivalent classes -- EthernetClient and EthernetServer with the same API.

The most elegant solution would be to convert the classes in PicoMQTT to templates. There can be some additional tweaks needed, but this way it would be easiest to work with W5500 library and potentially other libraries too.