@@ -18,26 +18,32 @@ AdafruitIO_WINC1500::AdafruitIO_WINC1500(const char *user, const char *key, cons
18
18
{
19
19
_ssid = ssid;
20
20
_pass = pass;
21
- _client = new WiFiSSLClient;
22
- _mqtt = new Adafruit_MQTT_Client (_client, _host, _mqtt_port);
23
- _http = new HttpClient (*_client, _host, _http_port);
21
+ _mqtt_client = new WiFiSSLClient;
22
+ _mqtt = new Adafruit_MQTT_Client (_mqtt_client, _host, _mqtt_port);
23
+ _http_client = new WiFiSSLClient;
24
+ _http = new HttpClient (*_http_client, _host, _http_port);
24
25
}
25
26
26
27
AdafruitIO_WINC1500::AdafruitIO_WINC1500 (const __FlashStringHelper *user, const __FlashStringHelper *key, const __FlashStringHelper *ssid, const __FlashStringHelper *pass):AdafruitIO(user, key)
27
28
{
28
29
_ssid = (const char *)ssid;
29
30
_pass = (const char *)pass;
30
- _client = new WiFiSSLClient;
31
- _mqtt = new Adafruit_MQTT_Client (_client, _host, _mqtt_port);
32
- _http = new HttpClient (*_client, _host, _http_port);
31
+ _mqtt_client = new WiFiSSLClient;
32
+ _mqtt = new Adafruit_MQTT_Client (_mqtt_client, _host, _mqtt_port);
33
+ _http_client = new WiFiSSLClient;
34
+ _http = new HttpClient (*_http_client, _host, _http_port);
33
35
}
34
36
35
37
AdafruitIO_WINC1500::~AdafruitIO_WINC1500 ()
36
38
{
37
- if (_client)
38
- delete _client;
39
+ if (_mqtt_client)
40
+ delete _http_client;
41
+ if (_http_client)
42
+ delete _mqtt_client;
39
43
if (_mqtt)
40
44
delete _mqtt;
45
+ if (_http)
46
+ delete _http;
41
47
}
42
48
43
49
void AdafruitIO_WINC1500::_connect ()
0 commit comments