From 9e11e5b43dcfc4463cab82fd2ee1551727dc5067 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Wed, 8 Jan 2020 09:56:19 +0000 Subject: [PATCH] Cellular: Replace UARTSerial references with BufferedSerial `BufferedSerial` is `UARTSerial` renamed to convey the original purpose of the class. It is the recommended buffered I/O serial class. --- .../at_cellularcontexttest.cpp | 2 +- .../AT/at_cellularcontext/unittest.cmake | 2 +- .../AT/at_cellulardevice/unittest.cmake | 2 +- .../framework/device/athandler/unittest.cmake | 2 +- .../cellularcontext/cellularcontexttest.cpp | 2 +- .../device/cellularcontext/unittest.cmake | 2 +- .../device/cellulardevice/unittest.cmake | 2 +- .../cellularstatemachine/unittest.cmake | 2 +- UNITTESTS/stubs/AT_CellularContext_stub.cpp | 2 +- UNITTESTS/stubs/AT_CellularDevice_stub.cpp | 2 +- UNITTESTS/stubs/BufferedSerial_stub.cpp | 132 +++++++++++++++++ UNITTESTS/stubs/UARTSerial_stub.cpp | 140 ------------------ UNITTESTS/target_h/myCellularContext.h | 2 +- UNITTESTS/target_h/myCellularDevice.h | 4 +- features/cellular/framework/API/ATHandler.h | 4 +- .../cellular/framework/API/CellularContext.h | 4 +- .../cellular/framework/API/CellularDevice.h | 8 +- .../framework/AT/AT_CellularContext.cpp | 6 +- .../framework/AT/AT_CellularContext.h | 2 +- .../framework/AT/AT_CellularDevice.cpp | 4 +- .../cellular/framework/AT/AT_CellularDevice.h | 2 +- .../cellular/framework/device/ATHandler.cpp | 2 +- .../framework/device/CellularContext.cpp | 4 +- .../GEMALTO/CINTERION/GEMALTO_CINTERION.cpp | 4 +- .../GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.cpp | 4 +- .../MultiTech/DragonflyNano/PPP/SARA4_PPP.cpp | 4 +- .../targets/QUECTEL/BC95/QUECTEL_BC95.cpp | 4 +- .../targets/QUECTEL/BG96/QUECTEL_BG96.cpp | 4 +- .../targets/QUECTEL/EC2X/QUECTEL_EC2X.cpp | 8 +- .../targets/QUECTEL/M26/QUECTEL_M26.cpp | 4 +- .../targets/QUECTEL/UG96/QUECTEL_UG96.cpp | 4 +- .../targets/RiotMicro/AT/RM1000_AT.cpp | 4 +- .../RiotMicro/AT/RM1000_AT_CellularStack.cpp | 2 +- .../targets/TELIT/HE910/TELIT_HE910.cpp | 4 +- .../targets/TELIT/ME910/TELIT_ME910.cpp | 4 +- .../framework/targets/UBLOX/AT/UBLOX_AT.cpp | 4 +- .../UBLOX/AT/UBLOX_AT_CellularStack.cpp | 4 +- .../targets/UBLOX/N2XX/UBLOX_N2XX.cpp | 4 +- .../UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp | 2 +- .../framework/targets/UBLOX/PPP/UBLOX_PPP.cpp | 4 +- 40 files changed, 197 insertions(+), 205 deletions(-) create mode 100644 UNITTESTS/stubs/BufferedSerial_stub.cpp delete mode 100644 UNITTESTS/stubs/UARTSerial_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/at_cellularcontexttest.cpp b/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/at_cellularcontexttest.cpp index 18f682c3d9..39bc4ae69a 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/at_cellularcontexttest.cpp +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/at_cellularcontexttest.cpp @@ -531,7 +531,7 @@ TEST_F(TestAT_CellularContext, set_file_handle) AT_CellularContext ctx(at, &dev); ctx.set_file_handle(&fh1); - UARTSerial ss(NC, NC); + BufferedSerial ss(NC, NC); ctx.set_file_handle(&ss, PTC0, true); ctx.enable_hup(true); diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake index f1c13669c9..69278eb97a 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake @@ -37,7 +37,7 @@ set(unittest-test-sources stubs/randLIB_stub.cpp stubs/Semaphore_stub.cpp stubs/us_ticker_stub.cpp - stubs/UARTSerial_stub.cpp + stubs/BufferedSerial_stub.cpp stubs/SerialBase_stub.cpp stubs/CellularContext_stub.cpp stubs/CellularUtil_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake b/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake index ecd7ebab06..c345cba67d 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake @@ -38,7 +38,7 @@ set(unittest-test-sources stubs/NetworkStack_stub.cpp stubs/AT_CellularContext_stub.cpp stubs/Semaphore_stub.cpp - stubs/UARTSerial_stub.cpp + stubs/BufferedSerial_stub.cpp stubs/SerialBase_stub.cpp stubs/CellularStateMachine_stub.cpp stubs/CellularContext_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/device/athandler/unittest.cmake b/UNITTESTS/features/cellular/framework/device/athandler/unittest.cmake index e2ba644254..060b14a1db 100644 --- a/UNITTESTS/features/cellular/framework/device/athandler/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/athandler/unittest.cmake @@ -24,7 +24,7 @@ set(unittest-test-sources stubs/EventQueue_stub.cpp stubs/FileHandle_stub.cpp stubs/us_ticker_stub.cpp - stubs/UARTSerial_stub.cpp + stubs/BufferedSerial_stub.cpp stubs/SerialBase_stub.cpp stubs/mbed_assert_stub.cpp stubs/mbed_poll_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/device/cellularcontext/cellularcontexttest.cpp b/UNITTESTS/features/cellular/framework/device/cellularcontext/cellularcontexttest.cpp index 3e6b889ed5..7ede92ca4c 100644 --- a/UNITTESTS/features/cellular/framework/device/cellularcontext/cellularcontexttest.cpp +++ b/UNITTESTS/features/cellular/framework/device/cellularcontext/cellularcontexttest.cpp @@ -165,7 +165,7 @@ public: } #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) - virtual void set_file_handle(UARTSerial *serial, PinName dcd_pin = NC, bool active_high = false) + virtual void set_file_handle(BufferedSerial *serial, PinName dcd_pin = NC, bool active_high = false) { } diff --git a/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake b/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake index 3f2452493b..9cccec2399 100644 --- a/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/cellularcontext/unittest.cmake @@ -29,7 +29,7 @@ set(unittest-test-sources stubs/CellularStateMachine_stub.cpp stubs/EventQueue_stub.cpp stubs/mbed_assert_stub.cpp - stubs/UARTSerial_stub.cpp + stubs/BufferedSerial_stub.cpp stubs/SerialBase_stub.cpp stubs/ATHandler_stub.cpp stubs/AT_CellularNetwork_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake b/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake index fcd1611e5c..96c0f1daac 100644 --- a/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/cellulardevice/unittest.cmake @@ -23,7 +23,7 @@ set(unittest-test-sources stubs/CellularStateMachine_stub.cpp stubs/EventQueue_stub.cpp stubs/mbed_assert_stub.cpp - stubs/UARTSerial_stub.cpp + stubs/BufferedSerial_stub.cpp stubs/SerialBase_stub.cpp stubs/ATHandler_stub.cpp stubs/AT_CellularNetwork_stub.cpp diff --git a/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake b/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake index dfaa51b608..95dbc7e503 100644 --- a/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake +++ b/UNITTESTS/features/cellular/framework/device/cellularstatemachine/unittest.cmake @@ -23,7 +23,7 @@ set(unittest-test-sources stubs/CellularDevice_stub.cpp stubs/EventQueue_stub.cpp stubs/mbed_assert_stub.cpp - stubs/UARTSerial_stub.cpp + stubs/BufferedSerial_stub.cpp stubs/SerialBase_stub.cpp stubs/ATHandler_stub.cpp stubs/AT_CellularNetwork_stub.cpp diff --git a/UNITTESTS/stubs/AT_CellularContext_stub.cpp b/UNITTESTS/stubs/AT_CellularContext_stub.cpp index 3e7d023ae3..abe5a14c52 100644 --- a/UNITTESTS/stubs/AT_CellularContext_stub.cpp +++ b/UNITTESTS/stubs/AT_CellularContext_stub.cpp @@ -51,7 +51,7 @@ AT_CellularContext::~AT_CellularContext() { } -void AT_CellularContext::set_file_handle(UARTSerial *serial, PinName dcd_pin, bool active_high) +void AT_CellularContext::set_file_handle(BufferedSerial *serial, PinName dcd_pin, bool active_high) { } diff --git a/UNITTESTS/stubs/AT_CellularDevice_stub.cpp b/UNITTESTS/stubs/AT_CellularDevice_stub.cpp index 7a6d45e2da..c3996c2bf1 100644 --- a/UNITTESTS/stubs/AT_CellularDevice_stub.cpp +++ b/UNITTESTS/stubs/AT_CellularDevice_stub.cpp @@ -65,7 +65,7 @@ nsapi_error_t AT_CellularDevice::release_at_handler(ATHandler *at_handler) } } -CellularContext *AT_CellularDevice::create_context(UARTSerial *serial, const char *const apn, PinName dcd_pin, +CellularContext *AT_CellularDevice::create_context(BufferedSerial *serial, const char *const apn, PinName dcd_pin, bool active_high, bool cp_req, bool nonip_req) { } diff --git a/UNITTESTS/stubs/BufferedSerial_stub.cpp b/UNITTESTS/stubs/BufferedSerial_stub.cpp new file mode 100644 index 0000000000..e67c84bfda --- /dev/null +++ b/UNITTESTS/stubs/BufferedSerial_stub.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018, Arm Limited and affiliates. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "drivers/BufferedSerial.h" + +namespace mbed { + + +BufferedSerial::BufferedSerial(PinName tx, PinName rx, int baud) : SerialBase(tx, rx, baud) +{ +} + +BufferedSerial::~BufferedSerial() +{ +} + +ssize_t BufferedSerial::read(void *buffer, size_t length) +{ + return 0; +} + +ssize_t BufferedSerial::write(const void *buffer, size_t length) +{ + return 0; +} + +off_t BufferedSerial::seek(off_t offset, int whence) +{ + return -ESPIPE; +} + +int BufferedSerial::close() +{ + return 0; +} + +void BufferedSerial::dcd_irq() +{ +} + +void BufferedSerial::set_baud(int baud) +{ +} + +void BufferedSerial::set_data_carrier_detect(PinName dcd_pin, bool active_high) +{ +} + +void BufferedSerial::set_format(int bits, Parity parity, int stop_bits) +{ +} + +int BufferedSerial::isatty() +{ + return 1; +} + +int BufferedSerial::sync() +{ + return 0; +} + +void BufferedSerial::sigio(Callback func) +{ +} + +ssize_t BufferedSerial::write_unbuffered(const char *buf_ptr, size_t length) +{ + return 0; +} + +bool BufferedSerial::hup() const +{ +} + +void BufferedSerial::wake() +{ +} + +short BufferedSerial::poll(short events) const +{ + return 0; +} + +void BufferedSerial::api_lock(void) +{ +} + +void BufferedSerial::api_unlock(void) +{ +} + +void BufferedSerial::rx_irq(void) +{ +} + +void BufferedSerial::tx_irq(void) +{ +} + +int BufferedSerial::enable_input(bool enabled) +{ + return 0; +} + +int BufferedSerial::enable_output(bool enabled) +{ + return 0; +} + +#if DEVICE_SERIAL_FC +void BufferedSerial::set_flow_control(mbed::SerialBase::Flow, PinName, PinName) +{ + +} +#endif + +} diff --git a/UNITTESTS/stubs/UARTSerial_stub.cpp b/UNITTESTS/stubs/UARTSerial_stub.cpp deleted file mode 100644 index 1d5087bb9f..0000000000 --- a/UNITTESTS/stubs/UARTSerial_stub.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UARTSerial.h" - -namespace mbed { - - -UARTSerial::UARTSerial(PinName tx, PinName rx, int baud) : SerialBase(tx, rx, baud) -{ -} - -UARTSerial::~UARTSerial() -{ -} - -ssize_t UARTSerial::read(void *buffer, size_t length) -{ - return 0; -} - -ssize_t UARTSerial::write(const void *buffer, size_t length) -{ - return 0; -} - -off_t UARTSerial::seek(off_t offset, int whence) -{ - return -ESPIPE; -} - -int UARTSerial::close() -{ - return 0; -} - -void UARTSerial::dcd_irq() -{ -} - -void UARTSerial::set_baud(int baud) -{ -} - -void UARTSerial::set_data_carrier_detect(PinName dcd_pin, bool active_high) -{ -} - -void UARTSerial::set_format(int bits, Parity parity, int stop_bits) -{ -} - -int UARTSerial::isatty() -{ - return 1; -} - -int UARTSerial::sync() -{ - return 0; -} - -void UARTSerial::sigio(Callback func) -{ -} - -ssize_t UARTSerial::write_unbuffered(const char *buf_ptr, size_t length) -{ - return 0; -} - -bool UARTSerial::hup() const -{ -} - -void UARTSerial::wake() -{ -} - -short UARTSerial::poll(short events) const -{ - return 0; -} - -void UARTSerial::lock() -{ -} - -void UARTSerial::unlock() -{ -} - -void UARTSerial::api_lock(void) -{ -} - -void UARTSerial::api_unlock(void) -{ -} - -void UARTSerial::rx_irq(void) -{ -} - -void UARTSerial::tx_irq(void) -{ -} - -int UARTSerial::enable_input(bool enabled) -{ - return 0; -} - -int UARTSerial::enable_output(bool enabled) -{ - return 0; -} - -#if DEVICE_SERIAL_FC -void UARTSerial::set_flow_control(mbed::SerialBase::Flow, PinName, PinName) -{ - -} -#endif - -} diff --git a/UNITTESTS/target_h/myCellularContext.h b/UNITTESTS/target_h/myCellularContext.h index 135a0f4511..eedba40982 100644 --- a/UNITTESTS/target_h/myCellularContext.h +++ b/UNITTESTS/target_h/myCellularContext.h @@ -39,7 +39,7 @@ public: } } - void set_file_handle(UARTSerial *serial, PinName dcd_pin, bool active_high) + void set_file_handle(BufferedSerial *serial, PinName dcd_pin, bool active_high) { }; diff --git a/UNITTESTS/target_h/myCellularDevice.h b/UNITTESTS/target_h/myCellularDevice.h index 1078404bc4..85c7f84beb 100644 --- a/UNITTESTS/target_h/myCellularDevice.h +++ b/UNITTESTS/target_h/myCellularDevice.h @@ -23,7 +23,7 @@ #include "ATHandler_stub.h" #include "AT_CellularContext.h" #include "gtest/gtest.h" -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" using namespace events; @@ -53,7 +53,7 @@ public: return NSAPI_ERROR_OK; } - virtual CellularContext *create_context(UARTSerial *serial, const char *const apn, PinName dcd_pin, + virtual CellularContext *create_context(BufferedSerial *serial, const char *const apn, PinName dcd_pin, bool active_high, bool cp_req = false, bool nonip_req = false) { if (_context_list) { diff --git a/features/cellular/framework/API/ATHandler.h b/features/cellular/framework/API/ATHandler.h index 1d54f226f1..5fdf023e7a 100644 --- a/features/cellular/framework/API/ATHandler.h +++ b/features/cellular/framework/API/ATHandler.h @@ -27,7 +27,7 @@ #include -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" /** * If application calls associated FileHandle only from single thread context @@ -204,7 +204,7 @@ public: */ void set_send_delay(uint16_t send_delay); - /** Sets UARTSerial filehandle to given baud rate + /** Sets BufferedSerial filehandle to given baud rate * * @param baud_rate */ diff --git a/features/cellular/framework/API/CellularContext.h b/features/cellular/framework/API/CellularContext.h index 6aed7f937c..ad28d00eb8 100644 --- a/features/cellular/framework/API/CellularContext.h +++ b/features/cellular/framework/API/CellularContext.h @@ -271,11 +271,11 @@ public: // from NetworkInterface /** Set the UART serial used to communicate with the modem. Can be used to change default file handle. * File handle set with this method will use data carrier detect to be able to detect disconnection much faster in PPP mode. * - * @param serial UARTSerial used in communication to modem. If null then the default file handle is used. + * @param serial BufferedSerial used in communication to modem. If null then the default file handle is used. * @param dcd_pin Pin used to set data carrier detect on/off for the given UART * @param active_high a boolean set to true if DCD polarity is active low */ - virtual void set_file_handle(UARTSerial *serial, PinName dcd_pin = NC, bool active_high = false) = 0; + virtual void set_file_handle(BufferedSerial *serial, PinName dcd_pin = NC, bool active_high = false) = 0; #endif // #if DEVICE_SERIAL /** Returns the control plane AT command interface diff --git a/features/cellular/framework/API/CellularDevice.h b/features/cellular/framework/API/CellularDevice.h index a67cc42ac7..bbeb0ef5f8 100644 --- a/features/cellular/framework/API/CellularDevice.h +++ b/features/cellular/framework/API/CellularDevice.h @@ -23,7 +23,7 @@ #include "ATHandler.h" #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" #endif // #if DEVICE_SERIAL #ifdef MBED_CONF_RTOS_PRESENT @@ -237,9 +237,9 @@ public: //Pure virtual functions #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) /** Creates a new CellularContext interface. This API should be used if serial is UART and PPP mode used. * CellularContext created will use data carrier detect to be able to detect disconnection much faster in PPP mode. - * UARTSerial usually is the same which was given for the CellularDevice. + * BufferedSerial usually is the same which was given for the CellularDevice. * - * @param serial UARTSerial used in communication to modem. If null then the default file handle is used. + * @param serial BufferedSerial used in communication to modem. If null then the default file handle is used. * @param apn access point to use with context, can be null. * @param dcd_pin Pin used to set data carrier detect on/off for the given UART * @param active_high a boolean set to true if DCD polarity is active low @@ -249,7 +249,7 @@ public: //Pure virtual functions * @return new instance of class CellularContext or NULL in case of failure * */ - virtual CellularContext *create_context(UARTSerial *serial, const char *apn, PinName dcd_pin = NC, + virtual CellularContext *create_context(BufferedSerial *serial, const char *apn, PinName dcd_pin = NC, bool active_high = false, bool cp_req = false, bool nonip_req = false) = 0; #endif // #if DEVICE_SERIAL diff --git a/features/cellular/framework/AT/AT_CellularContext.cpp b/features/cellular/framework/AT/AT_CellularContext.cpp index 45e72bd4a5..fdb555062e 100644 --- a/features/cellular/framework/AT/AT_CellularContext.cpp +++ b/features/cellular/framework/AT/AT_CellularContext.cpp @@ -23,7 +23,7 @@ #include "AT_CellularDevice.h" #include "CellularLog.h" #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" #endif // #if DEVICE_SERIAL #include "ThisThread.h" @@ -79,7 +79,7 @@ void AT_CellularContext::set_file_handle(FileHandle *fh) } #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) -void AT_CellularContext::set_file_handle(UARTSerial *serial, PinName dcd_pin, bool active_high) +void AT_CellularContext::set_file_handle(BufferedSerial *serial, PinName dcd_pin, bool active_high) { tr_info("CellularContext serial %p", serial); _dcd_pin = dcd_pin; @@ -94,7 +94,7 @@ void AT_CellularContext::enable_hup(bool enable) { if (_dcd_pin != NC) { #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) - static_cast(_fh)->set_data_carrier_detect(enable ? _dcd_pin : NC, _active_high); + static_cast(_fh)->set_data_carrier_detect(enable ? _dcd_pin : NC, _active_high); #endif // #if DEVICE_SERIAL } } diff --git a/features/cellular/framework/AT/AT_CellularContext.h b/features/cellular/framework/AT/AT_CellularContext.h index ac131bdf24..d3ccac843c 100644 --- a/features/cellular/framework/AT/AT_CellularContext.h +++ b/features/cellular/framework/AT/AT_CellularContext.h @@ -64,7 +64,7 @@ public: virtual nsapi_error_t attach_to_network(); virtual void set_file_handle(FileHandle *fh); #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) - virtual void set_file_handle(UARTSerial *serial, PinName dcd_pin = NC, bool active_high = false); + virtual void set_file_handle(BufferedSerial *serial, PinName dcd_pin = NC, bool active_high = false); #endif // #if DEVICE_SERIAL virtual void enable_hup(bool enable); diff --git a/features/cellular/framework/AT/AT_CellularDevice.cpp b/features/cellular/framework/AT/AT_CellularDevice.cpp index 2aed8c7042..9213feb392 100644 --- a/features/cellular/framework/AT/AT_CellularDevice.cpp +++ b/features/cellular/framework/AT/AT_CellularDevice.cpp @@ -26,7 +26,7 @@ #include "CellularLog.h" #include "ATHandler.h" #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" #endif // #if DEVICE_SERIAL #include "FileHandle.h" #include @@ -286,7 +286,7 @@ CellularContext *AT_CellularDevice::get_context_list() const } #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) -CellularContext *AT_CellularDevice::create_context(UARTSerial *serial, const char *const apn, PinName dcd_pin, +CellularContext *AT_CellularDevice::create_context(BufferedSerial *serial, const char *const apn, PinName dcd_pin, bool active_high, bool cp_req, bool nonip_req) { // Call FileHandle base version - explict upcast to avoid recursing into ourselves diff --git a/features/cellular/framework/AT/AT_CellularDevice.h b/features/cellular/framework/AT/AT_CellularDevice.h index 2e165e7252..ef14aa06c7 100755 --- a/features/cellular/framework/AT/AT_CellularDevice.h +++ b/features/cellular/framework/AT/AT_CellularDevice.h @@ -83,7 +83,7 @@ public: virtual CellularContext *create_context(FileHandle *fh = NULL, const char *apn = NULL, bool cp_req = false, bool nonip_req = false); #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) - virtual CellularContext *create_context(UARTSerial *serial, const char *const apn, PinName dcd_pin = NC, bool active_high = false, bool cp_req = false, bool nonip_req = false); + virtual CellularContext *create_context(BufferedSerial *serial, const char *const apn, PinName dcd_pin = NC, bool active_high = false, bool cp_req = false, bool nonip_req = false); #endif // #if DEVICE_SERIAL virtual void delete_context(CellularContext *context); diff --git a/features/cellular/framework/device/ATHandler.cpp b/features/cellular/framework/device/ATHandler.cpp index c24eb9152a..5b5442f45a 100644 --- a/features/cellular/framework/device/ATHandler.cpp +++ b/features/cellular/framework/device/ATHandler.cpp @@ -1657,6 +1657,6 @@ void ATHandler::write_hex_string(const char *str, size_t size) void ATHandler::set_baud(int baud_rate) { - static_cast(_fileHandle)->set_baud(baud_rate); + static_cast(_fileHandle)->set_baud(baud_rate); } diff --git a/features/cellular/framework/device/CellularContext.cpp b/features/cellular/framework/device/CellularContext.cpp index 35c174b0b1..54e9573477 100644 --- a/features/cellular/framework/device/CellularContext.cpp +++ b/features/cellular/framework/device/CellularContext.cpp @@ -35,7 +35,7 @@ MBED_WEAK CellularContext *CellularContext::get_default_instance() static CellularContext *context = dev->create_context(NULL, NULL, MBED_CONF_CELLULAR_CONTROL_PLANE_OPT); #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) #if defined(MDMDCD) && defined(MDM_PIN_POLARITY) - context->set_file_handle(static_cast(&dev->get_file_handle()), MDMDCD, MDM_PIN_POLARITY); + context->set_file_handle(static_cast(&dev->get_file_handle()), MDMDCD, MDM_PIN_POLARITY); #endif // #if defined(MDMDCD) && defined(MDM_PIN_POLARITY) #endif // #if DEVICE_SERIAL return context; @@ -52,7 +52,7 @@ MBED_WEAK CellularContext *CellularContext::get_default_nonip_instance() static CellularContext *context = dev->create_context(NULL, NULL, MBED_CONF_CELLULAR_CONTROL_PLANE_OPT, true); #if (DEVICE_SERIAL && DEVICE_INTERRUPTIN) || defined(DOXYGEN_ONLY) #if defined(MDMDCD) && defined(MDM_PIN_POLARITY) - context->set_file_handle(static_cast(&dev->get_file_handle()), MDMDCD, MDM_PIN_POLARITY); + context->set_file_handle(static_cast(&dev->get_file_handle()), MDMDCD, MDM_PIN_POLARITY); #endif // #if defined(MDMDCD) && defined(MDM_PIN_POLARITY) #endif // #if DEVICE_SERIAL return context; diff --git a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp index 3a0e4f5577..b2d174f17f 100644 --- a/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp +++ b/features/cellular/framework/targets/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp @@ -194,10 +194,10 @@ void GEMALTO_CINTERION::init_module_ehs5e() } #if MBED_CONF_GEMALTO_CINTERION_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_GEMALTO_CINTERION_TX, MBED_CONF_GEMALTO_CINTERION_RX, MBED_CONF_GEMALTO_CINTERION_BAUDRATE); + static BufferedSerial serial(MBED_CONF_GEMALTO_CINTERION_TX, MBED_CONF_GEMALTO_CINTERION_RX, MBED_CONF_GEMALTO_CINTERION_BAUDRATE); #if defined(MBED_CONF_GEMALTO_CINTERION_RTS) && defined(MBED_CONF_GEMALTO_CINTERION_CTS) tr_debug("GEMALTO_CINTERION flow control: RTS %d CTS %d", MBED_CONF_GEMALTO_CINTERION_RTS, MBED_CONF_GEMALTO_CINTERION_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_GEMALTO_CINTERION_RTS, MBED_CONF_GEMALTO_CINTERION_CTS); diff --git a/features/cellular/framework/targets/GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.cpp b/features/cellular/framework/targets/GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.cpp index cacfac6b87..a08bc018c2 100644 --- a/features/cellular/framework/targets/GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.cpp +++ b/features/cellular/framework/targets/GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.cpp @@ -46,10 +46,10 @@ GENERIC_AT3GPP::GENERIC_AT3GPP(FileHandle *fh) : AT_CellularDevice(fh) } #if MBED_CONF_GENERIC_AT3GPP_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_GENERIC_AT3GPP_TX, MBED_CONF_GENERIC_AT3GPP_RX, MBED_CONF_GENERIC_AT3GPP_BAUDRATE); + static BufferedSerial serial(MBED_CONF_GENERIC_AT3GPP_TX, MBED_CONF_GENERIC_AT3GPP_RX, MBED_CONF_GENERIC_AT3GPP_BAUDRATE); #if defined (MBED_CONF_GENERIC_AT3GPP_RTS) && defined(MBED_CONF_GENERIC_AT3GPP_CTS) tr_debug("GENERIC_AT3GPP flow control: RTS %d CTS %d", MBED_CONF_GENERIC_AT3GPP_RTS, MBED_CONF_GENERIC_AT3GPP_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_GENERIC_AT3GPP_RTS, MBED_CONF_GENERIC_AT3GPP_CTS); diff --git a/features/cellular/framework/targets/MultiTech/DragonflyNano/PPP/SARA4_PPP.cpp b/features/cellular/framework/targets/MultiTech/DragonflyNano/PPP/SARA4_PPP.cpp index a3e094b0ec..0fd33d4c91 100644 --- a/features/cellular/framework/targets/MultiTech/DragonflyNano/PPP/SARA4_PPP.cpp +++ b/features/cellular/framework/targets/MultiTech/DragonflyNano/PPP/SARA4_PPP.cpp @@ -51,10 +51,10 @@ AT_CellularNetwork *SARA4_PPP::open_network_impl(ATHandler &at) } #if MBED_CONF_SARA4_PPP_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_SARA4_PPP_TX, MBED_CONF_SARA4_PPP_RX, MBED_CONF_SARA4_PPP_BAUDRATE); + static BufferedSerial serial(MBED_CONF_SARA4_PPP_TX, MBED_CONF_SARA4_PPP_RX, MBED_CONF_SARA4_PPP_BAUDRATE); #if defined (MBED_CONF_SARA4_PPP_RTS) && defined (MBED_CONF_SARA4_PPP_CTS) tr_debug("SARA4_PPP flow control: RTS %d CTS %d", MBED_CONF_SARA4_PPP_RTS, MBED_CONF_SARA4_PPP_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_SARA4_PPP_RTS, MBED_CONF_SARA4_PPP_CTS); diff --git a/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95.cpp b/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95.cpp index 99da14386d..c41ed7afe7 100644 --- a/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95.cpp +++ b/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95.cpp @@ -109,10 +109,10 @@ nsapi_error_t QUECTEL_BC95::set_baud_rate_impl(int baud_rate) } #if MBED_CONF_QUECTEL_BC95_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_QUECTEL_BC95_TX, MBED_CONF_QUECTEL_BC95_RX, MBED_CONF_QUECTEL_BC95_BAUDRATE); + static BufferedSerial serial(MBED_CONF_QUECTEL_BC95_TX, MBED_CONF_QUECTEL_BC95_RX, MBED_CONF_QUECTEL_BC95_BAUDRATE); #if defined(MBED_CONF_QUECTEL_BC95_RTS) && defined(MBED_CONF_QUECTEL_BC95_CTS) tr_debug("QUECTEL_BC95 flow control: RTS %d CTS %d", MBED_CONF_QUECTEL_BC95_RTS, MBED_CONF_QUECTEL_BC95_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_QUECTEL_BC95_RTS, MBED_CONF_QUECTEL_BC95_CTS); diff --git a/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96.cpp b/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96.cpp index 754a9b03e6..e2d4f2edd1 100644 --- a/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96.cpp +++ b/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96.cpp @@ -137,10 +137,10 @@ nsapi_error_t QUECTEL_BG96::soft_power_off() } #if MBED_CONF_QUECTEL_BG96_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_QUECTEL_BG96_TX, MBED_CONF_QUECTEL_BG96_RX, MBED_CONF_QUECTEL_BG96_BAUDRATE); + static BufferedSerial serial(MBED_CONF_QUECTEL_BG96_TX, MBED_CONF_QUECTEL_BG96_RX, MBED_CONF_QUECTEL_BG96_BAUDRATE); #if defined (MBED_CONF_QUECTEL_BG96_RTS) && defined(MBED_CONF_QUECTEL_BG96_CTS) tr_debug("QUECTEL_BG96 flow control: RTS %d CTS %d", MBED_CONF_QUECTEL_BG96_RTS, MBED_CONF_QUECTEL_BG96_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_QUECTEL_BG96_RTS, MBED_CONF_QUECTEL_BG96_CTS); diff --git a/features/cellular/framework/targets/QUECTEL/EC2X/QUECTEL_EC2X.cpp b/features/cellular/framework/targets/QUECTEL/EC2X/QUECTEL_EC2X.cpp index b33d41fe3d..7c4244a3be 100644 --- a/features/cellular/framework/targets/QUECTEL/EC2X/QUECTEL_EC2X.cpp +++ b/features/cellular/framework/targets/QUECTEL/EC2X/QUECTEL_EC2X.cpp @@ -20,7 +20,7 @@ #include "PinNames.h" #include "AT_CellularNetwork.h" #include "rtos/ThisThread.h" -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" using namespace mbed; using namespace rtos; @@ -77,9 +77,9 @@ QUECTEL_EC2X::QUECTEL_EC2X(FileHandle *fh, PinName pwr, bool active_high, PinNam #if MBED_CONF_QUECTEL_EC2X_PROVIDE_DEFAULT CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_QUECTEL_EC2X_TX, - MBED_CONF_QUECTEL_EC2X_RX, - MBED_CONF_QUECTEL_EC2X_BAUDRATE); + static BufferedSerial serial(MBED_CONF_QUECTEL_EC2X_TX, + MBED_CONF_QUECTEL_EC2X_RX, + MBED_CONF_QUECTEL_EC2X_BAUDRATE); #if defined(MBED_CONF_QUECTEL_EC2X_RTS) && defined(MBED_CONF_QUECTEL_EC2X_CTS) serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_QUECTEL_EC2X_RTS, MBED_CONF_QUECTEL_EC2X_CTS); #endif diff --git a/features/cellular/framework/targets/QUECTEL/M26/QUECTEL_M26.cpp b/features/cellular/framework/targets/QUECTEL/M26/QUECTEL_M26.cpp index 72ae0c7476..00a44e9f5f 100644 --- a/features/cellular/framework/targets/QUECTEL/M26/QUECTEL_M26.cpp +++ b/features/cellular/framework/targets/QUECTEL/M26/QUECTEL_M26.cpp @@ -90,10 +90,10 @@ nsapi_error_t QUECTEL_M26::shutdown() #if MBED_CONF_QUECTEL_M26_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_QUECTEL_M26_TX, MBED_CONF_QUECTEL_M26_RX, MBED_CONF_QUECTEL_M26_BAUDRATE); + static BufferedSerial serial(MBED_CONF_QUECTEL_M26_TX, MBED_CONF_QUECTEL_M26_RX, MBED_CONF_QUECTEL_M26_BAUDRATE); #if defined (MBED_CONF_QUECTEL_M26_RTS) && defined(MBED_CONF_QUECTEL_M26_CTS) tr_debug("QUECTEL_M26 flow control: RTS %d CTS %d", MBED_CONF_QUECTEL_M26_RTS, MBED_CONF_QUECTEL_M26_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_QUECTEL_M26_RTS, MBED_CONF_QUECTEL_M26_CTS); diff --git a/features/cellular/framework/targets/QUECTEL/UG96/QUECTEL_UG96.cpp b/features/cellular/framework/targets/QUECTEL/UG96/QUECTEL_UG96.cpp index f5ff9b372e..2a29bce06d 100644 --- a/features/cellular/framework/targets/QUECTEL/UG96/QUECTEL_UG96.cpp +++ b/features/cellular/framework/targets/QUECTEL/UG96/QUECTEL_UG96.cpp @@ -56,10 +56,10 @@ AT_CellularContext *QUECTEL_UG96::create_context_impl(ATHandler &at, const char } #if MBED_CONF_QUECTEL_UG96_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_QUECTEL_UG96_TX, MBED_CONF_QUECTEL_UG96_RX, MBED_CONF_QUECTEL_UG96_BAUDRATE); + static BufferedSerial serial(MBED_CONF_QUECTEL_UG96_TX, MBED_CONF_QUECTEL_UG96_RX, MBED_CONF_QUECTEL_UG96_BAUDRATE); #if defined (MBED_CONF_QUECTEL_UG96_RTS) && defined (MBED_CONF_QUECTEL_UG96_CTS) tr_debug("QUECTEL_UG96 flow control: RTS %d CTS %d", MBED_CONF_QUECTEL_UG96_RTS, MBED_CONF_QUECTEL_UG96_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_QUECTEL_UG96_RTS, MBED_CONF_QUECTEL_UG96_CTS); diff --git a/features/cellular/framework/targets/RiotMicro/AT/RM1000_AT.cpp b/features/cellular/framework/targets/RiotMicro/AT/RM1000_AT.cpp index 32545d6ff4..1e2ebeeab0 100644 --- a/features/cellular/framework/targets/RiotMicro/AT/RM1000_AT.cpp +++ b/features/cellular/framework/targets/RiotMicro/AT/RM1000_AT.cpp @@ -85,12 +85,12 @@ nsapi_error_t RM1000_AT::init() } #if MBED_CONF_RM1000_AT_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { tr_debug("Calling CellularDevice::get_default_instance from RM1000_AT"); - static UARTSerial serial(MBED_CONF_RM1000_AT_TX, MBED_CONF_RM1000_AT_RX, MBED_CONF_RM1000_AT_BAUDRATE); + static BufferedSerial serial(MBED_CONF_RM1000_AT_TX, MBED_CONF_RM1000_AT_RX, MBED_CONF_RM1000_AT_BAUDRATE); #if defined (MBED_CONF_RM1000_AT_RTS) && defined(MBED_CONF_RM1000_AT_CTS) tr_debug("RM1000_AT flow control: RTS %d CTS %d", MBED_CONF_RM1000_AT_RTS, MBED_CONF_RM1000_AT_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_RM1000_AT_RTS, MBED_CONF_RM1000_AT_CTS); diff --git a/features/cellular/framework/targets/RiotMicro/AT/RM1000_AT_CellularStack.cpp b/features/cellular/framework/targets/RiotMicro/AT/RM1000_AT_CellularStack.cpp index e3e3a7e7ba..1b03cd0dca 100644 --- a/features/cellular/framework/targets/RiotMicro/AT/RM1000_AT_CellularStack.cpp +++ b/features/cellular/framework/targets/RiotMicro/AT/RM1000_AT_CellularStack.cpp @@ -69,7 +69,7 @@ void RM1000_AT_CellularStack::RUSORCV_URC() if (socket != NULL) { socket->pending_bytes = b; // No debug prints here as they can affect timing - // and cause data loss in UARTSerial + // and cause data loss in BufferedSerial if (socket->_cb != NULL) { socket->_cb(socket->_data); } diff --git a/features/cellular/framework/targets/TELIT/HE910/TELIT_HE910.cpp b/features/cellular/framework/targets/TELIT/HE910/TELIT_HE910.cpp index 7f312b9976..1405d591b4 100644 --- a/features/cellular/framework/targets/TELIT/HE910/TELIT_HE910.cpp +++ b/features/cellular/framework/targets/TELIT/HE910/TELIT_HE910.cpp @@ -60,10 +60,10 @@ nsapi_error_t TELIT_HE910::init() } #if MBED_CONF_TELIT_HE910_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_TELIT_HE910_TX, MBED_CONF_TELIT_HE910_RX, MBED_CONF_TELIT_HE910_BAUDRATE); + static BufferedSerial serial(MBED_CONF_TELIT_HE910_TX, MBED_CONF_TELIT_HE910_RX, MBED_CONF_TELIT_HE910_BAUDRATE); #if defined (MBED_CONF_TELIT_HE910_RTS) && defined (MBED_CONF_TELIT_HE910_CTS) tr_debug("TELIT_HE910 flow control: RTS %d CTS %d", MBED_CONF_TELIT_HE910_RTS, MBED_CONF_TELIT_HE910_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_TELIT_HE910_RTS, MBED_CONF_TELIT_HE910_CTS); diff --git a/features/cellular/framework/targets/TELIT/ME910/TELIT_ME910.cpp b/features/cellular/framework/targets/TELIT/ME910/TELIT_ME910.cpp index 385f25b4bf..931d2fa573 100644 --- a/features/cellular/framework/targets/TELIT/ME910/TELIT_ME910.cpp +++ b/features/cellular/framework/targets/TELIT/ME910/TELIT_ME910.cpp @@ -144,10 +144,10 @@ nsapi_error_t TELIT_ME910::init() } #if MBED_CONF_TELIT_ME910_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_TELIT_ME910_TX, MBED_CONF_TELIT_ME910_RX, MBED_CONF_TELIT_ME910_BAUDRATE); + static BufferedSerial serial(MBED_CONF_TELIT_ME910_TX, MBED_CONF_TELIT_ME910_RX, MBED_CONF_TELIT_ME910_BAUDRATE); #if defined (MBED_CONF_TELIT_ME910_RTS) && defined (MBED_CONF_TELIT_ME910_CTS) serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_TELIT_ME910_RTS, MBED_CONF_TELIT_ME910_CTS); #endif diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT.cpp b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT.cpp index 88be8ff4dc..ee52cf27db 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT.cpp +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT.cpp @@ -100,10 +100,10 @@ AT_CellularContext *UBLOX_AT::create_context_impl(ATHandler &at, const char *apn } #if MBED_CONF_UBLOX_AT_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_UBLOX_AT_TX, MBED_CONF_UBLOX_AT_RX, MBED_CONF_UBLOX_AT_BAUDRATE); + static BufferedSerial serial(MBED_CONF_UBLOX_AT_TX, MBED_CONF_UBLOX_AT_RX, MBED_CONF_UBLOX_AT_BAUDRATE); #if defined (MBED_CONF_UBLOX_AT_RTS) && defined(MBED_CONF_UBLOX_AT_CTS) tr_debug("UBLOX_AT flow control: RTS %d CTS %d", MBED_CONF_UBLOX_AT_RTS, MBED_CONF_UBLOX_AT_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_UBLOX_AT_RTS, MBED_CONF_UBLOX_AT_CTS); diff --git a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp index 3f6e475d7c..4a78aa3b4d 100644 --- a/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp +++ b/features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp @@ -58,7 +58,7 @@ void UBLOX_AT_CellularStack::UUSORD_URC() if (socket != NULL) { socket->pending_bytes = b; // No debug prints here as they can affect timing - // and cause data loss in UARTSerial + // and cause data loss in BufferedSerial if (socket->_cb != NULL) { socket->_cb(socket->_data); } @@ -78,7 +78,7 @@ void UBLOX_AT_CellularStack::UUSORF_URC() if (socket != NULL) { socket->pending_bytes = b; // No debug prints here as they can affect timing - // and cause data loss in UARTSerial + // and cause data loss in BufferedSerial if (socket->_cb != NULL) { socket->_cb(socket->_data); } diff --git a/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX.cpp b/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX.cpp index c27182c093..0fbc265b28 100644 --- a/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX.cpp +++ b/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX.cpp @@ -157,10 +157,10 @@ nsapi_error_t UBLOX_N2XX::set_pin(const char *sim_pin) } #if MBED_CONF_UBLOX_N2XX_PROVIDE_DEFAULT -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_UBLOX_N2XX_TX, MBED_CONF_UBLOX_N2XX_RX, MBED_CONF_UBLOX_N2XX_BAUDRATE); + static BufferedSerial serial(MBED_CONF_UBLOX_N2XX_TX, MBED_CONF_UBLOX_N2XX_RX, MBED_CONF_UBLOX_N2XX_BAUDRATE); #if defined (MBED_CONF_UBLOX_N2XX_RTS) && defined(MBED_CONF_UBLOX_N2XX_CTS) tr_debug("UBLOX_N2XX flow control: RTS %d CTS %d", MBED_CONF_UBLOX_N2XX_RTS, MBED_CONF_UBLOX_N2XX_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_UBLOX_N2XX_RTS, MBED_CONF_UBLOX_N2XX_CTS); diff --git a/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp b/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp index de9d65ec6f..b6fc66ac53 100644 --- a/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp +++ b/features/cellular/framework/targets/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp @@ -57,7 +57,7 @@ void UBLOX_N2XX_CellularStack::NSONMI_URC() if (socket != NULL) { socket->pending_bytes = b; // No debug prints here as they can affect timing - // and cause data loss in UARTSerial + // and cause data loss in BufferedSerial if (socket->_cb != NULL) { socket->_cb(socket->_data); } diff --git a/features/cellular/framework/targets/UBLOX/PPP/UBLOX_PPP.cpp b/features/cellular/framework/targets/UBLOX/PPP/UBLOX_PPP.cpp index 0e81a08142..b06965204f 100644 --- a/features/cellular/framework/targets/UBLOX/PPP/UBLOX_PPP.cpp +++ b/features/cellular/framework/targets/UBLOX/PPP/UBLOX_PPP.cpp @@ -95,10 +95,10 @@ UBLOX_PPP::UBLOX_PPP(FileHandle *fh) : AT_CellularDevice(fh) #error Must define lwip.ppp-enabled #endif -#include "UARTSerial.h" +#include "drivers/BufferedSerial.h" CellularDevice *CellularDevice::get_default_instance() { - static UARTSerial serial(MBED_CONF_UBLOX_PPP_TX, MBED_CONF_UBLOX_PPP_RX, MBED_CONF_UBLOX_PPP_BAUDRATE); + static BufferedSerial serial(MBED_CONF_UBLOX_PPP_TX, MBED_CONF_UBLOX_PPP_RX, MBED_CONF_UBLOX_PPP_BAUDRATE); #if defined (MBED_CONF_UBLOX_AT_RTS) && defined(MBED_CONF_UBLOX_AT_CTS) tr_debug("UBLOX_PPP flow control: RTS %d CTS %d", MBED_CONF_UBLOX_PPP_RTS, MBED_CONF_UBLOX_PPP_CTS); serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_UBLOX_PPP_RTS, MBED_CONF_UBLOX_PPP_CTS);