28
28
const static int keySlot = 0 ;
29
29
const static int compressedCertSlot = 10 ;
30
30
const static int serialNumberAndAuthorityKeyIdentifierSlot = 11 ;
31
- const static int thingIdSlot = 12 ;
31
+ const static int deviceIdSlot = 12 ;
32
32
33
33
const static int CONNECT_SUCCESS = 1 ;
34
34
const static int CONNECT_FAILURE = 0 ;
@@ -99,25 +99,25 @@ int ArduinoIoTCloudClass::begin(Client& net, String brokerAddress, uint16_t brok
99
99
// store the broker address as class member
100
100
_brokerAddress = brokerAddress;
101
101
_brokerPort = brokerPort;
102
- byte thingIdBytes [72 ];
102
+ byte deviceIdBytes [72 ];
103
103
104
104
if (!ECCX08.begin ()) {
105
105
debugMessage (" Cryptography processor failure. Make sure you have a compatible board." , 0 );
106
106
return 0 ;
107
107
}
108
108
109
- if (!ECCX08.readSlot (thingIdSlot, thingIdBytes , sizeof (thingIdBytes ))) {
109
+ if (!ECCX08.readSlot (deviceIdSlot, deviceIdBytes , sizeof (deviceIdBytes ))) {
110
110
debugMessage (" Cryptography processor read failure." , 0 );
111
111
return 0 ;
112
112
}
113
- _id = (char *)thingIdBytes ;
113
+ _device_id = (char *)deviceIdBytes ;
114
114
115
115
if (!ECCX08Cert.beginReconstruction (keySlot, compressedCertSlot, serialNumberAndAuthorityKeyIdentifierSlot)) {
116
116
debugMessage (" Cryptography certificate reconstruction failure." , 0 );
117
117
return 0 ;
118
118
}
119
119
120
- ECCX08Cert.setSubjectCommonName (_id );
120
+ ECCX08Cert.setSubjectCommonName (_device_id );
121
121
ECCX08Cert.setIssuerCountryName (" US" );
122
122
ECCX08Cert.setIssuerOrganizationName (" Arduino LLC US" );
123
123
ECCX08Cert.setIssuerOrganizationalUnitName (" IT" );
@@ -164,11 +164,11 @@ void ArduinoIoTCloudClass::onGetTime(unsigned long(*callback)(void))
164
164
void ArduinoIoTCloudClass::mqttClientBegin ()
165
165
{
166
166
// 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" ;
169
169
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" ;
172
172
}
173
173
else {
174
174
_dataTopicIn = " /a/t/" + _thing_id + " /e/i" ;
@@ -181,7 +181,7 @@ void ArduinoIoTCloudClass::mqttClientBegin()
181
181
_mqttClient->onMessage (ArduinoIoTCloudClass::onMessage);
182
182
_mqttClient->setKeepAliveInterval (30 * 1000 );
183
183
_mqttClient->setConnectionTimeout (1500 );
184
- _mqttClient->setId (_id .c_str ());
184
+ _mqttClient->setId (_device_id .c_str ());
185
185
}
186
186
187
187
int ArduinoIoTCloudClass::connect ()
0 commit comments