Skip to content

Commit b319be1

Browse files
author
Kimmo Vaisanen
committed
Offloaded TLSSocket for BG96
Some external modems have an internal TLSSocket implementation which can be used instead of mbedtls based TLSSocket. Using offloaded TLSSocket can result in significantly reduced ROM usage. Offloaded TLSSocket can be enabled by enabling "nsapi.offload-tlssocket" and the used network stack (e.g. cellular modem's CellularStack class) must support the setsockopt's defined in nsapi_types.h. Compared to original mbedtls based TLSSocket, offloaded TLSSocket brings in one significant API limitation. Offloaded TLSSocket requires setting of certificates and keys after open() and before connect() calls, where mbedtls based TLSSocket allows setting these before open() call.
1 parent d91ed5f commit b319be1

File tree

7 files changed

+410
-38
lines changed

7 files changed

+410
-38
lines changed

features/cellular/framework/AT/AT_CellularStack.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class AT_CellularStack : public NetworkStack, public AT_CellularBase {
102102
started(false),
103103
tx_ready(false),
104104
rx_avail(false),
105+
tls_socket(false),
105106
pending_bytes(0)
106107
{
107108
}
@@ -119,6 +120,7 @@ class AT_CellularStack : public NetworkStack, public AT_CellularBase {
119120
bool started; // socket has been opened on modem stack
120121
bool tx_ready; // socket is ready for sending on modem stack
121122
bool rx_avail; // socket has data for reading on modem stack
123+
bool tls_socket; // socket uses modem's internal TLS socket functionality
122124
nsapi_size_t pending_bytes; // The number of received bytes pending
123125
};
124126

0 commit comments

Comments
 (0)