Skip to content

Commit 7362cff

Browse files
committed
Add patch for TLS certificate validation
1 parent 9779eb9 commit 7362cff

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

examples/https_configure_ca/https_configure_ca.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <log.h>
22
#include <sequans_controller.h>
33

4-
#define AT_HTTPS_CONFIGURE_SECURITY_PROFILE "AT+SQNSPCFG=3,2,\"\",1,1"
4+
#define AT_HTTPS_CONFIGURE_SECURITY_PROFILE "AT+SQNSPCFG=3,2,\"\",0,1"
55

66
void setup() {
77
Log.begin(115200);

examples/sandbox/sandbox.ino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <lte.h>
1313
#include <mcp9808.h>
1414
#include <mqtt_client.h>
15+
#include <sequans_controller.h>
1516
#include <veml3328.h>
1617

1718
#define HEARTBEAT_INTERVAL_MS 10000
@@ -305,6 +306,16 @@ void setup() {
305306
sprintf(mqtt_sub_topic, MQTT_SUB_TOPIC_FMT, thing_name);
306307
sprintf(mqtt_pub_topic, MQTT_PUB_TOPIC_FMT, thing_name);
307308

309+
// - Patch begin -
310+
// Patch for TLS verification in certain regions
311+
SequansController.begin();
312+
313+
// Allow time for boot
314+
delay(500);
315+
while (!SequansController.retryCommand(
316+
"AT+SQNSPCFG=1,2,\"0xC02B\",0,19,0,0,\"\",\"\",1,0,0")) {}
317+
// - Patch end -
318+
308319
Log.info("Connecting to LTE network...");
309320
connectLTE();
310321
}

src/lte.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ bool LteClass::begin(void) {
8383

8484
SequansController.clearReceiveBuffer();
8585

86-
// This might fail the first times after initializing the sequans
87-
// controller, so we just retry until they succeed
8886
SequansController.retryCommand(AT_COMMAND_ENABLE_CEREG_URC);
89-
9087
SequansController.retryCommand(AT_COMMAND_CONNECT);
9188

9289
// CPIN might fail if issued to quickly after CFUN
9390
delay(500);
9491

92+
// Clear receive buffer before querying the SIM card
93+
SequansController.clearReceiveBuffer();
94+
9595
// We check that the SIM card is inserted and ready. Note that we can only
9696
// do this and get a meaningful response in CFUN=1 or CFUN=4.
9797
SequansController.retryCommand(AT_COMMAND_CHECK_SIM);
@@ -114,6 +114,7 @@ bool LteClass::begin(void) {
114114

115115
Log.error("Failed to extract value from command response during SIM "
116116
"status check");
117+
SequansController.retryCommand(AT_COMMAND_DISCONNECT);
117118
return false;
118119
}
119120

0 commit comments

Comments
 (0)