I have problem with C++ class. Is there have any way to reuse variable in the same class in the header file?
I have try
PubSubClient mqttClient(this->secureClient);
PubSubClient mqttClient(mqtt.secureClient);
but fail. Why?
#ifndef __MQTT_H_
#define __MQTT_H_
#include "Arduino.h"
#include "WiFi.h"
#include "WiFiClientSecure.h"
#include "PubSubClient.h"
class MQTT
{
public:
bool initWiFi();
String macAddress6btye(void);
void callback(char *topic, byte *payload, unsigned int length);
bool mqttConnect();
bool mqttPublish(const String &endPoint, const String &payload);
int getStrength(uint8_t points);
private:
WiFiClientSecure secureClient;
PubSubClient mqttClient(this->secureClient);
};
#endif