@@ -59,6 +59,7 @@ int main(int argc, char *argv[])
59
59
60
60
// Do the global initialization for the API
61
61
ApiHandle apiHandle;
62
+ apiHandle.InitializeLogging (Aws::Crt::LogLevel::Trace, " fleet_provisioning_file.log" );
62
63
// Variables for the sample
63
64
String csrFile;
64
65
String token;
@@ -263,6 +264,21 @@ int main(int argc, char *argv[])
263
264
fprintf (
264
265
stdout, " CreateKeysAndCertificateResponse certificateId: %s.\n " , response->CertificateId ->c_str ());
265
266
token = *response->CertificateOwnershipToken ;
267
+ AWS_LOGF_WARN (
268
+ AWS_LS_MQTT_CLIENT,
269
+ " TODO: Check if the created certificate is correct: \n %s \n -- End of created certificate -- " ,
270
+ response->CertificatePem ->c_str ());
271
+
272
+ AWS_LOGF_WARN (
273
+ AWS_LS_MQTT_CLIENT,
274
+ " TODO: Check if the created key value is correct: \n %s \n -- End of created key file -- " ,
275
+ response->PrivateKey ->c_str ());
276
+
277
+ AWS_LOGF_WARN (
278
+ AWS_LS_MQTT_CLIENT,
279
+ " TODO: Check if the created ownership token is correct: \n %s \n -- End of created token value -- " ,
280
+ response->CertificateOwnershipToken ->c_str ());
281
+
266
282
}
267
283
else
268
284
{
@@ -393,6 +409,12 @@ int main(int argc, char *argv[])
393
409
registerThingRequest.Parameters = params;
394
410
registerThingRequest.CertificateOwnershipToken = token;
395
411
412
+ AWS_LOGF_WARN (
413
+ AWS_LS_MQTT_CLIENT,
414
+ " TODO: Log CertificateOwnershipToken before send registerThingRequest: \n %s \n -- End of created certificate -- " ,
415
+ registerThingRequest.CertificateOwnershipToken ->c_str ());
416
+
417
+
396
418
identityClient.PublishRegisterThing (
397
419
registerThingRequest, AWS_MQTT_QOS_AT_LEAST_ONCE, onRegisterPublishSubAck);
398
420
sleep (1 );
0 commit comments