stanleyhuangyc / Freematics

Official source code repository for Freematics
https://freematics.com
428 stars 347 forks source link

Why not inheriting from Client #50

Open laurentvm opened 6 years ago

laurentvm commented 6 years ago

Hi Stanley,

I did tried some MQTT with the ONE+ using 2 libs: PubSubClient and TinyGSM.

However, to instanciate we need to do this:

WiFiClient espClient;
PubSubClient client(espClient);

I think it could work if you derive your client from "Client.h" from Arduino, right?

https://github.com/stanleyhuangyc/Freematics/blob/bd66ac6712776d5e0227de8c853da9bbd2e54cfd/libraries/FreematicsPlus/FreematicsNetwork.h#L59

I did a trial with the older version class UDPClientSIM800 : virtual NullClient to class UDPClientSIM800 : virtual Client

It compiles. Any thought?