Skip to content

Commit 39e6201

Browse files
committed
Release of version 2.2.0
1 parent 7aee025 commit 39e6201

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+730
-4992
lines changed

AWS-IoT-Arduino-Yun-Library/aws_iot_error.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ typedef enum {
5757
JSON_FILE_NOT_FOUND = -37,
5858
JSON_KEY_NOT_FOUND = -38,
5959
JSON_GENERIC_ERROR = -39,
60-
PUBLISH_QUEUE_FULL = -40
60+
PUBLISH_QUEUE_FULL = -40,
61+
PUBLISH_QUEUE_DISABLED = -41
6162
} IoT_Error_t;
6263

6364
#endif

AWS-IoT-Arduino-Yun-Library/aws_iot_mqtt.cpp

Lines changed: 176 additions & 162 deletions
Large diffs are not rendered by default.

AWS-IoT-Arduino-Yun-Library/aws_iot_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#define version_h
1818

1919
#define VERSION_MAJOR 2
20-
#define VERSION_MINOR 1
21-
#define VERSION_PATCH 1
20+
#define VERSION_MINOR 2
21+
#define VERSION_PATCH 0
2222
#define VERSION_TAG ""
2323

2424
#endif

AWS-IoT-Arduino-Yun-Library/examples/BasicPubSub/BasicPubSub.ino

