From 6d0b2fae9b2a3c0c0b5a8db2afba73f06867ec58 Mon Sep 17 00:00:00 2001 From: Antti Kauppila Date: Mon, 16 Dec 2019 12:56:55 +0200 Subject: [PATCH] Moved CP Max recv len into mbed_lib.json According to [3GPP-TS_24.008] the maximum size for Non-IP link MTU is 1358 octets to prevent fragmentation in the backbone network. Therefore reduced the maximum size to follow the standard. --- features/cellular/framework/AT/AT_ControlPlane_netif.h | 2 +- features/cellular/mbed_lib.json | 4 ++++ features/netsocket/cellular/ControlPlane_netif.h | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/features/cellular/framework/AT/AT_ControlPlane_netif.h b/features/cellular/framework/AT/AT_ControlPlane_netif.h index eaf0eb30fd..a502ded282 100644 --- a/features/cellular/framework/AT/AT_ControlPlane_netif.h +++ b/features/cellular/framework/AT/AT_ControlPlane_netif.h @@ -32,7 +32,7 @@ protected: private: void (*_cb)(void *); void *_data; - char _recv_buffer[MAX_CP_DATA_RECV_LEN]; + char _recv_buffer[MBED_CONF_CELLULAR_MAX_CP_DATA_RECV_LEN]; size_t _recv_len; // Called on receiving URC: +CRTDCP void urc_cp_recv(); diff --git a/features/cellular/mbed_lib.json b/features/cellular/mbed_lib.json index 265c151f78..9e65318953 100644 --- a/features/cellular/mbed_lib.json +++ b/features/cellular/mbed_lib.json @@ -32,6 +32,10 @@ "clear-on-connect" : { "help": "Clear modem to a known default state on connect() before SIM pin is entered, null to disable", "value": null + }, + "max-cp-data-recv-len" : { + "help": "Max length of the buffer storing data received over control plane", + "value": 1358 } } } diff --git a/features/netsocket/cellular/ControlPlane_netif.h b/features/netsocket/cellular/ControlPlane_netif.h index 97e3e903d3..90082d63b9 100644 --- a/features/netsocket/cellular/ControlPlane_netif.h +++ b/features/netsocket/cellular/ControlPlane_netif.h @@ -27,9 +27,10 @@ namespace mbed { /* Length of the buffer storing data received over control plane */ -#define MAX_CP_DATA_RECV_LEN 2048 +#ifndef MBED_CONF_CELLULAR_MAX_CP_DATA_RECV_LEN +#define MBED_CONF_CELLULAR_MAX_CP_DATA_RECV_LEN 1358 +#endif -// TODO: need to make this l3ip compatible /** * @addtogroup cellular