TinyGSM icon indicating copy to clipboard operation
TinyGSM copied to clipboard

It's not a bug, but can you help me to instance PubSubClient with TinyGsmClient OR WiFi ?

Open clabnet opened this issue 2 years ago • 1 comments

Hi, I have this class :

class MqttBackend : PubSubClient
{
public:
	MqttBackend(WiFiClient &wifiClient);
	MqttBackend(TinyGsmClient &gsmClient);
	....

and the main class as is :

#include <MqttBackend.h>
class SASModem : public MqttBackend
{
private:
    TinyGsmClient &_gsmClient;

public:
    SASModem()
    {
        MqttBackend(&_gsmClient);
    }
    bool init();  \\ init the modem network connection
    bool close(); \\ close the modem connection
};

How to instanciate the PubSubClient passing it the gsmClient OR the WiFiClient ?

Thank's

clabnet avatar Nov 06 '21 16:11 clabnet

Have you figured this out? I think you might be looking for an initialization list in your class constructor.

SRGDamia1 avatar Nov 24 '21 16:11 SRGDamia1