100644100755
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void setup() {
4141
while(!Serial);
4242
//
4343
char curr_version[80];
44-
sprintf(curr_version, "AWS IoT SDK Version(dev) %d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG);
44+
snprintf_P(curr_version, 80, PSTR("AWS IoT SDK Version(dev) %d.%d.%d-%s\n"), VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG);
4545
Serial.println(curr_version);
4646
// Set up the client
4747
if((rc = myClient.setup(AWS_IOT_CLIENT_ID)) == 0) {
@@ -57,17 +57,17 @@ void setup() {
5757
}
5858
}
5959
else {
60-
Serial.println("Connect failed!");
60+
Serial.println(F("Connect failed!"));
6161
Serial.println(rc);
6262
}
6363
}
6464
else {
65-
Serial.println("Config failed!");
65+
Serial.println(F("Config failed!"));
6666
Serial.println(rc);
6767
}
6868
}
6969
else {
70-
Serial.println("Setup failed!");
70+
Serial.println(F("Setup failed!"));
7171
Serial.println(rc);
7272
}
7373
// Delay to make sure SUBACK is received, delay time could vary according to the server
@@ -79,7 +79,7 @@ void loop() {
7979
// Generate a new message in each loop and publish to "topic1"
8080
sprintf(msg, "new message %d", cnt);
8181
if((rc = myClient.publish("topic1", msg, strlen(msg), 1, false)) != 0) {
82-
Serial.println("Publish failed!");
82+
Serial.println(F("Publish failed!"));
8383
Serial.println(rc);
8484
}
8585

@@ -90,7 +90,7 @@ void loop() {
9090
}
9191

9292
// Done with the current loop
93-
sprintf(msg, "loop %d done", cnt++);
93+
sprintf_P(msg, PSTR("loop %d done"), cnt++);
9494
Serial.println(msg);
9595

9696
delay(1000);

AWS-IoT-Arduino-Yun-Library/examples/ThermostatSimulatorDevice/ThermostatSimulatorDevice.ino

100644100755
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,23 @@ bool success_connect = false;
2929
bool print_log(const char* src, int code) {
3030
bool ret = true;
3131
if(code == 0) {
32-
Serial.print("[LOG] command: ");
33-
Serial.print(src);
34-
Serial.println(" completed.");
32+
#ifdef AWS_IOT_DEBUG
33+
Serial.print(F("[LOG] command: "));
34+
Serial.print(src);
35+
Serial.println(F(" completed."));
36+
#endif
3537
ret = true;
3638
}
3739
else {
38-
Serial.print("[ERR] command: ");
39-
Serial.print(src);
40-
Serial.print(" code: ");
41-
Serial.println(code);
40+
#ifdef AWS_IOT_DEBUG
41+
Serial.print(F("[ERR] command: "));
42+
Serial.print(src);
43+
Serial.print(F(" code: "));
44+
Serial.println(code);
45+
#endif
4246
ret = false;
4347
}
48+
Serial.flush();
4449
return ret;
4550
}
4651

@@ -57,7 +62,7 @@ void setup() {
5762
while(!Serial);
5863

5964
char curr_version[80];
60-
sprintf(curr_version, "AWS IoT SDK Version(dev) %d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG);
65+
snprintf_P(curr_version, 80, PSTR("AWS IoT SDK Version(dev) %d.%d.%d-%s\n"), VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG);
6166
Serial.println(curr_version);
6267

6368
if(print_log("setup", myClient.setup(AWS_IOT_CLIENT_ID))) {
@@ -79,7 +84,7 @@ void loop() {
7984
else if(reportedTemp - desiredTemp > 0.001) {reportedTemp -= 0.1;}
8085
dtostrf(reportedTemp, 4, 1, float_buf);
8186
float_buf[4] = '\0';
82-
sprintf(JSON_buf, "{\"state\":{\"reported\":{\"Temp\":%s}}}", float_buf);
87+
sprintf_P(JSON_buf, PSTR("{\"state\":{\"reported\":{\"Temp\":%s}}}"), float_buf);
8388
print_log("shadow update", myClient.shadow_update(AWS_IOT_MY_THING_NAME, JSON_buf, strlen(JSON_buf), NULL, 5));
8489
if(myClient.yield()) {
8590
Serial.println("Yield failed.");

AWS-IoT-Arduino-Yun-Library/examples/ThermostatSimulatorDevice/aws_iot_config.h

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define AWS_IOT_ROOT_CA_FILENAME "aws-iot-rootCA.crt" // your root-CA filename
2626
#define AWS_IOT_CERTIFICATE_FILENAME "certificate.pem.crt" // your certificate filename
2727
#define AWS_IOT_PRIVATE_KEY_FILENAME "private.pem.key" // your private key filename
28+
#define AWS_IOT_DEBUG // Enable debug logging. Remove it if you want to disable it.
2829
//===============================================================
2930
// SDK config, DO NOT modify it
3031
#define AWS_IOT_PATH_PREFIX "../certs/"

AWS-IoT-Arduino-Yun-Library/examples/ThingShadowEcho/ThingShadowEcho.ino

100644100755
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,23 @@ bool success_connect = false;
2626
bool print_log(const char* src, int code) {
2727
bool ret = true;
2828
if(code == 0) {
29-
Serial.print("[LOG] command: ");
30-
Serial.print(src);
31-
Serial.println(" completed.");
29+
#ifdef AWS_IOT_DEBUG
30+
Serial.print(F("[LOG] command: "));
31+
Serial.print(src);
32+
Serial.println(F(" completed."));
33+
#endif
3234
ret = true;
3335
}
3436
else {
35-
Serial.print("[ERR] command: ");
36-
Serial.print(src);
37-
Serial.print(" code: ");
38-
Serial.println(code);
37+
#ifdef AWS_IOT_DEBUG
38+
Serial.print(F("[ERR] command: "));
39+
Serial.print(src);
40+
Serial.print(F(" code: "));
41+
Serial.println(code);
42+
#endif
3943
ret = false;
4044
}
45+
Serial.flush();
4146
return ret;
4247
}
4348

@@ -58,7 +63,7 @@ void setup() {
5863
while(!Serial);
5964

6065
char curr_version[80];
61-
sprintf(curr_version, "AWS IoT SDK Version(dev) %d.%d.%d-%s\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG);
66+
snprintf_P(curr_version, 80, PSTR("AWS IoT SDK Version(dev) %d.%d.%d-%s\n"), VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, VERSION_TAG);
6267
Serial.println(curr_version);
6368

6469
if(print_log("setup", myClient.setup(AWS_IOT_CLIENT_ID))) {
@@ -75,7 +80,7 @@ void setup() {
7580
void loop() {
7681
if(success_connect) {
7782
if(myClient.yield()) {
78-
Serial.println("Yield failed.");
83+
Serial.println(F("Yield failed."));
7984
}
8085
delay(1000); // check for incoming delta per 100 ms
8186
}

AWS-IoT-Arduino-Yun-Library/examples/ThingShadowEcho/aws_iot_config.h

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define AWS_IOT_ROOT_CA_FILENAME "aws-iot-rootCA.crt" // your root-CA filename
2626
#define AWS_IOT_CERTIFICATE_FILENAME "cert.pem" // your certificate filename
2727
#define AWS_IOT_PRIVATE_KEY_FILENAME "privkey.pem" // your private key filename
28+
#define AWS_IOT_DEBUG // Enable debug logging. Remove it if you want to disable it.
2829
//===============================================================
2930
// SDK config, DO NOT modify it
3031
#define AWS_IOT_PATH_PREFIX "../certs/"

AWS-IoT-Python-Runtime/lib/comm/__init__.py

100755100644
File mode changed.

AWS-IoT-Python-Runtime/lib/comm/communicationServer.py

100755100644
File mode changed.

0 commit comments

Comments
 (0)