26
26
#include < ArduinoIoTCloud.h>
27
27
#include < ArduinoMqttClient.h>
28
28
29
- #if defined(BOARD_HAS_SECRET_KEY)
30
- #if defined(BOARD_ESP)
31
- #include < WiFiClientSecure.h>
32
- #elif defined(ARDUINO_EDGE_CONTROL)
33
- #include < GSMSSLClient.h>
34
- #endif
35
- #else
29
+ #if defined(BOARD_HAS_SECURE_ELEMENT)
36
30
#include < Arduino_SecureElement.h>
37
31
#include < utility/SElementArduinoCloudDeviceId.h>
38
- #if defined(BOARD_HAS_OFFLOADED_ECCX08)
39
- #else
32
+ #if !defined(BOARD_HAS_OFFLOADED_ECCX08)
40
33
#include < utility/SElementArduinoCloudCertificate.h>
41
- #ifdef BOARD_HAS_ECCX08
42
- #include " tls/BearSSLClient.h"
43
- #elif defined(BOARD_HAS_OFFLOADED_ECCX08)
44
- #include < WiFiSSLClient.h>
45
- #elif defined(BOARD_HAS_SE050)
46
- #if defined(ARDUINO_PORTENTA_C33)
47
- #include < SSLClient.h>
48
- #else
49
- #include < WiFiSSLSE050Client.h>
50
- #endif
51
- #elif defined(BOARD_HAS_SOFTSE)
52
- #include < WiFiSSLClient.h>
53
- #endif
54
34
#endif
55
35
#endif
56
36
37
+ #if defined(BOARD_HAS_OFFLOADED_ECCX08)
38
+ #include " WiFiSSLClient.h"
39
+ #elif defined(BOARD_HAS_ECCX08)
40
+ #include " tls/BearSSLClient.h"
41
+ #elif defined(ARDUINO_PORTENTA_C33)
42
+ #include < SSLClient.h>
43
+ #elif defined(NICLA_VISION)
44
+ #include < WiFiSSLSE050Client.h>
45
+ #elif defined(ARDUINO_EDGE_CONTROL)
46
+ #include < GSMSSLClient.h>
47
+ #elif defined(ARDUINO_UNOR4_WIFI)
48
+ #include < WiFiSSLClient.h>
49
+ #elif defined(BOARD_ESP)
50
+ #include < WiFiClientSecure.h>
51
+ #endif
52
+
57
53
/* *****************************************************************************
58
54
CONSTANTS
59
55
******************************************************************************/
60
-
56
+ # if defined(BOARD_HAS_SECURE_ELEMENT)
61
57
static char const DEFAULT_BROKER_ADDRESS_SECURE_AUTH[] = " mqtts-sa.iot.arduino.cc" ;
62
58
static uint16_t const DEFAULT_BROKER_PORT_SECURE_AUTH = 8883 ;
59
+ #endif
60
+
61
+ #if defined(BOARD_HAS_SECRET_KEY)
63
62
static char const DEFAULT_BROKER_ADDRESS_USER_PASS_AUTH[] = " mqtts-up.iot.arduino.cc" ;
64
63
static uint16_t const DEFAULT_BROKER_PORT_USER_PASS_AUTH = 8884 ;
64
+ #endif
65
65
66
66
/* *****************************************************************************
67
67
* TYPEDEF
@@ -85,11 +85,7 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
85
85
virtual int connected () override ;
86
86
virtual void printDebugInfo () override ;
87
87
88
- #if !defined(BOARD_HAS_SECRET_KEY)
89
88
int begin (ConnectionHandler & connection, bool const enable_watchdog = true , String brokerAddress = DEFAULT_BROKER_ADDRESS_SECURE_AUTH, uint16_t brokerPort = DEFAULT_BROKER_PORT_SECURE_AUTH);
90
- #else
91
- int begin (ConnectionHandler & connection, bool const enable_watchdog = true , String brokerAddress = DEFAULT_BROKER_ADDRESS_USER_PASS_AUTH, uint16_t brokerPort = DEFAULT_BROKER_PORT_USER_PASS_AUTH);
92
- #endif
93
89
int begin (bool const enable_watchdog = true , String brokerAddress = DEFAULT_BROKER_ADDRESS_SECURE_AUTH, uint16_t brokerPort = DEFAULT_BROKER_PORT_SECURE_AUTH);
94
90
95
91
#ifdef BOARD_HAS_SECRET_KEY
@@ -148,29 +144,29 @@ class ArduinoIoTCloudTCP: public ArduinoIoTCloudClass
148
144
149
145
#if defined(BOARD_HAS_SECRET_KEY)
150
146
String _password;
151
- #if defined(BOARD_ESP)
152
- WiFiClientSecure _sslClient;
153
- #elif defined(ARDUINO_EDGE_CONTROL)
154
- GSMSSLClient _sslClient;
155
- #endif
156
- #else
147
+ #endif
148
+
149
+ #if defined(BOARD_HAS_SECURE_ELEMENT)
157
150
SecureElement _crypto;
158
- #if defined(BOARD_HAS_OFFLOADED_ECCX08)
159
- WiFiBearSSLClient _sslClient;
160
- #else
161
- ECP256Certificate _cert;
162
- #if defined(BOARD_HAS_ECCX08)
151
+ #if !defined(BOARD_HAS_OFFLOADED_ECCX08)
152
+ ECP256Certificate _cert;
153
+ #endif
154
+ #endif
155
+
156
+ #if defined(BOARD_HAS_OFFLOADED_ECCX08)
157
+ WiFiSSLClient _sslClient;
158
+ #elif defined(BOARD_HAS_ECCX08)
163
159
BearSSLClient _sslClient;
164
- #elif defined(BOARD_HAS_SE050)
165
- #if defined(ARDUINO_PORTENTA_C33)
160
+ #elif defined(ARDUINO_PORTENTA_C33)
166
161
SSLClient _sslClient;
167
- # else
162
+ # elif defined(NICLA_VISION)
168
163
WiFiSSLSE050Client _sslClient;
169
- #endif
170
- #elif defined(BOARD_HAS_SOFTSE)
164
+ #elif defined(ARDUINO_EDGE_CONTROL)
165
+ GSMSSLClient _sslClient;
166
+ #elif defined(ARDUINO_UNOR4_WIFI)
171
167
WiFiSSLClient _sslClient;
172
- # endif
173
- # endif
168
+ # elif defined(BOARD_ESP)
169
+ WiFiClientSecure _sslClient;
174
170
#endif
175
171
176
172
MqttClient _mqttClient;
0 commit comments