Skip to content

Commit 87c0880

Browse files
committed
patches: GEMALTO CINTERION fixes for connection retries
1 parent c1e0fed commit 87c0880

4 files changed

+120
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From f40d4a9d65ee9163921271697d316c1061aca946 Mon Sep 17 00:00:00 2001
2+
From: pennam <[email protected]>
3+
Date: Thu, 31 Oct 2024 11:05:18 +0100
4+
Subject: [PATCH 244/247] GEMALTO CINTERION: cleanup stack before connection
5+
6+
Allows to re-connect after a disconnection
7+
---
8+
.../GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp | 5 +++++
9+
1 file changed, 5 insertions(+)
10+
11+
diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp
12+
index 78955c599e..76c788cdaf 100644
13+
--- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp
14+
+++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp
15+
@@ -35,6 +35,11 @@ nsapi_error_t GEMALTO_CINTERION_CellularContext::connect(const char *sim_pin, co
16+
{
17+
nsapi_error_t error = NSAPI_ERROR_OK;
18+
19+
+ if (_stack) {
20+
+ delete _stack;
21+
+ _stack = NULL;
22+
+ }
23+
+
24+
set_sim_pin(sim_pin);
25+
set_credentials(apn, uname, pwd);
26+
27+
--
28+
2.45.2
29+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 4b6c6ad0554c88c369fc4e2e5ed543d52117aa3f Mon Sep 17 00:00:00 2001
2+
From: pennam <[email protected]>
3+
Date: Thu, 31 Oct 2024 12:00:51 +0100
4+
Subject: [PATCH 245/247] GEMALTO CINTERION: close socket on timeout
5+
6+
---
7+
.../GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp
11+
index ac2a54282a..41a01859e7 100644
12+
--- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp
13+
+++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp
14+
@@ -59,7 +59,7 @@ void GEMALTO_CINTERION_CellularStack::urc_sis()
15+
}
16+
if (urc_code == 0) {
17+
int urc_info_id = _at.read_int();
18+
- if (urc_info_id == 48) {
19+
+ if (urc_info_id == 48 || urc_info_id == 20) {
20+
tr_info("Socket closed %d", sock_id);
21+
sock->closed = true;
22+
if (sock->_cb) {
23+
--
24+
2.45.2
25+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 84e682a7f4c0c05dded7f12817f78c1cc9a66cfe Mon Sep 17 00:00:00 2001
2+
From: pennam <[email protected]>
3+
Date: Thu, 31 Oct 2024 12:01:47 +0100
4+
Subject: [PATCH 246/247] GEMALTO CINTERION: add debug for urc_sis
5+
6+
---
7+
.../GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp | 3 +++
8+
1 file changed, 3 insertions(+)
9+
10+
diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp
11+
index 41a01859e7..9a3f22dc3c 100644
12+
--- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp
13+
+++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp
14+
@@ -47,6 +47,8 @@ void GEMALTO_CINTERION_CellularStack::urc_sis()
15+
int sock_id = _at.read_int();
16+
int urc_code = _at.read_int();
17+
CellularSocket *sock = find_socket(sock_id);
18+
+
19+
+ tr_info("urc_sis socket id %d urc code %d\n\r", sock_id, urc_code);
20+
if (sock) {
21+
// Currently only UDP is supported so there is need to handle only some error codes here,
22+
// and others are detected on sendto/recvfrom responses.
23+
@@ -59,6 +61,7 @@ void GEMALTO_CINTERION_CellularStack::urc_sis()
24+
}
25+
if (urc_code == 0) {
26+
int urc_info_id = _at.read_int();
27+
+ tr_info("urcInfoId %d\n\r", urc_info_id);
28+
if (urc_info_id == 48 || urc_info_id == 20) {
29+
tr_info("Socket closed %d", sock_id);
30+
sock->closed = true;
31+
--
32+
2.45.2
33+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 5cc2a1998d37bad69a0b4e75b7d6f7b92e95935c Mon Sep 17 00:00:00 2001
2+
From: pennam <[email protected]>
3+
Date: Thu, 31 Oct 2024 12:03:00 +0100
4+
Subject: [PATCH 247/247] GEMALTO CINTERION: add configuration for urcs during
5+
read
6+
7+
---
8+
.../CINTERION/GEMALTO_CINTERION_CellularStack.cpp | 9 +++++++--
9+
1 file changed, 7 insertions(+), 2 deletions(-)
10+
11+
diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp
12+
index 9a3f22dc3c..a96cb2b360 100644
13+
--- a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp
14+
+++ b/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp
15+
@@ -527,8 +527,13 @@ sisw_retry:
16+
return (_at.get_last_error() == NSAPI_ERROR_OK) ? accept_len : NSAPI_ERROR_DEVICE_ERROR;
17+
}
18+
19+
-#define DISABLE_URCs _at.at_cmd_discard("^SCFG", "=", "%s%s","Tcp/WithURCs","off")
20+
-#define RESTORE_URCs_AND_RETURN(ret) do { _at.at_cmd_discard("^SCFG", "=", "%s%s","Tcp/WithURCs","on"); return ret; } while(0)
21+
+#if defined GEMALTO_CINTERION_DISABLE_URC_READING
22+
+ #define DISABLE_URCs _at.at_cmd_discard("^SCFG", "=", "%s%s","Tcp/WithURCs","off")
23+
+ #define RESTORE_URCs_AND_RETURN(ret) do { _at.at_cmd_discard("^SCFG", "=", "%s%s","Tcp/WithURCs","on"); return ret; } while(0)
24+
+#else
25+
+ #define DISABLE_URCs
26+
+ #define RESTORE_URCs_AND_RETURN(ret) do { return ret; } while(0)
27+
+#endif
28+
29+
nsapi_size_or_error_t GEMALTO_CINTERION_CellularStack::socket_recvfrom_impl(CellularSocket *socket, SocketAddress *address,
30+
void *buffer, nsapi_size_t size)
31+
--
32+
2.45.2
33+

0 commit comments

Comments
 (0)