Skip to content

Commit 455aa34

Browse files
committed
MCU8MASS-1782 Merge develop
2 parents 3590db3 + 5d3a76d commit 455aa34

39 files changed

+2498
-1802
lines changed

Jenkinsfilek8s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
stage('linter') {
6060
steps {
61-
sh 'arduino-lint --library-manager update --compliance permissive'
61+
sh 'arduino-lint --library-manager update --compliance permissive --project-type library'
6262
script {
6363
env.DEP_ERROR = getDependencyError()
6464
if (env.DEP_ERROR != '') {

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
The recommended way to install the library is within the Arduino IDE. Simply go Tools -> Manage Libraries and search for "avr-iot". The library can also be cloned from this repository. More information can be found [here](https://iot.microchip.com/docs/arduino/introduction/devenv).
1111

12-
**As of DxCore version 1.5.3, there is a bug with the interrupt system. To alleviate this, choose `Tools` -> `attachInterrupt() Version` -> `Old version` in the Arduino IDE.**
13-
1412
## Board Description
1513

1614
The [AVR-IoT Cellular Mini](https://www.microchip.com/en-us/development-tool/EV70N78A) is a development board from Microchip to develop cellular IoT applications.

examples/custom_at_commands/custom_at_commands.ino

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ static void ping_callback(char* message) {
4040
void setup() {
4141
Log.begin(115200);
4242

43-
Log.info("Starting up example for custom AT commands");
43+
Log.info(F("Starting up example for custom AT commands"));
4444

4545
// If we didn't want to connect to the network, we could start the
4646
// SequansController directly by: SequansController.begin();
4747
// Lte.begin() will start the SequansController in its begin()
4848
Lte.begin();
4949

5050
// Here we enable verbose error messages
51-
SequansController.writeCommand("AT+CMEE=2");
51+
SequansController.writeCommand(F("AT+CMEE=2"));
5252

5353
// Here we perform a ping with incorrect parameter in order to trigger the
5454
// error message. Note that if the modem returns an error with the command,
@@ -57,14 +57,17 @@ void setup() {
5757
//
5858
// Here we also pass an optional response buffer to the function which will
5959
// be filled with the response from the command
60-
char response[128] = "";
61-
ResponseResult response_result =
62-
SequansController.writeCommand("AT+PING=0", response, sizeof(response));
60+
char response[128] = "";
61+
ResponseResult response_result = SequansController.writeCommand(
62+
F("AT+PING=0"),
63+
response,
64+
sizeof(response));
6365

6466
if (response_result == ResponseResult::OK) {
65-
Log.infof("Command written successfully, this should not happen");
67+
Log.infof(F("Command written successfully, this should not happen"));
6668
} else {
67-
Log.errorf("Error writing command, the response was: %s\r\n", response);
69+
Log.errorf(F("Error writing command, the response was: %s\r\n"),
70+
response);
6871
}
6972

7073
// --------------------- Notifications & Commands -------------------------
@@ -76,31 +79,32 @@ void setup() {
7679
// response code), which can be though of as a notification.
7780
//
7881
// The different URCs are documented in Sequans' AT command reference.
79-
SequansController.registerCallback("PING", ping_callback);
82+
SequansController.registerCallback(F("PING"), ping_callback);
8083

81-
// Instead of writing a command, we use the writeBytes function here. It
82-
// will simply write the bytes we provide and not check whether the command
84+
// Instead of writing a command, we use the writeString function here. It
85+
// will simply write the string we provide and not check whether the command
8386
// was written successfully. We do it this way for this example as we want
8487
// to utilise notifications and the ping command is blocking. This is thus
8588
// purely an example.
86-
const char* command = "AT+PING=\"www.microchip.com\"";
87-
SequansController.writeBytes((uint8_t*)command, strlen(command), true);
89+
SequansController.writeString(F("AT+PING=\"www.microchip.com\""), true);
8890

8991
// The default ping will retrieve four responses, so wait for them
9092
while (ping_messages_received < 4) {}
9193

92-
Log.infof("Received the following ping response:\r\n%s\r\n", ping_response);
94+
Log.infof(F("Received the following ping response:\r\n%s\r\n"),
95+
ping_response);
9396

9497
// -------------- Extracting Parameters from Responses --------------------
9598

9699
// Here we will utilise AT+CEREG?, which returns data about the current
97100
// connection. We can use it to check if we are connected to the network.
98-
response_result =
99-
SequansController.writeCommand("AT+CEREG?", response, sizeof(response));
101+
response_result = SequansController.writeCommand(F("AT+CEREG?"),
102+
response,
103+
sizeof(response));
100104

101105
if (response_result == ResponseResult::OK) {
102106

103-
Log.infof("Command written successfully, the response was: %s\r\n",
107+
Log.infof(F("Command written successfully, the response was: %s\r\n"),
104108
response);
105109

106110
char value_buffer[8] = "";
@@ -112,12 +116,13 @@ void setup() {
112116
1,
113117
value_buffer,
114118
sizeof(value_buffer))) {
115-
Log.infof("The value was: %s\r\n", value_buffer);
119+
Log.infof(F("The value was: %s\r\n"), value_buffer);
116120
} else {
117-
Log.error("Failed to extract value");
121+
Log.error(F("Failed to extract value"));
118122
}
119123
} else {
120-
Log.errorf("Error writing command, the response was: %s\r\n", response);
124+
Log.errorf(F("Error writing command, the response was: %s\r\n"),
125+
response);
121126
}
122127

123128
Lte.end();

examples/extract_certificates/extract_certificates.ino

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ static void printCertificate(const uint8_t* certificate, const size_t size) {
1313
ECC608.base64EncodeCertificate(certificate, size, buffer, &buffer_size);
1414

1515
if (status != ATCA_SUCCESS) {
16-
Log.errorf("Failed to encode into base64: %x\r\n", status);
16+
Log.errorf(F("Failed to encode into base64: %x\r\n"), status);
1717
return;
1818
}
1919

2020
Log.rawf(
21-
"-----BEGIN CERTIFICATE-----\r\n%s\r\n-----END CERTIFICATE-----\r\n",
21+
F("-----BEGIN CERTIFICATE-----\r\n%s\r\n-----END CERTIFICATE-----\r\n"),
2222
buffer);
2323
}
2424

@@ -28,12 +28,12 @@ void setup() {
2828
ATCA_STATUS atca_status = ECC608.begin();
2929

3030
if (atca_status != ATCA_SUCCESS) {
31-
Log.errorf("Failed to initialize ECC608, status code: 0x%X\r\n",
31+
Log.errorf(F("Failed to initialize ECC608, status code: 0x%X\r\n"),
3232
atca_status);
3333
return;
3434
}
3535

36-
Log.info("Initialized ECC\r\n");
36+
Log.info(F("Initialized ECC\r\n"));
3737

3838
// Extract the max size of the certificates first
3939

@@ -45,27 +45,29 @@ void setup() {
4545
if ((atca_cert_status = ECC608.getRootCertificateSize(
4646
&max_root_certificate_size)) != ATCACERT_E_SUCCESS) {
4747

48-
Log.errorf("Failed to get root certificate's max size, status code: "
49-
"0x%X\r\n",
48+
Log.errorf(F("Failed to get root certificate's max size, status code: "
49+
"0x%X\r\n"),
5050
atca_cert_status);
5151
return;
5252
}
5353

5454
if ((atca_cert_status = ECC608.getSignerCertificateSize(
5555
&max_signer_certificate_size)) != ATCACERT_E_SUCCESS) {
5656

57-
Log.errorf("Failed to get signer certificate's max size, status code: "
58-
"0x%X\r\n",
59-
atca_cert_status);
57+
Log.errorf(
58+
F("Failed to get signer certificate's max size, status code: "
59+
"0x%X\r\n"),
60+
atca_cert_status);
6061
return;
6162
}
6263

6364
if ((atca_cert_status = ECC608.getDeviceCertificateSize(
6465
&max_device_certificate_size)) != ATCACERT_E_SUCCESS) {
6566

66-
Log.errorf("Failed to get device certificate's max size, status code: "
67-
"0x%X\r\n",
68-
atca_cert_status);
67+
Log.errorf(
68+
F("Failed to get device certificate's max size, status code: "
69+
"0x%X\r\n"),
70+
atca_cert_status);
6971
return;
7072
}
7173

@@ -81,19 +83,19 @@ void setup() {
8183

8284
size_t root_certificate_size = certificate_buffer_size;
8385

84-
Log.raw("\r\n\r\n");
86+
Log.raw(F("\r\n\r\n"));
8587

8688
if ((atca_cert_status = ECC608.getRootCertificate(
8789
certificate_buffer,
8890
&root_certificate_size)) != ATCACERT_E_SUCCESS) {
8991

90-
Log.errorf("Failed to get root certificate, status code: "
91-
"0x%X\r\n",
92+
Log.errorf(F("Failed to get root certificate, status code: "
93+
"0x%X\r\n"),
9294
atca_cert_status);
9395
return;
9496
} else {
9597

96-
Log.info("Printing root certificate...\r\n");
98+
Log.info(F("Printing root certificate...\r\n"));
9799
printCertificate(certificate_buffer, root_certificate_size);
98100
}
99101

@@ -107,33 +109,33 @@ void setup() {
107109
certificate_buffer,
108110
&signer_certificate_size)) != ATCACERT_E_SUCCESS) {
109111

110-
Log.errorf("Failed to get signer certificate, status code: "
111-
"0x%X\r\n",
112+
Log.errorf(F("Failed to get signer certificate, status code: "
113+
"0x%X\r\n"),
112114
atca_cert_status);
113115
return;
114116
} else {
115117

116-
Log.info("Printing signer certificate...\r\n");
118+
Log.info(F("Printing signer certificate...\r\n"));
117119
printCertificate(certificate_buffer, signer_certificate_size);
118120
}
119121

120122
// --- Device certificate ---
121123

122124
size_t device_certificate_size = max_device_certificate_size;
123125

124-
Log.raw("\r\n\r\n");
126+
Log.raw(F("\r\n\r\n"));
125127

126128
if ((atca_cert_status = ECC608.getDeviceCertificate(
127129
certificate_buffer,
128130
&device_certificate_size)) != ATCACERT_E_SUCCESS) {
129131

130-
Log.errorf("Failed to get device certificate, status code: "
131-
"0x%X\r\n",
132+
Log.errorf(F("Failed to get device certificate, status code: "
133+
"0x%X\r\n"),
132134
atca_cert_status);
133135
return;
134136
} else {
135137

136-
Log.info("Printing device certificate...\r\n");
138+
Log.info(F("Printing device certificate...\r\n"));
137139
printCertificate(certificate_buffer, device_certificate_size);
138140
}
139141
}

examples/gpio/gpio.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ void setup() {
8888
// connected through USB (USB is delivering 5 V, but there are some
8989
// voltage drop over the components on the way to the voltage measurement
9090
// circuit)
91-
Serial3.print("The voltage supplied is: ");
91+
Serial3.print(F("The voltage supplied is: "));
9292
Serial3.println(analog_value);
9393
}
9494

9595
void loop() {
9696

9797
if (button_pressed) {
98-
Serial3.println("Button pressed");
98+
Serial3.println(F("Button pressed"));
9999
button_pressed = false;
100100
}
101101
}

0 commit comments

Comments
 (0)