From 337b811ba140cb28fa0006b1a1bd90d985a6f299 Mon Sep 17 00:00:00 2001 From: merge Date: Wed, 20 Apr 2022 14:21:31 +0200 Subject: [PATCH 1/3] add the possibility to customize the delimiter of the ATHandler in ATCellularDevice class --- .../include/cellular/framework/AT/AT_CellularDevice.h | 2 +- .../cellular/source/framework/AT/AT_CellularDevice.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h b/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h index 20fe6c139e..631c0043d8 100755 --- a/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h +++ b/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h @@ -67,7 +67,7 @@ public: }; public: - AT_CellularDevice(FileHandle *fh); + AT_CellularDevice(FileHandle *fh, char* delim = "\r"); virtual ~AT_CellularDevice(); virtual nsapi_error_t clear(); diff --git a/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp b/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp index 83ab47a3c4..cad8c575d1 100644 --- a/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp +++ b/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp @@ -39,9 +39,9 @@ using namespace std::chrono_literals; #define DEFAULT_AT_TIMEOUT 1s // at default timeout const int MAX_SIM_RESPONSE_LENGTH = 16; -AT_CellularDevice::AT_CellularDevice(FileHandle *fh) : +AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char* delim): CellularDevice(), - _at(fh, _queue, DEFAULT_AT_TIMEOUT, "\r"), + _at(fh, _queue, DEFAULT_AT_TIMEOUT, delim), #if MBED_CONF_CELLULAR_USE_SMS _sms(0), #endif // MBED_CONF_CELLULAR_USE_SMS From d720db5bc8f698c4ee1b8c5b8816db01ab19a614 Mon Sep 17 00:00:00 2001 From: tobi15 Date: Thu, 21 Apr 2022 17:29:10 +0200 Subject: [PATCH 2/3] modify AT_CellularDevice_stub to pass test with the new feature --- .../tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp b/connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp index f65362bcde..9a339bb945 100644 --- a/connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp +++ b/connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp @@ -33,9 +33,9 @@ bool AT_CellularDevice_stub::pin_needed = false; bool AT_CellularDevice_stub::supported_bool = false; int AT_CellularDevice_stub::max_sock_value = 1; -AT_CellularDevice::AT_CellularDevice(FileHandle *fh) : +AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char* delim) : CellularDevice(), - _at(fh, _queue, get_property(AT_CellularDevice::PROPERTY_AT_SEND_DELAY), "\r"), + _at(fh, _queue, get_property(AT_CellularDevice::PROPERTY_AT_SEND_DELAY), delim), #if MBED_CONF_CELLULAR_USE_SMS _sms(0), #endif // MBED_CONF_CELLULAR_USE_SMS From 73f2dd63793044f4b6cbb8ec0fc1b96d54fd5795 Mon Sep 17 00:00:00 2001 From: tobi15 Date: Tue, 10 May 2022 14:27:54 +0200 Subject: [PATCH 3/3] modify method signatures to pass astyle tests --- .../cellular/include/cellular/framework/AT/AT_CellularDevice.h | 2 +- connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp | 2 +- .../cellular/tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h b/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h index 631c0043d8..07a5f90dad 100755 --- a/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h +++ b/connectivity/cellular/include/cellular/framework/AT/AT_CellularDevice.h @@ -67,7 +67,7 @@ public: }; public: - AT_CellularDevice(FileHandle *fh, char* delim = "\r"); + AT_CellularDevice(FileHandle *fh, char *delim = "\r"); virtual ~AT_CellularDevice(); virtual nsapi_error_t clear(); diff --git a/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp b/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp index cad8c575d1..e3fd5b551a 100644 --- a/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp +++ b/connectivity/cellular/source/framework/AT/AT_CellularDevice.cpp @@ -39,7 +39,7 @@ using namespace std::chrono_literals; #define DEFAULT_AT_TIMEOUT 1s // at default timeout const int MAX_SIM_RESPONSE_LENGTH = 16; -AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char* delim): +AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char *delim): CellularDevice(), _at(fh, _queue, DEFAULT_AT_TIMEOUT, delim), #if MBED_CONF_CELLULAR_USE_SMS diff --git a/connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp b/connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp index 9a339bb945..300962bd7a 100644 --- a/connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp +++ b/connectivity/cellular/tests/UNITTESTS/doubles/AT_CellularDevice_stub.cpp @@ -33,7 +33,7 @@ bool AT_CellularDevice_stub::pin_needed = false; bool AT_CellularDevice_stub::supported_bool = false; int AT_CellularDevice_stub::max_sock_value = 1; -AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char* delim) : +AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char *delim) : CellularDevice(), _at(fh, _queue, get_property(AT_CellularDevice::PROPERTY_AT_SEND_DELAY), delim), #if MBED_CONF_CELLULAR_USE_SMS