@@ -84,8 +84,11 @@ class ArduinoIoTCloudClass {
8484 ArduinoIoTCloudClass ();
8585 ~ArduinoIoTCloudClass ();
8686
87- int begin (ConnectionHandler &connection, String device_id, String password, String brokerAddress = DEFAULT_BROKER_ADDRESS_USER_PASS_AUTH, uint16_t brokerPort = DEFAULT_BROKER_PORT_USER_PASS_AUTH);
87+ # ifdef BOARD_HAS_ECCX08
8888 int begin (ConnectionHandler &connection, String brokerAddress = DEFAULT_BROKER_ADDRESS_SECURE_AUTH, uint16_t brokerPort = DEFAULT_BROKER_PORT_SECURE_AUTH);
89+ #else
90+ int begin (ConnectionHandler &connection, String brokerAddress = DEFAULT_BROKER_ADDRESS_USER_PASS_AUTH, uint16_t brokerPort = DEFAULT_BROKER_PORT_USER_PASS_AUTH);
91+ #endif
8992 int begin (Client &net, String brokerAddress = DEFAULT_BROKER_ADDRESS_SECURE_AUTH, uint16_t brokerPort = DEFAULT_BROKER_PORT_SECURE_AUTH);
9093 // Class constant declaration
9194 static const int MQTT_TRANSMIT_BUFFER_SIZE = 256 ;
@@ -109,7 +112,14 @@ class ArduinoIoTCloudClass {
109112 inline void setThingId (String const thing_id) {
110113 _thing_id = thing_id;
111114 };
112-
115+ #ifdef BOARD_ESP
116+ inline void setDeviceId (String const device_id) {
117+ _device_id = device_id;
118+ }
119+ inline void setPassword (String const password) {
120+ _password = password;
121+ }
122+ #endif
113123 inline String getThingId () const {
114124 return _thing_id;
115125 };
@@ -209,7 +219,7 @@ class ArduinoIoTCloudClass {
209219
210220 void sendPropertiesToCloud ();
211221
212- String _device_id, _password, _thing_id, _brokerAddress;
222+ String _device_id, _thing_id, _brokerAddress;
213223 uint16_t _brokerPort;
214224
215225 ArduinoCloudThing Thing;
@@ -219,6 +229,7 @@ class ArduinoIoTCloudClass {
219229 #elif defined(BOARD_ESP)
220230 WiFiClientSecure *_sslClient;
221231 X509List _certificate;
232+ String _password;
222233 #endif
223234
224235 MqttClient *_mqttClient;
0 commit comments