2828const static int keySlot = 0 ;
2929const static int compressedCertSlot = 10 ;
3030const static int serialNumberAndAuthorityKeyIdentifierSlot = 11 ;
31- const static int thingIdSlot = 12 ;
31+ const static int deviceIdSlot = 12 ;
3232
3333const static int CONNECT_SUCCESS = 1 ;
3434const static int CONNECT_FAILURE = 0 ;
@@ -99,25 +99,25 @@ int ArduinoIoTCloudClass::begin(Client& net, String brokerAddress, uint16_t brok
9999 // store the broker address as class member
100100 _brokerAddress = brokerAddress;
101101 _brokerPort = brokerPort;
102- byte thingIdBytes [72 ];
102+ byte deviceIdBytes [72 ];
103103
104104 if (!ECCX08.begin ()) {
105105 debugMessage (" Cryptography processor failure. Make sure you have a compatible board." , 0 );
106106 return 0 ;
107107 }
108108
109- if (!ECCX08.readSlot (thingIdSlot, thingIdBytes , sizeof (thingIdBytes ))) {
109+ if (!ECCX08.readSlot (deviceIdSlot, deviceIdBytes , sizeof (deviceIdBytes ))) {
110110 debugMessage (" Cryptography processor read failure." , 0 );
111111 return 0 ;
112112 }
113- _id = (char *)thingIdBytes ;
113+ _device_id = (char *)deviceIdBytes ;
114114
115115 if (!ECCX08Cert.beginReconstruction (keySlot, compressedCertSlot, serialNumberAndAuthorityKeyIdentifierSlot)) {
116116 debugMessage (" Cryptography certificate reconstruction failure." , 0 );
117117 return 0 ;
118118 }
119119
120- ECCX08Cert.setSubjectCommonName (_id );
120+ ECCX08Cert.setSubjectCommonName (_device_id );
121121 ECCX08Cert.setIssuerCountryName (" US" );
122122 ECCX08Cert.setIssuerOrganizationName (" Arduino LLC US" );
123123 ECCX08Cert.setIssuerOrganizationalUnitName (" IT" );
@@ -164,11 +164,11 @@ void ArduinoIoTCloudClass::onGetTime(unsigned long(*callback)(void))
164164void ArduinoIoTCloudClass::mqttClientBegin ()
165165{
166166 // MQTT topics definition
167- _stdoutTopic = " /a/d/" + _id + " /s/o" ;
168- _stdinTopic = " /a/d/" + _id + " /s/i" ;
167+ _stdoutTopic = " /a/d/" + _device_id + " /s/o" ;
168+ _stdinTopic = " /a/d/" + _device_id + " /s/i" ;
169169 if (_thing_id == " " ) {
170- _dataTopicIn = " /a/d/" + _id + " /e/i" ;
171- _dataTopicOut = " /a/d/" + _id + " /e/o" ;
170+ _dataTopicIn = " /a/d/" + _device_id + " /e/i" ;
171+ _dataTopicOut = " /a/d/" + _device_id + " /e/o" ;
172172 }
173173 else {
174174 _dataTopicIn = " /a/t/" + _thing_id + " /e/i" ;
@@ -181,7 +181,7 @@ void ArduinoIoTCloudClass::mqttClientBegin()
181181 _mqttClient->onMessage (ArduinoIoTCloudClass::onMessage);
182182 _mqttClient->setKeepAliveInterval (30 * 1000 );
183183 _mqttClient->setConnectionTimeout (1500 );
184- _mqttClient->setId (_id .c_str ());
184+ _mqttClient->setId (_device_id .c_str ());
185185}
186186
187187int ArduinoIoTCloudClass::connect ()
0 commit comments