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