From 2aa5c32aa4731ce1e848805c6874fd8a05100dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teppo=20J=C3=A4rvelin?= Date: Wed, 23 May 2018 11:16:29 +0300 Subject: [PATCH 1/3] Cellular: added greentea test for cellular device. --- .../TESTS/api/cellular_device/main.cpp | 139 ++++++++++++++++++ .../framework/targets/UBLOX/PPP/UBLOX_PPP.cpp | 16 +- 2 files changed, 153 insertions(+), 2 deletions(-) create mode 100644 features/cellular/TESTS/api/cellular_device/main.cpp diff --git a/features/cellular/TESTS/api/cellular_device/main.cpp b/features/cellular/TESTS/api/cellular_device/main.cpp new file mode 100644 index 0000000000..3e2994e277 --- /dev/null +++ b/features/cellular/TESTS/api/cellular_device/main.cpp @@ -0,0 +1,139 @@ +/* + * 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. + */ + + +#if !defined(MBED_CONF_NSAPI_PRESENT) +#error [NOT_SUPPORTED] A json configuration file is needed. Skipping this build. +#endif + +#include "CellularUtil.h" // for CELLULAR_ helper macros +#include "CellularTargets.h" + +#ifndef CELLULAR_DEVICE +#error [NOT_SUPPORTED] CELLULAR_DEVICE must be defined +#endif + +#include "greentea-client/test_env.h" +#include "unity.h" +#include "utest.h" + +#include "mbed.h" + +#include "CellularLog.h" +#include "CellularDevice.h" +#include CELLULAR_STRINGIFY(CELLULAR_DEVICE.h) + +static UARTSerial cellular_serial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE); +static CellularDevice *device; +static EventQueue queue(8 * EVENTS_EVENT_SIZE); + +static void create_device() +{ + device = new CELLULAR_DEVICE(queue); + TEST_ASSERT(device != NULL); +} + +static void open_close_interfaces() +{ + CellularNetwork *nw = device->open_network(&cellular_serial); + TEST_ASSERT(nw != NULL); + device->close_network(); + nw = device->open_network(NULL); + TEST_ASSERT(nw == NULL); + + CellularSIM* sim = device->open_sim(&cellular_serial); + TEST_ASSERT(sim != NULL); + device->close_sim(); + sim = device->open_sim(NULL); + TEST_ASSERT(sim == NULL); + + CellularInformation* info = device->open_information(&cellular_serial); + TEST_ASSERT(info != NULL); + device->close_information(); + info = device->open_information(NULL); + TEST_ASSERT(info == NULL); + + CellularPower* power = device->open_power(&cellular_serial); + TEST_ASSERT(power != NULL); + device->close_power(); + power = device->open_power(NULL); + TEST_ASSERT(power == NULL); + + CellularSMS* sms = device->open_sms(&cellular_serial); + TEST_ASSERT(sms != NULL); + device->close_sms(); + sms = device->open_sms(NULL); + TEST_ASSERT(sms == NULL); +} + +static void other_methods() +{ + // test first without any open interfaces + device->set_timeout(5000); + device->modem_debug_on(true); + device->modem_debug_on(false); + NetworkStack* stack = device->get_stack(); + TEST_ASSERT(stack == NULL); + + CellularNetwork *nw = device->open_network(&cellular_serial); + TEST_ASSERT(nw != NULL); + + // then test witj open interface which is called + device->set_timeout(5000); + device->modem_debug_on(true); + device->modem_debug_on(false); + stack = device->get_stack(); + TEST_ASSERT(stack != NULL); +} + +static void delete_device() +{ + // delete will close all opened interfaces + delete device; + device = NULL; +} + +using namespace utest::v1; + +static utest::v1::status_t greentea_failure_handler(const Case *const source, const failure_t reason) +{ + greentea_case_failure_abort_handler(source, reason); + return STATUS_ABORT; +} + +static Case cases[] = { + Case("CellularDevice create device", create_device, greentea_failure_handler), + Case("CellularDevice Open and close interfaces", open_close_interfaces, greentea_failure_handler), + Case("CellularDevice other methods", other_methods, greentea_failure_handler), + Case("CellularDevice delete device", delete_device, greentea_failure_handler) +}; + +static utest::v1::status_t test_setup(const size_t number_of_cases) +{ + GREENTEA_SETUP(10*60, "default_auto"); + return verbose_test_setup_handler(number_of_cases); +} + +static Specification specification(test_setup, cases); + +int main() +{ + mbed_trace_init(); + + return Harness::run(specification); +} + diff --git a/features/cellular/framework/targets/UBLOX/PPP/UBLOX_PPP.cpp b/features/cellular/framework/targets/UBLOX/PPP/UBLOX_PPP.cpp index 813358e0d6..734274edd5 100644 --- a/features/cellular/framework/targets/UBLOX/PPP/UBLOX_PPP.cpp +++ b/features/cellular/framework/targets/UBLOX/PPP/UBLOX_PPP.cpp @@ -33,7 +33,13 @@ UBLOX_PPP::~UBLOX_PPP() CellularNetwork *UBLOX_PPP::open_network(FileHandle *fh) { if (!_network) { - _network = new UBLOX_PPP_CellularNetwork(*get_at_handler(fh)); + ATHandler *atHandler = get_at_handler(fh); + if (atHandler) { + _network = new UBLOX_PPP_CellularNetwork(*atHandler); + if (!_network) { + release_at_handler(atHandler); + } + } } return _network; } @@ -41,7 +47,13 @@ CellularNetwork *UBLOX_PPP::open_network(FileHandle *fh) CellularPower *UBLOX_PPP::open_power(FileHandle *fh) { if (!_power) { - _power = new UBLOX_PPP_CellularPower(*get_at_handler(fh)); + ATHandler *atHandler = get_at_handler(fh); + if (atHandler) { + _power = new UBLOX_PPP_CellularPower(*get_at_handler(fh)); + if (!_power) { + release_at_handler(atHandler); + } + } } return _power; } From 3311a6e456c488f66bdfbee71bea986ff72153e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teppo=20J=C3=A4rvelin?= Date: Wed, 23 May 2018 15:28:47 +0300 Subject: [PATCH 2/3] Cellular: added more unit tests for CellularDevice. --- .../at_cellulardevicetest.cpp | 14 +++ .../test_at_cellulardevice.cpp | 92 +++++++++++++++++++ .../test_at_cellulardevice.h | 6 ++ .../UNITTESTS/stubs/ATHandler_stub.cpp | 13 ++- .../cellular/UNITTESTS/stubs/ATHandler_stub.h | 4 + 5 files changed, 128 insertions(+), 1 deletion(-) diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/at_cellulardevicetest.cpp b/features/cellular/UNITTESTS/at/at_cellulardevice/at_cellulardevicetest.cpp index 1c5165203c..5902ee5524 100644 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/at_cellulardevicetest.cpp +++ b/features/cellular/UNITTESTS/at/at_cellulardevice/at_cellulardevicetest.cpp @@ -97,3 +97,17 @@ TEST(AT_CellularDevice, test_AT_CellularDevice_close_information) unit->test_AT_CellularDevice_close_information(); } +TEST(AT_CellularDevice, test_AT_CellularDevice_set_timeout) +{ + unit->test_AT_CellularDevice_set_timeout(); +} + +TEST(AT_CellularDevice, test_AT_CellularDevice_modem_debug_on) +{ + unit->test_AT_CellularDevice_modem_debug_on(); +} + +TEST(AT_CellularDevice, test_AT_CellularDevice_get_stack) +{ + unit->test_AT_CellularDevice_get_stack(); +} diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/test_at_cellulardevice.cpp b/features/cellular/UNITTESTS/at/at_cellulardevice/test_at_cellulardevice.cpp index 21ccedc61b..8d230164f9 100644 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/test_at_cellulardevice.cpp +++ b/features/cellular/UNITTESTS/at/at_cellulardevice/test_at_cellulardevice.cpp @@ -112,22 +112,56 @@ void Test_AT_CellularDevice::test_AT_CellularDevice_open_information() void Test_AT_CellularDevice::test_AT_CellularDevice_close_network() { + EventQueue que; + AT_CellularDevice dev(que); + FileHandle_stub fh1; + ATHandler_stub::ref_count = 0; + CHECK(dev.open_network(&fh1)); + CHECK(ATHandler_stub::ref_count == 1); + + dev.close_network(); } void Test_AT_CellularDevice::test_AT_CellularDevice_close_sms() { + EventQueue que; + AT_CellularDevice dev(que); + FileHandle_stub fh1; + ATHandler_stub::ref_count = 0; + CHECK(dev.open_sms(&fh1)); + CHECK(ATHandler_stub::ref_count == 1); + + dev.close_sms(); } void Test_AT_CellularDevice::test_AT_CellularDevice_close_power() { + EventQueue que; + AT_CellularDevice dev(que); + FileHandle_stub fh1; + ATHandler_stub::ref_count = 0; + CHECK(dev.open_power(&fh1)); + CHECK(ATHandler_stub::ref_count == 1); + + dev.close_power(); } void Test_AT_CellularDevice::test_AT_CellularDevice_close_sim() { + EventQueue que; + AT_CellularDevice dev(que); + FileHandle_stub fh1; + ATHandler_stub::ref_count = 0; + + CHECK(dev.open_sim(&fh1)); + dev.close_sms(); // this should not affect to refcount as it's not opened + CHECK(ATHandler_stub::ref_count == 1); + + dev.close_sim(); } void Test_AT_CellularDevice::test_AT_CellularDevice_close_information() @@ -155,3 +189,61 @@ void Test_AT_CellularDevice::test_AT_CellularDevice_close_information() ATHandler_stub::fh_value = NULL; } +void Test_AT_CellularDevice::test_AT_CellularDevice_set_timeout() +{ + EventQueue que; + AT_CellularDevice dev(que); + FileHandle_stub fh1; + ATHandler_stub::timeout = 0; + ATHandler_stub::default_timeout = false; + + // no interfaces open so settings timeout should not change anything + dev.set_timeout(5000); + CHECK(ATHandler_stub::timeout == 0); + CHECK(ATHandler_stub::default_timeout == false); + + CHECK(dev.open_sim(&fh1)); + CHECK(ATHandler_stub::ref_count == 1); + + dev.set_timeout(5000); + CHECK(ATHandler_stub::timeout == 5000); + CHECK(ATHandler_stub::default_timeout == true); + + dev.close_sim(); +} + +void Test_AT_CellularDevice::test_AT_CellularDevice_modem_debug_on() +{ + EventQueue que; + AT_CellularDevice dev(que); + FileHandle_stub fh1; + ATHandler_stub::debug_on = false; + + // no interfaces open so debug toggling should not affect + dev.modem_debug_on(true); + CHECK(ATHandler_stub::debug_on == false); + + CHECK(dev.open_sim(&fh1)); + CHECK(ATHandler_stub::ref_count == 1); + + dev.modem_debug_on(true); + CHECK(ATHandler_stub::debug_on == true); + + dev.close_sim(); +} + +void Test_AT_CellularDevice::test_AT_CellularDevice_get_stack() +{ + EventQueue que; + AT_CellularDevice dev(que); + FileHandle_stub fh1; + + NetworkStack *stack = dev.get_stack(); + CHECK(stack == NULL); + + CHECK(dev.open_network(&fh1)); + + stack = dev.get_stack(); + CHECK(stack == NULL); // Not in PPP so also null but this is got from the network class +} + diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/test_at_cellulardevice.h b/features/cellular/UNITTESTS/at/at_cellulardevice/test_at_cellulardevice.h index 83873ec4a5..3cf8a8517d 100644 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/test_at_cellulardevice.h +++ b/features/cellular/UNITTESTS/at/at_cellulardevice/test_at_cellulardevice.h @@ -47,6 +47,12 @@ public: void test_AT_CellularDevice_close_sim(); void test_AT_CellularDevice_close_information(); + + void test_AT_CellularDevice_set_timeout(); + + void test_AT_CellularDevice_modem_debug_on(); + + void test_AT_CellularDevice_get_stack(); }; #endif // TEST_AT_CELLULARDEVICE_H diff --git a/features/cellular/UNITTESTS/stubs/ATHandler_stub.cpp b/features/cellular/UNITTESTS/stubs/ATHandler_stub.cpp index d587395d08..40da5efa2c 100644 --- a/features/cellular/UNITTESTS/stubs/ATHandler_stub.cpp +++ b/features/cellular/UNITTESTS/stubs/ATHandler_stub.cpp @@ -31,6 +31,10 @@ const int DEFAULT_AT_TIMEOUT = 1000; // at default timeout in milliseconds nsapi_error_t ATHandler_stub::nsapi_error_value = 0; uint8_t ATHandler_stub::nsapi_error_ok_counter = 0; int ATHandler_stub::int_value = -1; +int ATHandler_stub::ref_count = 0; +int ATHandler_stub::timeout = 0; +bool ATHandler_stub::default_timeout = 0; +bool ATHandler_stub::debug_on = 0; ssize_t ATHandler_stub::ssize_value = 0; char* ATHandler_stub::read_string_value = NULL; size_t ATHandler_stub::size_value = 0; @@ -47,27 +51,32 @@ ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char _fileHandle(fh), _queue(queue) { + ATHandler_stub::ref_count = 1; } void ATHandler::enable_debug(bool enable) { + ATHandler_stub::debug_on = enable; } ATHandler::~ATHandler() { + ATHandler_stub::ref_count = -909; } void ATHandler::inc_ref_count() { + ATHandler_stub::ref_count++; } void ATHandler::dec_ref_count() { + ATHandler_stub::ref_count--; } int ATHandler::get_ref_count() { - return ATHandler_stub::int_value; + return ATHandler_stub::ref_count; } FileHandle *ATHandler::get_file_handle() @@ -113,6 +122,8 @@ nsapi_error_t ATHandler::unlock_return_error() void ATHandler::set_at_timeout(uint32_t timeout_milliseconds, bool default_timeout) { + ATHandler_stub::timeout = timeout_milliseconds; + ATHandler_stub::default_timeout = default_timeout; } void ATHandler::restore_at_timeout() diff --git a/features/cellular/UNITTESTS/stubs/ATHandler_stub.h b/features/cellular/UNITTESTS/stubs/ATHandler_stub.h index 72fd269583..0aa4be1498 100644 --- a/features/cellular/UNITTESTS/stubs/ATHandler_stub.h +++ b/features/cellular/UNITTESTS/stubs/ATHandler_stub.h @@ -28,6 +28,10 @@ namespace ATHandler_stub { extern nsapi_error_t nsapi_error_value; extern uint8_t nsapi_error_ok_counter; extern int int_value; + extern int ref_count; + extern int timeout; + extern bool default_timeout; + extern bool debug_on; extern ssize_t ssize_value; extern char* read_string_value; extern size_t size_value; From 9a3c3b531f64fdd7018cf62ce65f3cc965e36512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Teppo=20J=C3=A4rvelin?= Date: Mon, 4 Jun 2018 13:27:50 +0300 Subject: [PATCH 3/3] Cellular: fixed unit tests to compile after rebasing to latest. --- .../cellular/UNITTESTS/at/athandler/Makefile | 2 +- .../UNITTESTS/at/athandler/athandlertest.cpp | 4 +-- .../UNITTESTS/at/athandler/test_athandler.cpp | 6 ++-- .../UNITTESTS/at/athandler/test_athandler.h | 2 +- .../UNITTESTS/stubs/ATHandler_stub.cpp | 4 +-- .../UNITTESTS/stubs/AT_CellularPower_stub.cpp | 4 +++ .../UNITTESTS/stubs/NetworkInterface_stub.cpp | 10 ++++++ .../UNITTESTS/stubs/NetworkStack_stub.cpp | 31 ++++++++++++++++++- .../target_h/mbed-trace/mbed_trace.h | 30 ++++++++++++++++++ .../cellular/framework/common/CellularLog.h | 2 -- 10 files changed, 83 insertions(+), 12 deletions(-) create mode 100644 features/cellular/UNITTESTS/target_h/mbed-trace/mbed_trace.h diff --git a/features/cellular/UNITTESTS/at/athandler/Makefile b/features/cellular/UNITTESTS/at/athandler/Makefile index a608b0ce54..8fd405a01a 100644 --- a/features/cellular/UNITTESTS/at/athandler/Makefile +++ b/features/cellular/UNITTESTS/at/athandler/Makefile @@ -25,5 +25,5 @@ TEST_SRC_FILES = \ include ../../MakefileWorker.mk -CPPUTESTFLAGS += -DFEA_TRACE_SUPPORT +CPPUTESTFLAGS += -DFEA_TRACE_SUPPORT -DMBED_CONF_CELLULAR_DEBUG_AT=1 diff --git a/features/cellular/UNITTESTS/at/athandler/athandlertest.cpp b/features/cellular/UNITTESTS/at/athandler/athandlertest.cpp index 916608c0dd..f1a5b75b27 100644 --- a/features/cellular/UNITTESTS/at/athandler/athandlertest.cpp +++ b/features/cellular/UNITTESTS/at/athandler/athandlertest.cpp @@ -207,9 +207,9 @@ TEST(ATHandler, test_ATHandler_consume_to_stop_tag) unit->test_ATHandler_consume_to_stop_tag(); } -TEST(ATHandler, test_ATHandler_enable_debug) +TEST(ATHandler, test_ATHandler_set_debug) { - unit->test_ATHandler_enable_debug(); + unit->test_ATHandler_set_debug(); } TEST(ATHandler, test_ATHandler_get_3gpp_error) diff --git a/features/cellular/UNITTESTS/at/athandler/test_athandler.cpp b/features/cellular/UNITTESTS/at/athandler/test_athandler.cpp index ba878a1e59..6c4751fc0c 100644 --- a/features/cellular/UNITTESTS/at/athandler/test_athandler.cpp +++ b/features/cellular/UNITTESTS/at/athandler/test_athandler.cpp @@ -778,15 +778,15 @@ void Test_ATHandler::test_ATHandler_consume_to_stop_tag() CHECK(at.consume_to_stop_tag()); } -void Test_ATHandler::test_ATHandler_enable_debug() +void Test_ATHandler::test_ATHandler_set_debug() { EventQueue que; FileHandle_stub fh1; ATHandler at(&fh1, que, 0, ","); - at.enable_debug(true); + at.set_debug(true); - at.enable_debug(false); + at.set_debug(false); } void Test_ATHandler::test_ATHandler_get_3gpp_error() diff --git a/features/cellular/UNITTESTS/at/athandler/test_athandler.h b/features/cellular/UNITTESTS/at/athandler/test_athandler.h index 0acecc693c..f17e40084b 100644 --- a/features/cellular/UNITTESTS/at/athandler/test_athandler.h +++ b/features/cellular/UNITTESTS/at/athandler/test_athandler.h @@ -92,7 +92,7 @@ public: void test_ATHandler_consume_to_stop_tag(); - void test_ATHandler_enable_debug(); + void test_ATHandler_set_debug(); void test_ATHandler_get_3gpp_error(); }; diff --git a/features/cellular/UNITTESTS/stubs/ATHandler_stub.cpp b/features/cellular/UNITTESTS/stubs/ATHandler_stub.cpp index 40da5efa2c..a4661ecfe3 100644 --- a/features/cellular/UNITTESTS/stubs/ATHandler_stub.cpp +++ b/features/cellular/UNITTESTS/stubs/ATHandler_stub.cpp @@ -54,9 +54,9 @@ ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char ATHandler_stub::ref_count = 1; } -void ATHandler::enable_debug(bool enable) +void ATHandler::set_debug(bool debug_on) { - ATHandler_stub::debug_on = enable; + ATHandler_stub::debug_on = debug_on; } ATHandler::~ATHandler() diff --git a/features/cellular/UNITTESTS/stubs/AT_CellularPower_stub.cpp b/features/cellular/UNITTESTS/stubs/AT_CellularPower_stub.cpp index c2425b9cca..ef834c5dc0 100644 --- a/features/cellular/UNITTESTS/stubs/AT_CellularPower_stub.cpp +++ b/features/cellular/UNITTESTS/stubs/AT_CellularPower_stub.cpp @@ -74,3 +74,7 @@ void AT_CellularPower::remove_device_ready_urc_cb(mbed::Callback callbac } +nsapi_error_t AT_CellularPower::is_device_ready() +{ + return NSAPI_ERROR_OK; +} diff --git a/features/cellular/UNITTESTS/stubs/NetworkInterface_stub.cpp b/features/cellular/UNITTESTS/stubs/NetworkInterface_stub.cpp index fb1ad4dcbd..6933b3dff4 100644 --- a/features/cellular/UNITTESTS/stubs/NetworkInterface_stub.cpp +++ b/features/cellular/UNITTESTS/stubs/NetworkInterface_stub.cpp @@ -77,3 +77,13 @@ nsapi_error_t NetworkInterface::set_blocking(bool blocking) return NSAPI_ERROR_UNSUPPORTED; } +nsapi_value_or_error_t NetworkInterface::gethostbyname_async(char const*, mbed::Callback, nsapi_version) +{ + return NSAPI_ERROR_UNSUPPORTED; +} + +nsapi_error_t NetworkInterface::gethostbyname_async_cancel(int id) +{ + return NSAPI_ERROR_UNSUPPORTED; +} + diff --git a/features/cellular/UNITTESTS/stubs/NetworkStack_stub.cpp b/features/cellular/UNITTESTS/stubs/NetworkStack_stub.cpp index 0cbc1abb65..873728179a 100644 --- a/features/cellular/UNITTESTS/stubs/NetworkStack_stub.cpp +++ b/features/cellular/UNITTESTS/stubs/NetworkStack_stub.cpp @@ -21,7 +21,6 @@ #include "stddef.h" #include - // Default NetworkStack operations nsapi_error_t NetworkStack::gethostbyname(const char *name, SocketAddress *address, nsapi_version_t version) { @@ -33,6 +32,11 @@ nsapi_error_t NetworkStack::add_dns_server(const SocketAddress &address) return NSAPI_ERROR_OK; } +nsapi_error_t NetworkStack::get_dns_server(int index, SocketAddress *address) +{ + return NSAPI_ERROR_UNSUPPORTED; +} + nsapi_error_t NetworkStack::setstackopt(int level, int optname, const void *optval, unsigned optlen) { return NSAPI_ERROR_UNSUPPORTED; @@ -64,3 +68,28 @@ NetworkStack *nsapi_create_stack(NetworkStack *stack) return NULL; } + nsapi_value_or_error_t NetworkStack::gethostbyname_async(const char *host, hostbyname_cb_t callback, + nsapi_version_t version) + { + return NSAPI_ERROR_UNSUPPORTED; + } + + nsapi_error_t NetworkStack::gethostbyname_async_cancel(int id) + { + return NSAPI_ERROR_UNSUPPORTED; + } + +call_in_callback_cb_t NetworkStack::get_call_in_callback() +{ + return NULL; +} + +nsapi_error_t NetworkStack::call_in(int delay, mbed::Callback func) +{ + return NSAPI_ERROR_UNSUPPORTED; +} + +const char *NetworkStack::get_ip_address() +{ + return NULL; +} diff --git a/features/cellular/UNITTESTS/target_h/mbed-trace/mbed_trace.h b/features/cellular/UNITTESTS/target_h/mbed-trace/mbed_trace.h new file mode 100644 index 0000000000..5b4faeb291 --- /dev/null +++ b/features/cellular/UNITTESTS/target_h/mbed-trace/mbed_trace.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2017, 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. + */ +#ifndef MBED_OS_FEATURES_CELLULAR_MBED_TRACE_H_ +#define MBED_OS_FEATURES_CELLULAR_MBED_TRACE_H_ + + +//usage macros: +#define tr_debug(...) +#define tr_info(...) +#define tr_warning(...) +#define tr_warn(...) +#define tr_error(...) +#define tr_err(...) + + +#endif /* MBED_OS_FEATURES_CELLULAR_MBED_TRACE_H_ */ diff --git a/features/cellular/framework/common/CellularLog.h b/features/cellular/framework/common/CellularLog.h index 978900937a..083c401d6a 100644 --- a/features/cellular/framework/common/CellularLog.h +++ b/features/cellular/framework/common/CellularLog.h @@ -18,8 +18,6 @@ #ifndef CELLULAR_LOG_H_ #define CELLULAR_LOG_H_ -#include "rtos.h" - #if defined(HAVE_DEBUG) && !defined(FEA_TRACE_SUPPORT) #define FEA_TRACE_SUPPORT #endif