diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/AT_CellularBase_unit_tests b/features/cellular/UNITTESTS/at/at_cellularbase/AT_CellularBase_unit_tests deleted file mode 100755 index 98879e8c77..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/AT_CellularBase_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/AT_CellularBase_unit_tests.txt b/features/cellular/UNITTESTS/at/at_cellularbase/AT_CellularBase_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/cpputest_AT_CellularBase.xml b/features/cellular/UNITTESTS/at/at_cellularbase/cpputest_AT_CellularBase.xml deleted file mode 100644 index a0d7dde497..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/cpputest_AT_CellularBase.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/gcov/AT_CellularBase.cpp.gcov b/features/cellular/UNITTESTS/at/at_cellularbase/gcov/AT_CellularBase.cpp.gcov deleted file mode 100644 index b9ed80e5a5..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/gcov/AT_CellularBase.cpp.gcov +++ /dev/null @@ -1,41 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularBase.cpp - -: 0:Graph:objs/AT_CellularBase_unit/AT_CellularBase.gcno - -: 0:Data:objs/AT_CellularBase_unit/AT_CellularBase.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include "AT_CellularBase.h" - -: 19: - -: 20:using namespace mbed; - -: 21: - 2: 22:AT_CellularBase::AT_CellularBase(ATHandler& at) : _at(at) - -: 23:{ - -: 24: - 2: 25:} - -: 26: - 1: 27:ATHandler& AT_CellularBase::get_at_handler() - -: 28:{ - 1: 29: return _at; - -: 30:} - -: 31: - 1: 32:device_err_t AT_CellularBase::get_device_error() const - -: 33:{ - 1: 34: return _at.get_last_device_error(); - -: 35:} - -: 36: diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_output.txt deleted file mode 100644 index f5f6811fb5..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_output.txt +++ /dev/null @@ -1,4 +0,0 @@ -File '../../../framework/AT/AT_CellularBase.cpp' -Lines executed:100.00% of 6 -Creating 'AT_CellularBase.cpp.gcov' - diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_report.txt deleted file mode 100644 index 437cb58276..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_report.txt +++ /dev/null @@ -1 +0,0 @@ -100.00% ../framework/AT/AT_CellularBase.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_report.txt.html deleted file mode 100644 index 4dfb7ce3a0..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/gcov/gcov_report.txt.html +++ /dev/null @@ -1,4 +0,0 @@ - - - -
CoverageFile
100.00% ../framework/AT/AT_CellularBase.cpp
diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/lib/libAT_CellularBase_unit.a b/features/cellular/UNITTESTS/at/at_cellularbase/lib/libAT_CellularBase_unit.a deleted file mode 100644 index 6845666402..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/lib/libAT_CellularBase_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.d b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.d deleted file mode 100644 index 7fc1c10b28..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.d +++ /dev/null @@ -1,78 +0,0 @@ -objs/AT_CellularBase_unit/ATHandler_stub.o: \ - ../../stubs/ATHandler_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/platform.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.gcda deleted file mode 100644 index edaa0e77da..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.gcno deleted file mode 100644 index c731ced0df..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.o b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.o deleted file mode 100644 index 1e4754e2cf..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/ATHandler_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.d b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.d deleted file mode 100644 index 8f91415700..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.d +++ /dev/null @@ -1,48 +0,0 @@ -objs/AT_CellularBase_unit/AT_CellularBase.o: \ - ../../../framework/AT/AT_CellularBase.cpp \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.gcda b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.gcda deleted file mode 100644 index dbf7d8ce66..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.gcno b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.gcno deleted file mode 100644 index 64b7489199..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.o b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.o deleted file mode 100644 index b38a129066..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/AT_CellularBase.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.d deleted file mode 100644 index e6204831db..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularBase_unit/EventQueue_stub.o: \ - ../../stubs/EventQueue_stub.cpp ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.gcda deleted file mode 100644 index 6219437bbb..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.gcno deleted file mode 100644 index 0301777f6f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.o deleted file mode 100644 index dae2039ef1..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.d deleted file mode 100644 index 51d121c5f2..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/AT_CellularBase_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.gcda deleted file mode 100644 index 05fa86636a..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.gcno deleted file mode 100644 index d733a8f7c8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.o deleted file mode 100644 index f1d920bc2b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.d b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.d deleted file mode 100644 index 6b68fe75e2..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.d +++ /dev/null @@ -1,49 +0,0 @@ -objs/AT_CellularBase_unit/at_cellularbasetest.o: at_cellularbasetest.cpp \ - test_at_cellularbase.h ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h - -test_at_cellularbase.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.gcda b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.gcda deleted file mode 100644 index d70d184449..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.gcno b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.gcno deleted file mode 100644 index d3ae36f4b5..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.o b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.o deleted file mode 100644 index 38302eef3f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/at_cellularbasetest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.d b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.d deleted file mode 100644 index 0f63d956fe..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/AT_CellularBase_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.gcda b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.gcda deleted file mode 100644 index b3dc0e1f25..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.gcno b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.gcno deleted file mode 100644 index f5d6a89d56..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.o b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.o deleted file mode 100644 index de97687fee..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.d deleted file mode 100644 index b3085c20df..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/AT_CellularBase_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.gcda deleted file mode 100644 index bfc1105327..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.gcno deleted file mode 100644 index d2b5caddaa..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.o deleted file mode 100644 index cca314c8f4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.d b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.d deleted file mode 100644 index 0b712292c0..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.d +++ /dev/null @@ -1,77 +0,0 @@ -objs/AT_CellularBase_unit/test_at_cellularbase.o: \ - test_at_cellularbase.cpp test_at_cellularbase.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../../framework/AT/ATHandler.h ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h ../../stubs/FileHandle_stub.h - -test_at_cellularbase.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../../framework/AT/ATHandler.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../stubs/FileHandle_stub.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.gcda b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.gcda deleted file mode 100644 index 279641080c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.gcno b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.gcno deleted file mode 100644 index 941f55b885..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.o b/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.o deleted file mode 100644 index c208887586..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularbase/objs/AT_CellularBase_unit/test_at_cellularbase.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/AT_CellularDevice_unit_tests b/features/cellular/UNITTESTS/at/at_cellulardevice/AT_CellularDevice_unit_tests deleted file mode 100755 index 9d2d3b5e58..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/AT_CellularDevice_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/AT_CellularDevice_unit_tests.txt b/features/cellular/UNITTESTS/at/at_cellulardevice/AT_CellularDevice_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/cpputest_AT_CellularDevice.xml b/features/cellular/UNITTESTS/at/at_cellulardevice/cpputest_AT_CellularDevice.xml deleted file mode 100644 index ffa6e8d915..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/cpputest_AT_CellularDevice.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/AT_CellularDevice.cpp.gcov b/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/AT_CellularDevice.cpp.gcov deleted file mode 100644 index b0a09410f6..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/AT_CellularDevice.cpp.gcov +++ /dev/null @@ -1,253 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularDevice.cpp - -: 0:Graph:objs/AT_CellularDevice_unit/AT_CellularDevice.gcno - -: 0:Data:objs/AT_CellularDevice_unit/AT_CellularDevice.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include "AT_CellularDevice.h" - -: 19: - -: 20:using namespace events; - -: 21:using namespace mbed; - -: 22: - -: 23:#define DEFAULT_AT_TIMEOUT 1000 // at default timeout in milliseconds - -: 24: - 10: 25:AT_CellularDevice::AT_CellularDevice(EventQueue &queue) : - 10: 26: _atHandlers(0), _network(0), _sms(0), _sim(0), _power(0), _multiplexer(0), _information(0), _queue(queue), _default_timeout(DEFAULT_AT_TIMEOUT) - -: 27:{ - 10: 28:} - -: 29: - 21: 30:AT_CellularDevice::~AT_CellularDevice() - -: 31:{ - 10: 32: close_network(); - 10: 33: close_sms(); - 10: 34: close_power(); - 10: 35: close_sim(); - 10: 36: close_multiplexer(); - 10: 37: close_information(); - -: 38: - 10: 39: ATHandler *atHandler = _atHandlers; - 26: 40: while (atHandler) { - 8: 41: ATHandler *old = atHandler; - 8: 42: atHandler = atHandler->_nextATHandler; - 8: 43: delete old; - 8: 44: old = NULL; - -: 45: } - 11: 46:} - -: 47: - -: 48:// each parser is associated with one filehandle (that is UART or a MUX channel) - 18: 49:ATHandler* AT_CellularDevice::get_at_handler(FileHandle *fileHandle) - -: 50:{ - 18: 51: if (!fileHandle) { - 6: 52: return NULL; - -: 53: } - 12: 54: ATHandler *atHandler = _atHandlers; - 18: 55: while (atHandler) { - 5: 56: if (atHandler->get_file_handle() == fileHandle) { - 2: 57: atHandler->inc_ref_count(); - 2: 58: return atHandler; - -: 59: } - 3: 60: atHandler = atHandler->_nextATHandler; - -: 61: } - -: 62: - 10: 63: atHandler = new ATHandler(fileHandle, _queue, _default_timeout); - 10: 64: if (atHandler) { - 10: 65: atHandler->_nextATHandler = _atHandlers; - 10: 66: _atHandlers = atHandler; - -: 67: } - -: 68: - 10: 69: return atHandler; - -: 70:} - -: 71: - 12: 72:void AT_CellularDevice::release_at_handler(ATHandler* at_handler) - -: 73:{ - 12: 74: if (!at_handler) { - 1: 75: return; - -: 76: } - 11: 77: at_handler->dec_ref_count(); - 11: 78: if (at_handler->get_ref_count() == 0) { - -: 79: // we can delete this at_handler - 11: 80: ATHandler *atHandler = _atHandlers; - 11: 81: ATHandler *prev = NULL; - 37: 82: while (atHandler) { - 15: 83: if (atHandler == at_handler) { - 2: 84: if (prev == NULL) { - 1: 85: _atHandlers = _atHandlers->_nextATHandler; - -: 86: } - -: 87: else { - 1: 88: prev->_nextATHandler = atHandler->_nextATHandler; - -: 89: } - 2: 90: delete atHandler; - 2: 91: atHandler = NULL; - 2: 92: break; - -: 93: } else { - 13: 94: prev = atHandler; - 13: 95: atHandler =atHandler->_nextATHandler; - -: 96: } - -: 97: } - -: 98: } - -: 99:} - -: 100: - 3: 101:CellularNetwork *AT_CellularDevice::open_network(FileHandle *fh) - -: 102:{ - 3: 103: if (!_network) { - 3: 104: ATHandler *atHandler = get_at_handler(fh); - 3: 105: if (atHandler) { - 2: 106: _network = new AT_CellularNetwork(*atHandler); - 2: 107: if (!_network) { - #####: 108: release_at_handler(atHandler); - -: 109: } - -: 110: } - -: 111: } - 3: 112: return _network; - -: 113:} - -: 114: - 3: 115:CellularSMS *AT_CellularDevice::open_sms(FileHandle *fh) - -: 116:{ - 3: 117: if (!_sms) { - 3: 118: ATHandler *atHandler = get_at_handler(fh); - 3: 119: if (atHandler) { - 2: 120: _sms = new AT_CellularSMS(*atHandler); - 2: 121: if (!_sms) { - #####: 122: release_at_handler(atHandler); - -: 123: } - -: 124: } - -: 125: } - 3: 126: return _sms; - -: 127:} - -: 128: - 3: 129:CellularSIM *AT_CellularDevice::open_sim(FileHandle *fh) - -: 130:{ - 3: 131: if (!_sim) { - 3: 132: ATHandler *atHandler = get_at_handler(fh); - 3: 133: if (atHandler) { - 2: 134: _sim = new AT_CellularSIM(*atHandler); - 2: 135: if (!_sim) { - #####: 136: release_at_handler(atHandler); - -: 137: } - -: 138: } - -: 139: } - 3: 140: return _sim; - -: 141:} - -: 142: - 3: 143:CellularPower *AT_CellularDevice::open_power(FileHandle *fh) - -: 144:{ - 3: 145: if (!_power) { - 3: 146: ATHandler *atHandler = get_at_handler(fh); - 3: 147: if (atHandler) { - 2: 148: _power = new AT_CellularPower(*atHandler); - 2: 149: if (!_power) { - #####: 150: release_at_handler(atHandler); - -: 151: } - -: 152: } - -: 153: } - 3: 154: return _power; - -: 155:} - -: 156: - 2: 157:CellularMultiplexer *AT_CellularDevice::open_multiplexer(FileHandle *fh) - -: 158:{ - 2: 159: if (!_multiplexer) { - 2: 160: ATHandler *atHandler = get_at_handler(fh); - 2: 161: if (atHandler) { - 1: 162: _multiplexer = new AT_CellularMultiplexer(*atHandler); - 1: 163: if (!_multiplexer) { - #####: 164: release_at_handler(atHandler); - -: 165: } - -: 166: } - -: 167: } - -: 168: - 2: 169: return _multiplexer; - -: 170:} - -: 171: - 4: 172:CellularInformation *AT_CellularDevice::open_information(FileHandle *fh) - -: 173:{ - 4: 174: if (!_information) { - 4: 175: ATHandler *atHandler = get_at_handler(fh); - 4: 176: if (atHandler) { - 3: 177: _information = new AT_CellularInformation(*atHandler); - 3: 178: if (!_information) { - #####: 179: release_at_handler(atHandler); - -: 180: } - -: 181: } - -: 182: } - 4: 183: return _information; - -: 184:} - -: 185: - 10: 186:void AT_CellularDevice::close_network() - -: 187:{ - 10: 188: if (_network) { - 2: 189: release_at_handler(&_network->get_at_handler()); - 2: 190: delete _network; - 2: 191: _network = NULL; - -: 192: } - 10: 193:} - -: 194: - 10: 195:void AT_CellularDevice::close_sms() - -: 196:{ - 10: 197: if (_sms) { - 2: 198: release_at_handler(&_sms->get_at_handler()); - 2: 199: delete _sms; - 2: 200: _sms = NULL; - -: 201: } - 10: 202:} - 10: 203:void AT_CellularDevice::close_power() - -: 204:{ - 10: 205: if (_power) { - 2: 206: release_at_handler(&_power->get_at_handler()); - 2: 207: delete _power; - 2: 208: _power = NULL; - -: 209: } - 10: 210:} - -: 211: - 10: 212:void AT_CellularDevice::close_sim() - -: 213:{ - 10: 214: if (_sim) { - 2: 215: release_at_handler(&_sim->get_at_handler()); - 2: 216: delete _sim; - 2: 217: _sim = NULL; - -: 218: } - 10: 219:} - -: 220: - 10: 221:void AT_CellularDevice::close_multiplexer() - -: 222:{ - 10: 223: if (_multiplexer) { - 1: 224: release_at_handler(&_multiplexer->get_at_handler()); - 1: 225: delete _multiplexer; - 1: 226: _multiplexer = NULL; - -: 227: } - 10: 228:} - -: 229: - 12: 230:void AT_CellularDevice::close_information() - -: 231:{ - 12: 232: if (_information) { - 3: 233: release_at_handler(&_information->get_at_handler()); - 3: 234: delete _information; - 3: 235: _information = NULL; - -: 236: } - 12: 237:} - -: 238: - #####: 239:void AT_CellularDevice::set_timeout(int timeout) - -: 240:{ - #####: 241: _default_timeout = timeout; - -: 242: - #####: 243: ATHandler *atHandler = _atHandlers; - #####: 244: while (atHandler) { - #####: 245: atHandler->set_at_timeout(_default_timeout, true); // set as default timeout - #####: 246: atHandler = atHandler->_nextATHandler; - -: 247: } - #####: 248:} diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/CellularDevice.h.gcov b/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/CellularDevice.h.gcov deleted file mode 100644 index bd4a68803f..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/CellularDevice.h.gcov +++ /dev/null @@ -1,126 +0,0 @@ - -: 0:Source:../../../framework/API/CellularDevice.h - -: 0:Graph:objs/AT_CellularDevice_unit/AT_CellularDevice.gcno - -: 0:Data:objs/AT_CellularDevice_unit/AT_CellularDevice.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef CELLULAR_DEVICE_H_ - -: 19:#define CELLULAR_DEVICE_H_ - -: 20: - -: 21:#include "FileHandle.h" - -: 22: - -: 23:#include "CellularSIM.h" - -: 24:#include "CellularNetwork.h" - -: 25:#include "CellularSMS.h" - -: 26:#include "CellularPower.h" - -: 27:#include "CellularMultiplexer.h" - -: 28:#include "CellularInformation.h" - -: 29: - -: 30:namespace mbed { - -: 31: - -: 32:/** - -: 33: * Class CellularDevice - -: 34: * - -: 35: * An abstract interface that defines opening and closing of cellular interfaces. - -: 36: * Deleting/Closing of opened interfaces can be done only via this class. - -: 37: */ - 10: 38:class CellularDevice - -: 39:{ - -: 40:public: - -: 41: /** virtual Destructor - -: 42: */ - 10: 43: virtual ~CellularDevice() {} - -: 44: - -: 45:public: - -: 46: /** Create new CellularNetwork interface. - -: 47: * - -: 48: * @param fh file handle used in communication to modem. Can be for example UART handle. - -: 49: * @return New instance of interface CellularNetwork. - -: 50: */ - -: 51: virtual CellularNetwork *open_network(FileHandle *fh) = 0; - -: 52: - -: 53: /** Create new CellularSMS interface. - -: 54: * - -: 55: * @param fh file handle used in communication to modem. Can be for example UART handle. - -: 56: * @return New instance of interface CellularSMS. - -: 57: */ - -: 58: virtual CellularSMS *open_sms(FileHandle *fh) = 0; - -: 59: - -: 60: /** Create new CellularPower interface. - -: 61: * - -: 62: * @param fh file handle used in communication to modem. Can be for example UART handle. - -: 63: * @return New instance of interface CellularPower. - -: 64: */ - -: 65: virtual CellularPower *open_power(FileHandle *fh) = 0; - -: 66: - -: 67: /** Create new CellularSIM interface. - -: 68: * - -: 69: * @param fh file handle used in communication to modem. Can be for example UART handle. - -: 70: * @return New instance of interface CellularSIM. - -: 71: */ - -: 72: virtual CellularSIM *open_sim(FileHandle *fh) = 0; - -: 73: - -: 74: /** Create new CellularMultiplexer interface. - -: 75: * - -: 76: * @param fh file handle used in communication to modem. Can be for example UART handle. - -: 77: * @return New instance of interface CellularMultiplexer. - -: 78: */ - -: 79: virtual CellularMultiplexer *open_multiplexer(FileHandle *fh) = 0; - -: 80: - -: 81: /** Create new CellularInformation interface. - -: 82: * - -: 83: * @param fh file handle used in communication to modem. Can be for example UART handle. - -: 84: * @return New instance of interface CellularInformation. - -: 85: */ - -: 86: virtual CellularInformation *open_information(FileHandle *fh) = 0; - -: 87: - -: 88: /** Closes the opened CellularNetwork by deleting the CellularNetwork instance. - -: 89: */ - -: 90: virtual void close_network() = 0; - -: 91: - -: 92: /** Closes the opened CellularNetwork by deleting the CellularSMS instance. - -: 93: */ - -: 94: virtual void close_sms() = 0; - -: 95: - -: 96: /** Closes the opened CellularNetwork by deleting the CellularPower instance. - -: 97: */ - -: 98: virtual void close_power() = 0; - -: 99: - -: 100: /** Closes the opened CellularNetwork by deleting the CellularSIM instance. - -: 101: */ - -: 102: virtual void close_sim() = 0; - -: 103: - -: 104: /** Closes the opened CellularNetwork by deleting the CellularMultiplexer instance. - -: 105: */ - -: 106: virtual void close_multiplexer() = 0; - -: 107: - -: 108: /** Closes the opened CellularNetwork by deleting the CellularInformation instance. - -: 109: */ - -: 110: virtual void close_information() = 0; - -: 111: - -: 112: /** Set the default response timeout. - -: 113: * - -: 114: * @param timeout milliseconds to wait response from modem - -: 115: */ - -: 116: virtual void set_timeout(int timeout) = 0; - -: 117:}; - -: 118: - -: 119:} // namespace mbed - -: 120: - -: 121:#endif // CELLULAR_DEVICE_H_ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_output.txt deleted file mode 100644 index 3eb28f59c9..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_output.txt +++ /dev/null @@ -1,8 +0,0 @@ -File '../../../framework/AT/AT_CellularDevice.cpp' -Lines executed:90.65% of 139 -Creating 'AT_CellularDevice.cpp.gcov' - -File '../../../framework/API/CellularDevice.h' -Lines executed:100.00% of 2 -Creating 'CellularDevice.h.gcov' - diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_report.txt deleted file mode 100644 index 9b7b420626..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_report.txt +++ /dev/null @@ -1,2 +0,0 @@ -100.00% ../framework/API/CellularDevice.h - 90.65% ../framework/AT/AT_CellularDevice.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_report.txt.html deleted file mode 100644 index 523dfe8849..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/gcov/gcov_report.txt.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - -
CoverageFile
100.00% ../framework/API/CellularDevice.h
90.65% ../framework/AT/AT_CellularDevice.cpp
diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/lib/libAT_CellularDevice_unit.a b/features/cellular/UNITTESTS/at/at_cellulardevice/lib/libAT_CellularDevice_unit.a deleted file mode 100644 index db0f4b3dc2..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/lib/libAT_CellularDevice_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.d deleted file mode 100644 index beca409cb8..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.d +++ /dev/null @@ -1,78 +0,0 @@ -objs/AT_CellularDevice_unit/ATHandler_stub.o: \ - ../../stubs/ATHandler_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/platform.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.gcda deleted file mode 100644 index ab26a0c91e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.gcno deleted file mode 100644 index d422941c9f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.o deleted file mode 100644 index 8e79674537..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/ATHandler_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.d deleted file mode 100644 index b74bf945ea..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.d +++ /dev/null @@ -1,53 +0,0 @@ -objs/AT_CellularDevice_unit/AT_CellularBase_stub.o: \ - ../../stubs/AT_CellularBase_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/AT_CellularBase_stub.h \ - ../../../framework/AT/ATHandler.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/AT_CellularBase_stub.h: - -../../../framework/AT/ATHandler.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.gcda deleted file mode 100644 index 68a448e286..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.gcno deleted file mode 100644 index ab3b13fc01..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.o deleted file mode 100644 index 78899c1658..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularBase_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.d deleted file mode 100644 index 17c23a7258..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.d +++ /dev/null @@ -1,152 +0,0 @@ -objs/AT_CellularDevice_unit/AT_CellularDevice.o: \ - ../../../framework/AT/AT_CellularDevice.cpp \ - ../../../framework/AT/AT_CellularDevice.h \ - ../../../framework/API/CellularDevice.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../framework/API/CellularSIM.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/API/CellularSMS.h ../../../../../platform/Callback.h \ - ../../../framework/API/CellularPower.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../framework/API/CellularInformation.h \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/AT/AT_CellularSIM.h \ - ../../../framework/API/CellularSIM.h \ - ../../../framework/AT/AT_CellularSMS.h \ - ../../../framework/API/CellularSMS.h \ - ../../../framework/AT/AT_CellularPower.h \ - ../../../framework/API/CellularPower.h \ - ../../../framework/AT/AT_CellularMultiplexer.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../framework/AT/AT_CellularInformation.h \ - ../../../framework/API/CellularInformation.h - -../../../framework/AT/AT_CellularDevice.h: - -../../../framework/API/CellularDevice.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../framework/API/CellularSIM.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/API/CellularSMS.h: - -../../../../../platform/Callback.h: - -../../../framework/API/CellularPower.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../framework/API/CellularInformation.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/AT/AT_CellularSIM.h: - -../../../framework/API/CellularSIM.h: - -../../../framework/AT/AT_CellularSMS.h: - -../../../framework/API/CellularSMS.h: - -../../../framework/AT/AT_CellularPower.h: - -../../../framework/API/CellularPower.h: - -../../../framework/AT/AT_CellularMultiplexer.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../framework/AT/AT_CellularInformation.h: - -../../../framework/API/CellularInformation.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.gcda deleted file mode 100644 index 29e33106e3..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.gcno deleted file mode 100644 index a127fede45..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.o deleted file mode 100644 index 6a04b38844..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularDevice.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.d deleted file mode 100644 index a0e370e02f..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.d +++ /dev/null @@ -1,54 +0,0 @@ -objs/AT_CellularDevice_unit/AT_CellularInformation_stub.o: \ - ../../stubs/AT_CellularInformation_stub.cpp \ - ../../../framework/AT/AT_CellularInformation.h \ - ../../../framework/API/CellularInformation.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h - -../../../framework/AT/AT_CellularInformation.h: - -../../../framework/API/CellularInformation.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.gcda deleted file mode 100644 index 775a63c281..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.gcno deleted file mode 100644 index 0933b5c1be..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.o deleted file mode 100644 index 9cc0471b34..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularInformation_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.d deleted file mode 100644 index e19580a2d4..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.d +++ /dev/null @@ -1,69 +0,0 @@ -objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.o: \ - ../../stubs/AT_CellularMultiplexer_stub.cpp \ - ../../../framework/AT/AT_CellularMultiplexer.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../framework/AT/AT_CellularMultiplexer.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.gcda deleted file mode 100644 index b43238835f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.gcno deleted file mode 100644 index 6e492f6e7c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.o deleted file mode 100644 index 082da20272..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularMultiplexer_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.d deleted file mode 100644 index bfd226fa3a..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.d +++ /dev/null @@ -1,112 +0,0 @@ -objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.o: \ - ../../stubs/AT_CellularNetwork_stub.cpp \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/common/CellularUtil.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/PeripheralNames.h - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/common/CellularUtil.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/PeripheralNames.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.gcda deleted file mode 100644 index acd5660052..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.gcno deleted file mode 100644 index b91ec89beb..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.o deleted file mode 100644 index 37930298b3..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularNetwork_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.d deleted file mode 100644 index b0e6f54ee6..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.d +++ /dev/null @@ -1,72 +0,0 @@ -objs/AT_CellularDevice_unit/AT_CellularPower_stub.o: \ - ../../stubs/AT_CellularPower_stub.cpp \ - ../../../framework/AT/AT_CellularPower.h \ - ../../../framework/API/CellularPower.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h \ - ../../../framework/common/CellularUtil.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../framework/AT/AT_CellularPower.h: - -../../../framework/API/CellularPower.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../../framework/common/CellularUtil.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.gcda deleted file mode 100644 index e747fcc229..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.gcno deleted file mode 100644 index 8ac9a4bd3f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.o deleted file mode 100644 index a19e85e765..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularPower_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.d deleted file mode 100644 index e44f577fbd..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.d +++ /dev/null @@ -1,69 +0,0 @@ -objs/AT_CellularDevice_unit/AT_CellularSIM_stub.o: \ - ../../stubs/AT_CellularSIM_stub.cpp \ - ../../../framework/AT/AT_CellularSIM.h \ - ../../../framework/API/CellularSIM.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../framework/AT/AT_CellularSIM.h: - -../../../framework/API/CellularSIM.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.gcda deleted file mode 100644 index a6164f2c5b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.gcno deleted file mode 100644 index 500c768f4f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.o deleted file mode 100644 index c359caa559..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSIM_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.d deleted file mode 100644 index 7f9c2bb69e..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.d +++ /dev/null @@ -1,68 +0,0 @@ -objs/AT_CellularDevice_unit/AT_CellularSMS_stub.o: \ - ../../stubs/AT_CellularSMS_stub.cpp \ - ../../../framework/AT/AT_CellularSMS.h \ - ../../../framework/API/CellularSMS.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../framework/AT/AT_CellularSMS.h: - -../../../framework/API/CellularSMS.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.gcda deleted file mode 100644 index 528137308e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.gcno deleted file mode 100644 index af2bce1001..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.o deleted file mode 100644 index 166354cf80..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/AT_CellularSMS_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.d deleted file mode 100644 index 151c082e9d..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.d +++ /dev/null @@ -1,5 +0,0 @@ -objs/AT_CellularDevice_unit/CellularUtil_stub.o: \ - ../../stubs/CellularUtil_stub.cpp \ - ../../../framework/common/CellularUtil.h - -../../../framework/common/CellularUtil.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.gcda deleted file mode 100644 index 83f29f97ee..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.gcno deleted file mode 100644 index 741c2e0343..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.o deleted file mode 100644 index e0e39e5e05..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/CellularUtil_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.d deleted file mode 100644 index b55355d3da..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularDevice_unit/EventQueue_stub.o: \ - ../../stubs/EventQueue_stub.cpp ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.gcda deleted file mode 100644 index 797048b979..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.gcno deleted file mode 100644 index 94efe29434..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.o deleted file mode 100644 index 3b5d8723f1..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.d deleted file mode 100644 index 118e43f677..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/AT_CellularDevice_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.gcda deleted file mode 100644 index 7d1bf0ce81..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.gcno deleted file mode 100644 index 3e34254e3f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.o deleted file mode 100644 index ec3922cc52..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.d deleted file mode 100644 index f469db9ba4..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.d +++ /dev/null @@ -1,23 +0,0 @@ -objs/AT_CellularDevice_unit/NetworkInterface_stub.o: \ - ../../stubs/NetworkInterface_stub.cpp \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkStack.h - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkStack.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.gcda deleted file mode 100644 index e4d6d3545b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.gcno deleted file mode 100644 index 64471130f7..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.o deleted file mode 100644 index fb4396dfac..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/NetworkInterface_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.d deleted file mode 100644 index 15628e8e9b..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/AT_CellularDevice_unit/at_cellulardevicetest.o: \ - at_cellulardevicetest.cpp test_at_cellulardevice.h - -test_at_cellulardevice.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.gcda deleted file mode 100644 index ef1166a9ce..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.gcno deleted file mode 100644 index 7ae3906df2..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.o deleted file mode 100644 index 83b09482c7..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/at_cellulardevicetest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.d deleted file mode 100644 index ee243c0d26..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/AT_CellularDevice_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.gcda deleted file mode 100644 index f2ecdf9680..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.gcno deleted file mode 100644 index 06c4c74eb1..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.o deleted file mode 100644 index a34ac03d22..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.d deleted file mode 100644 index adeafd9fa9..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/AT_CellularDevice_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.gcda deleted file mode 100644 index d7826aca91..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.gcno deleted file mode 100644 index 3d4e5167c4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.o deleted file mode 100644 index 27840bb62a..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.d b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.d deleted file mode 100644 index cdf07ce59c..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.d +++ /dev/null @@ -1,164 +0,0 @@ -objs/AT_CellularDevice_unit/test_at_cellulardevice.o: \ - test_at_cellulardevice.cpp test_at_cellulardevice.h \ - ../../../framework/AT/AT_CellularDevice.h \ - ../../../framework/API/CellularDevice.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../framework/API/CellularSIM.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/API/CellularSMS.h ../../../../../platform/Callback.h \ - ../../../framework/API/CellularPower.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../framework/API/CellularInformation.h \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/AT/AT_CellularSIM.h \ - ../../../framework/API/CellularSIM.h \ - ../../../framework/AT/AT_CellularSMS.h \ - ../../../framework/API/CellularSMS.h \ - ../../../framework/AT/AT_CellularPower.h \ - ../../../framework/API/CellularPower.h \ - ../../../framework/AT/AT_CellularMultiplexer.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../framework/AT/AT_CellularInformation.h \ - ../../../framework/API/CellularInformation.h \ - ../../stubs/ATHandler_stub.h ../../../framework/AT/ATHandler.h \ - ../../stubs/FileHandle_stub.h ../../stubs/AT_CellularBase_stub.h - -test_at_cellulardevice.h: - -../../../framework/AT/AT_CellularDevice.h: - -../../../framework/API/CellularDevice.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../framework/API/CellularSIM.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/API/CellularSMS.h: - -../../../../../platform/Callback.h: - -../../../framework/API/CellularPower.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../framework/API/CellularInformation.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/AT/AT_CellularSIM.h: - -../../../framework/API/CellularSIM.h: - -../../../framework/AT/AT_CellularSMS.h: - -../../../framework/API/CellularSMS.h: - -../../../framework/AT/AT_CellularPower.h: - -../../../framework/API/CellularPower.h: - -../../../framework/AT/AT_CellularMultiplexer.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../framework/AT/AT_CellularInformation.h: - -../../../framework/API/CellularInformation.h: - -../../stubs/ATHandler_stub.h: - -../../../framework/AT/ATHandler.h: - -../../stubs/FileHandle_stub.h: - -../../stubs/AT_CellularBase_stub.h: diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.gcda b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.gcda deleted file mode 100644 index 410f465487..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.gcno b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.gcno deleted file mode 100644 index 9b929524c3..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.o b/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.o deleted file mode 100644 index 577c3041d7..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellulardevice/objs/AT_CellularDevice_unit/test_at_cellulardevice.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/AT_CellularInformation_unit_tests b/features/cellular/UNITTESTS/at/at_cellularinformation/AT_CellularInformation_unit_tests deleted file mode 100755 index 926c231b07..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/AT_CellularInformation_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/AT_CellularInformation_unit_tests.txt b/features/cellular/UNITTESTS/at/at_cellularinformation/AT_CellularInformation_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/cpputest_AT_CellularInformation.xml b/features/cellular/UNITTESTS/at/at_cellularinformation/cpputest_AT_CellularInformation.xml deleted file mode 100644 index 8d20b2b81f..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/cpputest_AT_CellularInformation.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/AT_CellularInformation.cpp.gcov b/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/AT_CellularInformation.cpp.gcov deleted file mode 100644 index 158e9052cc..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/AT_CellularInformation.cpp.gcov +++ /dev/null @@ -1,61 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularInformation.cpp - -: 0:Graph:objs/AT_CellularInformation_unit/AT_CellularInformation.gcno - -: 0:Data:objs/AT_CellularInformation_unit/AT_CellularInformation.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2018, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include "AT_CellularInformation.h" - -: 19: - -: 20:using namespace mbed; - -: 21: - 3: 22:AT_CellularInformation::AT_CellularInformation(ATHandler &at) : AT_CellularBase(at) - -: 23:{ - 3: 24:} - -: 25: - 4: 26:AT_CellularInformation::~AT_CellularInformation() - -: 27:{ - 4: 28:} - -: 29: - 1: 30:nsapi_error_t AT_CellularInformation::get_manufacturer(char *buf, size_t buf_size) - -: 31:{ - 1: 32: return get_info("AT+CGMI", buf, buf_size); - -: 33:} - -: 34: - 1: 35:nsapi_error_t AT_CellularInformation::get_model(char *buf, size_t buf_size) - -: 36:{ - 1: 37: return get_info("AT+CGMM", buf, buf_size); - -: 38:} - -: 39: - 1: 40:nsapi_error_t AT_CellularInformation::get_revision(char *buf, size_t buf_size) - -: 41:{ - 1: 42: return get_info("AT+CGMR", buf, buf_size); - -: 43:} - -: 44: - 3: 45:nsapi_error_t AT_CellularInformation::get_info(const char *cmd, char *buf, size_t buf_size) - -: 46:{ - 3: 47: _at.lock(); - -: 48: - 3: 49: _at.cmd_start(cmd); - 3: 50: _at.cmd_stop(); - 3: 51: _at.resp_start(); - 3: 52: _at.read_string(buf, buf_size-1); // stop tag OK\r\n - 3: 53: _at.resp_stop(); - -: 54: - 3: 55: return _at.unlock_return_error(); - -: 56:} diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/CellularInformation.h.gcov b/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/CellularInformation.h.gcov deleted file mode 100644 index bba5d661be..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/CellularInformation.h.gcov +++ /dev/null @@ -1,74 +0,0 @@ - -: 0:Source:../../../framework/API/CellularInformation.h - -: 0:Graph:objs/AT_CellularInformation_unit/AT_CellularInformation.gcno - -: 0:Data:objs/AT_CellularInformation_unit/AT_CellularInformation.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2018, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef CELLULAR_INFORMATION_H_ - -: 19:#define CELLULAR_INFORMATION_H_ - -: 20: - -: 21:#include - -: 22:#include "nsapi_types.h" - -: 23: - -: 24:namespace mbed { - -: 25: - -: 26:/** - -: 27: * Class CellularInformation - -: 28: * - -: 29: * An abstract interface that provides information about cellular device. - -: 30: */ - 3: 31:class CellularInformation - -: 32:{ - -: 33:protected: - -: 34: // friend of CellularDevice so that it's the only way to close/delete this class. - -: 35: friend class CellularDevice; - -: 36: - -: 37: /** virtual Destructor - -: 38: */ - 3: 39: virtual ~CellularInformation() {}; - -: 40: - -: 41:public: - -: 42: /** Request manufacturer identification of cellular device - -: 43: * - -: 44: * @param buf manufacturer identification - -: 45: * @param buf_size max length of manufacturer identification is 2048 characters - -: 46: * @return on success read character count, on failure negative error code - -: 47: */ - -: 48: virtual nsapi_size_or_error_t get_manufacturer(char *buf, size_t buf_size) = 0; - -: 49: - -: 50: /** Request model identification of cellular device - -: 51: * - -: 52: * @param buf model identification - -: 53: * @param buf_size max length of model identification is 2048 characters - -: 54: * @return on success read character count, on failure negative error code - -: 55: */ - -: 56: virtual nsapi_size_or_error_t get_model(char *buf, size_t buf_size) = 0; - -: 57: - -: 58: /** Request revision identification of cellular device - -: 59: * - -: 60: * @param buf revision identification - -: 61: * @param buf_size max length of revision identification is 2048 characters - -: 62: * @return on success read character count, on failure negative error code - -: 63: */ - -: 64: virtual nsapi_size_or_error_t get_revision(char *buf, size_t buf_size) = 0; - -: 65:}; - -: 66: - -: 67:} // namespace mbed - -: 68: - -: 69:#endif // CELLULAR_INFORMATION_H_ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_output.txt deleted file mode 100644 index 0f7a048c87..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_output.txt +++ /dev/null @@ -1,8 +0,0 @@ -File '../../../framework/AT/AT_CellularInformation.cpp' -Lines executed:100.00% of 18 -Creating 'AT_CellularInformation.cpp.gcov' - -File '../../../framework/API/CellularInformation.h' -Lines executed:100.00% of 2 -Creating 'CellularInformation.h.gcov' - diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_report.txt deleted file mode 100644 index 9b2501db30..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_report.txt +++ /dev/null @@ -1,2 +0,0 @@ -100.00% ../framework/API/CellularInformation.h -100.00% ../framework/AT/AT_CellularInformation.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_report.txt.html deleted file mode 100644 index e507d22f74..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/gcov/gcov_report.txt.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - -
CoverageFile
100.00% ../framework/API/CellularInformation.h
100.00% ../framework/AT/AT_CellularInformation.cpp
diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/lib/libAT_CellularInformation_unit.a b/features/cellular/UNITTESTS/at/at_cellularinformation/lib/libAT_CellularInformation_unit.a deleted file mode 100644 index fd747e7d62..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/lib/libAT_CellularInformation_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.d b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.d deleted file mode 100644 index d64f36f253..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.d +++ /dev/null @@ -1,78 +0,0 @@ -objs/AT_CellularInformation_unit/ATHandler_stub.o: \ - ../../stubs/ATHandler_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/platform.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.gcda deleted file mode 100644 index 2ac2da2ff2..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.gcno deleted file mode 100644 index 39581aa433..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.o b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.o deleted file mode 100644 index 051fad622e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/ATHandler_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.d b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.d deleted file mode 100644 index 0811c894d3..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.d +++ /dev/null @@ -1,53 +0,0 @@ -objs/AT_CellularInformation_unit/AT_CellularBase_stub.o: \ - ../../stubs/AT_CellularBase_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/AT_CellularBase_stub.h \ - ../../../framework/AT/ATHandler.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/AT_CellularBase_stub.h: - -../../../framework/AT/ATHandler.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.gcda deleted file mode 100644 index 4783066f4e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.gcno deleted file mode 100644 index 0c52812af8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.o b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.o deleted file mode 100644 index c46a789a62..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularBase_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.d b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.d deleted file mode 100644 index 8e44fc5361..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.d +++ /dev/null @@ -1,54 +0,0 @@ -objs/AT_CellularInformation_unit/AT_CellularInformation.o: \ - ../../../framework/AT/AT_CellularInformation.cpp \ - ../../../framework/AT/AT_CellularInformation.h \ - ../../../framework/API/CellularInformation.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h - -../../../framework/AT/AT_CellularInformation.h: - -../../../framework/API/CellularInformation.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.gcda b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.gcda deleted file mode 100644 index fa685c73ee..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.gcno b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.gcno deleted file mode 100644 index 80a69c20ca..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.o b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.o deleted file mode 100644 index 6a35eb77d2..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/AT_CellularInformation.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.d deleted file mode 100644 index 51f9676942..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularInformation_unit/EventQueue_stub.o: \ - ../../stubs/EventQueue_stub.cpp ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.gcda deleted file mode 100644 index c499257dda..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.gcno deleted file mode 100644 index 85a626699c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.o deleted file mode 100644 index e0f578e635..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.d deleted file mode 100644 index bc0f6aa5b9..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/AT_CellularInformation_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.gcda deleted file mode 100644 index b535cc0320..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.gcno deleted file mode 100644 index f8dc45cb0f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.o deleted file mode 100644 index d9b5a95938..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.d b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.d deleted file mode 100644 index 3d918a8b16..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/AT_CellularInformation_unit/at_cellularinformationtest.o: \ - at_cellularinformationtest.cpp test_at_cellularinformation.h - -test_at_cellularinformation.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.gcda b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.gcda deleted file mode 100644 index ab44bd2c06..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.gcno b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.gcno deleted file mode 100644 index 02a86a9f7e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.o b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.o deleted file mode 100644 index dd4a57c031..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/at_cellularinformationtest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.d b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.d deleted file mode 100644 index f9779a3bfe..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/AT_CellularInformation_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.gcda b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.gcda deleted file mode 100644 index 0a30328549..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.gcno b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.gcno deleted file mode 100644 index e610401e91..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.o b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.o deleted file mode 100644 index 9b2bff47fe..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.d deleted file mode 100644 index 4ae9e6929a..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/AT_CellularInformation_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.gcda deleted file mode 100644 index a497e30ff5..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.gcno deleted file mode 100644 index 8c5578c9a4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.o deleted file mode 100644 index 0e31263deb..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.d b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.d deleted file mode 100644 index 2f3b3b4102..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.d +++ /dev/null @@ -1,87 +0,0 @@ -objs/AT_CellularInformation_unit/test_at_cellularinformation.o: \ - test_at_cellularinformation.cpp test_at_cellularinformation.h \ - ../../stubs/ATHandler_stub.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h ../../stubs/FileHandle_stub.h \ - ../../../framework/AT/AT_CellularInformation.h \ - ../../../framework/API/CellularInformation.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../../framework/AT/AT_CellularBase.h - -test_at_cellularinformation.h: - -../../stubs/ATHandler_stub.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../stubs/FileHandle_stub.h: - -../../../framework/AT/AT_CellularInformation.h: - -../../../framework/API/CellularInformation.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../../framework/AT/AT_CellularBase.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.gcda b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.gcda deleted file mode 100644 index 6cc357de47..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.gcno b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.gcno deleted file mode 100644 index 4193ece23a..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.o b/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.o deleted file mode 100644 index 0e7908d549..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularinformation/objs/AT_CellularInformation_unit/test_at_cellularinformation.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/AT_CellularMultiplexer_unit_tests b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/AT_CellularMultiplexer_unit_tests deleted file mode 100755 index 5e0c1abe1b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/AT_CellularMultiplexer_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/AT_CellularMultiplexer_unit_tests.txt b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/AT_CellularMultiplexer_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/cpputest_AT_CellularMultiplexer.xml b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/cpputest_AT_CellularMultiplexer.xml deleted file mode 100644 index 4f0428899e..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/cpputest_AT_CellularMultiplexer.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/AT_CellularMultiplexer.cpp.gcov b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/AT_CellularMultiplexer.cpp.gcov deleted file mode 100644 index 5a24aa0f0c..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/AT_CellularMultiplexer.cpp.gcov +++ /dev/null @@ -1,48 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularMultiplexer.cpp - -: 0:Graph:objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcno - -: 0:Data:objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include "AT_CellularMultiplexer.h" - -: 19:#include "CellularLog.h" - -: 20: - -: 21:using namespace mbed; - -: 22: - 2: 23:AT_CellularMultiplexer::AT_CellularMultiplexer(ATHandler &at) : AT_CellularBase(at) - -: 24:{ - 2: 25:} - -: 26: - 3: 27:AT_CellularMultiplexer::~AT_CellularMultiplexer() - -: 28:{ - 3: 29:} - -: 30: - 1: 31:nsapi_error_t AT_CellularMultiplexer::multiplexer_mode_start() - -: 32:{ - -: 33: log_info("multiplexer_mode_start()"); - -: 34: - 1: 35: _at.lock(); - -: 36: - 1: 37: _at.cmd_start("AT+CMUX=0"); - 1: 38: _at.cmd_stop(); - 1: 39: _at.resp_start(); - 1: 40: _at.resp_stop(); - -: 41: - 1: 42: return _at.unlock_return_error(); - -: 43:} diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/CellularMultiplexer.h.gcov b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/CellularMultiplexer.h.gcov deleted file mode 100644 index afd15155cb..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/CellularMultiplexer.h.gcov +++ /dev/null @@ -1,56 +0,0 @@ - -: 0:Source:../../../framework/API/CellularMultiplexer.h - -: 0:Graph:objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcno - -: 0:Data:objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef CELLULAR_MULTIPLEXER_H_ - -: 19:#define CELLULAR_MULTIPLEXER_H_ - -: 20: - -: 21:#include "nsapi_types.h" - -: 22: - -: 23:namespace mbed { - -: 24: - -: 25:/** - -: 26: * Class CellularMultiplexer - -: 27: * - -: 28: * An abstract interface that provides a way to start multiplexer mode in modem. - -: 29: */ - 2: 30:class CellularMultiplexer - -: 31:{ - -: 32:protected: - -: 33: // friend of CellularDevice so that it's the only way to close/delete this class. - -: 34: friend class CellularDevice; - -: 35: - -: 36: /** virtual Destructor - -: 37: */ - 2: 38: virtual ~CellularMultiplexer() {}; - -: 39: - -: 40:public: - -: 41: - -: 42: /** Starts modem multiplexer mode specified by 3GPP TS 27.010. - -: 43: * - -: 44: * @return zero on success, negative error code on failure - -: 45: */ - -: 46: virtual nsapi_error_t multiplexer_mode_start() = 0; - -: 47:}; - -: 48: - -: 49:} // namespace mbed - -: 50: - -: 51:#endif // CELLULAR_MULTIPLEXER_H_ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_output.txt deleted file mode 100644 index 269477ed32..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_output.txt +++ /dev/null @@ -1,8 +0,0 @@ -File '../../../framework/AT/AT_CellularMultiplexer.cpp' -Lines executed:100.00% of 11 -Creating 'AT_CellularMultiplexer.cpp.gcov' - -File '../../../framework/API/CellularMultiplexer.h' -Lines executed:100.00% of 2 -Creating 'CellularMultiplexer.h.gcov' - diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_report.txt deleted file mode 100644 index 77c3217d0b..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_report.txt +++ /dev/null @@ -1,2 +0,0 @@ -100.00% ../framework/API/CellularMultiplexer.h -100.00% ../framework/AT/AT_CellularMultiplexer.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_report.txt.html deleted file mode 100644 index d2d82771b3..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/gcov/gcov_report.txt.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - -
CoverageFile
100.00% ../framework/API/CellularMultiplexer.h
100.00% ../framework/AT/AT_CellularMultiplexer.cpp
diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/lib/libAT_CellularMultiplexer_unit.a b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/lib/libAT_CellularMultiplexer_unit.a deleted file mode 100644 index 598441a63b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/lib/libAT_CellularMultiplexer_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.d b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.d deleted file mode 100644 index 7d60d13cf4..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.d +++ /dev/null @@ -1,78 +0,0 @@ -objs/AT_CellularMultiplexer_unit/ATHandler_stub.o: \ - ../../stubs/ATHandler_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/platform.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.gcda deleted file mode 100644 index 99943c3448..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.gcno deleted file mode 100644 index ae12bf3f27..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.o b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.o deleted file mode 100644 index 9079591fba..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/ATHandler_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.d b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.d deleted file mode 100644 index 17bdd705eb..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.d +++ /dev/null @@ -1,53 +0,0 @@ -objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.o: \ - ../../stubs/AT_CellularBase_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/AT_CellularBase_stub.h \ - ../../../framework/AT/ATHandler.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/AT_CellularBase_stub.h: - -../../../framework/AT/ATHandler.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.gcda deleted file mode 100644 index a06ac12bb5..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.gcno deleted file mode 100644 index 32aa18e774..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.o b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.o deleted file mode 100644 index 7e5faa54e2..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularBase_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.d b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.d deleted file mode 100644 index fc1a8d9606..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.d +++ /dev/null @@ -1,69 +0,0 @@ -objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.o: \ - ../../../framework/AT/AT_CellularMultiplexer.cpp \ - ../../../framework/AT/AT_CellularMultiplexer.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../framework/AT/AT_CellularMultiplexer.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcda b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcda deleted file mode 100644 index bb81afcc32..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcno b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcno deleted file mode 100644 index 02b1f0ba9f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.o b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.o deleted file mode 100644 index f1fa4702d7..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/AT_CellularMultiplexer.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.d deleted file mode 100644 index ce39686894..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularMultiplexer_unit/EventQueue_stub.o: \ - ../../stubs/EventQueue_stub.cpp ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.gcda deleted file mode 100644 index 71d5a57fd7..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.gcno deleted file mode 100644 index c500d7c33e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.o deleted file mode 100644 index 2043416432..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.d deleted file mode 100644 index d1b5031eee..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/AT_CellularMultiplexer_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.gcda deleted file mode 100644 index c476fe9439..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.gcno deleted file mode 100644 index 25980fd480..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.o deleted file mode 100644 index 5331239e6d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.d b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.d deleted file mode 100644 index 1a493c8d35..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.o: \ - at_cellularmultiplexertest.cpp test_at_cellularmultiplexer.h - -test_at_cellularmultiplexer.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.gcda b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.gcda deleted file mode 100644 index b89ffa0004..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.gcno b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.gcno deleted file mode 100644 index ab63721bf8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.o b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.o deleted file mode 100644 index 9e47fb4209..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/at_cellularmultiplexertest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.d b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.d deleted file mode 100644 index 8da48abe4c..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/AT_CellularMultiplexer_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.gcda b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.gcda deleted file mode 100644 index 56233781f4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.gcno b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.gcno deleted file mode 100644 index 6b9c0d40fc..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.o b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.o deleted file mode 100644 index a54513a1ee..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.d deleted file mode 100644 index 4e7c30163c..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/AT_CellularMultiplexer_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.gcda deleted file mode 100644 index 60e9be9db1..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.gcno deleted file mode 100644 index b315b36042..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.o deleted file mode 100644 index 8bddcabb06..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.d b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.d deleted file mode 100644 index f2a7059470..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.d +++ /dev/null @@ -1,162 +0,0 @@ -objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.o: \ - test_at_cellularmultiplexer.cpp test_at_cellularmultiplexer.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../framework/AT/AT_CellularDevice.h \ - ../../../framework/API/CellularDevice.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h ../../../framework/API/CellularSIM.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/API/CellularSMS.h \ - ../../../framework/API/CellularPower.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../framework/API/CellularInformation.h \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/AT/AT_CellularSIM.h \ - ../../../framework/API/CellularSIM.h \ - ../../../framework/AT/AT_CellularSMS.h \ - ../../../framework/API/CellularSMS.h \ - ../../../framework/AT/AT_CellularPower.h \ - ../../../framework/API/CellularPower.h \ - ../../../framework/AT/AT_CellularMultiplexer.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../framework/AT/AT_CellularInformation.h \ - ../../../framework/API/CellularInformation.h \ - ../../../framework/AT/AT_CellularMultiplexer.h \ - ../../stubs/FileHandle_stub.h - -test_at_cellularmultiplexer.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../framework/AT/AT_CellularDevice.h: - -../../../framework/API/CellularDevice.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/API/CellularSIM.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/API/CellularSMS.h: - -../../../framework/API/CellularPower.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../framework/API/CellularInformation.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/AT/AT_CellularSIM.h: - -../../../framework/API/CellularSIM.h: - -../../../framework/AT/AT_CellularSMS.h: - -../../../framework/API/CellularSMS.h: - -../../../framework/AT/AT_CellularPower.h: - -../../../framework/API/CellularPower.h: - -../../../framework/AT/AT_CellularMultiplexer.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../framework/AT/AT_CellularInformation.h: - -../../../framework/API/CellularInformation.h: - -../../../framework/AT/AT_CellularMultiplexer.h: - -../../stubs/FileHandle_stub.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.gcda b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.gcda deleted file mode 100644 index bf25d7c31c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.gcno b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.gcno deleted file mode 100644 index 29b610e7fe..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.o b/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.o deleted file mode 100644 index 814b5513e4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularmultiplexer/objs/AT_CellularMultiplexer_unit/test_at_cellularmultiplexer.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/AT_CellularNetwork_unit_tests b/features/cellular/UNITTESTS/at/at_cellularnetwork/AT_CellularNetwork_unit_tests deleted file mode 100755 index fc5377949d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/AT_CellularNetwork_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/AT_CellularNetwork_unit_tests.txt b/features/cellular/UNITTESTS/at/at_cellularnetwork/AT_CellularNetwork_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/cpputest_AT_CellularNetwork.xml b/features/cellular/UNITTESTS/at/at_cellularnetwork/cpputest_AT_CellularNetwork.xml deleted file mode 100644 index 92acf5e5b8..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/cpputest_AT_CellularNetwork.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/AT_CellularNetwork.cpp.gcov b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/AT_CellularNetwork.cpp.gcov deleted file mode 100644 index bafffc836e..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/AT_CellularNetwork.cpp.gcov +++ /dev/null @@ -1,910 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularNetwork.cpp - -: 0:Graph:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno - -: 0:Data:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include - -: 19:#include "AT_CellularNetwork.h" - -: 20:#include "nsapi_ppp.h" - -: 21:#include "CellularUtil.h" - -: 22:#include "CellularLog.h" - -: 23: - -: 24:using namespace std; - -: 25:using namespace mbed_cellular_util; - -: 26:using namespace mbed; - -: 27: - 25: 28:AT_CellularNetwork::AT_CellularNetwork(ATHandler &atHandler) : AT_CellularBase(atHandler), - -: 29: _stack(NULL), _uname(NULL), _pwd(NULL), _ip_stack_type_requested(DEFAULT_STACK), _ip_stack_type(DEFAULT_STACK), _cid(-1), - 25: 30: _op_act(operator_t::RAT_UNKNOWN), _authentication_type(CHAP), _last_reg_type(C_REG) - -: 31:{ - -: 32: - 25: 33: _at.set_urc_handler("NO CARRIER", callback(this, &AT_CellularNetwork::urc_no_carrier)); - -: 34: - 25: 35: memset(_apn, 0, MAX_APN_LENGTH); - -: 36: - -: 37:#ifdef MBED_CONF_APP_CELLULAR_APN - -: 38: strncpy(_apn, MBED_CONF_APP_CELLULAR_APN, MAX_APN_LENGTH); - -: 39: log_debug("Using APN [%s] from json", _apn); - -: 40:#endif - -: 41: - 25: 42:} - -: 43: - 26: 44:AT_CellularNetwork::~AT_CellularNetwork() - -: 45:{ - 26: 46:} - -: 47: - 1: 48:void AT_CellularNetwork::urc_no_carrier() - -: 49:{ - 1: 50: if (_connection_status_cb) { - 1: 51: _connection_status_cb(NSAPI_ERROR_CONNECTION_LOST); - -: 52: } - 1: 53:} - -: 54: - 1: 55:nsapi_error_t AT_CellularNetwork::set_credentials(const char *apn, - -: 56: const char *username, const char *password) - -: 57:{ - 1: 58: strncpy(_apn, apn, MAX_APN_LENGTH); - 1: 59: _uname = username; - 1: 60: _pwd = password; - -: 61: - 1: 62: return NSAPI_ERROR_OK; - -: 63:} - -: 64: - 1: 65:nsapi_error_t AT_CellularNetwork::set_credentials(const char *apn, - -: 66: AuthenticationType type, const char *username, const char *password) - -: 67:{ - 1: 68: strncpy(_apn, apn, MAX_APN_LENGTH); - 1: 69: _uname = username; - 1: 70: _pwd = password; - 1: 71: _authentication_type = type; - -: 72: - 1: 73: return NSAPI_ERROR_OK; - -: 74:} - -: 75: - 2: 76:nsapi_error_t AT_CellularNetwork::connect(const char *apn, - -: 77: const char *username, const char *password) - -: 78:{ - 2: 79: strncpy(_apn, apn, MAX_APN_LENGTH); - 2: 80: _uname = username; - 2: 81: _pwd = password; - -: 82: - 2: 83: return connect(); - -: 84:} - -: 85: - 2: 86:nsapi_error_t AT_CellularNetwork::connect() - -: 87:{ - 2: 88: _at.lock(); - -: 89: - 2: 90: nsapi_error_t err = set_context_to_be_activated(); - 2: 91: if (err != NSAPI_ERROR_OK) { - 1: 92: _at.unlock(); - 1: 93: log_error("Failed to activate network context!"); - 1: 94: return err; - -: 95: } - -: 96: - 1: 97: err = open_data_channel(); - 1: 98: if (err != NSAPI_ERROR_OK) { - 1: 99: _at.unlock(); - 1: 100: log_error("Failed to open data channel!"); - 1: 101: return err; - -: 102: } - -: 103: - #####: 104: _at.unlock(); - -: 105: - #####: 106: return NSAPI_ERROR_OK; - -: 107:} - -: 108: - 1: 109:nsapi_error_t AT_CellularNetwork::open_data_channel() - -: 110:{ - -: 111: //old way: _at.send("ATD*99***%d#", _cid) && _at.recv("CONNECT"); - 1: 112: nsapi_error_t err = NSAPI_ERROR_NO_CONNECTION; - -: 113:#if NSAPI_PPP_AVAILABLE - -: 114: log_info("Open data channel in PPP mode"); - -: 115: _at.cmd_start("AT+CGDATA=\"PPP\","); - -: 116: _at.write_int(_cid); - -: 117: _at.cmd_stop(); - -: 118: - -: 119: _at.resp_start("CONNECT", true); - -: 120: if (_at.get_last_error()) { - -: 121: log_warn("Failed to CONNECT"); - -: 122: } - -: 123: /* Initialize PPP - -: 124: * mbed_ppp_init() is a blocking call, it will block until - -: 125: * connected, or timeout after 30 seconds*/ - -: 126: err = nsapi_ppp_connect(_at.get_file_handle(), _connection_status_cb, _uname, _pwd, _ip_stack_type); - -: 127:#else - -: 128: // do check for stack to validate that we have support for stack - 1: 129: _stack = get_stack(); - 1: 130: if (!_stack) { - 1: 131: return err; - -: 132: } - -: 133: - #####: 134: bool is_context_active = false; - #####: 135: _at.cmd_start("AT+CGACT?"); - #####: 136: _at.cmd_stop(); - #####: 137: _at.resp_start("+CGACT:"); - #####: 138: while (_at.info_resp()) { - #####: 139: int context_id = _at.read_int(); - #####: 140: int context_activation_state = _at.read_int(); - #####: 141: if (context_id == _cid && context_activation_state == 1) { - #####: 142: is_context_active = true; - -: 143: } - -: 144: } - #####: 145: _at.resp_stop(); - -: 146: - #####: 147: if (!is_context_active) { - -: 148: log_info("Activate PDP context"); - #####: 149: _at.cmd_start("AT+CGACT=1,"); - #####: 150: _at.write_int(_cid); - #####: 151: _at.cmd_stop(); - #####: 152: _at.resp_start(); - #####: 153: _at.resp_stop(); - -: 154: } - -: 155: - #####: 156: err = (_at.get_last_error() == NSAPI_ERROR_OK) ? NSAPI_ERROR_OK : NSAPI_ERROR_NO_CONNECTION; - -: 157:#endif - #####: 158: return err; - -: 159:} - -: 160: - -: 161:/** - -: 162: * User initiated disconnect - -: 163: * - -: 164: * Disconnects from PPP connection only and brings down the underlying network - -: 165: * interface - -: 166: */ - 1: 167:nsapi_error_t AT_CellularNetwork::disconnect() - -: 168:{ - -: 169:#if NSAPI_PPP_AVAILABLE - -: 170: return nsapi_ppp_disconnect(_at.get_file_handle()); - -: 171:#else - 1: 172: return NSAPI_ERROR_OK; - -: 173:#endif - -: 174:} - -: 175: - 1: 176:void AT_CellularNetwork::connection_status_cb(Callback cb) - -: 177:{ - 1: 178: _connection_status_cb = cb; - 1: 179:} - -: 180: - 2: 181:nsapi_error_t AT_CellularNetwork::set_context_to_be_activated() - -: 182:{ - -: 183: // try to find or create context with suitable stack - 2: 184: if (!get_context(_ip_stack_type_requested)) { - 1: 185: return NSAPI_ERROR_NO_CONNECTION; - -: 186: } - -: 187: - -: 188: // if user has defined user name and password we need to call CGAUTH before activating or modifying context - 1: 189: if (_pwd && _uname) { - 1: 190: _at.cmd_start("AT+CGAUTH="); - 1: 191: _at.write_int(_cid); - 1: 192: _at.write_int(_authentication_type); - 1: 193: _at.write_string(_uname); - 1: 194: _at.write_string(_pwd); - 1: 195: _at.cmd_stop(); - 1: 196: _at.resp_start(); - 1: 197: _at.resp_stop(); - 1: 198: if (_at.get_last_error() != NSAPI_ERROR_OK) { - #####: 199: return NSAPI_ERROR_AUTH_FAILURE; - -: 200: } - -: 201: } - -: 202: - 1: 203: return _at.get_last_error(); - -: 204:} - -: 205: - 2: 206:bool AT_CellularNetwork::set_new_context(nsapi_ip_stack_t stack, int cid) - -: 207:{ - 2: 208: nsapi_ip_stack_t tmp_stack = stack; - 2: 209: char pdp_type[8+1] = {0}; - -: 210: - 2: 211: switch (stack) { - -: 212: case IPV4_STACK: - #####: 213: strncpy(pdp_type, "IP", sizeof(pdp_type)); - #####: 214: break; - -: 215: case IPV6_STACK: - #####: 216: strncpy(pdp_type, "IPV6", sizeof(pdp_type)); - #####: 217: break; - -: 218: case IPV4V6_STACK: - #####: 219: strncpy(pdp_type, "IPV4V6", sizeof(pdp_type)); - #####: 220: break; - -: 221: default: - 2: 222: strncpy(pdp_type, "", sizeof(pdp_type)); - 2: 223: break; - -: 224: } - -: 225: - -: 226: //apn: "If the value is null or omitted, then the subscription value will be requested." - 2: 227: bool success = false; - 2: 228: _at.cmd_start("AT+CGDCONT="); - 2: 229: _at.write_int(cid); - 2: 230: _at.write_string(pdp_type); - 2: 231: _at.write_string(_apn); - 2: 232: _at.cmd_stop(); - 2: 233: _at.resp_start(); - 2: 234: _at.resp_stop(); - 2: 235: success = (_at.get_last_error() == NSAPI_ERROR_OK); - -: 236: - -: 237: // Fall back to ipv4 - 2: 238: if (!success && tmp_stack == IPV4V6_STACK) { - #####: 239: tmp_stack = IPV4_STACK; - #####: 240: _at.cmd_start("AT+FCLASS=0;+CGDCONT="); - #####: 241: _at.write_int(cid); - #####: 242: _at.write_string("IP"); - #####: 243: _at.write_string(_apn); - #####: 244: _at.cmd_stop(); - #####: 245: _at.resp_start(); - #####: 246: _at.resp_stop(); - #####: 247: success = (_at.get_last_error() == NSAPI_ERROR_OK); - -: 248: } - -: 249: - 2: 250: if (success) { - 1: 251: _ip_stack_type = tmp_stack; - 1: 252: _cid = cid; - -: 253: } - -: 254: - 2: 255: return success; - -: 256:} - -: 257: - 2: 258:bool AT_CellularNetwork::get_context(nsapi_ip_stack_t requested_stack) - -: 259:{ - 2: 260: _at.cmd_start("AT+CGDCONT?"); - 2: 261: _at.cmd_stop(); - 2: 262: _at.resp_start("+CGDCONT:"); - 2: 263: _cid = -1; - 2: 264: int cid_max = 0; // needed when creating new context - 2: 265: char apn[MAX_APN_LENGTH] = {0}; - 2: 266: int apn_len = 0; - -: 267: - 2: 268: while (_at.info_resp()) { - #####: 269: int cid = _at.read_int(); - #####: 270: if (cid > cid_max) { - #####: 271: cid_max = cid; - -: 272: } - -: 273: char pdp_type_from_context[10]; - #####: 274: int pdp_type_len = _at.read_string(pdp_type_from_context, sizeof(pdp_type_from_context) - 1); - #####: 275: if (pdp_type_len > 0) { - #####: 276: apn_len = _at.read_string(apn, sizeof(apn) - 1); - #####: 277: if (apn_len >= 0) { - #####: 278: if (strlen(_apn) && strcmp(apn, _apn) != 0 ) { - #####: 279: continue; - -: 280: } - #####: 281: nsapi_ip_stack_t pdp_stack = string_to_stack_type(pdp_type_from_context); - #####: 282: if (pdp_stack != DEFAULT_STACK) { - #####: 283: if (get_modem_stack_type(pdp_stack)) { - #####: 284: if (requested_stack == IPV4_STACK) { - #####: 285: if (pdp_stack == IPV4_STACK || pdp_stack == IPV4V6_STACK) { - #####: 286: _ip_stack_type = requested_stack; - #####: 287: _cid = cid; - #####: 288: break; - -: 289: } - #####: 290: } else if (requested_stack == IPV6_STACK) { - #####: 291: if (pdp_stack == IPV6_STACK || pdp_stack == IPV4V6_STACK) { - #####: 292: _ip_stack_type = requested_stack; - #####: 293: _cid = cid; - #####: 294: break; - -: 295: } - -: 296: } else { // accept any but prefer to IPv6 - #####: 297: if (pdp_stack == IPV6_STACK || pdp_stack == IPV4V6_STACK) { - #####: 298: _ip_stack_type = requested_stack; - #####: 299: _cid = cid; - #####: 300: break; - -: 301: } - #####: 302: if (_ip_stack_type == DEFAULT_STACK) { - #####: 303: _ip_stack_type = pdp_stack; - #####: 304: _cid = cid; - -: 305: } - -: 306: } - -: 307: } - -: 308: } - -: 309: } - -: 310: } - -: 311: } - 2: 312: _at.resp_stop(); - 2: 313: if (_cid == -1) { // no suitable context was found so create a new one - 2: 314: if (!set_new_context(_ip_stack_type, cid_max+1)) { - 1: 315: return false; - -: 316: } - -: 317: } - -: 318: - -: 319: // save the apn - 1: 320: if (apn_len > 0 && !strlen(_apn)) { - #####: 321: strncpy(_apn, apn, MAX_APN_LENGTH); - -: 322: } - -: 323: - -: 324: log_debug("Context id %d", _cid); - 1: 325: return true; - -: 326:} - -: 327: - #####: 328:nsapi_ip_stack_t AT_CellularNetwork::string_to_stack_type(const char* pdp_type) - -: 329:{ - #####: 330: nsapi_ip_stack_t stack = DEFAULT_STACK; - #####: 331: int len = strlen(pdp_type); - -: 332: - #####: 333: if (len == 6 && memcmp(pdp_type, "IPV4V6", len) == 0) { - #####: 334: stack = IPV4V6_STACK; - #####: 335: } else if (len == 4 && memcmp(pdp_type, "IPV6", len) == 0) { - #####: 336: stack = IPV6_STACK; - #####: 337: } else if (len == 2 && memcmp(pdp_type, "IP", len) == 0) { - #####: 338: stack = IPV4_STACK; - -: 339: } - #####: 340: return stack; - -: 341:} - -: 342: - 1: 343:nsapi_error_t AT_CellularNetwork::set_registration_urc(bool urc_on) - -: 344:{ - 1: 345: RegistrationType reg_types[] = {C_EREG, C_GREG, C_REG}; - 1: 346: const char *cmd_on[] = {"AT+CEREG=2", "AT+CGREG=2", "AT+CREG=2"}; - 1: 347: const char *cmd_off[] = {"AT+CEREG=0", "AT+CGREG=0", "AT+CREG=0"}; - 4: 348: for (uint8_t i=0; i= 0 && i < C_MAX); - -: 398: - 2: 399: RegistrationType reg_types[] = { C_EREG, C_GREG, C_REG}; - 2: 400: const char *cmd[] = { "AT+CEREG", "AT+CGREG", "AT+CREG"}; - 2: 401: const char *rsp[] = { "+CEREG: ", "+CGREG: ", "+CREG: "}; - -: 402: - 2: 403: const int LAC_LENGTH = 5, CELL_ID_LENGTH = 9; - 2: 404: char lac_string[LAC_LENGTH] = {0}, cell_id_string[CELL_ID_LENGTH] = {0}; - 2: 405: bool lac_read = false, cell_id_read = false; - -: 406: - 2: 407: _cell_id = -1; - 2: 408: _lac = -1; - -: 409: - 2: 410: _at.lock(); - -: 411: - 2: 412: if (!has_registration(reg_types[i])) { - #####: 413: _at.unlock(); - #####: 414: return NSAPI_ERROR_UNSUPPORTED; - -: 415: } - -: 416: - 2: 417: _at.cmd_start(cmd[i]); - 2: 418: _at.write_string("=2", false); - 2: 419: _at.cmd_stop(); - 2: 420: _at.resp_start(); - 2: 421: _at.resp_stop(); - -: 422: - 2: 423: _at.cmd_start(cmd[i]); - 2: 424: _at.write_string("?", false); - -: 425: - 2: 426: _at.cmd_stop(); - 2: 427: _at.resp_start(rsp[i]); - 2: 428: _at.read_int(); // ignore urc mode subparam - 2: 429: status = (RegistrationStatus)_at.read_int(); - -: 430: - 2: 431: int len = _at.read_string(lac_string, LAC_LENGTH); - 2: 432: if (memcmp(lac_string, "ffff", LAC_LENGTH-1) && len >= 0) { - 2: 433: lac_read = true; - -: 434: } - -: 435: - 2: 436: len = _at.read_string(cell_id_string, CELL_ID_LENGTH); - 2: 437: if (memcmp(cell_id_string, "ffffffff", CELL_ID_LENGTH-1) && len >= 0) { - 2: 438: cell_id_read = true; - -: 439: } - -: 440: - 2: 441: _AcT = (operator_t::RadioAccessTechnology)_at.read_int(); - -: 442: - 2: 443: _at.resp_stop(); - -: 444: - 2: 445: _at.cmd_start(cmd[i]); - 2: 446: _at.write_string("=0", false); - 2: 447: _at.cmd_stop(); - 2: 448: _at.resp_start(); - 2: 449: _at.resp_stop(); - 2: 450: nsapi_error_t ret = _at.get_last_error(); - 2: 451: _at.unlock(); - -: 452: - 2: 453: if (lac_read) { - 2: 454: _lac = hex_str_to_int(lac_string, LAC_LENGTH); - -: 455: log_debug("lac %s %d", lac_string, _lac ); - -: 456: } - -: 457: - 2: 458: if (cell_id_read) { - 2: 459: _cell_id = hex_str_to_int(cell_id_string, CELL_ID_LENGTH); - -: 460: log_debug("cell_id %s %d", cell_id_string, _cell_id ); - -: 461: } - -: 462: - 2: 463: return ret; - -: 464:} - -: 465: - 1: 466:nsapi_error_t AT_CellularNetwork::get_cell_id(int &cell_id) - -: 467:{ - -: 468: RegistrationStatus tmp; - -: 469: - 1: 470: nsapi_error_t error = get_registration_status(_last_reg_type, tmp); - -: 471: - 1: 472: cell_id = _cell_id; - -: 473: - 1: 474: return error; - -: 475:} - -: 476: - 5: 477:bool AT_CellularNetwork::has_registration(RegistrationType reg_type) - -: 478:{ - -: 479: (void)reg_type; - 5: 480: return true; - -: 481:} - -: 482: - 1: 483:nsapi_error_t AT_CellularNetwork::set_attach(int timeout) - -: 484:{ - 1: 485: _at.lock(); - -: 486: - 1: 487: _at.cmd_start("AT+CGATT?"); - 1: 488: _at.cmd_stop(); - 1: 489: _at.resp_start("+CGATT:"); - 1: 490: int attached_state = _at.read_int(); - 1: 491: _at.resp_stop(); - 1: 492: if (attached_state != 1) { - -: 493: log_debug("Network attach"); - 1: 494: _at.cmd_start("AT+CGATT=1"); - 1: 495: _at.cmd_stop(); - 1: 496: _at.resp_start(); - 1: 497: _at.resp_stop(); - -: 498: } - -: 499: - 1: 500: return _at.unlock_return_error(); - -: 501:} - -: 502: - 1: 503:nsapi_error_t AT_CellularNetwork::get_attach(AttachStatus &status) - -: 504:{ - 1: 505: _at.lock(); - -: 506: - 1: 507: _at.cmd_start("AT+CGATT?"); - 1: 508: _at.cmd_stop(); - -: 509: - 1: 510: _at.resp_start("+CGATT:"); - 1: 511: if (_at.info_resp()) { - #####: 512: int attach_status = _at.read_int(); - #####: 513: status = (attach_status == 1) ? Attached : Detached; - -: 514: } - 1: 515: _at.resp_stop(); - -: 516: - 1: 517: return _at.unlock_return_error(); - -: 518:} - -: 519: - -: 520: - 1: 521:nsapi_error_t AT_CellularNetwork::get_backoff_time(int &backoffTime) - -: 522:{ - 1: 523: _at.lock(); - -: 524: - -: 525: // If apn is set - 1: 526: if (strlen(_apn)) { - #####: 527: _at.cmd_start("AT+CABTRDP="); - #####: 528: _at.write_string(_apn); - #####: 529: _at.cmd_stop(); - #####: 530: _at.resp_start("+CABTRDP:"); - #####: 531: if (_at.info_resp()) { - #####: 532: _at.skip_param(); - #####: 533: backoffTime = _at.read_int(); - -: 534: } - #####: 535: _at.resp_stop(); - -: 536: } - -: 537: - 1: 538: return _at.unlock_return_error(); - -: 539:} - -: 540: - 3: 541:NetworkStack *AT_CellularNetwork::get_stack() - -: 542:{ - -: 543: // use lwIP/PPP if modem does not have IP stack - -: 544:#if NSAPI_PPP_AVAILABLE - -: 545: _stack = nsapi_ppp_get_stack(); - -: 546:#else - 3: 547: _stack = NULL; - -: 548:#endif - 3: 549: return _stack; - -: 550:} - -: 551: - 1: 552:const char *AT_CellularNetwork::get_ip_address() - -: 553:{ - -: 554:#if NSAPI_PPP_AVAILABLE - -: 555: return nsapi_ppp_get_ip_addr(_at.get_file_handle()); - -: 556:#else - 1: 557: if (!_stack) { - 1: 558: _stack = get_stack(); - -: 559: } - 1: 560: if (_stack) { - #####: 561: return _stack->get_ip_address(); - -: 562: } - 1: 563: return NULL; - -: 564:#endif - -: 565:} - -: 566: - 3: 567:nsapi_error_t AT_CellularNetwork::set_stack_type(nsapi_ip_stack_t stack_type) - -: 568:{ - -: 569: - 3: 570: if (get_modem_stack_type(stack_type)) { - 1: 571: _ip_stack_type_requested = stack_type; - 1: 572: return NSAPI_ERROR_OK; - -: 573: } else { - 2: 574: return NSAPI_ERROR_PARAMETER; - -: 575: } - -: 576: - -: 577:} - -: 578: - 1: 579:nsapi_ip_stack_t AT_CellularNetwork::get_stack_type() - -: 580:{ - 1: 581: return _ip_stack_type; - -: 582:} - -: 583: - 3: 584:bool AT_CellularNetwork::get_modem_stack_type(nsapi_ip_stack_t requested_stack) - -: 585:{ - 3: 586: if (requested_stack == _ip_stack_type) { - 1: 587: return true; - -: 588: } else { - 2: 589: return false; - -: 590: } - -: 591:} - -: 592: - 1: 593:nsapi_error_t AT_CellularNetwork::set_access_technology_impl(operator_t::RadioAccessTechnology opsAct) - -: 594:{ - 1: 595: return NSAPI_ERROR_UNSUPPORTED; - -: 596:} - -: 597: - 2: 598:nsapi_error_t AT_CellularNetwork::set_access_technology(operator_t::RadioAccessTechnology opAct) - -: 599:{ - 2: 600: if (opAct == operator_t::RAT_UNKNOWN) { - 1: 601: return NSAPI_ERROR_UNSUPPORTED; - -: 602: } - -: 603: - 1: 604: _op_act = opAct; - -: 605: - 1: 606: return set_access_technology_impl(opAct); - -: 607:} - -: 608: - 1: 609:nsapi_error_t AT_CellularNetwork::scan_plmn(operList_t &operators, int &opsCount) - -: 610:{ - 1: 611: int idx = 0; - -: 612: - 1: 613: _at.lock(); - -: 614: - 1: 615: _at.cmd_start("AT+COPS=?"); - 1: 616: _at.cmd_stop(); - -: 617: - 1: 618: _at.resp_start("+COPS:"); - -: 619: - 1: 620: int ret, error_code = -1; - 1: 621: operator_t *op = NULL; - -: 622: - 1: 623: while (_at.info_elem('(')) { - -: 624: - #####: 625: op = operators.add_new(); - -: 626: - #####: 627: op->op_status = (operator_t::Status)_at.read_int(); - #####: 628: _at.read_string(op->op_long, sizeof(op->op_long)); - #####: 629: _at.read_string(op->op_short, sizeof(op->op_short)); - #####: 630: _at.read_string(op->op_num, sizeof(op->op_num)); - -: 631: - -: 632: // Optional - try read an int - #####: 633: ret = _at.read_int(); - #####: 634: op->op_rat = (ret == error_code) ? operator_t::RAT_UNKNOWN:(operator_t::RadioAccessTechnology)ret; - -: 635: - #####: 636: if ((_op_act == operator_t::RAT_UNKNOWN) || - #####: 637: ((op->op_rat != operator_t::RAT_UNKNOWN) && (op->op_rat == _op_act))) { - #####: 638: idx++; - -: 639: } else { - #####: 640: operators.delete_last(); - -: 641: } - -: 642: } - -: 643: - 1: 644: _at.resp_stop(); - -: 645: - 1: 646: opsCount = idx; - -: 647: - 1: 648: return _at.unlock_return_error(); - -: 649:} - -: 650: - 1: 651:nsapi_error_t AT_CellularNetwork::set_ciot_optimization_config(Supported_UE_Opt supported_opt, - -: 652: Preferred_UE_Opt preferred_opt) - -: 653:{ - 1: 654: _at.lock(); - -: 655: - 1: 656: _at.cmd_start("AT+CCIOTOPT="); - 1: 657: _at.write_int(_cid); - 1: 658: _at.write_int(supported_opt); - 1: 659: _at.write_int(preferred_opt); - 1: 660: _at.cmd_stop(); - -: 661: - 1: 662: _at.resp_start(); - 1: 663: _at.resp_stop(); - -: 664: - 1: 665: return _at.unlock_return_error(); - -: 666:} - -: 667: - 1: 668:nsapi_error_t AT_CellularNetwork::get_ciot_optimization_config(Supported_UE_Opt& supported_opt, - -: 669: Preferred_UE_Opt& preferred_opt) - -: 670:{ - 1: 671: _at.lock(); - -: 672: - 1: 673: _at.cmd_start("AT+CCIOTOPT?"); - 1: 674: _at.cmd_stop(); - -: 675: - 1: 676: _at.resp_start("+CCIOTOPT:"); - 1: 677: _at.read_int(); - 1: 678: if (_at.get_last_error() == NSAPI_ERROR_OK) { - #####: 679: supported_opt = (Supported_UE_Opt)_at.read_int(); - #####: 680: preferred_opt = (Preferred_UE_Opt)_at.read_int(); - -: 681: } - -: 682: - 1: 683: _at.resp_stop(); - -: 684: - 1: 685: return _at.unlock_return_error(); - -: 686:} - -: 687: - 1: 688:nsapi_error_t AT_CellularNetwork::get_rate_control( - -: 689: CellularNetwork::RateControlExceptionReports &reports, - -: 690: CellularNetwork::RateControlUplinkTimeUnit &timeUnit, int &uplinkRate) - -: 691:{ - -: 692: - 1: 693: _at.lock(); - -: 694: - 1: 695: _at.cmd_start("AT+CGAPNRC="); - 1: 696: _at.write_int(_cid); - 1: 697: _at.cmd_stop(); - -: 698: - 1: 699: _at.resp_start("+CGAPNRC:"); - 1: 700: _at.read_int(); - 1: 701: if (_at.get_last_error() == NSAPI_ERROR_OK) { - 1: 702: bool comma_found = true; - 1: 703: int next_element = _at.read_int(); - 1: 704: if (next_element >= 0) { - #####: 705: reports = (RateControlExceptionReports)next_element; - -: 706: log_debug("reports %d",reports); - #####: 707: next_element = _at.read_int(); - -: 708: } else { - 1: 709: comma_found = false; - -: 710: } - -: 711: - 1: 712: if (comma_found && next_element >= 0) { - #####: 713: timeUnit = (RateControlUplinkTimeUnit)next_element; - -: 714: log_debug("time %d",timeUnit); - #####: 715: next_element = _at.read_int(); - -: 716: } else { - 1: 717: comma_found = false; - -: 718: } - -: 719: - 1: 720: if (comma_found && next_element >= 0) { - #####: 721: uplinkRate = next_element; - -: 722: log_debug("rate %d",uplinkRate); - -: 723: } - -: 724: } - 1: 725: _at.resp_stop(); - 1: 726: nsapi_error_t ret = _at.get_last_error(); - 1: 727: _at.unlock(); - -: 728: - 1: 729: return (ret == NSAPI_ERROR_OK) ? NSAPI_ERROR_OK : NSAPI_ERROR_PARAMETER; - -: 730:} - -: 731: - 1: 732:nsapi_error_t AT_CellularNetwork::get_pdpcontext_params(pdpContextList_t& params_list) - -: 733:{ - 1: 734: const int ipv6_subnet_size = 128; - 1: 735: const int max_ipv6_size = 64; - 1: 736: char* ipv6_and_subnetmask = (char*)malloc(ipv6_subnet_size); - 1: 737: if (!ipv6_and_subnetmask) { - #####: 738: return NSAPI_ERROR_NO_MEMORY; - -: 739: } - -: 740: - 1: 741: char* temp = (char*)malloc(max_ipv6_size); - 1: 742: if (!temp) { - #####: 743: free(ipv6_and_subnetmask); - #####: 744: return NSAPI_ERROR_NO_MEMORY; - -: 745: } - -: 746: - 1: 747: _at.lock(); - -: 748: - 1: 749: _at.cmd_start("AT+CGCONTRDP="); - 1: 750: _at.write_int(_cid); - 1: 751: _at.cmd_stop(); - -: 752: - 1: 753: _at.resp_start("+CGCONTRDP:"); - 1: 754: pdpcontext_params_t *params = NULL; - 1: 755: while (_at.info_resp()) { // response can be zero or many +CGDCONT lines - #####: 756: params = params_list.add_new(); - #####: 757: if (!params) { - -: 758: log_warn("Could not allocate new pdpcontext_params_t"); - #####: 759: params_list.delete_all(); - #####: 760: _at.resp_stop(); - #####: 761: free(temp); - #####: 762: free(ipv6_and_subnetmask); - #####: 763: return NSAPI_ERROR_NO_MEMORY; - -: 764: } - -: 765: - #####: 766: params->cid = _at.read_int(); - #####: 767: params->bearer_id = _at.read_int(); - #####: 768: _at.read_string(params->apn, sizeof(params->apn)); - -: 769: - -: 770: // rest are optional params - #####: 771: ipv6_and_subnetmask[0] = '\0'; - #####: 772: temp[0] = '\0'; - #####: 773: _at.read_string(ipv6_and_subnetmask, ipv6_subnet_size); - #####: 774: separate_ip_addresses(ipv6_and_subnetmask, params->local_addr, sizeof(params->local_addr), params->local_subnet_mask, sizeof(params->local_subnet_mask)); - #####: 775: ipv6_and_subnetmask[0] = '\0'; - -: 776: - #####: 777: _at.read_string(ipv6_and_subnetmask, ipv6_subnet_size); - #####: 778: separate_ip_addresses(ipv6_and_subnetmask, params->gateway_addr, sizeof(params->gateway_addr), temp, max_ipv6_size); - #####: 779: prefer_ipv6(params->gateway_addr, sizeof(params->gateway_addr), temp, max_ipv6_size); - #####: 780: ipv6_and_subnetmask[0] = '\0'; - #####: 781: temp[0] = '\0'; - -: 782: - #####: 783: _at.read_string(ipv6_and_subnetmask, ipv6_subnet_size); - #####: 784: separate_ip_addresses(ipv6_and_subnetmask, params->dns_primary_addr, sizeof(params->dns_primary_addr), temp, max_ipv6_size); - #####: 785: prefer_ipv6(params->dns_primary_addr, sizeof(params->dns_primary_addr), temp, max_ipv6_size); - #####: 786: ipv6_and_subnetmask[0] = '\0'; - #####: 787: temp[0] = '\0'; - -: 788: - #####: 789: _at.read_string(ipv6_and_subnetmask, ipv6_subnet_size); - #####: 790: separate_ip_addresses(ipv6_and_subnetmask, params->dns_secondary_addr, sizeof(params->dns_secondary_addr), temp, max_ipv6_size); - #####: 791: prefer_ipv6(params->dns_secondary_addr, sizeof(params->dns_secondary_addr), temp, max_ipv6_size); - #####: 792: ipv6_and_subnetmask[0] = '\0'; - #####: 793: temp[0] = '\0'; - -: 794: - #####: 795: _at.read_string(ipv6_and_subnetmask, ipv6_subnet_size); - #####: 796: separate_ip_addresses(ipv6_and_subnetmask, params->p_cscf_prim_addr, sizeof(params->p_cscf_prim_addr), temp, max_ipv6_size); - #####: 797: prefer_ipv6(params->p_cscf_prim_addr, sizeof(params->p_cscf_prim_addr), temp, max_ipv6_size); - #####: 798: ipv6_and_subnetmask[0] = '\0'; - #####: 799: temp[0] = '\0'; - -: 800: - #####: 801: _at.read_string(ipv6_and_subnetmask, ipv6_subnet_size); - #####: 802: separate_ip_addresses(ipv6_and_subnetmask, params->p_cscf_sec_addr, sizeof(params->p_cscf_sec_addr), temp, max_ipv6_size); - #####: 803: prefer_ipv6(params->p_cscf_sec_addr, sizeof(params->p_cscf_sec_addr), temp, max_ipv6_size); - -: 804: - #####: 805: params->im_signalling_flag = _at.read_int(); - #####: 806: params->lipa_indication = _at.read_int(); - #####: 807: params->ipv4_mtu = _at.read_int(); - #####: 808: params->wlan_offload = _at.read_int(); - #####: 809: params->local_addr_ind = _at.read_int(); - #####: 810: params->non_ip_mtu = _at.read_int(); - #####: 811: params->serving_plmn_rate_control_value = _at.read_int(); - -: 812: } - 1: 813: _at.resp_stop(); - -: 814: - 1: 815: free(temp); - 1: 816: free(ipv6_and_subnetmask); - -: 817: - 1: 818: return _at.unlock_return_error(); - -: 819:} - -: 820: - 2: 821:nsapi_error_t AT_CellularNetwork::get_extended_signal_quality(int &rxlev, int &ber, int &rscp, int &ecno, int &rsrq, int &rsrp) - -: 822:{ - 2: 823: _at.lock(); - -: 824: - 2: 825: _at.cmd_start("AT+CESQ"); - 2: 826: _at.cmd_stop(); - -: 827: - 2: 828: _at.resp_start("+CESQ:"); - 2: 829: rxlev = _at.read_int(); - 2: 830: ber = _at.read_int(); - 2: 831: rscp = _at.read_int(); - 2: 832: ecno = _at.read_int(); - 2: 833: rsrq = _at.read_int(); - 2: 834: rsrp = _at.read_int(); - 2: 835: _at.resp_stop(); - 2: 836: if (rxlev < 0 || ber < 0 || rscp < 0 || ecno < 0 || rsrq < 0 || rsrp < 0) { - 1: 837: _at.unlock(); - 1: 838: return NSAPI_ERROR_DEVICE_ERROR; - -: 839: } - -: 840: - 1: 841: return _at.unlock_return_error(); - -: 842:} - -: 843: - 2: 844:nsapi_error_t AT_CellularNetwork::get_signal_quality(int &rssi, int &ber) - -: 845:{ - 2: 846: _at.lock(); - -: 847: - 2: 848: _at.cmd_start("AT+CSQ"); - 2: 849: _at.cmd_stop(); - -: 850: - 2: 851: _at.resp_start("+CSQ:"); - 2: 852: rssi = _at.read_int(); - 2: 853: ber = _at.read_int(); - 2: 854: _at.resp_stop(); - 2: 855: if (rssi < 0 || ber < 0) { - 1: 856: _at.unlock(); - 1: 857: return NSAPI_ERROR_DEVICE_ERROR; - -: 858: } - -: 859: - 1: 860: return _at.unlock_return_error(); - -: 861:} - -: 862: - -: 863:/** Get the last 3GPP error code - -: 864: * @return see 3GPP TS 27.007 error codes - -: 865: */ - 1: 866:uint8_t AT_CellularNetwork::get_3gpp_error() - -: 867:{ - 1: 868: return _at.get_3gpp_error(); - -: 869:} - -: 870: - -: 871: - 1: 872:nsapi_error_t AT_CellularNetwork::get_operator_params(int &format, operator_t &operator_params) - -: 873:{ - 1: 874: _at.lock(); - -: 875: - 1: 876: _at.cmd_start("AT+COPS?"); - 1: 877: _at.cmd_stop(); - -: 878: - 1: 879: _at.resp_start("+COPS: "); - 1: 880: _at.read_int(); //ignore mode - 1: 881: format = _at.read_int(); - -: 882: - 1: 883: if (_at.get_last_error() == NSAPI_ERROR_OK) { - -: 884: - #####: 885: switch (format) { - -: 886: case 0: - #####: 887: _at.read_string(operator_params.op_long, 16+9); - #####: 888: break; - -: 889: - -: 890: case 1: - #####: 891: _at.read_string(operator_params.op_short, 8+4); - #####: 892: break; - -: 893: - -: 894: default: - #####: 895: _at.read_string(operator_params.op_num, 8+4); - #####: 896: break; - -: 897: } - -: 898: - #####: 899: operator_params.op_rat = (operator_t::RadioAccessTechnology)_at.read_int(); - -: 900: } - -: 901: - 1: 902: _at.resp_stop(); - -: 903: - 1: 904: return _at.unlock_return_error(); - -: 905:} diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/Callback.h.gcov b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/Callback.h.gcov deleted file mode 100644 index 7f3175c216..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/Callback.h.gcov +++ /dev/null @@ -1,4557 +0,0 @@ - -: 0:Source:../../../../../platform/Callback.h - -: 0:Graph:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno - -: 0:Data:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* mbed Microcontroller Library - -: 2: * Copyright (c) 2006-2015 ARM Limited - -: 3: * - -: 4: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 5: * you may not use this file except in compliance with the License. - -: 6: * You may obtain a copy of the License at - -: 7: * - -: 8: * http://www.apache.org/licenses/LICENSE-2.0 - -: 9: * - -: 10: * Unless required by applicable law or agreed to in writing, software - -: 11: * distributed under the License is distributed on an "AS IS" BASIS, - -: 12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 13: * See the License for the specific language governing permissions and - -: 14: * limitations under the License. - -: 15: */ - -: 16:#ifndef MBED_CALLBACK_H - -: 17:#define MBED_CALLBACK_H - -: 18: - -: 19:#include - -: 20:#include - -: 21:#include - -: 22:#include "platform/mbed_assert.h" - -: 23:#include "platform/mbed_toolchain.h" - -: 24: - -: 25:namespace mbed { - -: 26:/** \addtogroup platform */ - -: 27:/** @{*/ - -: 28:/** - -: 29: * \defgroup platform_Callback Callback class - -: 30: * @{ - -: 31: */ - -: 32: - -: 33:/** Callback class based on template specialization - -: 34: * - -: 35: * @note Synchronization level: Not protected - -: 36: */ - -: 37:template - -: 38:class Callback; - -: 39: - -: 40:// Internal sfinae declarations - -: 41:// - -: 42:// These are used to eliminate overloads based on type attributes - -: 43:// 1. Does a function object have a call operator - -: 44:// 2. Does a function object fit in the available storage - -: 45:// - -: 46:// These eliminations are handled cleanly by the compiler and avoid - -: 47:// massive and misleading error messages when confronted with an - -: 48:// invalid type (or worse, runtime failures) - -: 49:namespace detail { - -: 50: struct nil {}; - -: 51: - -: 52: template - -: 53: struct enable_if { typedef R type; }; - -: 54: - -: 55: template - -: 56: struct enable_if {}; - -: 57: - -: 58: template - -: 59: struct is_type { - -: 60: static const bool value = true; - -: 61: }; - -: 62:} - -: 63: - -: 64:#define MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M) \ - -: 65: typename detail::enable_if< \ - -: 66: detail::is_type::value && \ - -: 67: sizeof(F) <= sizeof(uintptr_t) \ - -: 68: >::type = detail::nil() - -: 69: - -: 70:/** Callback class based on template specialization - -: 71: * - -: 72: * @note Synchronization level: Not protected - -: 73: */ - -: 74:template - -: 75:class Callback { - -: 76:public: - -: 77: /** Create a Callback with a static function - -: 78: * @param func Static function to attach - -: 79: */ - -: 80: Callback(R (*func)() = 0) { - -: 81: if (!func) { - -: 82: memset(this, 0, sizeof(Callback)); - -: 83: } else { - -: 84: generate(func); - -: 85: } - -: 86: } - -: 87: - -: 88: /** Attach a Callback - -: 89: * @param func The Callback to attach - -: 90: */ - -: 91: Callback(const Callback &func) { - -: 92: if (func._ops) { - -: 93: func._ops->move(this, &func); - -: 94: } - -: 95: _ops = func._ops; - -: 96: } - -: 97: - -: 98: /** Create a Callback with a member function - -: 99: * @param obj Pointer to object to invoke member function on - -: 100: * @param method Member function to attach - -: 101: */ - -: 102: template - 25: 103: Callback(U *obj, R (T::*method)()) { - 25: 104: generate(method_context(obj, method)); - 25: 105: } - -: 106: - -: 107: /** Create a Callback with a member function - -: 108: * @param obj Pointer to object to invoke member function on - -: 109: * @param method Member function to attach - -: 110: */ - -: 111: template - -: 112: Callback(const U *obj, R (T::*method)() const) { - -: 113: generate(method_context(obj, method)); - -: 114: } - -: 115: - -: 116: /** Create a Callback with a member function - -: 117: * @param obj Pointer to object to invoke member function on - -: 118: * @param method Member function to attach - -: 119: */ - -: 120: template - -: 121: Callback(volatile U *obj, R (T::*method)() volatile) { - -: 122: generate(method_context(obj, method)); - -: 123: } - -: 124: - -: 125: /** Create a Callback with a member function - -: 126: * @param obj Pointer to object to invoke member function on - -: 127: * @param method Member function to attach - -: 128: */ - -: 129: template - -: 130: Callback(const volatile U *obj, R (T::*method)() const volatile) { - -: 131: generate(method_context(obj, method)); - -: 132: } - -: 133: - -: 134: /** Create a Callback with a static function and bound pointer - -: 135: * @param func Static function to attach - -: 136: * @param arg Pointer argument to function - -: 137: */ - -: 138: template - -: 139: Callback(R (*func)(T*), U *arg) { - -: 140: generate(function_context(func, arg)); - -: 141: } - -: 142: - -: 143: /** Create a Callback with a static function and bound pointer - -: 144: * @param func Static function to attach - -: 145: * @param arg Pointer argument to function - -: 146: */ - -: 147: template - -: 148: Callback(R (*func)(const T*), const U *arg) { - -: 149: generate(function_context(func, arg)); - -: 150: } - -: 151: - -: 152: /** Create a Callback with a static function and bound pointer - -: 153: * @param func Static function to attach - -: 154: * @param arg Pointer argument to function - -: 155: */ - -: 156: template - -: 157: Callback(R (*func)(volatile T*), volatile U *arg) { - -: 158: generate(function_context(func, arg)); - -: 159: } - -: 160: - -: 161: /** Create a Callback with a static function and bound pointer - -: 162: * @param func Static function to attach - -: 163: * @param arg Pointer argument to function - -: 164: */ - -: 165: template - -: 166: Callback(R (*func)(const volatile T*), const volatile U *arg) { - -: 167: generate(function_context(func, arg)); - -: 168: } - -: 169: - -: 170: /** Create a Callback with a function object - -: 171: * @param f Function object to attach - -: 172: * @note The function object is limited to a single word of storage - -: 173: */ - -: 174: template - -: 175: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { - -: 176: generate(f); - -: 177: } - -: 178: - -: 179: /** Create a Callback with a function object - -: 180: * @param f Function object to attach - -: 181: * @note The function object is limited to a single word of storage - -: 182: */ - -: 183: template - -: 184: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { - -: 185: generate(f); - -: 186: } - -: 187: - -: 188: /** Create a Callback with a function object - -: 189: * @param f Function object to attach - -: 190: * @note The function object is limited to a single word of storage - -: 191: */ - -: 192: template - -: 193: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { - -: 194: generate(f); - -: 195: } - -: 196: - -: 197: /** Create a Callback with a function object - -: 198: * @param f Function object to attach - -: 199: * @note The function object is limited to a single word of storage - -: 200: */ - -: 201: template - -: 202: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { - -: 203: generate(f); - -: 204: } - -: 205: - -: 206: /** Create a Callback with a static function and bound pointer - -: 207: * @param obj Pointer to object to bind to function - -: 208: * @param func Static function to attach - -: 209: * @deprecated - -: 210: * Arguments to callback have been reordered to Callback(func, arg) - -: 211: */ - -: 212: template - -: 213: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 214: "Arguments to callback have been reordered to Callback(func, arg)") - -: 215: Callback(U *obj, R (*func)(T*)) { - -: 216: new (this) Callback(func, obj); - -: 217: } - -: 218: - -: 219: /** Create a Callback with a static function and bound pointer - -: 220: * @param obj Pointer to object to bind to function - -: 221: * @param func Static function to attach - -: 222: * @deprecated - -: 223: * Arguments to callback have been reordered to Callback(func, arg) - -: 224: */ - -: 225: template - -: 226: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 227: "Arguments to callback have been reordered to Callback(func, arg)") - -: 228: Callback(const U *obj, R (*func)(const T*)) { - -: 229: new (this) Callback(func, obj); - -: 230: } - -: 231: - -: 232: /** Create a Callback with a static function and bound pointer - -: 233: * @param obj Pointer to object to bind to function - -: 234: * @param func Static function to attach - -: 235: * @deprecated - -: 236: * Arguments to callback have been reordered to Callback(func, arg) - -: 237: */ - -: 238: template - -: 239: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 240: "Arguments to callback have been reordered to Callback(func, arg)") - -: 241: Callback(volatile U *obj, R (*func)(volatile T*)) { - -: 242: new (this) Callback(func, obj); - -: 243: } - -: 244: - -: 245: /** Create a Callback with a static function and bound pointer - -: 246: * @param obj Pointer to object to bind to function - -: 247: * @param func Static function to attach - -: 248: * @deprecated - -: 249: * Arguments to callback have been reordered to Callback(func, arg) - -: 250: */ - -: 251: template - -: 252: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 253: "Arguments to callback have been reordered to Callback(func, arg)") - -: 254: Callback(const volatile U *obj, R (*func)(const volatile T*)) { - -: 255: new (this) Callback(func, obj); - -: 256: } - -: 257: - -: 258: /** Destroy a callback - -: 259: */ - #####: 260: ~Callback() { - #####: 261: if (_ops) { - #####: 262: _ops->dtor(this); - -: 263: } - #####: 264: } - -: 265: - -: 266: /** Attach a static function - -: 267: * @param func Static function to attach - -: 268: * @deprecated - -: 269: * Replaced by simple assignment 'Callback cb = func' - -: 270: */ - -: 271: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 272: "Replaced by simple assignment 'Callback cb = func") - -: 273: void attach(R (*func)()) { - -: 274: this->~Callback(); - -: 275: new (this) Callback(func); - -: 276: } - -: 277: - -: 278: /** Attach a Callback - -: 279: * @param func The Callback to attach - -: 280: * @deprecated - -: 281: * Replaced by simple assignment 'Callback cb = func' - -: 282: */ - -: 283: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 284: "Replaced by simple assignment 'Callback cb = func") - -: 285: void attach(const Callback &func) { - -: 286: this->~Callback(); - -: 287: new (this) Callback(func); - -: 288: } - -: 289: - -: 290: /** Attach a member function - -: 291: * @param obj Pointer to object to invoke member function on - -: 292: * @param method Member function to attach - -: 293: * @deprecated - -: 294: * Replaced by simple assignment 'Callback cb = func' - -: 295: */ - -: 296: template - -: 297: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 298: "Replaced by simple assignment 'Callback cb = func") - -: 299: void attach(U *obj, R (T::*method)()) { - -: 300: this->~Callback(); - -: 301: new (this) Callback(obj, method); - -: 302: } - -: 303: - -: 304: /** Attach a member function - -: 305: * @param obj Pointer to object to invoke member function on - -: 306: * @param method Member function to attach - -: 307: * @deprecated - -: 308: * Replaced by simple assignment 'Callback cb = func' - -: 309: */ - -: 310: template - -: 311: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 312: "Replaced by simple assignment 'Callback cb = func") - -: 313: void attach(const U *obj, R (T::*method)() const) { - -: 314: this->~Callback(); - -: 315: new (this) Callback(obj, method); - -: 316: } - -: 317: - -: 318: /** Attach a member function - -: 319: * @param obj Pointer to object to invoke member function on - -: 320: * @param method Member function to attach - -: 321: * @deprecated - -: 322: * Replaced by simple assignment 'Callback cb = func' - -: 323: */ - -: 324: template - -: 325: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 326: "Replaced by simple assignment 'Callback cb = func") - -: 327: void attach(volatile U *obj, R (T::*method)() volatile) { - -: 328: this->~Callback(); - -: 329: new (this) Callback(obj, method); - -: 330: } - -: 331: - -: 332: /** Attach a member function - -: 333: * @param obj Pointer to object to invoke member function on - -: 334: * @param method Member function to attach - -: 335: * @deprecated - -: 336: * Replaced by simple assignment 'Callback cb = func' - -: 337: */ - -: 338: template - -: 339: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 340: "Replaced by simple assignment 'Callback cb = func") - -: 341: void attach(const volatile U *obj, R (T::*method)() const volatile) { - -: 342: this->~Callback(); - -: 343: new (this) Callback(obj, method); - -: 344: } - -: 345: - -: 346: /** Attach a static function with a bound pointer - -: 347: * @param func Static function to attach - -: 348: * @param arg Pointer argument to function - -: 349: * @deprecated - -: 350: * Replaced by simple assignment 'Callback cb = func' - -: 351: */ - -: 352: template - -: 353: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 354: "Replaced by simple assignment 'Callback cb = func") - -: 355: void attach(R (*func)(T*), U *arg) { - -: 356: this->~Callback(); - -: 357: new (this) Callback(func, arg); - -: 358: } - -: 359: - -: 360: /** Attach a static function with a bound pointer - -: 361: * @param func Static function to attach - -: 362: * @param arg Pointer argument to function - -: 363: * @deprecated - -: 364: * Replaced by simple assignment 'Callback cb = func' - -: 365: */ - -: 366: template - -: 367: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 368: "Replaced by simple assignment 'Callback cb = func") - -: 369: void attach(R (*func)(const T*), const U *arg) { - -: 370: this->~Callback(); - -: 371: new (this) Callback(func, arg); - -: 372: } - -: 373: - -: 374: /** Attach a static function with a bound pointer - -: 375: * @param func Static function to attach - -: 376: * @param arg Pointer argument to function - -: 377: * @deprecated - -: 378: * Replaced by simple assignment 'Callback cb = func' - -: 379: */ - -: 380: template - -: 381: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 382: "Replaced by simple assignment 'Callback cb = func") - -: 383: void attach(R (*func)(volatile T*), volatile U *arg) { - -: 384: this->~Callback(); - -: 385: new (this) Callback(func, arg); - -: 386: } - -: 387: - -: 388: /** Attach a static function with a bound pointer - -: 389: * @param func Static function to attach - -: 390: * @param arg Pointer argument to function - -: 391: * @deprecated - -: 392: * Replaced by simple assignment 'Callback cb = func' - -: 393: */ - -: 394: template - -: 395: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 396: "Replaced by simple assignment 'Callback cb = func") - -: 397: void attach(R (*func)(const volatile T*), const volatile U *arg) { - -: 398: this->~Callback(); - -: 399: new (this) Callback(func, arg); - -: 400: } - -: 401: - -: 402: /** Attach a function object - -: 403: * @param f Function object to attach - -: 404: * @note The function object is limited to a single word of storage - -: 405: * @deprecated - -: 406: * Replaced by simple assignment 'Callback cb = func' - -: 407: */ - -: 408: template - -: 409: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 410: "Replaced by simple assignment 'Callback cb = func") - -: 411: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { - -: 412: this->~Callback(); - -: 413: new (this) Callback(f); - -: 414: } - -: 415: - -: 416: /** Attach a function object - -: 417: * @param f Function object to attach - -: 418: * @note The function object is limited to a single word of storage - -: 419: * @deprecated - -: 420: * Replaced by simple assignment 'Callback cb = func' - -: 421: */ - -: 422: template - -: 423: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 424: "Replaced by simple assignment 'Callback cb = func") - -: 425: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { - -: 426: this->~Callback(); - -: 427: new (this) Callback(f); - -: 428: } - -: 429: - -: 430: /** Attach a function object - -: 431: * @param f Function object to attach - -: 432: * @note The function object is limited to a single word of storage - -: 433: * @deprecated - -: 434: * Replaced by simple assignment 'Callback cb = func' - -: 435: */ - -: 436: template - -: 437: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 438: "Replaced by simple assignment 'Callback cb = func") - -: 439: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { - -: 440: this->~Callback(); - -: 441: new (this) Callback(f); - -: 442: } - -: 443: - -: 444: /** Attach a function object - -: 445: * @param f Function object to attach - -: 446: * @note The function object is limited to a single word of storage - -: 447: * @deprecated - -: 448: * Replaced by simple assignment 'Callback cb = func' - -: 449: */ - -: 450: template - -: 451: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 452: "Replaced by simple assignment 'Callback cb = func") - -: 453: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { - -: 454: this->~Callback(); - -: 455: new (this) Callback(f); - -: 456: } - -: 457: - -: 458: /** Attach a static function with a bound pointer - -: 459: * @param obj Pointer to object to bind to function - -: 460: * @param func Static function to attach - -: 461: * @deprecated - -: 462: * Arguments to callback have been reordered to attach(func, arg) - -: 463: */ - -: 464: template - -: 465: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 466: "Arguments to callback have been reordered to attach(func, arg)") - -: 467: void attach(U *obj, R (*func)(T*)) { - -: 468: this->~Callback(); - -: 469: new (this) Callback(func, obj); - -: 470: } - -: 471: - -: 472: /** Attach a static function with a bound pointer - -: 473: * @param obj Pointer to object to bind to function - -: 474: * @param func Static function to attach - -: 475: * @deprecated - -: 476: * Arguments to callback have been reordered to attach(func, arg) - -: 477: */ - -: 478: template - -: 479: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 480: "Arguments to callback have been reordered to attach(func, arg)") - -: 481: void attach(const U *obj, R (*func)(const T*)) { - -: 482: this->~Callback(); - -: 483: new (this) Callback(func, obj); - -: 484: } - -: 485: - -: 486: /** Attach a static function with a bound pointer - -: 487: * @param obj Pointer to object to bind to function - -: 488: * @param func Static function to attach - -: 489: * @deprecated - -: 490: * Arguments to callback have been reordered to attach(func, arg) - -: 491: */ - -: 492: template - -: 493: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 494: "Arguments to callback have been reordered to attach(func, arg)") - -: 495: void attach(volatile U *obj, R (*func)(volatile T*)) { - -: 496: this->~Callback(); - -: 497: new (this) Callback(func, obj); - -: 498: } - -: 499: - -: 500: /** Attach a static function with a bound pointer - -: 501: * @param obj Pointer to object to bind to function - -: 502: * @param func Static function to attach - -: 503: * @deprecated - -: 504: * Arguments to callback have been reordered to attach(func, arg) - -: 505: */ - -: 506: template - -: 507: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 508: "Arguments to callback have been reordered to attach(func, arg)") - -: 509: void attach(const volatile U *obj, R (*func)(const volatile T*)) { - -: 510: this->~Callback(); - -: 511: new (this) Callback(func, obj); - -: 512: } - -: 513: - -: 514: /** Assign a callback - -: 515: */ - -: 516: Callback &operator=(const Callback &that) { - -: 517: if (this != &that) { - -: 518: this->~Callback(); - -: 519: new (this) Callback(that); - -: 520: } - -: 521: - -: 522: return *this; - -: 523: } - -: 524: - -: 525: /** Call the attached function - -: 526: */ - -: 527: R call() const { - -: 528: MBED_ASSERT(_ops); - -: 529: return _ops->call(this); - -: 530: } - -: 531: - -: 532: /** Call the attached function - -: 533: */ - -: 534: R operator()() const { - -: 535: return call(); - -: 536: } - -: 537: - -: 538: /** Test if function has been attached - -: 539: */ - -: 540: operator bool() const { - -: 541: return _ops; - -: 542: } - -: 543: - -: 544: /** Test for equality - -: 545: */ - -: 546: friend bool operator==(const Callback &l, const Callback &r) { - -: 547: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 548: } - -: 549: - -: 550: /** Test for inequality - -: 551: */ - -: 552: friend bool operator!=(const Callback &l, const Callback &r) { - -: 553: return !(l == r); - -: 554: } - -: 555: - -: 556: /** Static thunk for passing as C-style function - -: 557: * @param func Callback to call passed as void pointer - -: 558: * @return the value as determined by func which is of - -: 559: * type and determined by the signiture of func - -: 560: */ - -: 561: static R thunk(void *func) { - -: 562: return static_cast(func)->call(); - -: 563: } - -: 564: - -: 565:private: - -: 566: // Stored as pointer to function and pointer to optional object - -: 567: // Function pointer is stored as union of possible function types - -: 568: // to garuntee proper size and alignment - -: 569: struct _class; - -: 570: union { - -: 571: void (*_staticfunc)(); - -: 572: void (*_boundfunc)(_class*); - -: 573: void (_class::*_methodfunc)(); - -: 574: } _func; - -: 575: void *_obj; - -: 576: - -: 577: // Dynamically dispatched operations - -: 578: const struct ops { - -: 579: R (*call)(const void*); - -: 580: void (*move)(void*, const void*); - -: 581: void (*dtor)(void*); - -: 582: } *_ops; - -: 583: - -: 584: // Generate operations for function object - -: 585: template - 25: 586: void generate(const F &f) { - -: 587: static const ops ops = { - -: 588: &Callback::function_call, - -: 589: &Callback::function_move, - -: 590: &Callback::function_dtor, - -: 591: }; - -: 592: - -: 593: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 594: "Type F must not exceed the size of the Callback class"); - 25: 595: memset(this, 0, sizeof(Callback)); - 25: 596: new (this) F(f); - 25: 597: _ops = &ops; - 25: 598: } - -: 599: - -: 600: // Function attributes - -: 601: template - 1: 602: static R function_call(const void *p) { - 1: 603: return (*(F*)p)(); - -: 604: } - -: 605: - -: 606: template - 25: 607: static void function_move(void *d, const void *p) { - 25: 608: new (d) F(*(F*)p); - 25: 609: } - -: 610: - -: 611: template - 50: 612: static void function_dtor(void *p) { - -: 613: ((F*)p)->~F(); - 50: 614: } - -: 615: - -: 616: // Wrappers for functions with context - -: 617: template - -: 618: struct method_context { - -: 619: M method; - -: 620: O *obj; - -: 621: - 25: 622: method_context(O *obj, M method) - 25: 623: : method(method), obj(obj) {} - -: 624: - 1: 625: R operator()() const { - 1: 626: return (obj->*method)(); - -: 627: } - -: 628: }; - -: 629: - -: 630: template - -: 631: struct function_context { - -: 632: F func; - -: 633: A *arg; - -: 634: - -: 635: function_context(F func, A *arg) - -: 636: : func(func), arg(arg) {} - -: 637: - -: 638: R operator()() const { - -: 639: return func(arg); - -: 640: } - -: 641: }; - -: 642:}; - -: 643: - -: 644:/** Callback class based on template specialization - -: 645: * - -: 646: * @note Synchronization level: Not protected - -: 647: */ - -: 648:template - -: 649:class Callback { - -: 650:public: - -: 651: /** Create a Callback with a static function - -: 652: * @param func Static function to attach - -: 653: */ - #####: 654: Callback(R (*func)(A0) = 0) { - #####: 655: if (!func) { - #####: 656: memset(this, 0, sizeof(Callback)); - -: 657: } else { - #####: 658: generate(func); - -: 659: } - #####: 660: } - -: 661: - -: 662: /** Attach a Callback - -: 663: * @param func The Callback to attach - -: 664: */ - 1: 665: Callback(const Callback &func) { - 1: 666: if (func._ops) { - 1: 667: func._ops->move(this, &func); - -: 668: } - 1: 669: _ops = func._ops; - 1: 670: } - -: 671: - -: 672: /** Create a Callback with a member function - -: 673: * @param obj Pointer to object to invoke member function on - -: 674: * @param method Member function to attach - -: 675: */ - -: 676: template - -: 677: Callback(U *obj, R (T::*method)(A0)) { - -: 678: generate(method_context(obj, method)); - -: 679: } - -: 680: - -: 681: /** Create a Callback with a member function - -: 682: * @param obj Pointer to object to invoke member function on - -: 683: * @param method Member function to attach - -: 684: */ - -: 685: template - -: 686: Callback(const U *obj, R (T::*method)(A0) const) { - -: 687: generate(method_context(obj, method)); - -: 688: } - -: 689: - -: 690: /** Create a Callback with a member function - -: 691: * @param obj Pointer to object to invoke member function on - -: 692: * @param method Member function to attach - -: 693: */ - -: 694: template - -: 695: Callback(volatile U *obj, R (T::*method)(A0) volatile) { - -: 696: generate(method_context(obj, method)); - -: 697: } - -: 698: - -: 699: /** Create a Callback with a member function - -: 700: * @param obj Pointer to object to invoke member function on - -: 701: * @param method Member function to attach - -: 702: */ - -: 703: template - -: 704: Callback(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 705: generate(method_context(obj, method)); - -: 706: } - -: 707: - -: 708: /** Create a Callback with a static function and bound pointer - -: 709: * @param func Static function to attach - -: 710: * @param arg Pointer argument to function - -: 711: */ - -: 712: template - -: 713: Callback(R (*func)(T*, A0), U *arg) { - -: 714: generate(function_context(func, arg)); - -: 715: } - -: 716: - -: 717: /** Create a Callback with a static function and bound pointer - -: 718: * @param func Static function to attach - -: 719: * @param arg Pointer argument to function - -: 720: */ - -: 721: template - -: 722: Callback(R (*func)(const T*, A0), const U *arg) { - -: 723: generate(function_context(func, arg)); - -: 724: } - -: 725: - -: 726: /** Create a Callback with a static function and bound pointer - -: 727: * @param func Static function to attach - -: 728: * @param arg Pointer argument to function - -: 729: */ - -: 730: template - -: 731: Callback(R (*func)(volatile T*, A0), volatile U *arg) { - -: 732: generate(function_context(func, arg)); - -: 733: } - -: 734: - -: 735: /** Create a Callback with a static function and bound pointer - -: 736: * @param func Static function to attach - -: 737: * @param arg Pointer argument to function - -: 738: */ - -: 739: template - -: 740: Callback(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 741: generate(function_context(func, arg)); - -: 742: } - -: 743: - -: 744: /** Create a Callback with a function object - -: 745: * @param f Function object to attach - -: 746: * @note The function object is limited to a single word of storage - -: 747: */ - -: 748: template - -: 749: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { - -: 750: generate(f); - -: 751: } - -: 752: - -: 753: /** Create a Callback with a function object - -: 754: * @param f Function object to attach - -: 755: * @note The function object is limited to a single word of storage - -: 756: */ - -: 757: template - -: 758: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { - -: 759: generate(f); - -: 760: } - -: 761: - -: 762: /** Create a Callback with a function object - -: 763: * @param f Function object to attach - -: 764: * @note The function object is limited to a single word of storage - -: 765: */ - -: 766: template - -: 767: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { - -: 768: generate(f); - -: 769: } - -: 770: - -: 771: /** Create a Callback with a function object - -: 772: * @param f Function object to attach - -: 773: * @note The function object is limited to a single word of storage - -: 774: */ - -: 775: template - -: 776: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { - -: 777: generate(f); - -: 778: } - -: 779: - -: 780: /** Create a Callback with a static function and bound pointer - -: 781: * @param obj Pointer to object to bind to function - -: 782: * @param func Static function to attach - -: 783: * @deprecated - -: 784: * Arguments to callback have been reordered to Callback(func, arg) - -: 785: */ - -: 786: template - -: 787: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 788: "Arguments to callback have been reordered to Callback(func, arg)") - -: 789: Callback(U *obj, R (*func)(T*, A0)) { - -: 790: new (this) Callback(func, obj); - -: 791: } - -: 792: - -: 793: /** Create a Callback with a static function and bound pointer - -: 794: * @param obj Pointer to object to bind to function - -: 795: * @param func Static function to attach - -: 796: * @deprecated - -: 797: * Arguments to callback have been reordered to Callback(func, arg) - -: 798: */ - -: 799: template - -: 800: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 801: "Arguments to callback have been reordered to Callback(func, arg)") - -: 802: Callback(const U *obj, R (*func)(const T*, A0)) { - -: 803: new (this) Callback(func, obj); - -: 804: } - -: 805: - -: 806: /** Create a Callback with a static function and bound pointer - -: 807: * @param obj Pointer to object to bind to function - -: 808: * @param func Static function to attach - -: 809: * @deprecated - -: 810: * Arguments to callback have been reordered to Callback(func, arg) - -: 811: */ - -: 812: template - -: 813: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 814: "Arguments to callback have been reordered to Callback(func, arg)") - -: 815: Callback(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 816: new (this) Callback(func, obj); - -: 817: } - -: 818: - -: 819: /** Create a Callback with a static function and bound pointer - -: 820: * @param obj Pointer to object to bind to function - -: 821: * @param func Static function to attach - -: 822: * @deprecated - -: 823: * Arguments to callback have been reordered to Callback(func, arg) - -: 824: */ - -: 825: template - -: 826: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 827: "Arguments to callback have been reordered to Callback(func, arg)") - -: 828: Callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 829: new (this) Callback(func, obj); - -: 830: } - -: 831: - -: 832: /** Destroy a callback - -: 833: */ - #####: 834: ~Callback() { - #####: 835: if (_ops) { - #####: 836: _ops->dtor(this); - -: 837: } - #####: 838: } - -: 839: - -: 840: /** Attach a static function - -: 841: * @param func Static function to attach - -: 842: * @deprecated - -: 843: * Replaced by simple assignment 'Callback cb = func' - -: 844: */ - -: 845: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 846: "Replaced by simple assignment 'Callback cb = func") - -: 847: void attach(R (*func)(A0)) { - -: 848: this->~Callback(); - -: 849: new (this) Callback(func); - -: 850: } - -: 851: - -: 852: /** Attach a Callback - -: 853: * @param func The Callback to attach - -: 854: * @deprecated - -: 855: * Replaced by simple assignment 'Callback cb = func' - -: 856: */ - -: 857: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 858: "Replaced by simple assignment 'Callback cb = func") - -: 859: void attach(const Callback &func) { - -: 860: this->~Callback(); - -: 861: new (this) Callback(func); - -: 862: } - -: 863: - -: 864: /** Attach a member function - -: 865: * @param obj Pointer to object to invoke member function on - -: 866: * @param method Member function to attach - -: 867: * @deprecated - -: 868: * Replaced by simple assignment 'Callback cb = func' - -: 869: */ - -: 870: template - -: 871: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 872: "Replaced by simple assignment 'Callback cb = func") - -: 873: void attach(U *obj, R (T::*method)(A0)) { - -: 874: this->~Callback(); - -: 875: new (this) Callback(obj, method); - -: 876: } - -: 877: - -: 878: /** Attach a member function - -: 879: * @param obj Pointer to object to invoke member function on - -: 880: * @param method Member function to attach - -: 881: * @deprecated - -: 882: * Replaced by simple assignment 'Callback cb = func' - -: 883: */ - -: 884: template - -: 885: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 886: "Replaced by simple assignment 'Callback cb = func") - -: 887: void attach(const U *obj, R (T::*method)(A0) const) { - -: 888: this->~Callback(); - -: 889: new (this) Callback(obj, method); - -: 890: } - -: 891: - -: 892: /** Attach a member function - -: 893: * @param obj Pointer to object to invoke member function on - -: 894: * @param method Member function to attach - -: 895: * @deprecated - -: 896: * Replaced by simple assignment 'Callback cb = func' - -: 897: */ - -: 898: template - -: 899: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 900: "Replaced by simple assignment 'Callback cb = func") - -: 901: void attach(volatile U *obj, R (T::*method)(A0) volatile) { - -: 902: this->~Callback(); - -: 903: new (this) Callback(obj, method); - -: 904: } - -: 905: - -: 906: /** Attach a member function - -: 907: * @param obj Pointer to object to invoke member function on - -: 908: * @param method Member function to attach - -: 909: * @deprecated - -: 910: * Replaced by simple assignment 'Callback cb = func' - -: 911: */ - -: 912: template - -: 913: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 914: "Replaced by simple assignment 'Callback cb = func") - -: 915: void attach(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 916: this->~Callback(); - -: 917: new (this) Callback(obj, method); - -: 918: } - -: 919: - -: 920: /** Attach a static function with a bound pointer - -: 921: * @param func Static function to attach - -: 922: * @param arg Pointer argument to function - -: 923: * @deprecated - -: 924: * Replaced by simple assignment 'Callback cb = func' - -: 925: */ - -: 926: template - -: 927: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 928: "Replaced by simple assignment 'Callback cb = func") - -: 929: void attach(R (*func)(T*, A0), U *arg) { - -: 930: this->~Callback(); - -: 931: new (this) Callback(func, arg); - -: 932: } - -: 933: - -: 934: /** Attach a static function with a bound pointer - -: 935: * @param func Static function to attach - -: 936: * @param arg Pointer argument to function - -: 937: * @deprecated - -: 938: * Replaced by simple assignment 'Callback cb = func' - -: 939: */ - -: 940: template - -: 941: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 942: "Replaced by simple assignment 'Callback cb = func") - -: 943: void attach(R (*func)(const T*, A0), const U *arg) { - -: 944: this->~Callback(); - -: 945: new (this) Callback(func, arg); - -: 946: } - -: 947: - -: 948: /** Attach a static function with a bound pointer - -: 949: * @param func Static function to attach - -: 950: * @param arg Pointer argument to function - -: 951: * @deprecated - -: 952: * Replaced by simple assignment 'Callback cb = func' - -: 953: */ - -: 954: template - -: 955: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 956: "Replaced by simple assignment 'Callback cb = func") - -: 957: void attach(R (*func)(volatile T*, A0), volatile U *arg) { - -: 958: this->~Callback(); - -: 959: new (this) Callback(func, arg); - -: 960: } - -: 961: - -: 962: /** Attach a static function with a bound pointer - -: 963: * @param func Static function to attach - -: 964: * @param arg Pointer argument to function - -: 965: * @deprecated - -: 966: * Replaced by simple assignment 'Callback cb = func' - -: 967: */ - -: 968: template - -: 969: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 970: "Replaced by simple assignment 'Callback cb = func") - -: 971: void attach(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 972: this->~Callback(); - -: 973: new (this) Callback(func, arg); - -: 974: } - -: 975: - -: 976: /** Attach a function object - -: 977: * @param f Function object to attach - -: 978: * @note The function object is limited to a single word of storage - -: 979: * @deprecated - -: 980: * Replaced by simple assignment 'Callback cb = func' - -: 981: */ - -: 982: template - -: 983: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 984: "Replaced by simple assignment 'Callback cb = func") - -: 985: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { - -: 986: this->~Callback(); - -: 987: new (this) Callback(f); - -: 988: } - -: 989: - -: 990: /** Attach a function object - -: 991: * @param f Function object to attach - -: 992: * @note The function object is limited to a single word of storage - -: 993: * @deprecated - -: 994: * Replaced by simple assignment 'Callback cb = func' - -: 995: */ - -: 996: template - -: 997: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 998: "Replaced by simple assignment 'Callback cb = func") - -: 999: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { - -: 1000: this->~Callback(); - -: 1001: new (this) Callback(f); - -: 1002: } - -: 1003: - -: 1004: /** Attach a function object - -: 1005: * @param f Function object to attach - -: 1006: * @note The function object is limited to a single word of storage - -: 1007: * @deprecated - -: 1008: * Replaced by simple assignment 'Callback cb = func' - -: 1009: */ - -: 1010: template - -: 1011: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1012: "Replaced by simple assignment 'Callback cb = func") - -: 1013: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { - -: 1014: this->~Callback(); - -: 1015: new (this) Callback(f); - -: 1016: } - -: 1017: - -: 1018: /** Attach a function object - -: 1019: * @param f Function object to attach - -: 1020: * @note The function object is limited to a single word of storage - -: 1021: * @deprecated - -: 1022: * Replaced by simple assignment 'Callback cb = func' - -: 1023: */ - -: 1024: template - -: 1025: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1026: "Replaced by simple assignment 'Callback cb = func") - -: 1027: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { - -: 1028: this->~Callback(); - -: 1029: new (this) Callback(f); - -: 1030: } - -: 1031: - -: 1032: /** Attach a static function with a bound pointer - -: 1033: * @param obj Pointer to object to bind to function - -: 1034: * @param func Static function to attach - -: 1035: * @deprecated - -: 1036: * Arguments to callback have been reordered to attach(func, arg) - -: 1037: */ - -: 1038: template - -: 1039: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1040: "Arguments to callback have been reordered to attach(func, arg)") - -: 1041: void attach(U *obj, R (*func)(T*, A0)) { - -: 1042: this->~Callback(); - -: 1043: new (this) Callback(func, obj); - -: 1044: } - -: 1045: - -: 1046: /** Attach a static function with a bound pointer - -: 1047: * @param obj Pointer to object to bind to function - -: 1048: * @param func Static function to attach - -: 1049: * @deprecated - -: 1050: * Arguments to callback have been reordered to attach(func, arg) - -: 1051: */ - -: 1052: template - -: 1053: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1054: "Arguments to callback have been reordered to attach(func, arg)") - -: 1055: void attach(const U *obj, R (*func)(const T*, A0)) { - -: 1056: this->~Callback(); - -: 1057: new (this) Callback(func, obj); - -: 1058: } - -: 1059: - -: 1060: /** Attach a static function with a bound pointer - -: 1061: * @param obj Pointer to object to bind to function - -: 1062: * @param func Static function to attach - -: 1063: * @deprecated - -: 1064: * Arguments to callback have been reordered to attach(func, arg) - -: 1065: */ - -: 1066: template - -: 1067: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1068: "Arguments to callback have been reordered to attach(func, arg)") - -: 1069: void attach(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 1070: this->~Callback(); - -: 1071: new (this) Callback(func, obj); - -: 1072: } - -: 1073: - -: 1074: /** Attach a static function with a bound pointer - -: 1075: * @param obj Pointer to object to bind to function - -: 1076: * @param func Static function to attach - -: 1077: * @deprecated - -: 1078: * Arguments to callback have been reordered to attach(func, arg) - -: 1079: */ - -: 1080: template - -: 1081: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1082: "Arguments to callback have been reordered to attach(func, arg)") - -: 1083: void attach(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 1084: this->~Callback(); - -: 1085: new (this) Callback(func, obj); - -: 1086: } - -: 1087: - -: 1088: /** Assign a callback - -: 1089: */ - 1: 1090: Callback &operator=(const Callback &that) { - 1: 1091: if (this != &that) { - 1: 1092: this->~Callback(); - 1: 1093: new (this) Callback(that); - -: 1094: } - -: 1095: - 1: 1096: return *this; - -: 1097: } - -: 1098: - -: 1099: /** Call the attached function - -: 1100: */ - 1: 1101: R call(A0 a0) const { - 1: 1102: MBED_ASSERT(_ops); - 1: 1103: return _ops->call(this, a0); - -: 1104: } - -: 1105: - -: 1106: /** Call the attached function - -: 1107: */ - 1: 1108: R operator()(A0 a0) const { - 1: 1109: return call(a0); - -: 1110: } - -: 1111: - -: 1112: /** Test if function has been attached - -: 1113: */ - 1: 1114: operator bool() const { - 1: 1115: return _ops; - -: 1116: } - -: 1117: - -: 1118: /** Test for equality - -: 1119: */ - -: 1120: friend bool operator==(const Callback &l, const Callback &r) { - -: 1121: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 1122: } - -: 1123: - -: 1124: /** Test for inequality - -: 1125: */ - -: 1126: friend bool operator!=(const Callback &l, const Callback &r) { - -: 1127: return !(l == r); - -: 1128: } - -: 1129: - -: 1130: /** Static thunk for passing as C-style function - -: 1131: * @param func Callback to call passed as void pointer - -: 1132: * @param a0 An argument to be called with function func - -: 1133: * @return the value as determined by func which is of - -: 1134: * type and determined by the signiture of func - -: 1135: */ - -: 1136: static R thunk(void *func, A0 a0) { - -: 1137: return static_cast(func)->call(a0); - -: 1138: } - -: 1139: - -: 1140:private: - -: 1141: // Stored as pointer to function and pointer to optional object - -: 1142: // Function pointer is stored as union of possible function types - -: 1143: // to garuntee proper size and alignment - -: 1144: struct _class; - -: 1145: union { - -: 1146: void (*_staticfunc)(A0); - -: 1147: void (*_boundfunc)(_class*, A0); - -: 1148: void (_class::*_methodfunc)(A0); - -: 1149: } _func; - -: 1150: void *_obj; - -: 1151: - -: 1152: // Dynamically dispatched operations - -: 1153: const struct ops { - -: 1154: R (*call)(const void*, A0); - -: 1155: void (*move)(void*, const void*); - -: 1156: void (*dtor)(void*); - -: 1157: } *_ops; - -: 1158: - -: 1159: // Generate operations for function object - -: 1160: template - #####: 1161: void generate(const F &f) { - -: 1162: static const ops ops = { - -: 1163: &Callback::function_call, - -: 1164: &Callback::function_move, - -: 1165: &Callback::function_dtor, - -: 1166: }; - -: 1167: - -: 1168: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 1169: "Type F must not exceed the size of the Callback class"); - #####: 1170: memset(this, 0, sizeof(Callback)); - #####: 1171: new (this) F(f); - #####: 1172: _ops = &ops; - #####: 1173: } - -: 1174: - -: 1175: // Function attributes - -: 1176: template - #####: 1177: static R function_call(const void *p, A0 a0) { - #####: 1178: return (*(F*)p)(a0); - -: 1179: } - -: 1180: - -: 1181: template - #####: 1182: static void function_move(void *d, const void *p) { - #####: 1183: new (d) F(*(F*)p); - #####: 1184: } - -: 1185: - -: 1186: template - #####: 1187: static void function_dtor(void *p) { - -: 1188: ((F*)p)->~F(); - #####: 1189: } - -: 1190: - -: 1191: // Wrappers for functions with context - -: 1192: template - -: 1193: struct method_context { - -: 1194: M method; - -: 1195: O *obj; - -: 1196: - -: 1197: method_context(O *obj, M method) - -: 1198: : method(method), obj(obj) {} - -: 1199: - -: 1200: R operator()(A0 a0) const { - -: 1201: return (obj->*method)(a0); - -: 1202: } - -: 1203: }; - -: 1204: - -: 1205: template - -: 1206: struct function_context { - -: 1207: F func; - -: 1208: A *arg; - -: 1209: - -: 1210: function_context(F func, A *arg) - -: 1211: : func(func), arg(arg) {} - -: 1212: - -: 1213: R operator()(A0 a0) const { - -: 1214: return func(arg, a0); - -: 1215: } - -: 1216: }; - -: 1217:}; - -: 1218: - -: 1219:/** Callback class based on template specialization - -: 1220: * - -: 1221: * @note Synchronization level: Not protected - -: 1222: */ - -: 1223:template - -: 1224:class Callback { - -: 1225:public: - -: 1226: /** Create a Callback with a static function - -: 1227: * @param func Static function to attach - -: 1228: */ - -: 1229: Callback(R (*func)(A0, A1) = 0) { - -: 1230: if (!func) { - -: 1231: memset(this, 0, sizeof(Callback)); - -: 1232: } else { - -: 1233: generate(func); - -: 1234: } - -: 1235: } - -: 1236: - -: 1237: /** Attach a Callback - -: 1238: * @param func The Callback to attach - -: 1239: */ - -: 1240: Callback(const Callback &func) { - -: 1241: if (func._ops) { - -: 1242: func._ops->move(this, &func); - -: 1243: } - -: 1244: _ops = func._ops; - -: 1245: } - -: 1246: - -: 1247: /** Create a Callback with a member function - -: 1248: * @param obj Pointer to object to invoke member function on - -: 1249: * @param method Member function to attach - -: 1250: */ - -: 1251: template - -: 1252: Callback(U *obj, R (T::*method)(A0, A1)) { - -: 1253: generate(method_context(obj, method)); - -: 1254: } - -: 1255: - -: 1256: /** Create a Callback with a member function - -: 1257: * @param obj Pointer to object to invoke member function on - -: 1258: * @param method Member function to attach - -: 1259: */ - -: 1260: template - -: 1261: Callback(const U *obj, R (T::*method)(A0, A1) const) { - -: 1262: generate(method_context(obj, method)); - -: 1263: } - -: 1264: - -: 1265: /** Create a Callback with a member function - -: 1266: * @param obj Pointer to object to invoke member function on - -: 1267: * @param method Member function to attach - -: 1268: */ - -: 1269: template - -: 1270: Callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 1271: generate(method_context(obj, method)); - -: 1272: } - -: 1273: - -: 1274: /** Create a Callback with a member function - -: 1275: * @param obj Pointer to object to invoke member function on - -: 1276: * @param method Member function to attach - -: 1277: */ - -: 1278: template - -: 1279: Callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 1280: generate(method_context(obj, method)); - -: 1281: } - -: 1282: - -: 1283: /** Create a Callback with a static function and bound pointer - -: 1284: * @param func Static function to attach - -: 1285: * @param arg Pointer argument to function - -: 1286: */ - -: 1287: template - -: 1288: Callback(R (*func)(T*, A0, A1), U *arg) { - -: 1289: generate(function_context(func, arg)); - -: 1290: } - -: 1291: - -: 1292: /** Create a Callback with a static function and bound pointer - -: 1293: * @param func Static function to attach - -: 1294: * @param arg Pointer argument to function - -: 1295: */ - -: 1296: template - -: 1297: Callback(R (*func)(const T*, A0, A1), const U *arg) { - -: 1298: generate(function_context(func, arg)); - -: 1299: } - -: 1300: - -: 1301: /** Create a Callback with a static function and bound pointer - -: 1302: * @param func Static function to attach - -: 1303: * @param arg Pointer argument to function - -: 1304: */ - -: 1305: template - -: 1306: Callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 1307: generate(function_context(func, arg)); - -: 1308: } - -: 1309: - -: 1310: /** Create a Callback with a static function and bound pointer - -: 1311: * @param func Static function to attach - -: 1312: * @param arg Pointer argument to function - -: 1313: */ - -: 1314: template - -: 1315: Callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 1316: generate(function_context(func, arg)); - -: 1317: } - -: 1318: - -: 1319: /** Create a Callback with a function object - -: 1320: * @param f Function object to attach - -: 1321: * @note The function object is limited to a single word of storage - -: 1322: */ - -: 1323: template - -: 1324: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { - -: 1325: generate(f); - -: 1326: } - -: 1327: - -: 1328: /** Create a Callback with a function object - -: 1329: * @param f Function object to attach - -: 1330: * @note The function object is limited to a single word of storage - -: 1331: */ - -: 1332: template - -: 1333: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { - -: 1334: generate(f); - -: 1335: } - -: 1336: - -: 1337: /** Create a Callback with a function object - -: 1338: * @param f Function object to attach - -: 1339: * @note The function object is limited to a single word of storage - -: 1340: */ - -: 1341: template - -: 1342: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { - -: 1343: generate(f); - -: 1344: } - -: 1345: - -: 1346: /** Create a Callback with a function object - -: 1347: * @param f Function object to attach - -: 1348: * @note The function object is limited to a single word of storage - -: 1349: */ - -: 1350: template - -: 1351: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { - -: 1352: generate(f); - -: 1353: } - -: 1354: - -: 1355: /** Create a Callback with a static function and bound pointer - -: 1356: * @param obj Pointer to object to bind to function - -: 1357: * @param func Static function to attach - -: 1358: * @deprecated - -: 1359: * Arguments to callback have been reordered to Callback(func, arg) - -: 1360: */ - -: 1361: template - -: 1362: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1363: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1364: Callback(U *obj, R (*func)(T*, A0, A1)) { - -: 1365: new (this) Callback(func, obj); - -: 1366: } - -: 1367: - -: 1368: /** Create a Callback with a static function and bound pointer - -: 1369: * @param obj Pointer to object to bind to function - -: 1370: * @param func Static function to attach - -: 1371: * @deprecated - -: 1372: * Arguments to callback have been reordered to Callback(func, arg) - -: 1373: */ - -: 1374: template - -: 1375: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1376: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1377: Callback(const U *obj, R (*func)(const T*, A0, A1)) { - -: 1378: new (this) Callback(func, obj); - -: 1379: } - -: 1380: - -: 1381: /** Create a Callback with a static function and bound pointer - -: 1382: * @param obj Pointer to object to bind to function - -: 1383: * @param func Static function to attach - -: 1384: * @deprecated - -: 1385: * Arguments to callback have been reordered to Callback(func, arg) - -: 1386: */ - -: 1387: template - -: 1388: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1389: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1390: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 1391: new (this) Callback(func, obj); - -: 1392: } - -: 1393: - -: 1394: /** Create a Callback with a static function and bound pointer - -: 1395: * @param obj Pointer to object to bind to function - -: 1396: * @param func Static function to attach - -: 1397: * @deprecated - -: 1398: * Arguments to callback have been reordered to Callback(func, arg) - -: 1399: */ - -: 1400: template - -: 1401: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1402: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1403: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 1404: new (this) Callback(func, obj); - -: 1405: } - -: 1406: - -: 1407: /** Destroy a callback - -: 1408: */ - -: 1409: ~Callback() { - -: 1410: if (_ops) { - -: 1411: _ops->dtor(this); - -: 1412: } - -: 1413: } - -: 1414: - -: 1415: /** Attach a static function - -: 1416: * @param func Static function to attach - -: 1417: * @deprecated - -: 1418: * Replaced by simple assignment 'Callback cb = func' - -: 1419: */ - -: 1420: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1421: "Replaced by simple assignment 'Callback cb = func") - -: 1422: void attach(R (*func)(A0, A1)) { - -: 1423: this->~Callback(); - -: 1424: new (this) Callback(func); - -: 1425: } - -: 1426: - -: 1427: /** Attach a Callback - -: 1428: * @param func The Callback to attach - -: 1429: * @deprecated - -: 1430: * Replaced by simple assignment 'Callback cb = func' - -: 1431: */ - -: 1432: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1433: "Replaced by simple assignment 'Callback cb = func") - -: 1434: void attach(const Callback &func) { - -: 1435: this->~Callback(); - -: 1436: new (this) Callback(func); - -: 1437: } - -: 1438: - -: 1439: /** Attach a member function - -: 1440: * @param obj Pointer to object to invoke member function on - -: 1441: * @param method Member function to attach - -: 1442: * @deprecated - -: 1443: * Replaced by simple assignment 'Callback cb = func' - -: 1444: */ - -: 1445: template - -: 1446: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1447: "Replaced by simple assignment 'Callback cb = func") - -: 1448: void attach(U *obj, R (T::*method)(A0, A1)) { - -: 1449: this->~Callback(); - -: 1450: new (this) Callback(obj, method); - -: 1451: } - -: 1452: - -: 1453: /** Attach a member function - -: 1454: * @param obj Pointer to object to invoke member function on - -: 1455: * @param method Member function to attach - -: 1456: * @deprecated - -: 1457: * Replaced by simple assignment 'Callback cb = func' - -: 1458: */ - -: 1459: template - -: 1460: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1461: "Replaced by simple assignment 'Callback cb = func") - -: 1462: void attach(const U *obj, R (T::*method)(A0, A1) const) { - -: 1463: this->~Callback(); - -: 1464: new (this) Callback(obj, method); - -: 1465: } - -: 1466: - -: 1467: /** Attach a member function - -: 1468: * @param obj Pointer to object to invoke member function on - -: 1469: * @param method Member function to attach - -: 1470: * @deprecated - -: 1471: * Replaced by simple assignment 'Callback cb = func' - -: 1472: */ - -: 1473: template - -: 1474: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1475: "Replaced by simple assignment 'Callback cb = func") - -: 1476: void attach(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 1477: this->~Callback(); - -: 1478: new (this) Callback(obj, method); - -: 1479: } - -: 1480: - -: 1481: /** Attach a member function - -: 1482: * @param obj Pointer to object to invoke member function on - -: 1483: * @param method Member function to attach - -: 1484: * @deprecated - -: 1485: * Replaced by simple assignment 'Callback cb = func' - -: 1486: */ - -: 1487: template - -: 1488: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1489: "Replaced by simple assignment 'Callback cb = func") - -: 1490: void attach(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 1491: this->~Callback(); - -: 1492: new (this) Callback(obj, method); - -: 1493: } - -: 1494: - -: 1495: /** Attach a static function with a bound pointer - -: 1496: * @param func Static function to attach - -: 1497: * @param arg Pointer argument to function - -: 1498: * @deprecated - -: 1499: * Replaced by simple assignment 'Callback cb = func' - -: 1500: */ - -: 1501: template - -: 1502: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1503: "Replaced by simple assignment 'Callback cb = func") - -: 1504: void attach(R (*func)(T*, A0, A1), U *arg) { - -: 1505: this->~Callback(); - -: 1506: new (this) Callback(func, arg); - -: 1507: } - -: 1508: - -: 1509: /** Attach a static function with a bound pointer - -: 1510: * @param func Static function to attach - -: 1511: * @param arg Pointer argument to function - -: 1512: * @deprecated - -: 1513: * Replaced by simple assignment 'Callback cb = func' - -: 1514: */ - -: 1515: template - -: 1516: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1517: "Replaced by simple assignment 'Callback cb = func") - -: 1518: void attach(R (*func)(const T*, A0, A1), const U *arg) { - -: 1519: this->~Callback(); - -: 1520: new (this) Callback(func, arg); - -: 1521: } - -: 1522: - -: 1523: /** Attach a static function with a bound pointer - -: 1524: * @param func Static function to attach - -: 1525: * @param arg Pointer argument to function - -: 1526: * @deprecated - -: 1527: * Replaced by simple assignment 'Callback cb = func' - -: 1528: */ - -: 1529: template - -: 1530: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1531: "Replaced by simple assignment 'Callback cb = func") - -: 1532: void attach(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 1533: this->~Callback(); - -: 1534: new (this) Callback(func, arg); - -: 1535: } - -: 1536: - -: 1537: /** Attach a static function with a bound pointer - -: 1538: * @param func Static function to attach - -: 1539: * @param arg Pointer argument to function - -: 1540: * @deprecated - -: 1541: * Replaced by simple assignment 'Callback cb = func' - -: 1542: */ - -: 1543: template - -: 1544: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1545: "Replaced by simple assignment 'Callback cb = func") - -: 1546: void attach(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 1547: this->~Callback(); - -: 1548: new (this) Callback(func, arg); - -: 1549: } - -: 1550: - -: 1551: /** Attach a function object - -: 1552: * @param f Function object to attach - -: 1553: * @note The function object is limited to a single word of storage - -: 1554: * @deprecated - -: 1555: * Replaced by simple assignment 'Callback cb = func' - -: 1556: */ - -: 1557: template - -: 1558: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1559: "Replaced by simple assignment 'Callback cb = func") - -: 1560: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { - -: 1561: this->~Callback(); - -: 1562: new (this) Callback(f); - -: 1563: } - -: 1564: - -: 1565: /** Attach a function object - -: 1566: * @param f Function object to attach - -: 1567: * @note The function object is limited to a single word of storage - -: 1568: * @deprecated - -: 1569: * Replaced by simple assignment 'Callback cb = func' - -: 1570: */ - -: 1571: template - -: 1572: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1573: "Replaced by simple assignment 'Callback cb = func") - -: 1574: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { - -: 1575: this->~Callback(); - -: 1576: new (this) Callback(f); - -: 1577: } - -: 1578: - -: 1579: /** Attach a function object - -: 1580: * @param f Function object to attach - -: 1581: * @note The function object is limited to a single word of storage - -: 1582: * @deprecated - -: 1583: * Replaced by simple assignment 'Callback cb = func' - -: 1584: */ - -: 1585: template - -: 1586: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1587: "Replaced by simple assignment 'Callback cb = func") - -: 1588: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { - -: 1589: this->~Callback(); - -: 1590: new (this) Callback(f); - -: 1591: } - -: 1592: - -: 1593: /** Attach a function object - -: 1594: * @param f Function object to attach - -: 1595: * @note The function object is limited to a single word of storage - -: 1596: * @deprecated - -: 1597: * Replaced by simple assignment 'Callback cb = func' - -: 1598: */ - -: 1599: template - -: 1600: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1601: "Replaced by simple assignment 'Callback cb = func") - -: 1602: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { - -: 1603: this->~Callback(); - -: 1604: new (this) Callback(f); - -: 1605: } - -: 1606: - -: 1607: /** Attach a static function with a bound pointer - -: 1608: * @param obj Pointer to object to bind to function - -: 1609: * @param func Static function to attach - -: 1610: * @deprecated - -: 1611: * Arguments to callback have been reordered to attach(func, arg) - -: 1612: */ - -: 1613: template - -: 1614: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1615: "Arguments to callback have been reordered to attach(func, arg)") - -: 1616: void attach(U *obj, R (*func)(T*, A0, A1)) { - -: 1617: this->~Callback(); - -: 1618: new (this) Callback(func, obj); - -: 1619: } - -: 1620: - -: 1621: /** Attach a static function with a bound pointer - -: 1622: * @param obj Pointer to object to bind to function - -: 1623: * @param func Static function to attach - -: 1624: * @deprecated - -: 1625: * Arguments to callback have been reordered to attach(func, arg) - -: 1626: */ - -: 1627: template - -: 1628: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1629: "Arguments to callback have been reordered to attach(func, arg)") - -: 1630: void attach(const U *obj, R (*func)(const T*, A0, A1)) { - -: 1631: this->~Callback(); - -: 1632: new (this) Callback(func, obj); - -: 1633: } - -: 1634: - -: 1635: /** Attach a static function with a bound pointer - -: 1636: * @param obj Pointer to object to bind to function - -: 1637: * @param func Static function to attach - -: 1638: * @deprecated - -: 1639: * Arguments to callback have been reordered to attach(func, arg) - -: 1640: */ - -: 1641: template - -: 1642: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1643: "Arguments to callback have been reordered to attach(func, arg)") - -: 1644: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 1645: this->~Callback(); - -: 1646: new (this) Callback(func, obj); - -: 1647: } - -: 1648: - -: 1649: /** Attach a static function with a bound pointer - -: 1650: * @param obj Pointer to object to bind to function - -: 1651: * @param func Static function to attach - -: 1652: * @deprecated - -: 1653: * Arguments to callback have been reordered to attach(func, arg) - -: 1654: */ - -: 1655: template - -: 1656: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1657: "Arguments to callback have been reordered to attach(func, arg)") - -: 1658: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 1659: this->~Callback(); - -: 1660: new (this) Callback(func, obj); - -: 1661: } - -: 1662: - -: 1663: /** Assign a callback - -: 1664: */ - -: 1665: Callback &operator=(const Callback &that) { - -: 1666: if (this != &that) { - -: 1667: this->~Callback(); - -: 1668: new (this) Callback(that); - -: 1669: } - -: 1670: - -: 1671: return *this; - -: 1672: } - -: 1673: - -: 1674: /** Call the attached function - -: 1675: */ - -: 1676: R call(A0 a0, A1 a1) const { - -: 1677: MBED_ASSERT(_ops); - -: 1678: return _ops->call(this, a0, a1); - -: 1679: } - -: 1680: - -: 1681: /** Call the attached function - -: 1682: */ - -: 1683: R operator()(A0 a0, A1 a1) const { - -: 1684: return call(a0, a1); - -: 1685: } - -: 1686: - -: 1687: /** Test if function has been attached - -: 1688: */ - -: 1689: operator bool() const { - -: 1690: return _ops; - -: 1691: } - -: 1692: - -: 1693: /** Test for equality - -: 1694: */ - -: 1695: friend bool operator==(const Callback &l, const Callback &r) { - -: 1696: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 1697: } - -: 1698: - -: 1699: /** Test for inequality - -: 1700: */ - -: 1701: friend bool operator!=(const Callback &l, const Callback &r) { - -: 1702: return !(l == r); - -: 1703: } - -: 1704: - -: 1705: /** Static thunk for passing as C-style function - -: 1706: * @param func Callback to call passed as void pointer - -: 1707: * @param a0 An argument to be called with function func - -: 1708: * @param a1 An argument to be called with function func - -: 1709: * @return the value as determined by func which is of - -: 1710: * type and determined by the signiture of func - -: 1711: */ - -: 1712: static R thunk(void *func, A0 a0, A1 a1) { - -: 1713: return static_cast(func)->call(a0, a1); - -: 1714: } - -: 1715: - -: 1716:private: - -: 1717: // Stored as pointer to function and pointer to optional object - -: 1718: // Function pointer is stored as union of possible function types - -: 1719: // to garuntee proper size and alignment - -: 1720: struct _class; - -: 1721: union { - -: 1722: void (*_staticfunc)(A0, A1); - -: 1723: void (*_boundfunc)(_class*, A0, A1); - -: 1724: void (_class::*_methodfunc)(A0, A1); - -: 1725: } _func; - -: 1726: void *_obj; - -: 1727: - -: 1728: // Dynamically dispatched operations - -: 1729: const struct ops { - -: 1730: R (*call)(const void*, A0, A1); - -: 1731: void (*move)(void*, const void*); - -: 1732: void (*dtor)(void*); - -: 1733: } *_ops; - -: 1734: - -: 1735: // Generate operations for function object - -: 1736: template - -: 1737: void generate(const F &f) { - -: 1738: static const ops ops = { - -: 1739: &Callback::function_call, - -: 1740: &Callback::function_move, - -: 1741: &Callback::function_dtor, - -: 1742: }; - -: 1743: - -: 1744: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 1745: "Type F must not exceed the size of the Callback class"); - -: 1746: memset(this, 0, sizeof(Callback)); - -: 1747: new (this) F(f); - -: 1748: _ops = &ops; - -: 1749: } - -: 1750: - -: 1751: // Function attributes - -: 1752: template - -: 1753: static R function_call(const void *p, A0 a0, A1 a1) { - -: 1754: return (*(F*)p)(a0, a1); - -: 1755: } - -: 1756: - -: 1757: template - -: 1758: static void function_move(void *d, const void *p) { - -: 1759: new (d) F(*(F*)p); - -: 1760: } - -: 1761: - -: 1762: template - -: 1763: static void function_dtor(void *p) { - -: 1764: ((F*)p)->~F(); - -: 1765: } - -: 1766: - -: 1767: // Wrappers for functions with context - -: 1768: template - -: 1769: struct method_context { - -: 1770: M method; - -: 1771: O *obj; - -: 1772: - -: 1773: method_context(O *obj, M method) - -: 1774: : method(method), obj(obj) {} - -: 1775: - -: 1776: R operator()(A0 a0, A1 a1) const { - -: 1777: return (obj->*method)(a0, a1); - -: 1778: } - -: 1779: }; - -: 1780: - -: 1781: template - -: 1782: struct function_context { - -: 1783: F func; - -: 1784: A *arg; - -: 1785: - -: 1786: function_context(F func, A *arg) - -: 1787: : func(func), arg(arg) {} - -: 1788: - -: 1789: R operator()(A0 a0, A1 a1) const { - -: 1790: return func(arg, a0, a1); - -: 1791: } - -: 1792: }; - -: 1793:}; - -: 1794: - -: 1795:/** Callback class based on template specialization - -: 1796: * - -: 1797: * @note Synchronization level: Not protected - -: 1798: */ - -: 1799:template - -: 1800:class Callback { - -: 1801:public: - -: 1802: /** Create a Callback with a static function - -: 1803: * @param func Static function to attach - -: 1804: */ - -: 1805: Callback(R (*func)(A0, A1, A2) = 0) { - -: 1806: if (!func) { - -: 1807: memset(this, 0, sizeof(Callback)); - -: 1808: } else { - -: 1809: generate(func); - -: 1810: } - -: 1811: } - -: 1812: - -: 1813: /** Attach a Callback - -: 1814: * @param func The Callback to attach - -: 1815: */ - -: 1816: Callback(const Callback &func) { - -: 1817: if (func._ops) { - -: 1818: func._ops->move(this, &func); - -: 1819: } - -: 1820: _ops = func._ops; - -: 1821: } - -: 1822: - -: 1823: /** Create a Callback with a member function - -: 1824: * @param obj Pointer to object to invoke member function on - -: 1825: * @param method Member function to attach - -: 1826: */ - -: 1827: template - -: 1828: Callback(U *obj, R (T::*method)(A0, A1, A2)) { - -: 1829: generate(method_context(obj, method)); - -: 1830: } - -: 1831: - -: 1832: /** Create a Callback with a member function - -: 1833: * @param obj Pointer to object to invoke member function on - -: 1834: * @param method Member function to attach - -: 1835: */ - -: 1836: template - -: 1837: Callback(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 1838: generate(method_context(obj, method)); - -: 1839: } - -: 1840: - -: 1841: /** Create a Callback with a member function - -: 1842: * @param obj Pointer to object to invoke member function on - -: 1843: * @param method Member function to attach - -: 1844: */ - -: 1845: template - -: 1846: Callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 1847: generate(method_context(obj, method)); - -: 1848: } - -: 1849: - -: 1850: /** Create a Callback with a member function - -: 1851: * @param obj Pointer to object to invoke member function on - -: 1852: * @param method Member function to attach - -: 1853: */ - -: 1854: template - -: 1855: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 1856: generate(method_context(obj, method)); - -: 1857: } - -: 1858: - -: 1859: /** Create a Callback with a static function and bound pointer - -: 1860: * @param func Static function to attach - -: 1861: * @param arg Pointer argument to function - -: 1862: */ - -: 1863: template - -: 1864: Callback(R (*func)(T*, A0, A1, A2), U *arg) { - -: 1865: generate(function_context(func, arg)); - -: 1866: } - -: 1867: - -: 1868: /** Create a Callback with a static function and bound pointer - -: 1869: * @param func Static function to attach - -: 1870: * @param arg Pointer argument to function - -: 1871: */ - -: 1872: template - -: 1873: Callback(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 1874: generate(function_context(func, arg)); - -: 1875: } - -: 1876: - -: 1877: /** Create a Callback with a static function and bound pointer - -: 1878: * @param func Static function to attach - -: 1879: * @param arg Pointer argument to function - -: 1880: */ - -: 1881: template - -: 1882: Callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 1883: generate(function_context(func, arg)); - -: 1884: } - -: 1885: - -: 1886: /** Create a Callback with a static function and bound pointer - -: 1887: * @param func Static function to attach - -: 1888: * @param arg Pointer argument to function - -: 1889: */ - -: 1890: template - -: 1891: Callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 1892: generate(function_context(func, arg)); - -: 1893: } - -: 1894: - -: 1895: /** Create a Callback with a function object - -: 1896: * @param f Function object to attach - -: 1897: * @note The function object is limited to a single word of storage - -: 1898: */ - -: 1899: template - -: 1900: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { - -: 1901: generate(f); - -: 1902: } - -: 1903: - -: 1904: /** Create a Callback with a function object - -: 1905: * @param f Function object to attach - -: 1906: * @note The function object is limited to a single word of storage - -: 1907: */ - -: 1908: template - -: 1909: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { - -: 1910: generate(f); - -: 1911: } - -: 1912: - -: 1913: /** Create a Callback with a function object - -: 1914: * @param f Function object to attach - -: 1915: * @note The function object is limited to a single word of storage - -: 1916: */ - -: 1917: template - -: 1918: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { - -: 1919: generate(f); - -: 1920: } - -: 1921: - -: 1922: /** Create a Callback with a function object - -: 1923: * @param f Function object to attach - -: 1924: * @note The function object is limited to a single word of storage - -: 1925: */ - -: 1926: template - -: 1927: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { - -: 1928: generate(f); - -: 1929: } - -: 1930: - -: 1931: /** Create a Callback with a static function and bound pointer - -: 1932: * @param obj Pointer to object to bind to function - -: 1933: * @param func Static function to attach - -: 1934: * @deprecated - -: 1935: * Arguments to callback have been reordered to Callback(func, arg) - -: 1936: */ - -: 1937: template - -: 1938: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1939: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1940: Callback(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 1941: new (this) Callback(func, obj); - -: 1942: } - -: 1943: - -: 1944: /** Create a Callback with a static function and bound pointer - -: 1945: * @param obj Pointer to object to bind to function - -: 1946: * @param func Static function to attach - -: 1947: * @deprecated - -: 1948: * Arguments to callback have been reordered to Callback(func, arg) - -: 1949: */ - -: 1950: template - -: 1951: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1952: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1953: Callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 1954: new (this) Callback(func, obj); - -: 1955: } - -: 1956: - -: 1957: /** Create a Callback with a static function and bound pointer - -: 1958: * @param obj Pointer to object to bind to function - -: 1959: * @param func Static function to attach - -: 1960: * @deprecated - -: 1961: * Arguments to callback have been reordered to Callback(func, arg) - -: 1962: */ - -: 1963: template - -: 1964: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1965: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1966: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 1967: new (this) Callback(func, obj); - -: 1968: } - -: 1969: - -: 1970: /** Create a Callback with a static function and bound pointer - -: 1971: * @param obj Pointer to object to bind to function - -: 1972: * @param func Static function to attach - -: 1973: * @deprecated - -: 1974: * Arguments to callback have been reordered to Callback(func, arg) - -: 1975: */ - -: 1976: template - -: 1977: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1978: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1979: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 1980: new (this) Callback(func, obj); - -: 1981: } - -: 1982: - -: 1983: /** Destroy a callback - -: 1984: */ - -: 1985: ~Callback() { - -: 1986: if (_ops) { - -: 1987: _ops->dtor(this); - -: 1988: } - -: 1989: } - -: 1990: - -: 1991: /** Attach a static function - -: 1992: * @param func Static function to attach - -: 1993: * @deprecated - -: 1994: * Replaced by simple assignment 'Callback cb = func' - -: 1995: */ - -: 1996: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1997: "Replaced by simple assignment 'Callback cb = func") - -: 1998: void attach(R (*func)(A0, A1, A2)) { - -: 1999: this->~Callback(); - -: 2000: new (this) Callback(func); - -: 2001: } - -: 2002: - -: 2003: /** Attach a Callback - -: 2004: * @param func The Callback to attach - -: 2005: * @deprecated - -: 2006: * Replaced by simple assignment 'Callback cb = func' - -: 2007: */ - -: 2008: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2009: "Replaced by simple assignment 'Callback cb = func") - -: 2010: void attach(const Callback &func) { - -: 2011: this->~Callback(); - -: 2012: new (this) Callback(func); - -: 2013: } - -: 2014: - -: 2015: /** Attach a member function - -: 2016: * @param obj Pointer to object to invoke member function on - -: 2017: * @param method Member function to attach - -: 2018: * @deprecated - -: 2019: * Replaced by simple assignment 'Callback cb = func' - -: 2020: */ - -: 2021: template - -: 2022: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2023: "Replaced by simple assignment 'Callback cb = func") - -: 2024: void attach(U *obj, R (T::*method)(A0, A1, A2)) { - -: 2025: this->~Callback(); - -: 2026: new (this) Callback(obj, method); - -: 2027: } - -: 2028: - -: 2029: /** Attach a member function - -: 2030: * @param obj Pointer to object to invoke member function on - -: 2031: * @param method Member function to attach - -: 2032: * @deprecated - -: 2033: * Replaced by simple assignment 'Callback cb = func' - -: 2034: */ - -: 2035: template - -: 2036: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2037: "Replaced by simple assignment 'Callback cb = func") - -: 2038: void attach(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 2039: this->~Callback(); - -: 2040: new (this) Callback(obj, method); - -: 2041: } - -: 2042: - -: 2043: /** Attach a member function - -: 2044: * @param obj Pointer to object to invoke member function on - -: 2045: * @param method Member function to attach - -: 2046: * @deprecated - -: 2047: * Replaced by simple assignment 'Callback cb = func' - -: 2048: */ - -: 2049: template - -: 2050: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2051: "Replaced by simple assignment 'Callback cb = func") - -: 2052: void attach(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 2053: this->~Callback(); - -: 2054: new (this) Callback(obj, method); - -: 2055: } - -: 2056: - -: 2057: /** Attach a member function - -: 2058: * @param obj Pointer to object to invoke member function on - -: 2059: * @param method Member function to attach - -: 2060: * @deprecated - -: 2061: * Replaced by simple assignment 'Callback cb = func' - -: 2062: */ - -: 2063: template - -: 2064: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2065: "Replaced by simple assignment 'Callback cb = func") - -: 2066: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 2067: this->~Callback(); - -: 2068: new (this) Callback(obj, method); - -: 2069: } - -: 2070: - -: 2071: /** Attach a static function with a bound pointer - -: 2072: * @param func Static function to attach - -: 2073: * @param arg Pointer argument to function - -: 2074: * @deprecated - -: 2075: * Replaced by simple assignment 'Callback cb = func' - -: 2076: */ - -: 2077: template - -: 2078: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2079: "Replaced by simple assignment 'Callback cb = func") - -: 2080: void attach(R (*func)(T*, A0, A1, A2), U *arg) { - -: 2081: this->~Callback(); - -: 2082: new (this) Callback(func, arg); - -: 2083: } - -: 2084: - -: 2085: /** Attach a static function with a bound pointer - -: 2086: * @param func Static function to attach - -: 2087: * @param arg Pointer argument to function - -: 2088: * @deprecated - -: 2089: * Replaced by simple assignment 'Callback cb = func' - -: 2090: */ - -: 2091: template - -: 2092: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2093: "Replaced by simple assignment 'Callback cb = func") - -: 2094: void attach(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 2095: this->~Callback(); - -: 2096: new (this) Callback(func, arg); - -: 2097: } - -: 2098: - -: 2099: /** Attach a static function with a bound pointer - -: 2100: * @param func Static function to attach - -: 2101: * @param arg Pointer argument to function - -: 2102: * @deprecated - -: 2103: * Replaced by simple assignment 'Callback cb = func' - -: 2104: */ - -: 2105: template - -: 2106: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2107: "Replaced by simple assignment 'Callback cb = func") - -: 2108: void attach(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 2109: this->~Callback(); - -: 2110: new (this) Callback(func, arg); - -: 2111: } - -: 2112: - -: 2113: /** Attach a static function with a bound pointer - -: 2114: * @param func Static function to attach - -: 2115: * @param arg Pointer argument to function - -: 2116: * @deprecated - -: 2117: * Replaced by simple assignment 'Callback cb = func' - -: 2118: */ - -: 2119: template - -: 2120: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2121: "Replaced by simple assignment 'Callback cb = func") - -: 2122: void attach(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 2123: this->~Callback(); - -: 2124: new (this) Callback(func, arg); - -: 2125: } - -: 2126: - -: 2127: /** Attach a function object - -: 2128: * @param f Function object to attach - -: 2129: * @note The function object is limited to a single word of storage - -: 2130: * @deprecated - -: 2131: * Replaced by simple assignment 'Callback cb = func' - -: 2132: */ - -: 2133: template - -: 2134: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2135: "Replaced by simple assignment 'Callback cb = func") - -: 2136: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { - -: 2137: this->~Callback(); - -: 2138: new (this) Callback(f); - -: 2139: } - -: 2140: - -: 2141: /** Attach a function object - -: 2142: * @param f Function object to attach - -: 2143: * @note The function object is limited to a single word of storage - -: 2144: * @deprecated - -: 2145: * Replaced by simple assignment 'Callback cb = func' - -: 2146: */ - -: 2147: template - -: 2148: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2149: "Replaced by simple assignment 'Callback cb = func") - -: 2150: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { - -: 2151: this->~Callback(); - -: 2152: new (this) Callback(f); - -: 2153: } - -: 2154: - -: 2155: /** Attach a function object - -: 2156: * @param f Function object to attach - -: 2157: * @note The function object is limited to a single word of storage - -: 2158: * @deprecated - -: 2159: * Replaced by simple assignment 'Callback cb = func' - -: 2160: */ - -: 2161: template - -: 2162: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2163: "Replaced by simple assignment 'Callback cb = func") - -: 2164: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { - -: 2165: this->~Callback(); - -: 2166: new (this) Callback(f); - -: 2167: } - -: 2168: - -: 2169: /** Attach a function object - -: 2170: * @param f Function object to attach - -: 2171: * @note The function object is limited to a single word of storage - -: 2172: * @deprecated - -: 2173: * Replaced by simple assignment 'Callback cb = func' - -: 2174: */ - -: 2175: template - -: 2176: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2177: "Replaced by simple assignment 'Callback cb = func") - -: 2178: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { - -: 2179: this->~Callback(); - -: 2180: new (this) Callback(f); - -: 2181: } - -: 2182: - -: 2183: /** Attach a static function with a bound pointer - -: 2184: * @param obj Pointer to object to bind to function - -: 2185: * @param func Static function to attach - -: 2186: * @deprecated - -: 2187: * Arguments to callback have been reordered to attach(func, arg) - -: 2188: */ - -: 2189: template - -: 2190: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2191: "Arguments to callback have been reordered to attach(func, arg)") - -: 2192: void attach(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 2193: this->~Callback(); - -: 2194: new (this) Callback(func, obj); - -: 2195: } - -: 2196: - -: 2197: /** Attach a static function with a bound pointer - -: 2198: * @param obj Pointer to object to bind to function - -: 2199: * @param func Static function to attach - -: 2200: * @deprecated - -: 2201: * Arguments to callback have been reordered to attach(func, arg) - -: 2202: */ - -: 2203: template - -: 2204: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2205: "Arguments to callback have been reordered to attach(func, arg)") - -: 2206: void attach(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 2207: this->~Callback(); - -: 2208: new (this) Callback(func, obj); - -: 2209: } - -: 2210: - -: 2211: /** Attach a static function with a bound pointer - -: 2212: * @param obj Pointer to object to bind to function - -: 2213: * @param func Static function to attach - -: 2214: * @deprecated - -: 2215: * Arguments to callback have been reordered to attach(func, arg) - -: 2216: */ - -: 2217: template - -: 2218: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2219: "Arguments to callback have been reordered to attach(func, arg)") - -: 2220: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 2221: this->~Callback(); - -: 2222: new (this) Callback(func, obj); - -: 2223: } - -: 2224: - -: 2225: /** Attach a static function with a bound pointer - -: 2226: * @param obj Pointer to object to bind to function - -: 2227: * @param func Static function to attach - -: 2228: * @deprecated - -: 2229: * Arguments to callback have been reordered to attach(func, arg) - -: 2230: */ - -: 2231: template - -: 2232: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2233: "Arguments to callback have been reordered to attach(func, arg)") - -: 2234: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 2235: this->~Callback(); - -: 2236: new (this) Callback(func, obj); - -: 2237: } - -: 2238: - -: 2239: /** Assign a callback - -: 2240: */ - -: 2241: Callback &operator=(const Callback &that) { - -: 2242: if (this != &that) { - -: 2243: this->~Callback(); - -: 2244: new (this) Callback(that); - -: 2245: } - -: 2246: - -: 2247: return *this; - -: 2248: } - -: 2249: - -: 2250: /** Call the attached function - -: 2251: */ - -: 2252: R call(A0 a0, A1 a1, A2 a2) const { - -: 2253: MBED_ASSERT(_ops); - -: 2254: return _ops->call(this, a0, a1, a2); - -: 2255: } - -: 2256: - -: 2257: /** Call the attached function - -: 2258: */ - -: 2259: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2260: return call(a0, a1, a2); - -: 2261: } - -: 2262: - -: 2263: /** Test if function has been attached - -: 2264: */ - -: 2265: operator bool() const { - -: 2266: return _ops; - -: 2267: } - -: 2268: - -: 2269: /** Test for equality - -: 2270: */ - -: 2271: friend bool operator==(const Callback &l, const Callback &r) { - -: 2272: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 2273: } - -: 2274: - -: 2275: /** Test for inequality - -: 2276: */ - -: 2277: friend bool operator!=(const Callback &l, const Callback &r) { - -: 2278: return !(l == r); - -: 2279: } - -: 2280: - -: 2281: /** Static thunk for passing as C-style function - -: 2282: * @param func Callback to call passed as void pointer - -: 2283: * @param a0 An argument to be called with function func - -: 2284: * @param a1 An argument to be called with function func - -: 2285: * @param a2 An argument to be called with function func - -: 2286: * @return the value as determined by func which is of - -: 2287: * type and determined by the signiture of func - -: 2288: */ - -: 2289: static R thunk(void *func, A0 a0, A1 a1, A2 a2) { - -: 2290: return static_cast(func)->call(a0, a1, a2); - -: 2291: } - -: 2292: - -: 2293:private: - -: 2294: // Stored as pointer to function and pointer to optional object - -: 2295: // Function pointer is stored as union of possible function types - -: 2296: // to garuntee proper size and alignment - -: 2297: struct _class; - -: 2298: union { - -: 2299: void (*_staticfunc)(A0, A1, A2); - -: 2300: void (*_boundfunc)(_class*, A0, A1, A2); - -: 2301: void (_class::*_methodfunc)(A0, A1, A2); - -: 2302: } _func; - -: 2303: void *_obj; - -: 2304: - -: 2305: // Dynamically dispatched operations - -: 2306: const struct ops { - -: 2307: R (*call)(const void*, A0, A1, A2); - -: 2308: void (*move)(void*, const void*); - -: 2309: void (*dtor)(void*); - -: 2310: } *_ops; - -: 2311: - -: 2312: // Generate operations for function object - -: 2313: template - -: 2314: void generate(const F &f) { - -: 2315: static const ops ops = { - -: 2316: &Callback::function_call, - -: 2317: &Callback::function_move, - -: 2318: &Callback::function_dtor, - -: 2319: }; - -: 2320: - -: 2321: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 2322: "Type F must not exceed the size of the Callback class"); - -: 2323: memset(this, 0, sizeof(Callback)); - -: 2324: new (this) F(f); - -: 2325: _ops = &ops; - -: 2326: } - -: 2327: - -: 2328: // Function attributes - -: 2329: template - -: 2330: static R function_call(const void *p, A0 a0, A1 a1, A2 a2) { - -: 2331: return (*(F*)p)(a0, a1, a2); - -: 2332: } - -: 2333: - -: 2334: template - -: 2335: static void function_move(void *d, const void *p) { - -: 2336: new (d) F(*(F*)p); - -: 2337: } - -: 2338: - -: 2339: template - -: 2340: static void function_dtor(void *p) { - -: 2341: ((F*)p)->~F(); - -: 2342: } - -: 2343: - -: 2344: // Wrappers for functions with context - -: 2345: template - -: 2346: struct method_context { - -: 2347: M method; - -: 2348: O *obj; - -: 2349: - -: 2350: method_context(O *obj, M method) - -: 2351: : method(method), obj(obj) {} - -: 2352: - -: 2353: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2354: return (obj->*method)(a0, a1, a2); - -: 2355: } - -: 2356: }; - -: 2357: - -: 2358: template - -: 2359: struct function_context { - -: 2360: F func; - -: 2361: A *arg; - -: 2362: - -: 2363: function_context(F func, A *arg) - -: 2364: : func(func), arg(arg) {} - -: 2365: - -: 2366: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2367: return func(arg, a0, a1, a2); - -: 2368: } - -: 2369: }; - -: 2370:}; - -: 2371: - -: 2372:/** Callback class based on template specialization - -: 2373: * - -: 2374: * @note Synchronization level: Not protected - -: 2375: */ - -: 2376:template - -: 2377:class Callback { - -: 2378:public: - -: 2379: /** Create a Callback with a static function - -: 2380: * @param func Static function to attach - -: 2381: */ - -: 2382: Callback(R (*func)(A0, A1, A2, A3) = 0) { - -: 2383: if (!func) { - -: 2384: memset(this, 0, sizeof(Callback)); - -: 2385: } else { - -: 2386: generate(func); - -: 2387: } - -: 2388: } - -: 2389: - -: 2390: /** Attach a Callback - -: 2391: * @param func The Callback to attach - -: 2392: */ - -: 2393: Callback(const Callback &func) { - -: 2394: if (func._ops) { - -: 2395: func._ops->move(this, &func); - -: 2396: } - -: 2397: _ops = func._ops; - -: 2398: } - -: 2399: - -: 2400: /** Create a Callback with a member function - -: 2401: * @param obj Pointer to object to invoke member function on - -: 2402: * @param method Member function to attach - -: 2403: */ - -: 2404: template - -: 2405: Callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 2406: generate(method_context(obj, method)); - -: 2407: } - -: 2408: - -: 2409: /** Create a Callback with a member function - -: 2410: * @param obj Pointer to object to invoke member function on - -: 2411: * @param method Member function to attach - -: 2412: */ - -: 2413: template - -: 2414: Callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 2415: generate(method_context(obj, method)); - -: 2416: } - -: 2417: - -: 2418: /** Create a Callback with a member function - -: 2419: * @param obj Pointer to object to invoke member function on - -: 2420: * @param method Member function to attach - -: 2421: */ - -: 2422: template - -: 2423: Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 2424: generate(method_context(obj, method)); - -: 2425: } - -: 2426: - -: 2427: /** Create a Callback with a member function - -: 2428: * @param obj Pointer to object to invoke member function on - -: 2429: * @param method Member function to attach - -: 2430: */ - -: 2431: template - -: 2432: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 2433: generate(method_context(obj, method)); - -: 2434: } - -: 2435: - -: 2436: /** Create a Callback with a static function and bound pointer - -: 2437: * @param func Static function to attach - -: 2438: * @param arg Pointer argument to function - -: 2439: */ - -: 2440: template - -: 2441: Callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 2442: generate(function_context(func, arg)); - -: 2443: } - -: 2444: - -: 2445: /** Create a Callback with a static function and bound pointer - -: 2446: * @param func Static function to attach - -: 2447: * @param arg Pointer argument to function - -: 2448: */ - -: 2449: template - -: 2450: Callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 2451: generate(function_context(func, arg)); - -: 2452: } - -: 2453: - -: 2454: /** Create a Callback with a static function and bound pointer - -: 2455: * @param func Static function to attach - -: 2456: * @param arg Pointer argument to function - -: 2457: */ - -: 2458: template - -: 2459: Callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 2460: generate(function_context(func, arg)); - -: 2461: } - -: 2462: - -: 2463: /** Create a Callback with a static function and bound pointer - -: 2464: * @param func Static function to attach - -: 2465: * @param arg Pointer argument to function - -: 2466: */ - -: 2467: template - -: 2468: Callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 2469: generate(function_context(func, arg)); - -: 2470: } - -: 2471: - -: 2472: /** Create a Callback with a function object - -: 2473: * @param f Function object to attach - -: 2474: * @note The function object is limited to a single word of storage - -: 2475: */ - -: 2476: template - -: 2477: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { - -: 2478: generate(f); - -: 2479: } - -: 2480: - -: 2481: /** Create a Callback with a function object - -: 2482: * @param f Function object to attach - -: 2483: * @note The function object is limited to a single word of storage - -: 2484: */ - -: 2485: template - -: 2486: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { - -: 2487: generate(f); - -: 2488: } - -: 2489: - -: 2490: /** Create a Callback with a function object - -: 2491: * @param f Function object to attach - -: 2492: * @note The function object is limited to a single word of storage - -: 2493: */ - -: 2494: template - -: 2495: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { - -: 2496: generate(f); - -: 2497: } - -: 2498: - -: 2499: /** Create a Callback with a function object - -: 2500: * @param f Function object to attach - -: 2501: * @note The function object is limited to a single word of storage - -: 2502: */ - -: 2503: template - -: 2504: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { - -: 2505: generate(f); - -: 2506: } - -: 2507: - -: 2508: /** Create a Callback with a static function and bound pointer - -: 2509: * @param obj Pointer to object to bind to function - -: 2510: * @param func Static function to attach - -: 2511: * @deprecated - -: 2512: * Arguments to callback have been reordered to Callback(func, arg) - -: 2513: */ - -: 2514: template - -: 2515: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2516: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2517: Callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 2518: new (this) Callback(func, obj); - -: 2519: } - -: 2520: - -: 2521: /** Create a Callback with a static function and bound pointer - -: 2522: * @param obj Pointer to object to bind to function - -: 2523: * @param func Static function to attach - -: 2524: * @deprecated - -: 2525: * Arguments to callback have been reordered to Callback(func, arg) - -: 2526: */ - -: 2527: template - -: 2528: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2529: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2530: Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 2531: new (this) Callback(func, obj); - -: 2532: } - -: 2533: - -: 2534: /** Create a Callback with a static function and bound pointer - -: 2535: * @param obj Pointer to object to bind to function - -: 2536: * @param func Static function to attach - -: 2537: * @deprecated - -: 2538: * Arguments to callback have been reordered to Callback(func, arg) - -: 2539: */ - -: 2540: template - -: 2541: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2542: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2543: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 2544: new (this) Callback(func, obj); - -: 2545: } - -: 2546: - -: 2547: /** Create a Callback with a static function and bound pointer - -: 2548: * @param obj Pointer to object to bind to function - -: 2549: * @param func Static function to attach - -: 2550: * @deprecated - -: 2551: * Arguments to callback have been reordered to Callback(func, arg) - -: 2552: */ - -: 2553: template - -: 2554: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2555: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2556: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 2557: new (this) Callback(func, obj); - -: 2558: } - -: 2559: - -: 2560: /** Destroy a callback - -: 2561: */ - -: 2562: ~Callback() { - -: 2563: if (_ops) { - -: 2564: _ops->dtor(this); - -: 2565: } - -: 2566: } - -: 2567: - -: 2568: /** Attach a static function - -: 2569: * @param func Static function to attach - -: 2570: * @deprecated - -: 2571: * Replaced by simple assignment 'Callback cb = func' - -: 2572: */ - -: 2573: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2574: "Replaced by simple assignment 'Callback cb = func") - -: 2575: void attach(R (*func)(A0, A1, A2, A3)) { - -: 2576: this->~Callback(); - -: 2577: new (this) Callback(func); - -: 2578: } - -: 2579: - -: 2580: /** Attach a Callback - -: 2581: * @param func The Callback to attach - -: 2582: * @deprecated - -: 2583: * Replaced by simple assignment 'Callback cb = func' - -: 2584: */ - -: 2585: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2586: "Replaced by simple assignment 'Callback cb = func") - -: 2587: void attach(const Callback &func) { - -: 2588: this->~Callback(); - -: 2589: new (this) Callback(func); - -: 2590: } - -: 2591: - -: 2592: /** Attach a member function - -: 2593: * @param obj Pointer to object to invoke member function on - -: 2594: * @param method Member function to attach - -: 2595: * @deprecated - -: 2596: * Replaced by simple assignment 'Callback cb = func' - -: 2597: */ - -: 2598: template - -: 2599: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2600: "Replaced by simple assignment 'Callback cb = func") - -: 2601: void attach(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 2602: this->~Callback(); - -: 2603: new (this) Callback(obj, method); - -: 2604: } - -: 2605: - -: 2606: /** Attach a member function - -: 2607: * @param obj Pointer to object to invoke member function on - -: 2608: * @param method Member function to attach - -: 2609: * @deprecated - -: 2610: * Replaced by simple assignment 'Callback cb = func' - -: 2611: */ - -: 2612: template - -: 2613: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2614: "Replaced by simple assignment 'Callback cb = func") - -: 2615: void attach(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 2616: this->~Callback(); - -: 2617: new (this) Callback(obj, method); - -: 2618: } - -: 2619: - -: 2620: /** Attach a member function - -: 2621: * @param obj Pointer to object to invoke member function on - -: 2622: * @param method Member function to attach - -: 2623: * @deprecated - -: 2624: * Replaced by simple assignment 'Callback cb = func' - -: 2625: */ - -: 2626: template - -: 2627: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2628: "Replaced by simple assignment 'Callback cb = func") - -: 2629: void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 2630: this->~Callback(); - -: 2631: new (this) Callback(obj, method); - -: 2632: } - -: 2633: - -: 2634: /** Attach a member function - -: 2635: * @param obj Pointer to object to invoke member function on - -: 2636: * @param method Member function to attach - -: 2637: * @deprecated - -: 2638: * Replaced by simple assignment 'Callback cb = func' - -: 2639: */ - -: 2640: template - -: 2641: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2642: "Replaced by simple assignment 'Callback cb = func") - -: 2643: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 2644: this->~Callback(); - -: 2645: new (this) Callback(obj, method); - -: 2646: } - -: 2647: - -: 2648: /** Attach a static function with a bound pointer - -: 2649: * @param func Static function to attach - -: 2650: * @param arg Pointer argument to function - -: 2651: * @deprecated - -: 2652: * Replaced by simple assignment 'Callback cb = func' - -: 2653: */ - -: 2654: template - -: 2655: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2656: "Replaced by simple assignment 'Callback cb = func") - -: 2657: void attach(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 2658: this->~Callback(); - -: 2659: new (this) Callback(func, arg); - -: 2660: } - -: 2661: - -: 2662: /** Attach a static function with a bound pointer - -: 2663: * @param func Static function to attach - -: 2664: * @param arg Pointer argument to function - -: 2665: * @deprecated - -: 2666: * Replaced by simple assignment 'Callback cb = func' - -: 2667: */ - -: 2668: template - -: 2669: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2670: "Replaced by simple assignment 'Callback cb = func") - -: 2671: void attach(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 2672: this->~Callback(); - -: 2673: new (this) Callback(func, arg); - -: 2674: } - -: 2675: - -: 2676: /** Attach a static function with a bound pointer - -: 2677: * @param func Static function to attach - -: 2678: * @param arg Pointer argument to function - -: 2679: * @deprecated - -: 2680: * Replaced by simple assignment 'Callback cb = func' - -: 2681: */ - -: 2682: template - -: 2683: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2684: "Replaced by simple assignment 'Callback cb = func") - -: 2685: void attach(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 2686: this->~Callback(); - -: 2687: new (this) Callback(func, arg); - -: 2688: } - -: 2689: - -: 2690: /** Attach a static function with a bound pointer - -: 2691: * @param func Static function to attach - -: 2692: * @param arg Pointer argument to function - -: 2693: * @deprecated - -: 2694: * Replaced by simple assignment 'Callback cb = func' - -: 2695: */ - -: 2696: template - -: 2697: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2698: "Replaced by simple assignment 'Callback cb = func") - -: 2699: void attach(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 2700: this->~Callback(); - -: 2701: new (this) Callback(func, arg); - -: 2702: } - -: 2703: - -: 2704: /** Attach a function object - -: 2705: * @param f Function object to attach - -: 2706: * @note The function object is limited to a single word of storage - -: 2707: * @deprecated - -: 2708: * Replaced by simple assignment 'Callback cb = func' - -: 2709: */ - -: 2710: template - -: 2711: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2712: "Replaced by simple assignment 'Callback cb = func") - -: 2713: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { - -: 2714: this->~Callback(); - -: 2715: new (this) Callback(f); - -: 2716: } - -: 2717: - -: 2718: /** Attach a function object - -: 2719: * @param f Function object to attach - -: 2720: * @note The function object is limited to a single word of storage - -: 2721: * @deprecated - -: 2722: * Replaced by simple assignment 'Callback cb = func' - -: 2723: */ - -: 2724: template - -: 2725: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2726: "Replaced by simple assignment 'Callback cb = func") - -: 2727: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { - -: 2728: this->~Callback(); - -: 2729: new (this) Callback(f); - -: 2730: } - -: 2731: - -: 2732: /** Attach a function object - -: 2733: * @param f Function object to attach - -: 2734: * @note The function object is limited to a single word of storage - -: 2735: * @deprecated - -: 2736: * Replaced by simple assignment 'Callback cb = func' - -: 2737: */ - -: 2738: template - -: 2739: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2740: "Replaced by simple assignment 'Callback cb = func") - -: 2741: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { - -: 2742: this->~Callback(); - -: 2743: new (this) Callback(f); - -: 2744: } - -: 2745: - -: 2746: /** Attach a function object - -: 2747: * @param f Function object to attach - -: 2748: * @note The function object is limited to a single word of storage - -: 2749: * @deprecated - -: 2750: * Replaced by simple assignment 'Callback cb = func' - -: 2751: */ - -: 2752: template - -: 2753: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2754: "Replaced by simple assignment 'Callback cb = func") - -: 2755: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { - -: 2756: this->~Callback(); - -: 2757: new (this) Callback(f); - -: 2758: } - -: 2759: - -: 2760: /** Attach a static function with a bound pointer - -: 2761: * @param obj Pointer to object to bind to function - -: 2762: * @param func Static function to attach - -: 2763: * @deprecated - -: 2764: * Arguments to callback have been reordered to attach(func, arg) - -: 2765: */ - -: 2766: template - -: 2767: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2768: "Arguments to callback have been reordered to attach(func, arg)") - -: 2769: void attach(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 2770: this->~Callback(); - -: 2771: new (this) Callback(func, obj); - -: 2772: } - -: 2773: - -: 2774: /** Attach a static function with a bound pointer - -: 2775: * @param obj Pointer to object to bind to function - -: 2776: * @param func Static function to attach - -: 2777: * @deprecated - -: 2778: * Arguments to callback have been reordered to attach(func, arg) - -: 2779: */ - -: 2780: template - -: 2781: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2782: "Arguments to callback have been reordered to attach(func, arg)") - -: 2783: void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 2784: this->~Callback(); - -: 2785: new (this) Callback(func, obj); - -: 2786: } - -: 2787: - -: 2788: /** Attach a static function with a bound pointer - -: 2789: * @param obj Pointer to object to bind to function - -: 2790: * @param func Static function to attach - -: 2791: * @deprecated - -: 2792: * Arguments to callback have been reordered to attach(func, arg) - -: 2793: */ - -: 2794: template - -: 2795: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2796: "Arguments to callback have been reordered to attach(func, arg)") - -: 2797: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 2798: this->~Callback(); - -: 2799: new (this) Callback(func, obj); - -: 2800: } - -: 2801: - -: 2802: /** Attach a static function with a bound pointer - -: 2803: * @param obj Pointer to object to bind to function - -: 2804: * @param func Static function to attach - -: 2805: * @deprecated - -: 2806: * Arguments to callback have been reordered to attach(func, arg) - -: 2807: */ - -: 2808: template - -: 2809: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2810: "Arguments to callback have been reordered to attach(func, arg)") - -: 2811: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 2812: this->~Callback(); - -: 2813: new (this) Callback(func, obj); - -: 2814: } - -: 2815: - -: 2816: /** Assign a callback - -: 2817: */ - -: 2818: Callback &operator=(const Callback &that) { - -: 2819: if (this != &that) { - -: 2820: this->~Callback(); - -: 2821: new (this) Callback(that); - -: 2822: } - -: 2823: - -: 2824: return *this; - -: 2825: } - -: 2826: - -: 2827: /** Call the attached function - -: 2828: */ - -: 2829: R call(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2830: MBED_ASSERT(_ops); - -: 2831: return _ops->call(this, a0, a1, a2, a3); - -: 2832: } - -: 2833: - -: 2834: /** Call the attached function - -: 2835: */ - -: 2836: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2837: return call(a0, a1, a2, a3); - -: 2838: } - -: 2839: - -: 2840: /** Test if function has been attached - -: 2841: */ - -: 2842: operator bool() const { - -: 2843: return _ops; - -: 2844: } - -: 2845: - -: 2846: /** Test for equality - -: 2847: */ - -: 2848: friend bool operator==(const Callback &l, const Callback &r) { - -: 2849: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 2850: } - -: 2851: - -: 2852: /** Test for inequality - -: 2853: */ - -: 2854: friend bool operator!=(const Callback &l, const Callback &r) { - -: 2855: return !(l == r); - -: 2856: } - -: 2857: - -: 2858: /** Static thunk for passing as C-style function - -: 2859: * @param func Callback to call passed as void pointer - -: 2860: * @param a0 An argument to be called with function func - -: 2861: * @param a1 An argument to be called with function func - -: 2862: * @param a2 An argument to be called with function func - -: 2863: * @param a3 An argument to be called with function func - -: 2864: * @return the value as determined by func which is of - -: 2865: * type and determined by the signiture of func - -: 2866: */ - -: 2867: static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2868: return static_cast(func)->call(a0, a1, a2, a3); - -: 2869: } - -: 2870: - -: 2871:private: - -: 2872: // Stored as pointer to function and pointer to optional object - -: 2873: // Function pointer is stored as union of possible function types - -: 2874: // to garuntee proper size and alignment - -: 2875: struct _class; - -: 2876: union { - -: 2877: void (*_staticfunc)(A0, A1, A2, A3); - -: 2878: void (*_boundfunc)(_class*, A0, A1, A2, A3); - -: 2879: void (_class::*_methodfunc)(A0, A1, A2, A3); - -: 2880: } _func; - -: 2881: void *_obj; - -: 2882: - -: 2883: // Dynamically dispatched operations - -: 2884: const struct ops { - -: 2885: R (*call)(const void*, A0, A1, A2, A3); - -: 2886: void (*move)(void*, const void*); - -: 2887: void (*dtor)(void*); - -: 2888: } *_ops; - -: 2889: - -: 2890: // Generate operations for function object - -: 2891: template - -: 2892: void generate(const F &f) { - -: 2893: static const ops ops = { - -: 2894: &Callback::function_call, - -: 2895: &Callback::function_move, - -: 2896: &Callback::function_dtor, - -: 2897: }; - -: 2898: - -: 2899: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 2900: "Type F must not exceed the size of the Callback class"); - -: 2901: memset(this, 0, sizeof(Callback)); - -: 2902: new (this) F(f); - -: 2903: _ops = &ops; - -: 2904: } - -: 2905: - -: 2906: // Function attributes - -: 2907: template - -: 2908: static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2909: return (*(F*)p)(a0, a1, a2, a3); - -: 2910: } - -: 2911: - -: 2912: template - -: 2913: static void function_move(void *d, const void *p) { - -: 2914: new (d) F(*(F*)p); - -: 2915: } - -: 2916: - -: 2917: template - -: 2918: static void function_dtor(void *p) { - -: 2919: ((F*)p)->~F(); - -: 2920: } - -: 2921: - -: 2922: // Wrappers for functions with context - -: 2923: template - -: 2924: struct method_context { - -: 2925: M method; - -: 2926: O *obj; - -: 2927: - -: 2928: method_context(O *obj, M method) - -: 2929: : method(method), obj(obj) {} - -: 2930: - -: 2931: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2932: return (obj->*method)(a0, a1, a2, a3); - -: 2933: } - -: 2934: }; - -: 2935: - -: 2936: template - -: 2937: struct function_context { - -: 2938: F func; - -: 2939: A *arg; - -: 2940: - -: 2941: function_context(F func, A *arg) - -: 2942: : func(func), arg(arg) {} - -: 2943: - -: 2944: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2945: return func(arg, a0, a1, a2, a3); - -: 2946: } - -: 2947: }; - -: 2948:}; - -: 2949: - -: 2950:/** Callback class based on template specialization - -: 2951: * - -: 2952: * @note Synchronization level: Not protected - -: 2953: */ - -: 2954:template - -: 2955:class Callback { - -: 2956:public: - -: 2957: /** Create a Callback with a static function - -: 2958: * @param func Static function to attach - -: 2959: */ - -: 2960: Callback(R (*func)(A0, A1, A2, A3, A4) = 0) { - -: 2961: if (!func) { - -: 2962: memset(this, 0, sizeof(Callback)); - -: 2963: } else { - -: 2964: generate(func); - -: 2965: } - -: 2966: } - -: 2967: - -: 2968: /** Attach a Callback - -: 2969: * @param func The Callback to attach - -: 2970: */ - -: 2971: Callback(const Callback &func) { - -: 2972: if (func._ops) { - -: 2973: func._ops->move(this, &func); - -: 2974: } - -: 2975: _ops = func._ops; - -: 2976: } - -: 2977: - -: 2978: /** Create a Callback with a member function - -: 2979: * @param obj Pointer to object to invoke member function on - -: 2980: * @param method Member function to attach - -: 2981: */ - -: 2982: template - -: 2983: Callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 2984: generate(method_context(obj, method)); - -: 2985: } - -: 2986: - -: 2987: /** Create a Callback with a member function - -: 2988: * @param obj Pointer to object to invoke member function on - -: 2989: * @param method Member function to attach - -: 2990: */ - -: 2991: template - -: 2992: Callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 2993: generate(method_context(obj, method)); - -: 2994: } - -: 2995: - -: 2996: /** Create a Callback with a member function - -: 2997: * @param obj Pointer to object to invoke member function on - -: 2998: * @param method Member function to attach - -: 2999: */ - -: 3000: template - -: 3001: Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 3002: generate(method_context(obj, method)); - -: 3003: } - -: 3004: - -: 3005: /** Create a Callback with a member function - -: 3006: * @param obj Pointer to object to invoke member function on - -: 3007: * @param method Member function to attach - -: 3008: */ - -: 3009: template - -: 3010: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 3011: generate(method_context(obj, method)); - -: 3012: } - -: 3013: - -: 3014: /** Create a Callback with a static function and bound pointer - -: 3015: * @param func Static function to attach - -: 3016: * @param arg Pointer argument to function - -: 3017: */ - -: 3018: template - -: 3019: Callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 3020: generate(function_context(func, arg)); - -: 3021: } - -: 3022: - -: 3023: /** Create a Callback with a static function and bound pointer - -: 3024: * @param func Static function to attach - -: 3025: * @param arg Pointer argument to function - -: 3026: */ - -: 3027: template - -: 3028: Callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 3029: generate(function_context(func, arg)); - -: 3030: } - -: 3031: - -: 3032: /** Create a Callback with a static function and bound pointer - -: 3033: * @param func Static function to attach - -: 3034: * @param arg Pointer argument to function - -: 3035: */ - -: 3036: template - -: 3037: Callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 3038: generate(function_context(func, arg)); - -: 3039: } - -: 3040: - -: 3041: /** Create a Callback with a static function and bound pointer - -: 3042: * @param func Static function to attach - -: 3043: * @param arg Pointer argument to function - -: 3044: */ - -: 3045: template - -: 3046: Callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 3047: generate(function_context(func, arg)); - -: 3048: } - -: 3049: - -: 3050: /** Create a Callback with a function object - -: 3051: * @param f Function object to attach - -: 3052: * @note The function object is limited to a single word of storage - -: 3053: */ - -: 3054: template - -: 3055: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { - -: 3056: generate(f); - -: 3057: } - -: 3058: - -: 3059: /** Create a Callback with a function object - -: 3060: * @param f Function object to attach - -: 3061: * @note The function object is limited to a single word of storage - -: 3062: */ - -: 3063: template - -: 3064: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { - -: 3065: generate(f); - -: 3066: } - -: 3067: - -: 3068: /** Create a Callback with a function object - -: 3069: * @param f Function object to attach - -: 3070: * @note The function object is limited to a single word of storage - -: 3071: */ - -: 3072: template - -: 3073: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { - -: 3074: generate(f); - -: 3075: } - -: 3076: - -: 3077: /** Create a Callback with a function object - -: 3078: * @param f Function object to attach - -: 3079: * @note The function object is limited to a single word of storage - -: 3080: */ - -: 3081: template - -: 3082: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { - -: 3083: generate(f); - -: 3084: } - -: 3085: - -: 3086: /** Create a Callback with a static function and bound pointer - -: 3087: * @param obj Pointer to object to bind to function - -: 3088: * @param func Static function to attach - -: 3089: * @deprecated - -: 3090: * Arguments to callback have been reordered to Callback(func, arg) - -: 3091: */ - -: 3092: template - -: 3093: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3094: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3095: Callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 3096: new (this) Callback(func, obj); - -: 3097: } - -: 3098: - -: 3099: /** Create a Callback with a static function and bound pointer - -: 3100: * @param obj Pointer to object to bind to function - -: 3101: * @param func Static function to attach - -: 3102: * @deprecated - -: 3103: * Arguments to callback have been reordered to Callback(func, arg) - -: 3104: */ - -: 3105: template - -: 3106: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3107: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3108: Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 3109: new (this) Callback(func, obj); - -: 3110: } - -: 3111: - -: 3112: /** Create a Callback with a static function and bound pointer - -: 3113: * @param obj Pointer to object to bind to function - -: 3114: * @param func Static function to attach - -: 3115: * @deprecated - -: 3116: * Arguments to callback have been reordered to Callback(func, arg) - -: 3117: */ - -: 3118: template - -: 3119: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3120: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3121: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 3122: new (this) Callback(func, obj); - -: 3123: } - -: 3124: - -: 3125: /** Create a Callback with a static function and bound pointer - -: 3126: * @param obj Pointer to object to bind to function - -: 3127: * @param func Static function to attach - -: 3128: * @deprecated - -: 3129: * Arguments to callback have been reordered to Callback(func, arg) - -: 3130: */ - -: 3131: template - -: 3132: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3133: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3134: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 3135: new (this) Callback(func, obj); - -: 3136: } - -: 3137: - -: 3138: /** Destroy a callback - -: 3139: */ - -: 3140: ~Callback() { - -: 3141: if (_ops) { - -: 3142: _ops->dtor(this); - -: 3143: } - -: 3144: } - -: 3145: - -: 3146: /** Attach a static function - -: 3147: * @param func Static function to attach - -: 3148: * @deprecated - -: 3149: * Replaced by simple assignment 'Callback cb = func' - -: 3150: */ - -: 3151: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3152: "Replaced by simple assignment 'Callback cb = func") - -: 3153: void attach(R (*func)(A0, A1, A2, A3, A4)) { - -: 3154: this->~Callback(); - -: 3155: new (this) Callback(func); - -: 3156: } - -: 3157: - -: 3158: /** Attach a Callback - -: 3159: * @param func The Callback to attach - -: 3160: * @deprecated - -: 3161: * Replaced by simple assignment 'Callback cb = func' - -: 3162: */ - -: 3163: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3164: "Replaced by simple assignment 'Callback cb = func") - -: 3165: void attach(const Callback &func) { - -: 3166: this->~Callback(); - -: 3167: new (this) Callback(func); - -: 3168: } - -: 3169: - -: 3170: /** Attach a member function - -: 3171: * @param obj Pointer to object to invoke member function on - -: 3172: * @param method Member function to attach - -: 3173: * @deprecated - -: 3174: * Replaced by simple assignment 'Callback cb = func' - -: 3175: */ - -: 3176: template - -: 3177: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3178: "Replaced by simple assignment 'Callback cb = func") - -: 3179: void attach(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 3180: this->~Callback(); - -: 3181: new (this) Callback(obj, method); - -: 3182: } - -: 3183: - -: 3184: /** Attach a member function - -: 3185: * @param obj Pointer to object to invoke member function on - -: 3186: * @param method Member function to attach - -: 3187: * @deprecated - -: 3188: * Replaced by simple assignment 'Callback cb = func' - -: 3189: */ - -: 3190: template - -: 3191: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3192: "Replaced by simple assignment 'Callback cb = func") - -: 3193: void attach(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 3194: this->~Callback(); - -: 3195: new (this) Callback(obj, method); - -: 3196: } - -: 3197: - -: 3198: /** Attach a member function - -: 3199: * @param obj Pointer to object to invoke member function on - -: 3200: * @param method Member function to attach - -: 3201: * @deprecated - -: 3202: * Replaced by simple assignment 'Callback cb = func' - -: 3203: */ - -: 3204: template - -: 3205: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3206: "Replaced by simple assignment 'Callback cb = func") - -: 3207: void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 3208: this->~Callback(); - -: 3209: new (this) Callback(obj, method); - -: 3210: } - -: 3211: - -: 3212: /** Attach a member function - -: 3213: * @param obj Pointer to object to invoke member function on - -: 3214: * @param method Member function to attach - -: 3215: * @deprecated - -: 3216: * Replaced by simple assignment 'Callback cb = func' - -: 3217: */ - -: 3218: template - -: 3219: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3220: "Replaced by simple assignment 'Callback cb = func") - -: 3221: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 3222: this->~Callback(); - -: 3223: new (this) Callback(obj, method); - -: 3224: } - -: 3225: - -: 3226: /** Attach a static function with a bound pointer - -: 3227: * @param func Static function to attach - -: 3228: * @param arg Pointer argument to function - -: 3229: * @deprecated - -: 3230: * Replaced by simple assignment 'Callback cb = func' - -: 3231: */ - -: 3232: template - -: 3233: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3234: "Replaced by simple assignment 'Callback cb = func") - -: 3235: void attach(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 3236: this->~Callback(); - -: 3237: new (this) Callback(func, arg); - -: 3238: } - -: 3239: - -: 3240: /** Attach a static function with a bound pointer - -: 3241: * @param func Static function to attach - -: 3242: * @param arg Pointer argument to function - -: 3243: * @deprecated - -: 3244: * Replaced by simple assignment 'Callback cb = func' - -: 3245: */ - -: 3246: template - -: 3247: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3248: "Replaced by simple assignment 'Callback cb = func") - -: 3249: void attach(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 3250: this->~Callback(); - -: 3251: new (this) Callback(func, arg); - -: 3252: } - -: 3253: - -: 3254: /** Attach a static function with a bound pointer - -: 3255: * @param func Static function to attach - -: 3256: * @param arg Pointer argument to function - -: 3257: * @deprecated - -: 3258: * Replaced by simple assignment 'Callback cb = func' - -: 3259: */ - -: 3260: template - -: 3261: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3262: "Replaced by simple assignment 'Callback cb = func") - -: 3263: void attach(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 3264: this->~Callback(); - -: 3265: new (this) Callback(func, arg); - -: 3266: } - -: 3267: - -: 3268: /** Attach a static function with a bound pointer - -: 3269: * @param func Static function to attach - -: 3270: * @param arg Pointer argument to function - -: 3271: * @deprecated - -: 3272: * Replaced by simple assignment 'Callback cb = func' - -: 3273: */ - -: 3274: template - -: 3275: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3276: "Replaced by simple assignment 'Callback cb = func") - -: 3277: void attach(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 3278: this->~Callback(); - -: 3279: new (this) Callback(func, arg); - -: 3280: } - -: 3281: - -: 3282: /** Attach a function object - -: 3283: * @param f Function object to attach - -: 3284: * @note The function object is limited to a single word of storage - -: 3285: * @deprecated - -: 3286: * Replaced by simple assignment 'Callback cb = func' - -: 3287: */ - -: 3288: template - -: 3289: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3290: "Replaced by simple assignment 'Callback cb = func") - -: 3291: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { - -: 3292: this->~Callback(); - -: 3293: new (this) Callback(f); - -: 3294: } - -: 3295: - -: 3296: /** Attach a function object - -: 3297: * @param f Function object to attach - -: 3298: * @note The function object is limited to a single word of storage - -: 3299: * @deprecated - -: 3300: * Replaced by simple assignment 'Callback cb = func' - -: 3301: */ - -: 3302: template - -: 3303: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3304: "Replaced by simple assignment 'Callback cb = func") - -: 3305: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { - -: 3306: this->~Callback(); - -: 3307: new (this) Callback(f); - -: 3308: } - -: 3309: - -: 3310: /** Attach a function object - -: 3311: * @param f Function object to attach - -: 3312: * @note The function object is limited to a single word of storage - -: 3313: * @deprecated - -: 3314: * Replaced by simple assignment 'Callback cb = func' - -: 3315: */ - -: 3316: template - -: 3317: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3318: "Replaced by simple assignment 'Callback cb = func") - -: 3319: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { - -: 3320: this->~Callback(); - -: 3321: new (this) Callback(f); - -: 3322: } - -: 3323: - -: 3324: /** Attach a function object - -: 3325: * @param f Function object to attach - -: 3326: * @note The function object is limited to a single word of storage - -: 3327: * @deprecated - -: 3328: * Replaced by simple assignment 'Callback cb = func' - -: 3329: */ - -: 3330: template - -: 3331: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3332: "Replaced by simple assignment 'Callback cb = func") - -: 3333: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { - -: 3334: this->~Callback(); - -: 3335: new (this) Callback(f); - -: 3336: } - -: 3337: - -: 3338: /** Attach a static function with a bound pointer - -: 3339: * @param obj Pointer to object to bind to function - -: 3340: * @param func Static function to attach - -: 3341: * @deprecated - -: 3342: * Arguments to callback have been reordered to attach(func, arg) - -: 3343: */ - -: 3344: template - -: 3345: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3346: "Arguments to callback have been reordered to attach(func, arg)") - -: 3347: void attach(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 3348: this->~Callback(); - -: 3349: new (this) Callback(func, obj); - -: 3350: } - -: 3351: - -: 3352: /** Attach a static function with a bound pointer - -: 3353: * @param obj Pointer to object to bind to function - -: 3354: * @param func Static function to attach - -: 3355: * @deprecated - -: 3356: * Arguments to callback have been reordered to attach(func, arg) - -: 3357: */ - -: 3358: template - -: 3359: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3360: "Arguments to callback have been reordered to attach(func, arg)") - -: 3361: void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 3362: this->~Callback(); - -: 3363: new (this) Callback(func, obj); - -: 3364: } - -: 3365: - -: 3366: /** Attach a static function with a bound pointer - -: 3367: * @param obj Pointer to object to bind to function - -: 3368: * @param func Static function to attach - -: 3369: * @deprecated - -: 3370: * Arguments to callback have been reordered to attach(func, arg) - -: 3371: */ - -: 3372: template - -: 3373: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3374: "Arguments to callback have been reordered to attach(func, arg)") - -: 3375: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 3376: this->~Callback(); - -: 3377: new (this) Callback(func, obj); - -: 3378: } - -: 3379: - -: 3380: /** Attach a static function with a bound pointer - -: 3381: * @param obj Pointer to object to bind to function - -: 3382: * @param func Static function to attach - -: 3383: * @deprecated - -: 3384: * Arguments to callback have been reordered to attach(func, arg) - -: 3385: */ - -: 3386: template - -: 3387: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3388: "Arguments to callback have been reordered to attach(func, arg)") - -: 3389: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 3390: this->~Callback(); - -: 3391: new (this) Callback(func, obj); - -: 3392: } - -: 3393: - -: 3394: /** Assign a callback - -: 3395: */ - -: 3396: Callback &operator=(const Callback &that) { - -: 3397: if (this != &that) { - -: 3398: this->~Callback(); - -: 3399: new (this) Callback(that); - -: 3400: } - -: 3401: - -: 3402: return *this; - -: 3403: } - -: 3404: - -: 3405: /** Call the attached function - -: 3406: */ - -: 3407: R call(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3408: MBED_ASSERT(_ops); - -: 3409: return _ops->call(this, a0, a1, a2, a3, a4); - -: 3410: } - -: 3411: - -: 3412: /** Call the attached function - -: 3413: */ - -: 3414: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3415: return call(a0, a1, a2, a3, a4); - -: 3416: } - -: 3417: - -: 3418: /** Test if function has been attached - -: 3419: */ - -: 3420: operator bool() const { - -: 3421: return _ops; - -: 3422: } - -: 3423: - -: 3424: /** Test for equality - -: 3425: */ - -: 3426: friend bool operator==(const Callback &l, const Callback &r) { - -: 3427: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 3428: } - -: 3429: - -: 3430: /** Test for inequality - -: 3431: */ - -: 3432: friend bool operator!=(const Callback &l, const Callback &r) { - -: 3433: return !(l == r); - -: 3434: } - -: 3435: - -: 3436: /** Static thunk for passing as C-style function - -: 3437: * @param func Callback to call passed as void pointer - -: 3438: * @param a0 An argument to be called with function func - -: 3439: * @param a1 An argument to be called with function func - -: 3440: * @param a2 An argument to be called with function func - -: 3441: * @param a3 An argument to be called with function func - -: 3442: * @param a4 An argument to be called with function func - -: 3443: * @return the value as determined by func which is of - -: 3444: * type and determined by the signiture of func - -: 3445: */ - -: 3446: static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 3447: return static_cast(func)->call(a0, a1, a2, a3, a4); - -: 3448: } - -: 3449: - -: 3450:private: - -: 3451: // Stored as pointer to function and pointer to optional object - -: 3452: // Function pointer is stored as union of possible function types - -: 3453: // to garuntee proper size and alignment - -: 3454: struct _class; - -: 3455: union { - -: 3456: void (*_staticfunc)(A0, A1, A2, A3, A4); - -: 3457: void (*_boundfunc)(_class*, A0, A1, A2, A3, A4); - -: 3458: void (_class::*_methodfunc)(A0, A1, A2, A3, A4); - -: 3459: } _func; - -: 3460: void *_obj; - -: 3461: - -: 3462: // Dynamically dispatched operations - -: 3463: const struct ops { - -: 3464: R (*call)(const void*, A0, A1, A2, A3, A4); - -: 3465: void (*move)(void*, const void*); - -: 3466: void (*dtor)(void*); - -: 3467: } *_ops; - -: 3468: - -: 3469: // Generate operations for function object - -: 3470: template - -: 3471: void generate(const F &f) { - -: 3472: static const ops ops = { - -: 3473: &Callback::function_call, - -: 3474: &Callback::function_move, - -: 3475: &Callback::function_dtor, - -: 3476: }; - -: 3477: - -: 3478: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 3479: "Type F must not exceed the size of the Callback class"); - -: 3480: memset(this, 0, sizeof(Callback)); - -: 3481: new (this) F(f); - -: 3482: _ops = &ops; - -: 3483: } - -: 3484: - -: 3485: // Function attributes - -: 3486: template - -: 3487: static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 3488: return (*(F*)p)(a0, a1, a2, a3, a4); - -: 3489: } - -: 3490: - -: 3491: template - -: 3492: static void function_move(void *d, const void *p) { - -: 3493: new (d) F(*(F*)p); - -: 3494: } - -: 3495: - -: 3496: template - -: 3497: static void function_dtor(void *p) { - -: 3498: ((F*)p)->~F(); - -: 3499: } - -: 3500: - -: 3501: // Wrappers for functions with context - -: 3502: template - -: 3503: struct method_context { - -: 3504: M method; - -: 3505: O *obj; - -: 3506: - -: 3507: method_context(O *obj, M method) - -: 3508: : method(method), obj(obj) {} - -: 3509: - -: 3510: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3511: return (obj->*method)(a0, a1, a2, a3, a4); - -: 3512: } - -: 3513: }; - -: 3514: - -: 3515: template - -: 3516: struct function_context { - -: 3517: F func; - -: 3518: A *arg; - -: 3519: - -: 3520: function_context(F func, A *arg) - -: 3521: : func(func), arg(arg) {} - -: 3522: - -: 3523: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3524: return func(arg, a0, a1, a2, a3, a4); - -: 3525: } - -: 3526: }; - -: 3527:}; - -: 3528: - -: 3529:// Internally used event type - -: 3530:typedef Callback event_callback_t; - -: 3531: - -: 3532: - -: 3533:/** Create a callback class with type infered from the arguments - -: 3534: * - -: 3535: * @param func Static function to attach - -: 3536: * @return Callback with infered type - -: 3537: */ - -: 3538:template - -: 3539:Callback callback(R (*func)() = 0) { - -: 3540: return Callback(func); - -: 3541:} - -: 3542: - -: 3543:/** Create a callback class with type infered from the arguments - -: 3544: * - -: 3545: * @param func Static function to attach - -: 3546: * @return Callback with infered type - -: 3547: */ - -: 3548:template - -: 3549:Callback callback(const Callback &func) { - -: 3550: return Callback(func); - -: 3551:} - -: 3552: - -: 3553:/** Create a callback class with type infered from the arguments - -: 3554: * - -: 3555: * @param obj Optional pointer to object to bind to function - -: 3556: * @param method Member function to attach - -: 3557: * @return Callback with infered type - -: 3558: */ - -: 3559:template - 25: 3560:Callback callback(U *obj, R (T::*method)()) { - 25: 3561: return Callback(obj, method); - -: 3562:} - -: 3563: - -: 3564:/** Create a callback class with type infered from the arguments - -: 3565: * - -: 3566: * @param obj Optional pointer to object to bind to function - -: 3567: * @param method Member function to attach - -: 3568: * @return Callback with infered type - -: 3569: */ - -: 3570:template - -: 3571:Callback callback(const U *obj, R (T::*method)() const) { - -: 3572: return Callback(obj, method); - -: 3573:} - -: 3574: - -: 3575:/** Create a callback class with type infered from the arguments - -: 3576: * - -: 3577: * @param obj Optional pointer to object to bind to function - -: 3578: * @param method Member function to attach - -: 3579: * @return Callback with infered type - -: 3580: */ - -: 3581:template - -: 3582:Callback callback(volatile U *obj, R (T::*method)() volatile) { - -: 3583: return Callback(obj, method); - -: 3584:} - -: 3585: - -: 3586:/** Create a callback class with type infered from the arguments - -: 3587: * - -: 3588: * @param obj Optional pointer to object to bind to function - -: 3589: * @param method Member function to attach - -: 3590: * @return Callback with infered type - -: 3591: */ - -: 3592:template - -: 3593:Callback callback(const volatile U *obj, R (T::*method)() const volatile) { - -: 3594: return Callback(obj, method); - -: 3595:} - -: 3596: - -: 3597:/** Create a callback class with type infered from the arguments - -: 3598: * - -: 3599: * @param func Static function to attach - -: 3600: * @param arg Pointer argument to function - -: 3601: * @return Callback with infered type - -: 3602: */ - -: 3603:template - -: 3604:Callback callback(R (*func)(T*), U *arg) { - -: 3605: return Callback(func, arg); - -: 3606:} - -: 3607: - -: 3608:/** Create a callback class with type infered from the arguments - -: 3609: * - -: 3610: * @param func Static function to attach - -: 3611: * @param arg Pointer argument to function - -: 3612: * @return Callback with infered type - -: 3613: */ - -: 3614:template - -: 3615:Callback callback(R (*func)(const T*), const U *arg) { - -: 3616: return Callback(func, arg); - -: 3617:} - -: 3618: - -: 3619:/** Create a callback class with type infered from the arguments - -: 3620: * - -: 3621: * @param func Static function to attach - -: 3622: * @param arg Pointer argument to function - -: 3623: * @return Callback with infered type - -: 3624: */ - -: 3625:template - -: 3626:Callback callback(R (*func)(volatile T*), volatile U *arg) { - -: 3627: return Callback(func, arg); - -: 3628:} - -: 3629: - -: 3630:/** Create a callback class with type infered from the arguments - -: 3631: * - -: 3632: * @param func Static function to attach - -: 3633: * @param arg Pointer argument to function - -: 3634: * @return Callback with infered type - -: 3635: */ - -: 3636:template - -: 3637:Callback callback(R (*func)(const volatile T*), const volatile U *arg) { - -: 3638: return Callback(func, arg); - -: 3639:} - -: 3640: - -: 3641:/** Create a callback class with type infered from the arguments - -: 3642: * - -: 3643: * @param obj Optional pointer to object to bind to function - -: 3644: * @param func Static function to attach - -: 3645: * @return Callback with infered type - -: 3646: * @deprecated - -: 3647: * Arguments to callback have been reordered to callback(func, arg) - -: 3648: */ - -: 3649:template - -: 3650:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3651: "Arguments to callback have been reordered to callback(func, arg)") - -: 3652:Callback callback(U *obj, R (*func)(T*)) { - -: 3653: return Callback(func, obj); - -: 3654:} - -: 3655: - -: 3656:/** Create a callback class with type infered from the arguments - -: 3657: * - -: 3658: * @param obj Optional pointer to object to bind to function - -: 3659: * @param func Static function to attach - -: 3660: * @return Callback with infered type - -: 3661: * @deprecated - -: 3662: * Arguments to callback have been reordered to callback(func, arg) - -: 3663: */ - -: 3664:template - -: 3665:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3666: "Arguments to callback have been reordered to callback(func, arg)") - -: 3667:Callback callback(const U *obj, R (*func)(const T*)) { - -: 3668: return Callback(func, obj); - -: 3669:} - -: 3670: - -: 3671:/** Create a callback class with type infered from the arguments - -: 3672: * - -: 3673: * @param obj Optional pointer to object to bind to function - -: 3674: * @param func Static function to attach - -: 3675: * @return Callback with infered type - -: 3676: * @deprecated - -: 3677: * Arguments to callback have been reordered to callback(func, arg) - -: 3678: */ - -: 3679:template - -: 3680:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3681: "Arguments to callback have been reordered to callback(func, arg)") - -: 3682:Callback callback(volatile U *obj, R (*func)(volatile T*)) { - -: 3683: return Callback(func, obj); - -: 3684:} - -: 3685: - -: 3686:/** Create a callback class with type infered from the arguments - -: 3687: * - -: 3688: * @param obj Optional pointer to object to bind to function - -: 3689: * @param func Static function to attach - -: 3690: * @return Callback with infered type - -: 3691: * @deprecated - -: 3692: * Arguments to callback have been reordered to callback(func, arg) - -: 3693: */ - -: 3694:template - -: 3695:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3696: "Arguments to callback have been reordered to callback(func, arg)") - -: 3697:Callback callback(const volatile U *obj, R (*func)(const volatile T*)) { - -: 3698: return Callback(func, obj); - -: 3699:} - -: 3700: - -: 3701: - -: 3702:/** Create a callback class with type infered from the arguments - -: 3703: * - -: 3704: * @param func Static function to attach - -: 3705: * @return Callback with infered type - -: 3706: */ - -: 3707:template - -: 3708:Callback callback(R (*func)(A0) = 0) { - -: 3709: return Callback(func); - -: 3710:} - -: 3711: - -: 3712:/** Create a callback class with type infered from the arguments - -: 3713: * - -: 3714: * @param func Static function to attach - -: 3715: * @return Callback with infered type - -: 3716: */ - -: 3717:template - -: 3718:Callback callback(const Callback &func) { - -: 3719: return Callback(func); - -: 3720:} - -: 3721: - -: 3722:/** Create a callback class with type infered from the arguments - -: 3723: * - -: 3724: * @param obj Optional pointer to object to bind to function - -: 3725: * @param method Member function to attach - -: 3726: * @return Callback with infered type - -: 3727: */ - -: 3728:template - -: 3729:Callback callback(U *obj, R (T::*method)(A0)) { - -: 3730: return Callback(obj, method); - -: 3731:} - -: 3732: - -: 3733:/** Create a callback class with type infered from the arguments - -: 3734: * - -: 3735: * @param obj Optional pointer to object to bind to function - -: 3736: * @param method Member function to attach - -: 3737: * @return Callback with infered type - -: 3738: */ - -: 3739:template - -: 3740:Callback callback(const U *obj, R (T::*method)(A0) const) { - -: 3741: return Callback(obj, method); - -: 3742:} - -: 3743: - -: 3744:/** Create a callback class with type infered from the arguments - -: 3745: * - -: 3746: * @param obj Optional pointer to object to bind to function - -: 3747: * @param method Member function to attach - -: 3748: * @return Callback with infered type - -: 3749: */ - -: 3750:template - -: 3751:Callback callback(volatile U *obj, R (T::*method)(A0) volatile) { - -: 3752: return Callback(obj, method); - -: 3753:} - -: 3754: - -: 3755:/** Create a callback class with type infered from the arguments - -: 3756: * - -: 3757: * @param obj Optional pointer to object to bind to function - -: 3758: * @param method Member function to attach - -: 3759: * @return Callback with infered type - -: 3760: */ - -: 3761:template - -: 3762:Callback callback(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 3763: return Callback(obj, method); - -: 3764:} - -: 3765: - -: 3766:/** Create a callback class with type infered from the arguments - -: 3767: * - -: 3768: * @param func Static function to attach - -: 3769: * @param arg Pointer argument to function - -: 3770: * @return Callback with infered type - -: 3771: */ - -: 3772:template - -: 3773:Callback callback(R (*func)(T*, A0), U *arg) { - -: 3774: return Callback(func, arg); - -: 3775:} - -: 3776: - -: 3777:/** Create a callback class with type infered from the arguments - -: 3778: * - -: 3779: * @param func Static function to attach - -: 3780: * @param arg Pointer argument to function - -: 3781: * @return Callback with infered type - -: 3782: */ - -: 3783:template - -: 3784:Callback callback(R (*func)(const T*, A0), const U *arg) { - -: 3785: return Callback(func, arg); - -: 3786:} - -: 3787: - -: 3788:/** Create a callback class with type infered from the arguments - -: 3789: * - -: 3790: * @param func Static function to attach - -: 3791: * @param arg Pointer argument to function - -: 3792: * @return Callback with infered type - -: 3793: */ - -: 3794:template - -: 3795:Callback callback(R (*func)(volatile T*, A0), volatile U *arg) { - -: 3796: return Callback(func, arg); - -: 3797:} - -: 3798: - -: 3799:/** Create a callback class with type infered from the arguments - -: 3800: * - -: 3801: * @param func Static function to attach - -: 3802: * @param arg Pointer argument to function - -: 3803: * @return Callback with infered type - -: 3804: */ - -: 3805:template - -: 3806:Callback callback(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 3807: return Callback(func, arg); - -: 3808:} - -: 3809: - -: 3810:/** Create a callback class with type infered from the arguments - -: 3811: * - -: 3812: * @param obj Optional pointer to object to bind to function - -: 3813: * @param func Static function to attach - -: 3814: * @return Callback with infered type - -: 3815: * @deprecated - -: 3816: * Arguments to callback have been reordered to callback(func, arg) - -: 3817: */ - -: 3818:template - -: 3819:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3820: "Arguments to callback have been reordered to callback(func, arg)") - -: 3821:Callback callback(U *obj, R (*func)(T*, A0)) { - -: 3822: return Callback(func, obj); - -: 3823:} - -: 3824: - -: 3825:/** Create a callback class with type infered from the arguments - -: 3826: * - -: 3827: * @param obj Optional pointer to object to bind to function - -: 3828: * @param func Static function to attach - -: 3829: * @return Callback with infered type - -: 3830: * @deprecated - -: 3831: * Arguments to callback have been reordered to callback(func, arg) - -: 3832: */ - -: 3833:template - -: 3834:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3835: "Arguments to callback have been reordered to callback(func, arg)") - -: 3836:Callback callback(const U *obj, R (*func)(const T*, A0)) { - -: 3837: return Callback(func, obj); - -: 3838:} - -: 3839: - -: 3840:/** Create a callback class with type infered from the arguments - -: 3841: * - -: 3842: * @param obj Optional pointer to object to bind to function - -: 3843: * @param func Static function to attach - -: 3844: * @return Callback with infered type - -: 3845: * @deprecated - -: 3846: * Arguments to callback have been reordered to callback(func, arg) - -: 3847: */ - -: 3848:template - -: 3849:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3850: "Arguments to callback have been reordered to callback(func, arg)") - -: 3851:Callback callback(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 3852: return Callback(func, obj); - -: 3853:} - -: 3854: - -: 3855:/** Create a callback class with type infered from the arguments - -: 3856: * - -: 3857: * @param obj Optional pointer to object to bind to function - -: 3858: * @param func Static function to attach - -: 3859: * @return Callback with infered type - -: 3860: * @deprecated - -: 3861: * Arguments to callback have been reordered to callback(func, arg) - -: 3862: */ - -: 3863:template - -: 3864:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3865: "Arguments to callback have been reordered to callback(func, arg)") - -: 3866:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 3867: return Callback(func, obj); - -: 3868:} - -: 3869: - -: 3870: - -: 3871:/** Create a callback class with type infered from the arguments - -: 3872: * - -: 3873: * @param func Static function to attach - -: 3874: * @return Callback with infered type - -: 3875: */ - -: 3876:template - -: 3877:Callback callback(R (*func)(A0, A1) = 0) { - -: 3878: return Callback(func); - -: 3879:} - -: 3880: - -: 3881:/** Create a callback class with type infered from the arguments - -: 3882: * - -: 3883: * @param func Static function to attach - -: 3884: * @return Callback with infered type - -: 3885: */ - -: 3886:template - -: 3887:Callback callback(const Callback &func) { - -: 3888: return Callback(func); - -: 3889:} - -: 3890: - -: 3891:/** Create a callback class with type infered from the arguments - -: 3892: * - -: 3893: * @param obj Optional pointer to object to bind to function - -: 3894: * @param method Member function to attach - -: 3895: * @return Callback with infered type - -: 3896: */ - -: 3897:template - -: 3898:Callback callback(U *obj, R (T::*method)(A0, A1)) { - -: 3899: return Callback(obj, method); - -: 3900:} - -: 3901: - -: 3902:/** Create a callback class with type infered from the arguments - -: 3903: * - -: 3904: * @param obj Optional pointer to object to bind to function - -: 3905: * @param method Member function to attach - -: 3906: * @return Callback with infered type - -: 3907: */ - -: 3908:template - -: 3909:Callback callback(const U *obj, R (T::*method)(A0, A1) const) { - -: 3910: return Callback(obj, method); - -: 3911:} - -: 3912: - -: 3913:/** Create a callback class with type infered from the arguments - -: 3914: * - -: 3915: * @param obj Optional pointer to object to bind to function - -: 3916: * @param method Member function to attach - -: 3917: * @return Callback with infered type - -: 3918: */ - -: 3919:template - -: 3920:Callback callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 3921: return Callback(obj, method); - -: 3922:} - -: 3923: - -: 3924:/** Create a callback class with type infered from the arguments - -: 3925: * - -: 3926: * @param obj Optional pointer to object to bind to function - -: 3927: * @param method Member function to attach - -: 3928: * @return Callback with infered type - -: 3929: */ - -: 3930:template - -: 3931:Callback callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 3932: return Callback(obj, method); - -: 3933:} - -: 3934: - -: 3935:/** Create a callback class with type infered from the arguments - -: 3936: * - -: 3937: * @param func Static function to attach - -: 3938: * @param arg Pointer argument to function - -: 3939: * @return Callback with infered type - -: 3940: */ - -: 3941:template - -: 3942:Callback callback(R (*func)(T*, A0, A1), U *arg) { - -: 3943: return Callback(func, arg); - -: 3944:} - -: 3945: - -: 3946:/** Create a callback class with type infered from the arguments - -: 3947: * - -: 3948: * @param func Static function to attach - -: 3949: * @param arg Pointer argument to function - -: 3950: * @return Callback with infered type - -: 3951: */ - -: 3952:template - -: 3953:Callback callback(R (*func)(const T*, A0, A1), const U *arg) { - -: 3954: return Callback(func, arg); - -: 3955:} - -: 3956: - -: 3957:/** Create a callback class with type infered from the arguments - -: 3958: * - -: 3959: * @param func Static function to attach - -: 3960: * @param arg Pointer argument to function - -: 3961: * @return Callback with infered type - -: 3962: */ - -: 3963:template - -: 3964:Callback callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 3965: return Callback(func, arg); - -: 3966:} - -: 3967: - -: 3968:/** Create a callback class with type infered from the arguments - -: 3969: * - -: 3970: * @param func Static function to attach - -: 3971: * @param arg Pointer argument to function - -: 3972: * @return Callback with infered type - -: 3973: */ - -: 3974:template - -: 3975:Callback callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 3976: return Callback(func, arg); - -: 3977:} - -: 3978: - -: 3979:/** Create a callback class with type infered from the arguments - -: 3980: * - -: 3981: * @param obj Optional pointer to object to bind to function - -: 3982: * @param func Static function to attach - -: 3983: * @return Callback with infered type - -: 3984: * @deprecated - -: 3985: * Arguments to callback have been reordered to callback(func, arg) - -: 3986: */ - -: 3987:template - -: 3988:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3989: "Arguments to callback have been reordered to callback(func, arg)") - -: 3990:Callback callback(U *obj, R (*func)(T*, A0, A1)) { - -: 3991: return Callback(func, obj); - -: 3992:} - -: 3993: - -: 3994:/** Create a callback class with type infered from the arguments - -: 3995: * - -: 3996: * @param obj Optional pointer to object to bind to function - -: 3997: * @param func Static function to attach - -: 3998: * @return Callback with infered type - -: 3999: * @deprecated - -: 4000: * Arguments to callback have been reordered to callback(func, arg) - -: 4001: */ - -: 4002:template - -: 4003:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4004: "Arguments to callback have been reordered to callback(func, arg)") - -: 4005:Callback callback(const U *obj, R (*func)(const T*, A0, A1)) { - -: 4006: return Callback(func, obj); - -: 4007:} - -: 4008: - -: 4009:/** Create a callback class with type infered from the arguments - -: 4010: * - -: 4011: * @param obj Optional pointer to object to bind to function - -: 4012: * @param func Static function to attach - -: 4013: * @return Callback with infered type - -: 4014: * @deprecated - -: 4015: * Arguments to callback have been reordered to callback(func, arg) - -: 4016: */ - -: 4017:template - -: 4018:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4019: "Arguments to callback have been reordered to callback(func, arg)") - -: 4020:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 4021: return Callback(func, obj); - -: 4022:} - -: 4023: - -: 4024:/** Create a callback class with type infered from the arguments - -: 4025: * - -: 4026: * @param obj Optional pointer to object to bind to function - -: 4027: * @param func Static function to attach - -: 4028: * @return Callback with infered type - -: 4029: * @deprecated - -: 4030: * Arguments to callback have been reordered to callback(func, arg) - -: 4031: */ - -: 4032:template - -: 4033:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4034: "Arguments to callback have been reordered to callback(func, arg)") - -: 4035:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 4036: return Callback(func, obj); - -: 4037:} - -: 4038: - -: 4039: - -: 4040:/** Create a callback class with type infered from the arguments - -: 4041: * - -: 4042: * @param func Static function to attach - -: 4043: * @return Callback with infered type - -: 4044: */ - -: 4045:template - -: 4046:Callback callback(R (*func)(A0, A1, A2) = 0) { - -: 4047: return Callback(func); - -: 4048:} - -: 4049: - -: 4050:/** Create a callback class with type infered from the arguments - -: 4051: * - -: 4052: * @param func Static function to attach - -: 4053: * @return Callback with infered type - -: 4054: */ - -: 4055:template - -: 4056:Callback callback(const Callback &func) { - -: 4057: return Callback(func); - -: 4058:} - -: 4059: - -: 4060:/** Create a callback class with type infered from the arguments - -: 4061: * - -: 4062: * @param obj Optional pointer to object to bind to function - -: 4063: * @param method Member function to attach - -: 4064: * @return Callback with infered type - -: 4065: */ - -: 4066:template - -: 4067:Callback callback(U *obj, R (T::*method)(A0, A1, A2)) { - -: 4068: return Callback(obj, method); - -: 4069:} - -: 4070: - -: 4071:/** Create a callback class with type infered from the arguments - -: 4072: * - -: 4073: * @param obj Optional pointer to object to bind to function - -: 4074: * @param method Member function to attach - -: 4075: * @return Callback with infered type - -: 4076: */ - -: 4077:template - -: 4078:Callback callback(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 4079: return Callback(obj, method); - -: 4080:} - -: 4081: - -: 4082:/** Create a callback class with type infered from the arguments - -: 4083: * - -: 4084: * @param obj Optional pointer to object to bind to function - -: 4085: * @param method Member function to attach - -: 4086: * @return Callback with infered type - -: 4087: */ - -: 4088:template - -: 4089:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 4090: return Callback(obj, method); - -: 4091:} - -: 4092: - -: 4093:/** Create a callback class with type infered from the arguments - -: 4094: * - -: 4095: * @param obj Optional pointer to object to bind to function - -: 4096: * @param method Member function to attach - -: 4097: * @return Callback with infered type - -: 4098: */ - -: 4099:template - -: 4100:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 4101: return Callback(obj, method); - -: 4102:} - -: 4103: - -: 4104:/** Create a callback class with type infered from the arguments - -: 4105: * - -: 4106: * @param func Static function to attach - -: 4107: * @param arg Pointer argument to function - -: 4108: * @return Callback with infered type - -: 4109: */ - -: 4110:template - -: 4111:Callback callback(R (*func)(T*, A0, A1, A2), U *arg) { - -: 4112: return Callback(func, arg); - -: 4113:} - -: 4114: - -: 4115:/** Create a callback class with type infered from the arguments - -: 4116: * - -: 4117: * @param func Static function to attach - -: 4118: * @param arg Pointer argument to function - -: 4119: * @return Callback with infered type - -: 4120: */ - -: 4121:template - -: 4122:Callback callback(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 4123: return Callback(func, arg); - -: 4124:} - -: 4125: - -: 4126:/** Create a callback class with type infered from the arguments - -: 4127: * - -: 4128: * @param func Static function to attach - -: 4129: * @param arg Pointer argument to function - -: 4130: * @return Callback with infered type - -: 4131: */ - -: 4132:template - -: 4133:Callback callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 4134: return Callback(func, arg); - -: 4135:} - -: 4136: - -: 4137:/** Create a callback class with type infered from the arguments - -: 4138: * - -: 4139: * @param func Static function to attach - -: 4140: * @param arg Pointer argument to function - -: 4141: * @return Callback with infered type - -: 4142: */ - -: 4143:template - -: 4144:Callback callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 4145: return Callback(func, arg); - -: 4146:} - -: 4147: - -: 4148:/** Create a callback class with type infered from the arguments - -: 4149: * - -: 4150: * @param obj Optional pointer to object to bind to function - -: 4151: * @param func Static function to attach - -: 4152: * @return Callback with infered type - -: 4153: * @deprecated - -: 4154: * Arguments to callback have been reordered to callback(func, arg) - -: 4155: */ - -: 4156:template - -: 4157:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4158: "Arguments to callback have been reordered to callback(func, arg)") - -: 4159:Callback callback(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 4160: return Callback(func, obj); - -: 4161:} - -: 4162: - -: 4163:/** Create a callback class with type infered from the arguments - -: 4164: * - -: 4165: * @param obj Optional pointer to object to bind to function - -: 4166: * @param func Static function to attach - -: 4167: * @return Callback with infered type - -: 4168: * @deprecated - -: 4169: * Arguments to callback have been reordered to callback(func, arg) - -: 4170: */ - -: 4171:template - -: 4172:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4173: "Arguments to callback have been reordered to callback(func, arg)") - -: 4174:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 4175: return Callback(func, obj); - -: 4176:} - -: 4177: - -: 4178:/** Create a callback class with type infered from the arguments - -: 4179: * - -: 4180: * @param obj Optional pointer to object to bind to function - -: 4181: * @param func Static function to attach - -: 4182: * @return Callback with infered type - -: 4183: * @deprecated - -: 4184: * Arguments to callback have been reordered to callback(func, arg) - -: 4185: */ - -: 4186:template - -: 4187:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4188: "Arguments to callback have been reordered to callback(func, arg)") - -: 4189:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 4190: return Callback(func, obj); - -: 4191:} - -: 4192: - -: 4193:/** Create a callback class with type infered from the arguments - -: 4194: * - -: 4195: * @param obj Optional pointer to object to bind to function - -: 4196: * @param func Static function to attach - -: 4197: * @return Callback with infered type - -: 4198: * @deprecated - -: 4199: * Arguments to callback have been reordered to callback(func, arg) - -: 4200: */ - -: 4201:template - -: 4202:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4203: "Arguments to callback have been reordered to callback(func, arg)") - -: 4204:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 4205: return Callback(func, obj); - -: 4206:} - -: 4207: - -: 4208: - -: 4209:/** Create a callback class with type infered from the arguments - -: 4210: * - -: 4211: * @param func Static function to attach - -: 4212: * @return Callback with infered type - -: 4213: */ - -: 4214:template - -: 4215:Callback callback(R (*func)(A0, A1, A2, A3) = 0) { - -: 4216: return Callback(func); - -: 4217:} - -: 4218: - -: 4219:/** Create a callback class with type infered from the arguments - -: 4220: * - -: 4221: * @param func Static function to attach - -: 4222: * @return Callback with infered type - -: 4223: */ - -: 4224:template - -: 4225:Callback callback(const Callback &func) { - -: 4226: return Callback(func); - -: 4227:} - -: 4228: - -: 4229:/** Create a callback class with type infered from the arguments - -: 4230: * - -: 4231: * @param obj Optional pointer to object to bind to function - -: 4232: * @param method Member function to attach - -: 4233: * @return Callback with infered type - -: 4234: */ - -: 4235:template - -: 4236:Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 4237: return Callback(obj, method); - -: 4238:} - -: 4239: - -: 4240:/** Create a callback class with type infered from the arguments - -: 4241: * - -: 4242: * @param obj Optional pointer to object to bind to function - -: 4243: * @param method Member function to attach - -: 4244: * @return Callback with infered type - -: 4245: */ - -: 4246:template - -: 4247:Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 4248: return Callback(obj, method); - -: 4249:} - -: 4250: - -: 4251:/** Create a callback class with type infered from the arguments - -: 4252: * - -: 4253: * @param obj Optional pointer to object to bind to function - -: 4254: * @param method Member function to attach - -: 4255: * @return Callback with infered type - -: 4256: */ - -: 4257:template - -: 4258:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 4259: return Callback(obj, method); - -: 4260:} - -: 4261: - -: 4262:/** Create a callback class with type infered from the arguments - -: 4263: * - -: 4264: * @param obj Optional pointer to object to bind to function - -: 4265: * @param method Member function to attach - -: 4266: * @return Callback with infered type - -: 4267: */ - -: 4268:template - -: 4269:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 4270: return Callback(obj, method); - -: 4271:} - -: 4272: - -: 4273:/** Create a callback class with type infered from the arguments - -: 4274: * - -: 4275: * @param func Static function to attach - -: 4276: * @param arg Pointer argument to function - -: 4277: * @return Callback with infered type - -: 4278: */ - -: 4279:template - -: 4280:Callback callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 4281: return Callback(func, arg); - -: 4282:} - -: 4283: - -: 4284:/** Create a callback class with type infered from the arguments - -: 4285: * - -: 4286: * @param func Static function to attach - -: 4287: * @param arg Pointer argument to function - -: 4288: * @return Callback with infered type - -: 4289: */ - -: 4290:template - -: 4291:Callback callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 4292: return Callback(func, arg); - -: 4293:} - -: 4294: - -: 4295:/** Create a callback class with type infered from the arguments - -: 4296: * - -: 4297: * @param func Static function to attach - -: 4298: * @param arg Pointer argument to function - -: 4299: * @return Callback with infered type - -: 4300: */ - -: 4301:template - -: 4302:Callback callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 4303: return Callback(func, arg); - -: 4304:} - -: 4305: - -: 4306:/** Create a callback class with type infered from the arguments - -: 4307: * - -: 4308: * @param func Static function to attach - -: 4309: * @param arg Pointer argument to function - -: 4310: * @return Callback with infered type - -: 4311: */ - -: 4312:template - -: 4313:Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 4314: return Callback(func, arg); - -: 4315:} - -: 4316: - -: 4317:/** Create a callback class with type infered from the arguments - -: 4318: * - -: 4319: * @param obj Optional pointer to object to bind to function - -: 4320: * @param func Static function to attach - -: 4321: * @return Callback with infered type - -: 4322: * @deprecated - -: 4323: * Arguments to callback have been reordered to callback(func, arg) - -: 4324: */ - -: 4325:template - -: 4326:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4327: "Arguments to callback have been reordered to callback(func, arg)") - -: 4328:Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 4329: return Callback(func, obj); - -: 4330:} - -: 4331: - -: 4332:/** Create a callback class with type infered from the arguments - -: 4333: * - -: 4334: * @param obj Optional pointer to object to bind to function - -: 4335: * @param func Static function to attach - -: 4336: * @return Callback with infered type - -: 4337: * @deprecated - -: 4338: * Arguments to callback have been reordered to callback(func, arg) - -: 4339: */ - -: 4340:template - -: 4341:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4342: "Arguments to callback have been reordered to callback(func, arg)") - -: 4343:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 4344: return Callback(func, obj); - -: 4345:} - -: 4346: - -: 4347:/** Create a callback class with type infered from the arguments - -: 4348: * - -: 4349: * @param obj Optional pointer to object to bind to function - -: 4350: * @param func Static function to attach - -: 4351: * @return Callback with infered type - -: 4352: * @deprecated - -: 4353: * Arguments to callback have been reordered to callback(func, arg) - -: 4354: */ - -: 4355:template - -: 4356:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4357: "Arguments to callback have been reordered to callback(func, arg)") - -: 4358:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 4359: return Callback(func, obj); - -: 4360:} - -: 4361: - -: 4362:/** Create a callback class with type infered from the arguments - -: 4363: * - -: 4364: * @param obj Optional pointer to object to bind to function - -: 4365: * @param func Static function to attach - -: 4366: * @return Callback with infered type - -: 4367: * @deprecated - -: 4368: * Arguments to callback have been reordered to callback(func, arg) - -: 4369: */ - -: 4370:template - -: 4371:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4372: "Arguments to callback have been reordered to callback(func, arg)") - -: 4373:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 4374: return Callback(func, obj); - -: 4375:} - -: 4376: - -: 4377: - -: 4378:/** Create a callback class with type infered from the arguments - -: 4379: * - -: 4380: * @param func Static function to attach - -: 4381: * @return Callback with infered type - -: 4382: */ - -: 4383:template - -: 4384:Callback callback(R (*func)(A0, A1, A2, A3, A4) = 0) { - -: 4385: return Callback(func); - -: 4386:} - -: 4387: - -: 4388:/** Create a callback class with type infered from the arguments - -: 4389: * - -: 4390: * @param func Static function to attach - -: 4391: * @return Callback with infered type - -: 4392: */ - -: 4393:template - -: 4394:Callback callback(const Callback &func) { - -: 4395: return Callback(func); - -: 4396:} - -: 4397: - -: 4398:/** Create a callback class with type infered from the arguments - -: 4399: * - -: 4400: * @param obj Optional pointer to object to bind to function - -: 4401: * @param method Member function to attach - -: 4402: * @return Callback with infered type - -: 4403: */ - -: 4404:template - -: 4405:Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 4406: return Callback(obj, method); - -: 4407:} - -: 4408: - -: 4409:/** Create a callback class with type infered from the arguments - -: 4410: * - -: 4411: * @param obj Optional pointer to object to bind to function - -: 4412: * @param method Member function to attach - -: 4413: * @return Callback with infered type - -: 4414: */ - -: 4415:template - -: 4416:Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 4417: return Callback(obj, method); - -: 4418:} - -: 4419: - -: 4420:/** Create a callback class with type infered from the arguments - -: 4421: * - -: 4422: * @param obj Optional pointer to object to bind to function - -: 4423: * @param method Member function to attach - -: 4424: * @return Callback with infered type - -: 4425: */ - -: 4426:template - -: 4427:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 4428: return Callback(obj, method); - -: 4429:} - -: 4430: - -: 4431:/** Create a callback class with type infered from the arguments - -: 4432: * - -: 4433: * @param obj Optional pointer to object to bind to function - -: 4434: * @param method Member function to attach - -: 4435: * @return Callback with infered type - -: 4436: */ - -: 4437:template - -: 4438:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 4439: return Callback(obj, method); - -: 4440:} - -: 4441: - -: 4442:/** Create a callback class with type infered from the arguments - -: 4443: * - -: 4444: * @param func Static function to attach - -: 4445: * @param arg Pointer argument to function - -: 4446: * @return Callback with infered type - -: 4447: */ - -: 4448:template - -: 4449:Callback callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 4450: return Callback(func, arg); - -: 4451:} - -: 4452: - -: 4453:/** Create a callback class with type infered from the arguments - -: 4454: * - -: 4455: * @param func Static function to attach - -: 4456: * @param arg Pointer argument to function - -: 4457: * @return Callback with infered type - -: 4458: */ - -: 4459:template - -: 4460:Callback callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 4461: return Callback(func, arg); - -: 4462:} - -: 4463: - -: 4464:/** Create a callback class with type infered from the arguments - -: 4465: * - -: 4466: * @param func Static function to attach - -: 4467: * @param arg Pointer argument to function - -: 4468: * @return Callback with infered type - -: 4469: */ - -: 4470:template - -: 4471:Callback callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 4472: return Callback(func, arg); - -: 4473:} - -: 4474: - -: 4475:/** Create a callback class with type infered from the arguments - -: 4476: * - -: 4477: * @param func Static function to attach - -: 4478: * @param arg Pointer argument to function - -: 4479: * @return Callback with infered type - -: 4480: */ - -: 4481:template - -: 4482:Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 4483: return Callback(func, arg); - -: 4484:} - -: 4485: - -: 4486:/** Create a callback class with type infered from the arguments - -: 4487: * - -: 4488: * @param obj Optional pointer to object to bind to function - -: 4489: * @param func Static function to attach - -: 4490: * @return Callback with infered type - -: 4491: * @deprecated - -: 4492: * Arguments to callback have been reordered to callback(func, arg) - -: 4493: */ - -: 4494:template - -: 4495:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4496: "Arguments to callback have been reordered to callback(func, arg)") - -: 4497:Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 4498: return Callback(func, obj); - -: 4499:} - -: 4500: - -: 4501:/** Create a callback class with type infered from the arguments - -: 4502: * - -: 4503: * @param obj Optional pointer to object to bind to function - -: 4504: * @param func Static function to attach - -: 4505: * @return Callback with infered type - -: 4506: * @deprecated - -: 4507: * Arguments to callback have been reordered to callback(func, arg) - -: 4508: */ - -: 4509:template - -: 4510:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4511: "Arguments to callback have been reordered to callback(func, arg)") - -: 4512:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 4513: return Callback(func, obj); - -: 4514:} - -: 4515: - -: 4516:/** Create a callback class with type infered from the arguments - -: 4517: * - -: 4518: * @param obj Optional pointer to object to bind to function - -: 4519: * @param func Static function to attach - -: 4520: * @return Callback with infered type - -: 4521: * @deprecated - -: 4522: * Arguments to callback have been reordered to callback(func, arg) - -: 4523: */ - -: 4524:template - -: 4525:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4526: "Arguments to callback have been reordered to callback(func, arg)") - -: 4527:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 4528: return Callback(func, obj); - -: 4529:} - -: 4530: - -: 4531:/** Create a callback class with type infered from the arguments - -: 4532: * - -: 4533: * @param obj Optional pointer to object to bind to function - -: 4534: * @param func Static function to attach - -: 4535: * @return Callback with infered type - -: 4536: * @deprecated - -: 4537: * Arguments to callback have been reordered to callback(func, arg) - -: 4538: */ - -: 4539:template - -: 4540:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4541: "Arguments to callback have been reordered to callback(func, arg)") - -: 4542:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 4543: return Callback(func, obj); - -: 4544:} - -: 4545: - -: 4546:/**@}*/ - -: 4547: - -: 4548:/**@}*/ - -: 4549: - -: 4550:} // namespace mbed - -: 4551: - -: 4552:#endif diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/CellularList.h.gcov b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/CellularList.h.gcov deleted file mode 100644 index a507611882..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/CellularList.h.gcov +++ /dev/null @@ -1,107 +0,0 @@ - -: 0:Source:../../../framework/common/CellularList.h - -: 0:Graph:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno - -: 0:Data:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef CELLULAR_LIST_H_ - -: 19:#define CELLULAR_LIST_H_ - -: 20: - -: 21:#include - -: 22: - -: 23:namespace mbed { - -: 24: - -: 25:/** Class CellularList - -: 26: * - -: 27: * Templated linked list class for common usage. - -: 28: * - -: 29: */ - -: 30:template class CellularList - -: 31:{ - -: 32:private: - -: 33: T *_head, *_tail; - -: 34:public: - -: 35: CellularList() - -: 36: { - -: 37: _head=NULL; - -: 38: _tail=NULL; - -: 39: } - -: 40: - #####: 41: T* add_new() - -: 42: { - #####: 43: T *temp=new T; - #####: 44: if (!temp) { - #####: 45: return NULL; - -: 46: } - #####: 47: temp->next = NULL; - #####: 48: if (_head == NULL) { - #####: 49: _head = temp; - -: 50: } else { - #####: 51: _tail->next=temp; - -: 52: } - #####: 53: _tail = temp; - -: 54: - #####: 55: return _tail; - -: 56: } - -: 57: - #####: 58: void delete_last() - -: 59: { - #####: 60: T* previous = NULL; - #####: 61: T *current=_head; - -: 62: - #####: 63: if (!current) { - #####: 64: return; - -: 65: } - -: 66: - #####: 67: while (current->next != NULL) { - #####: 68: previous=current; - #####: 69: current=current->next; - -: 70: } - -: 71: - #####: 72: if (previous) { - #####: 73: _tail=previous; - #####: 74: previous->next=NULL; - -: 75: } else { - #####: 76: _head = NULL; - #####: 77: _tail = NULL; - -: 78: } - -: 79: - #####: 80: delete current; - -: 81: } - -: 82: - #####: 83: void delete_all() - -: 84: { - #####: 85: T *temp = _head; - #####: 86: while (temp) { - #####: 87: _head = _head->next; - #####: 88: delete temp; - #####: 89: temp = _head; - -: 90: } - #####: 91: } - -: 92: - -: 93: - -: 94: T *get_head() - -: 95: { - -: 96: return _head; - -: 97: } - -: 98:}; - -: 99: - -: 100:} // namespace mbed - -: 101: - -: 102:#endif // CELLULAR_LIST_H_ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/CellularNetwork.h.gcov b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/CellularNetwork.h.gcov deleted file mode 100644 index 993c29d931..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/CellularNetwork.h.gcov +++ /dev/null @@ -1,387 +0,0 @@ - -: 0:Source:../../../framework/API/CellularNetwork.h - -: 0:Graph:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno - -: 0:Data:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef CELLULAR_NETWORK_H_ - -: 19:#define CELLULAR_NETWORK_H_ - -: 20: - -: 21:#include "CellularInterface.h" - -: 22:#include "NetworkInterface.h" - -: 23:#include "CellularList.h" - -: 24: - -: 25:namespace mbed { - -: 26: - -: 27:/** - -: 28: * Class CellularNetwork - -: 29: * - -: 30: * An abstract interface for connecting to a network and getting information from it. - -: 31: */ - 25: 32:class CellularNetwork : public NetworkInterface - -: 33:{ - -: 34:protected: - -: 35: // friend of CellularDevice so that it's the only way to close/delete this class. - -: 36: friend class CellularDevice; - -: 37: - -: 38: /** - -: 39: * virtual Destructor - -: 40: */ - 25: 41: virtual ~CellularNetwork() {} - -: 42: - -: 43:public: - -: 44: /* Definition for Supported CIoT EPS optimizations type. */ - -: 45: enum Supported_UE_Opt { - -: 46: SUPPORTED_UE_OPT_NO_SUPPORT = 0, /* No support. */ - -: 47: SUPPORTED_UE_OPT_CONTROL_PLANE, /* Support for control plane CIoT EPS optimization. */ - -: 48: SUPPORTED_UE_OPT_USER_PLANE, /* Support for user plane CIoT EPS optimization. */ - -: 49: SUPPORTED_UE_OPT_BOTH, /* Support for both control plane CIoT EPS optimization and user plane CIoT EPS - -: 50: optimization. */ - -: 51: SUPPORTED_UE_OPT_MAX - -: 52: }; - -: 53: - -: 54: /* Definition for Preferred CIoT EPS optimizations type. */ - -: 55: enum Preferred_UE_Opt { - -: 56: PREFERRED_UE_OPT_NO_PREFERENCE = 0, /* No preference. */ - -: 57: PREFERRED_UE_OPT_CONTROL_PLANE, /* Preference for control plane CIoT EPS optimization. */ - -: 58: PREFERRED_UE_OPT_USER_PLANE, /* Preference for user plane CIoT EPS optimization. */ - -: 59: PREFERRED_UE_OPT_MAX - -: 60: }; - -: 61: - -: 62: /* Network registration status */ - -: 63: enum RegistrationStatus { - -: 64: NotRegistered = 0, - -: 65: RegisteredHomeNetwork, - -: 66: SearchingNetwork, - -: 67: RegistrationDenied, - -: 68: Unknown, - -: 69: RegisteredRoaming, - -: 70: RegisteredSMSOnlyHome, - -: 71: RegisteredSMSOnlyRoaming, - -: 72: AttachedEmergencyOnly, - -: 73: RegisteredCSFBNotPreferredHome, - -: 74: RegisteredCSFBNotPreferredRoaming = 10 - -: 75: }; - -: 76: - -: 77: /* Network registration type */ - -: 78: enum RegistrationType { - -: 79: C_EREG = 0, - -: 80: C_GREG, - -: 81: C_REG, - -: 82: C_MAX - -: 83: }; - -: 84: - -: 85: /* device attach status to network */ - -: 86: enum AttachStatus { - -: 87: Detached = 0, - -: 88: Attached, - -: 89: }; - -: 90: - -: 91: /* whether the additional exception reports are allowed to be sent when the maximum uplink rate is reached */ - -: 92: enum RateControlExceptionReports { - -: 93: NotAllowedToBeSent = 0, - -: 94: AllowedToBeSent - -: 95: }; - -: 96: - -: 97: /* specifies the time unit to be used for the maximum uplink rate */ - -: 98: enum RateControlUplinkTimeUnit { - -: 99: Unrestricted = 0, - -: 100: Minute, - -: 101: Hour, - -: 102: Day, - -: 103: Week - -: 104: }; - -: 105: - -: 106: /* authentication type when activating or modifying the pdp context */ - -: 107: enum AuthenticationType { - -: 108: NOAUTH = 0, - -: 109: PAP, - -: 110: CHAP - -: 111: }; - -: 112: - -: 113: // 3GPP TS 27.007 - 7.3 PLMN selection +COPS - -: 114: struct operator_t { - -: 115: enum Status { - -: 116: Unknown, - -: 117: Available, - -: 118: Current, - -: 119: Forbiden - -: 120: }; - -: 121: - -: 122: enum RadioAccessTechnology { - -: 123: RAT_GSM, - -: 124: RAT_GSM_COMPACT, - -: 125: RAT_UTRAN, - -: 126: RAT_EGPRS, - -: 127: RAT_HSDPA, - -: 128: RAT_HSUPA, - -: 129: RAT_HSDPA_HSUPA, - -: 130: RAT_E_UTRAN, - -: 131: RAT_CATM1, - -: 132: RAT_NB1, - -: 133: RAT_UNKNOWN - -: 134: }; - -: 135: - -: 136: - -: 137: Status op_status; - -: 138: char op_long[16+9]; - -: 139: char op_short[8+4]; - -: 140: char op_num[8+4]; - -: 141: RadioAccessTechnology op_rat; - -: 142: operator_t *next; - -: 143: - #####: 144: operator_t() { - #####: 145: op_status = Unknown; - #####: 146: op_rat = RAT_UNKNOWN; - #####: 147: next = NULL; - #####: 148: } - -: 149: }; - -: 150: - -: 151: typedef CellularList operList_t; - -: 152: - -: 153: /* PDP Context information */ - -: 154: struct pdpcontext_params_t { - -: 155: char apn[100+1]; - -: 156: char local_addr[63+1]; - -: 157: char local_subnet_mask[63+1]; - -: 158: char gateway_addr[63+1]; - -: 159: char dns_primary_addr[63+1]; - -: 160: char dns_secondary_addr[63+1]; - -: 161: char p_cscf_prim_addr[63+1]; - -: 162: char p_cscf_sec_addr[63+1]; - -: 163: int cid; - -: 164: int bearer_id; - -: 165: int im_signalling_flag; - -: 166: int lipa_indication; - -: 167: int ipv4_mtu; - -: 168: int wlan_offload; - -: 169: int local_addr_ind; - -: 170: int non_ip_mtu; - -: 171: int serving_plmn_rate_control_value; - -: 172: pdpcontext_params_t* next; - -: 173: - #####: 174: pdpcontext_params_t() { - #####: 175: apn[0] = '\0'; - #####: 176: local_addr[0] = '\0'; - #####: 177: local_subnet_mask[0] = '\0'; - #####: 178: gateway_addr[0] = '\0'; - #####: 179: dns_primary_addr[0] = '\0'; - #####: 180: dns_secondary_addr[0] = '\0'; - #####: 181: p_cscf_prim_addr[0] = '\0'; - #####: 182: p_cscf_sec_addr[0] = '\0'; - #####: 183: cid = -1; - #####: 184: bearer_id = -1; - #####: 185: im_signalling_flag = -1; - #####: 186: lipa_indication = -1; - #####: 187: ipv4_mtu = -1; - #####: 188: wlan_offload = -1; - #####: 189: local_addr_ind = -1; - #####: 190: non_ip_mtu = -1; - #####: 191: serving_plmn_rate_control_value = -1; - #####: 192: next = NULL; - #####: 193: } - -: 194: }; - -: 195: typedef CellularList pdpContextList_t; - -: 196: - -: 197: /** Request registering to network. - -: 198: * - -: 199: * @param plmn format is in numeric format or 0 for automatic network registration - -: 200: * @return zero on success - -: 201: */ - -: 202: virtual nsapi_error_t set_registration(char *plmn = 0) = 0; - -: 203: - -: 204: /** Gets the network registration status. - -: 205: * - -: 206: * @param type see RegistrationType values - -: 207: * @param status see RegistrationStatus values - -: 208: * @return zero on success - -: 209: */ - -: 210: virtual nsapi_error_t get_registration_status(RegistrationType type, RegistrationStatus &status) = 0; - -: 211: - -: 212: /** Set the cellular network APN and credentials - -: 213: * - -: 214: * @param apn Optional name of the network to connect to - -: 215: * @param username Optional username for the APN - -: 216: * @param password Optional password fot the APN - -: 217: * @return 0 on success, negative error code on failure - -: 218: */ - -: 219: virtual nsapi_error_t set_credentials(const char *apn, - -: 220: const char *username = 0, const char *password = 0) = 0; - -: 221: - -: 222: /** Set the cellular network APN and credentials - -: 223: * - -: 224: * @param apn Name of the network to connect to - -: 225: * @param type Authentication type to use - -: 226: * @param username Optional username for the APN - -: 227: * @param password Optional password fot the APN - -: 228: * @return 0 on success, negative error code on failure - -: 229: */ - -: 230: virtual nsapi_error_t set_credentials(const char *apn, AuthenticationType type, - -: 231: const char *username = 0, const char *password = 0) = 0; - -: 232: - -: 233: /** Request attach to network. - -: 234: * - -: 235: * @param timeout milliseconds to wait for attach response - -: 236: * @return zero on success - -: 237: */ - -: 238: virtual nsapi_error_t set_attach(int timeout = 10*1000) = 0; - -: 239: - -: 240: /** Request attach status from network. - -: 241: * - -: 242: * @param status see AttachStatus values - -: 243: * @return zero on success - -: 244: */ - -: 245: virtual nsapi_error_t get_attach(AttachStatus &status) = 0; - -: 246: - -: 247: /** Get APN rate control. - -: 248: * - -: 249: * @remark optional params are not updated if not received from network, so use good defaults - -: 250: * @param reports Additional exception reports at maximum rate reached are allowed to be sent [optional] - -: 251: * @param time_unit Uplink time unit with values 0=unrestricted, 1=minute, 2=hour, 3=day, 4=week [optional] - -: 252: * @param uplink_rate Maximum number of messages per timeUnit [optional] - -: 253: * @return zero on success - -: 254: */ - -: 255: virtual nsapi_error_t get_rate_control(CellularNetwork::RateControlExceptionReports &reports, - -: 256: CellularNetwork::RateControlUplinkTimeUnit &time_unit, int &uplink_rate) = 0; - -: 257: - -: 258: /** Get backoff timer value - -: 259: * - -: 260: * @param backoff_time Backoff timer value associated with PDP APN in seconds - -: 261: * @return zero on success - -: 262: */ - -: 263: virtual nsapi_error_t get_backoff_time(int &backoff_time) = 0; - -: 264: - -: 265: /** Sets radio access technology. - -: 266: * - -: 267: * @param op_rat Radio access technology - -: 268: * @return zero on success - -: 269: */ - -: 270: virtual nsapi_error_t set_access_technology(operator_t::RadioAccessTechnology op_rat) = 0; - -: 271: - -: 272: /** Scans for operators module can reach. - -: 273: * - -: 274: * @param operators Container of reachable operators and their access technologies - -: 275: * @param ops_count Number of found operators - -: 276: * @return zero on success - -: 277: */ - -: 278: virtual nsapi_error_t scan_plmn(operList_t &operators, int &ops_count) = 0; - -: 279: - -: 280: /** Set CIoT optimizations. - -: 281: * - -: 282: * @param supported_opt Supported CIoT EPS optimizations. - -: 283: * @param preferred_opt Preferred CIoT EPS optimizations. - -: 284: * @return zero on success - -: 285: */ - -: 286: virtual nsapi_error_t set_ciot_optimization_config(Supported_UE_Opt supported_opt, - -: 287: Preferred_UE_Opt preferred_opt) = 0; - -: 288: - -: 289: /** Get CIoT optimizations. - -: 290: * - -: 291: * @param supported_opt Supported CIoT EPS optimizations. - -: 292: * @param preferred_opt Preferred CIoT EPS optimizations. - -: 293: * @return zero on success - -: 294: */ - -: 295: virtual nsapi_error_t get_ciot_optimization_config(Supported_UE_Opt& supported_opt, - -: 296: Preferred_UE_Opt& preferred_opt) = 0; - -: 297: - -: 298: /** Start the interface. Attempts to connect to a cellular network. - -: 299: * - -: 300: * @return 0 on success, negative error code on failure - -: 301: */ - -: 302: virtual nsapi_error_t connect() = 0; - -: 303: - -: 304: /** Start the interface. Attempts to connect to a cellular network. - -: 305: * - -: 306: * @param apn Optional name of the network to connect to - -: 307: * @param username Optional username for your APN - -: 308: * @param password Optional password for your APN - -: 309: * @return 0 on success, negative error code on failure - -: 310: */ - -: 311: virtual nsapi_error_t connect(const char *apn, - -: 312: const char *username = 0, const char *password = 0) = 0; - -: 313: - -: 314: /** - -: 315: * Set the pdn type to be used - -: 316: * - -: 317: * @param stack_type the stack type to be used. - -: 318: * - -: 319: * @return NSAPI_ERROR_OK on success - -: 320: */ - -: 321: virtual nsapi_error_t set_stack_type(nsapi_ip_stack_t stack_type) = 0; - -: 322: - -: 323: /** - -: 324: * Get the pdn type in use - -: 325: * - -: 326: * @return stack type - -: 327: */ - -: 328: virtual nsapi_ip_stack_t get_stack_type() = 0; - -: 329: - -: 330: /** Get the relevant information for an active non secondary PDP context. - -: 331: * - -: 332: * @remark optional params are not updated if not received from network. - -: 333: * @param params_list reference to linked list which is filled on successful call - -: 334: * @return 0 on success, negative error code on failure - -: 335: */ - -: 336: virtual nsapi_error_t get_pdpcontext_params(pdpContextList_t& params_list) = 0; - -: 337: - -: 338: /** Get extended signal quality parameters. - -: 339: * - -: 340: * @param rxlev signal strength level - -: 341: * @param ber bit error rate - -: 342: * @param rscp signal code power - -: 343: * @param ecno ratio of the received energy per PN chip to the total received power spectral density - -: 344: * @param rsrq signal received quality - -: 345: * @param rsrp signal received power - -: 346: * @return NSAPI_ERROR_OK on success, negative error code on failure - -: 347: */ - -: 348: virtual nsapi_error_t get_extended_signal_quality(int &rxlev, int &ber, int &rscp, int &ecno, int &rsrq, int &rsrp) = 0; - -: 349: - -: 350: /** Get signal quality parameters. - -: 351: * - -: 352: * @param rssi signal strength level - -: 353: * @param ber bit error rate - -: 354: * @return NSAPI_ERROR_OK on success, negative error code on failure - -: 355: */ - -: 356: virtual nsapi_error_t get_signal_quality(int &rssi, int &ber) = 0; - -: 357: - -: 358: /** Get cell id. - -: 359: * - -: 360: * @param cell_id cell id - -: 361: * @return NSAPI_ERROR_OK on success, negative error code on failure - -: 362: */ - -: 363: virtual nsapi_error_t get_cell_id(int &cell_id) = 0; - -: 364: - -: 365: /** Get the last 3GPP error code - -: 366: * @return see 3GPP TS 27.007 error codes - -: 367: */ - -: 368: virtual uint8_t get_3gpp_error() = 0; - -: 369: - -: 370: /** Get the operator params - -: 371: * - -: 372: * @param format format of the operator field - -: 373: * @param operator_params applicable operator param fields filled - -: 374: * @return NSAPI_ERROR_OK on success, negative error code on failure - -: 375: */ - -: 376: virtual nsapi_error_t get_operator_params(int &format, operator_t &operator_params) = 0; - -: 377: - -: 378:}; - -: 379: - -: 380:} // namespace mbed - -: 381: - -: 382:#endif // CELLULAR_NETWORK_H_ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/NetworkInterface.h.gcov b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/NetworkInterface.h.gcov deleted file mode 100644 index 4e16b5f646..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/NetworkInterface.h.gcov +++ /dev/null @@ -1,151 +0,0 @@ - -: 0:Source:../../../../../features/netsocket/NetworkInterface.h - -: 0:Graph:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno - -: 0:Data:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* NetworkStack - -: 2: * Copyright (c) 2015 ARM Limited - -: 3: * - -: 4: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 5: * you may not use this file except in compliance with the License. - -: 6: * You may obtain a copy of the License at - -: 7: * - -: 8: * http://www.apache.org/licenses/LICENSE-2.0 - -: 9: * - -: 10: * Unless required by applicable law or agreed to in writing, software - -: 11: * distributed under the License is distributed on an "AS IS" BASIS, - -: 12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 13: * See the License for the specific language governing permissions and - -: 14: * limitations under the License. - -: 15: */ - -: 16: - -: 17:#ifndef NETWORK_INTERFACE_H - -: 18:#define NETWORK_INTERFACE_H - -: 19: - -: 20:#include "netsocket/nsapi_types.h" - -: 21:#include "netsocket/SocketAddress.h" - -: 22: - -: 23:// Predeclared class - -: 24:class NetworkStack; - -: 25: - -: 26: - -: 27:/** NetworkInterface class - -: 28: * - -: 29: * Common interface that is shared between network devices - -: 30: * @addtogroup netsocket - -: 31: */ - 25: 32:class NetworkInterface { - -: 33:public: - 25: 34: virtual ~NetworkInterface() {}; - -: 35: - -: 36: /** Get the local MAC address - -: 37: * - -: 38: * Provided MAC address is intended for info or debug purposes and - -: 39: * may not be provided if the underlying network interface does not - -: 40: * provide a MAC address - -: 41: * - -: 42: * @return Null-terminated representation of the local MAC address - -: 43: * or null if no MAC address is available - -: 44: */ - -: 45: virtual const char *get_mac_address(); - -: 46: - -: 47: /** Get the local IP address - -: 48: * - -: 49: * @return Null-terminated representation of the local IP address - -: 50: * or null if no IP address has been recieved - -: 51: */ - -: 52: virtual const char *get_ip_address(); - -: 53: - -: 54: /** Get the local network mask - -: 55: * - -: 56: * @return Null-terminated representation of the local network mask - -: 57: * or null if no network mask has been recieved - -: 58: */ - -: 59: virtual const char *get_netmask(); - -: 60: - -: 61: /** Get the local gateway - -: 62: * - -: 63: * @return Null-terminated representation of the local gateway - -: 64: * or null if no network mask has been recieved - -: 65: */ - -: 66: virtual const char *get_gateway(); - -: 67: - -: 68: /** Set a static IP address - -: 69: * - -: 70: * Configures this network interface to use a static IP address. - -: 71: * Implicitly disables DHCP, which can be enabled in set_dhcp. - -: 72: * Requires that the network is disconnected. - -: 73: * - -: 74: * @param ip_address Null-terminated representation of the local IP address - -: 75: * @param netmask Null-terminated representation of the local network mask - -: 76: * @param gateway Null-terminated representation of the local gateway - -: 77: * @return 0 on success, negative error code on failure - -: 78: */ - -: 79: virtual nsapi_error_t set_network( - -: 80: const char *ip_address, const char *netmask, const char *gateway); - -: 81: - -: 82: /** Enable or disable DHCP on the network - -: 83: * - -: 84: * Enables DHCP on connecting the network. Defaults to enabled unless - -: 85: * a static IP address has been assigned. Requires that the network is - -: 86: * disconnected. - -: 87: * - -: 88: * @param dhcp True to enable DHCP - -: 89: * @return 0 on success, negative error code on failure - -: 90: */ - -: 91: virtual nsapi_error_t set_dhcp(bool dhcp); - -: 92: - -: 93: /** Start the interface - -: 94: * - -: 95: * @return 0 on success, negative error code on failure - -: 96: */ - -: 97: virtual nsapi_error_t connect() = 0; - -: 98: - -: 99: /** Stop the interface - -: 100: * - -: 101: * @return 0 on success, negative error code on failure - -: 102: */ - -: 103: virtual nsapi_error_t disconnect() = 0; - -: 104: - -: 105: /** Translates a hostname to an IP address with specific version - -: 106: * - -: 107: * The hostname may be either a domain name or an IP address. If the - -: 108: * hostname is an IP address, no network transactions will be performed. - -: 109: * - -: 110: * If no stack-specific DNS resolution is provided, the hostname - -: 111: * will be resolve using a UDP socket on the stack. - -: 112: * - -: 113: * @param address Destination for the host SocketAddress - -: 114: * @param host Hostname to resolve - -: 115: * @param version IP version of address to resolve, NSAPI_UNSPEC indicates - -: 116: * version is chosen by the stack (defaults to NSAPI_UNSPEC) - -: 117: * @return 0 on success, negative error code on failure - -: 118: */ - -: 119: virtual nsapi_error_t gethostbyname(const char *host, - -: 120: SocketAddress *address, nsapi_version_t version = NSAPI_UNSPEC); - -: 121: - -: 122: /** Add a domain name server to list of servers to query - -: 123: * - -: 124: * @param address Destination for the host address - -: 125: * @return 0 on success, negative error code on failure - -: 126: */ - -: 127: virtual nsapi_error_t add_dns_server(const SocketAddress &address); - -: 128: - -: 129:protected: - -: 130: friend class Socket; - -: 131: friend class UDPSocket; - -: 132: friend class TCPSocket; - -: 133: friend class TCPServer; - -: 134: friend class SocketAddress; - -: 135: template - -: 136: friend NetworkStack *nsapi_create_stack(IF *iface); - -: 137: - -: 138: /** Provide access to the NetworkStack object - -: 139: * - -: 140: * @return The underlying NetworkStack object - -: 141: */ - -: 142: virtual NetworkStack *get_stack() = 0; - -: 143:}; - -: 144: - -: 145: - -: 146:#endif diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_output.txt deleted file mode 100644 index 13355a4381..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_output.txt +++ /dev/null @@ -1,28 +0,0 @@ -File '../../../../../platform/Callback.h' -Lines executed:60.32% of 63 -Creating 'Callback.h.gcov' - -File '../../../framework/common/CellularList.h' -Lines executed:0.00% of 31 -Creating 'CellularList.h.gcov' - -File '../../../framework/AT/AT_CellularNetwork.cpp' -Lines executed:66.14% of 502 -Creating 'AT_CellularNetwork.cpp.gcov' - -File '../../../framework/API/CellularNetwork.h' -Lines executed:7.41% of 27 -Creating 'CellularNetwork.h.gcov' - -File '../../../../../features/netsocket/NetworkInterface.h' -Lines executed:100.00% of 2 -Creating 'NetworkInterface.h.gcov' - -File '../../../../../platform/mbed_debug.h' -Lines executed:100.00% of 2 -Creating 'mbed_debug.h.gcov' - -File '/usr/include/c++/5/new' -Lines executed:0.00% of 3 -Creating 'new.gcov' - diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_report.txt deleted file mode 100644 index 575cdc2ddd..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_report.txt +++ /dev/null @@ -1,7 +0,0 @@ - - 0.00% ../framework/common/CellularList.h -100.00% ../features/netsocket/NetworkInterface.h -100.00% ../platform/mbed_debug.h - 60.32% ../platform/Callback.h - 66.14% ../framework/AT/AT_CellularNetwork.cpp - 7.41% ../framework/API/CellularNetwork.h diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_report.txt.html deleted file mode 100644 index 8f12e22c13..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/gcov_report.txt.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - -
CoverageFile
0.00% ../framework/common/CellularList.h
100.00% ../features/netsocket/NetworkInterface.h
100.00% ../platform/mbed_debug.h
60.32% ../platform/Callback.h
66.14% ../framework/AT/AT_CellularNetwork.cpp
7.41% ../framework/API/CellularNetwork.h
diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/mbed_debug.h.gcov b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/mbed_debug.h.gcov deleted file mode 100644 index ee14aefc49..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/mbed_debug.h.gcov +++ /dev/null @@ -1,84 +0,0 @@ - -: 0:Source:../../../../../platform/mbed_debug.h - -: 0:Graph:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno - -: 0:Data:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1: - -: 2:/** \addtogroup platform */ - -: 3:/** @{*/ - -: 4:/** - -: 5: * \defgroup platform_debug Debug functions - -: 6: * @{ - -: 7: */ - -: 8: - -: 9:/* mbed Microcontroller Library - -: 10: * Copyright (c) 2006-2013 ARM Limited - -: 11: * - -: 12: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 13: * you may not use this file except in compliance with the License. - -: 14: * You may obtain a copy of the License at - -: 15: * - -: 16: * http://www.apache.org/licenses/LICENSE-2.0 - -: 17: * - -: 18: * Unless required by applicable law or agreed to in writing, software - -: 19: * distributed under the License is distributed on an "AS IS" BASIS, - -: 20: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 21: * See the License for the specific language governing permissions and - -: 22: * limitations under the License. - -: 23: */ - -: 24:#ifndef MBED_DEBUG_H - -: 25:#define MBED_DEBUG_H - -: 26:#if DEVICE_STDIO_MESSAGES - -: 27:#include - -: 28:#include - -: 29:#endif - -: 30: - -: 31:#ifdef __cplusplus - -: 32:extern "C" { - -: 33:#endif - -: 34: - -: 35: - -: 36:/** Output a debug message - -: 37: * - -: 38: * @param format printf-style format string, followed by variables - -: 39: */ - 3: 40:static inline void debug(const char *format, ...) { - -: 41:#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) - -: 42: va_list args; - -: 43: va_start(args, format); - -: 44: vfprintf(stderr, format, args); - -: 45: va_end(args); - -: 46:#endif - 3: 47:} - -: 48: - -: 49: - -: 50:/** Conditionally output a debug message - -: 51: * - -: 52: * NOTE: If the condition is constant false (== 0) and the compiler optimization - -: 53: * level is greater than 0, then the whole function will be compiled away. - -: 54: * - -: 55: * @param condition output only if condition is true (!= 0) - -: 56: * @param format printf-style format string, followed by variables - -: 57: */ - -: 58:static inline void debug_if(int condition, const char *format, ...) { - -: 59:#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) - -: 60: if (condition) { - -: 61: va_list args; - -: 62: va_start(args, format); - -: 63: vfprintf(stderr, format, args); - -: 64: va_end(args); - -: 65: } - -: 66:#endif - -: 67:} - -: 68: - -: 69: - -: 70:#ifdef __cplusplus - -: 71:} - -: 72:#endif - -: 73: - -: 74:#endif - -: 75: - -: 76:/**@}*/ - -: 77: - -: 78:/**@}*/ - -: 79: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/new.gcov b/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/new.gcov deleted file mode 100644 index 952918a386..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/gcov/new.gcov +++ /dev/null @@ -1,147 +0,0 @@ - -: 0:Source:/usr/include/c++/5/new - -: 0:Graph:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno - -: 0:Data:objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:// The -*- C++ -*- dynamic memory management header. - -: 2: - -: 3:// Copyright (C) 1994-2015 Free Software Foundation, Inc. - -: 4: - -: 5:// This file is part of GCC. - -: 6:// - -: 7:// GCC is free software; you can redistribute it and/or modify - -: 8:// it under the terms of the GNU General Public License as published by - -: 9:// the Free Software Foundation; either version 3, or (at your option) - -: 10:// any later version. - -: 11:// - -: 12:// GCC is distributed in the hope that it will be useful, - -: 13:// but WITHOUT ANY WARRANTY; without even the implied warranty of - -: 14:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - -: 15:// GNU General Public License for more details. - -: 16:// - -: 17:// Under Section 7 of GPL version 3, you are granted additional - -: 18:// permissions described in the GCC Runtime Library Exception, version - -: 19:// 3.1, as published by the Free Software Foundation. - -: 20: - -: 21:// You should have received a copy of the GNU General Public License and - -: 22:// a copy of the GCC Runtime Library Exception along with this program; - -: 23:// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - -: 24:// . - -: 25: - -: 26:/** @file new - -: 27: * This is a Standard C++ Library header. - -: 28: * - -: 29: * The header @c new defines several functions to manage dynamic memory and - -: 30: * handling memory allocation errors; see - -: 31: * http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more. - -: 32: */ - -: 33: - -: 34:#ifndef _NEW - -: 35:#define _NEW - -: 36: - -: 37:#pragma GCC system_header - -: 38: - -: 39:#include - -: 40:#include - -: 41: - -: 42:#pragma GCC visibility push(default) - -: 43: - -: 44:extern "C++" { - -: 45: - -: 46:namespace std - -: 47:{ - -: 48: /** - -: 49: * @brief Exception possibly thrown by @c new. - -: 50: * @ingroup exceptions - -: 51: * - -: 52: * @c bad_alloc (or classes derived from it) is used to report allocation - -: 53: * errors from the throwing forms of @c new. */ - -: 54: class bad_alloc : public exception - -: 55: { - -: 56: public: - -: 57: bad_alloc() throw() { } - -: 58: - -: 59: // This declaration is not useless: - -: 60: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - -: 61: virtual ~bad_alloc() throw(); - -: 62: - -: 63: // See comment in eh_exception.cc. - -: 64: virtual const char* what() const throw(); - -: 65: }; - -: 66: - -: 67:#if __cplusplus >= 201103L - -: 68: class bad_array_new_length : public bad_alloc - -: 69: { - -: 70: public: - -: 71: bad_array_new_length() throw() { }; - -: 72: - -: 73: // This declaration is not useless: - -: 74: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - -: 75: virtual ~bad_array_new_length() throw(); - -: 76: - -: 77: // See comment in eh_exception.cc. - -: 78: virtual const char* what() const throw(); - -: 79: }; - -: 80:#endif - -: 81: - -: 82: struct nothrow_t { }; - -: 83: - -: 84: extern const nothrow_t nothrow; - -: 85: - -: 86: /** If you write your own error handler to be called by @c new, it must - -: 87: * be of this type. */ - -: 88: typedef void (*new_handler)(); - -: 89: - -: 90: /// Takes a replacement handler as the argument, returns the - -: 91: /// previous handler. - -: 92: new_handler set_new_handler(new_handler) throw(); - -: 93: - -: 94:#if __cplusplus >= 201103L - -: 95: /// Return the current new handler. - -: 96: new_handler get_new_handler() noexcept; - -: 97:#endif - -: 98:} // namespace std - -: 99: - -: 100://@{ - -: 101:/** These are replaceable signatures: - -: 102: * - normal single new and delete (no arguments, throw @c bad_alloc on error) - -: 103: * - normal array new and delete (same) - -: 104: * - @c nothrow single new and delete (take a @c nothrow argument, return - -: 105: * @c NULL on error) - -: 106: * - @c nothrow array new and delete (same) - -: 107: * - -: 108: * Placement new and delete signatures (take a memory address argument, - -: 109: * does nothing) may not be replaced by a user's program. - -: 110:*/ - -: 111:void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) - -: 112: __attribute__((__externally_visible__)); - -: 113:void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) - -: 114: __attribute__((__externally_visible__)); - -: 115:void operator delete(void*) _GLIBCXX_USE_NOEXCEPT - -: 116: __attribute__((__externally_visible__)); - -: 117:void operator delete[](void*) _GLIBCXX_USE_NOEXCEPT - -: 118: __attribute__((__externally_visible__)); - -: 119:void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 120: __attribute__((__externally_visible__)); - -: 121:void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 122: __attribute__((__externally_visible__)); - -: 123:void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 124: __attribute__((__externally_visible__)); - -: 125:void operator delete[](void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 126: __attribute__((__externally_visible__)); - -: 127: - -: 128:// Default placement versions of operator new. - #####: 129:inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT - #####: 130:{ return __p; } - -: 131:inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT - -: 132:{ return __p; } - -: 133: - -: 134:// Default placement versions of operator delete. - #####: 135:inline void operator delete (void*, void*) _GLIBCXX_USE_NOEXCEPT { } - -: 136:inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { } - -: 137://@} - -: 138:} // extern "C++" - -: 139: - -: 140:#pragma GCC visibility pop - -: 141: - -: 142:#endif diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/lib/libAT_CellularNetwork_unit.a b/features/cellular/UNITTESTS/at/at_cellularnetwork/lib/libAT_CellularNetwork_unit.a deleted file mode 100644 index b247bb23a4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/lib/libAT_CellularNetwork_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.d deleted file mode 100644 index 29120c9d71..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.d +++ /dev/null @@ -1,78 +0,0 @@ -objs/AT_CellularNetwork_unit/ATHandler_stub.o: \ - ../../stubs/ATHandler_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/platform.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.gcda deleted file mode 100644 index eabefd9738..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.gcno deleted file mode 100644 index 25352dfeea..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.o deleted file mode 100644 index 9257d64696..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/ATHandler_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.d deleted file mode 100644 index e1c427babb..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.d +++ /dev/null @@ -1,53 +0,0 @@ -objs/AT_CellularNetwork_unit/AT_CellularBase_stub.o: \ - ../../stubs/AT_CellularBase_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/AT_CellularBase_stub.h \ - ../../../framework/AT/ATHandler.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/AT_CellularBase_stub.h: - -../../../framework/AT/ATHandler.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.gcda deleted file mode 100644 index e1eb67d7f5..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.gcno deleted file mode 100644 index 9ecfa5d296..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.o deleted file mode 100644 index 6469688de6..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularBase_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.d deleted file mode 100644 index 895c0e7955..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.d +++ /dev/null @@ -1,101 +0,0 @@ -objs/AT_CellularNetwork_unit/AT_CellularNetwork.o: \ - ../../../framework/AT/AT_CellularNetwork.cpp \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../target_h/nsapi_ppp.h ../../../framework/common/CellularUtil.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../target_h/nsapi_ppp.h: - -../../../framework/common/CellularUtil.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda deleted file mode 100644 index c0e3bd65d0..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno deleted file mode 100644 index 40e852fd0c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.o deleted file mode 100644 index 8e90820599..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/AT_CellularNetwork.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.d deleted file mode 100644 index 72b681b4c0..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.d +++ /dev/null @@ -1,5 +0,0 @@ -objs/AT_CellularNetwork_unit/CellularUtil_stub.o: \ - ../../stubs/CellularUtil_stub.cpp \ - ../../../framework/common/CellularUtil.h - -../../../framework/common/CellularUtil.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.gcda deleted file mode 100644 index d151f62b26..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.gcno deleted file mode 100644 index 52ba3f5a90..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.o deleted file mode 100644 index 95d6cea52f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/CellularUtil_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.d deleted file mode 100644 index d2bc2f925b..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularNetwork_unit/EventQueue_stub.o: \ - ../../stubs/EventQueue_stub.cpp ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.gcda deleted file mode 100644 index e365efa69f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.gcno deleted file mode 100644 index 8247867a2b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.o deleted file mode 100644 index 2c870ba8e0..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.d deleted file mode 100644 index 9a03aaea04..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/AT_CellularNetwork_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.gcda deleted file mode 100644 index 41bab6347a..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.gcno deleted file mode 100644 index c245bd486e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.o deleted file mode 100644 index c2d8341159..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.d deleted file mode 100644 index e9534d90c6..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.d +++ /dev/null @@ -1,23 +0,0 @@ -objs/AT_CellularNetwork_unit/NetworkInterface_stub.o: \ - ../../stubs/NetworkInterface_stub.cpp \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkStack.h - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkStack.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.gcda deleted file mode 100644 index 8c5a67c032..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.gcno deleted file mode 100644 index 2f4455694d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.o deleted file mode 100644 index 98f47880bb..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/NetworkInterface_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.d deleted file mode 100644 index 4518c73457..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/AT_CellularNetwork_unit/at_cellularnetworktest.o: \ - at_cellularnetworktest.cpp test_at_cellularnetwork.h - -test_at_cellularnetwork.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.gcda deleted file mode 100644 index d19be0aba8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.gcno deleted file mode 100644 index 590c3dbdc0..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.o deleted file mode 100644 index ba6740c05c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/at_cellularnetworktest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.d deleted file mode 100644 index 28afab2710..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/AT_CellularNetwork_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.gcda deleted file mode 100644 index aab08bec0d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.gcno deleted file mode 100644 index 76d21afb93..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.o deleted file mode 100644 index 47abf09426..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.d deleted file mode 100644 index 8a1eee62d4..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/AT_CellularNetwork_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.gcda deleted file mode 100644 index c8a5bc933b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.gcno deleted file mode 100644 index 8f0b438964..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.o deleted file mode 100644 index bebf9f11fd..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.d deleted file mode 100644 index 720843361d..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.d +++ /dev/null @@ -1,178 +0,0 @@ -objs/AT_CellularNetwork_unit/test_at_cellularnetwork.o: \ - test_at_cellularnetwork.cpp test_at_cellularnetwork.h \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/AT/ATHandler.h \ - ../../../framework/AT/AT_CellularDevice.h \ - ../../../framework/API/CellularDevice.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h ../../../framework/API/CellularSIM.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../framework/API/CellularSMS.h \ - ../../../framework/API/CellularPower.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../framework/API/CellularInformation.h \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/AT/AT_CellularSIM.h \ - ../../../framework/API/CellularSIM.h \ - ../../../framework/AT/AT_CellularSMS.h \ - ../../../framework/API/CellularSMS.h \ - ../../../framework/AT/AT_CellularPower.h \ - ../../../framework/API/CellularPower.h \ - ../../../framework/AT/AT_CellularMultiplexer.h \ - ../../../framework/API/CellularMultiplexer.h \ - ../../../framework/AT/AT_CellularInformation.h \ - ../../../framework/API/CellularInformation.h \ - ../../stubs/FileHandle_stub.h ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h - -test_at_cellularnetwork.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/AT/ATHandler.h: - -../../../framework/AT/AT_CellularDevice.h: - -../../../framework/API/CellularDevice.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/API/CellularSIM.h: - -../../../framework/API/CellularNetwork.h: - -../../../framework/API/CellularSMS.h: - -../../../framework/API/CellularPower.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../framework/API/CellularInformation.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/AT/AT_CellularSIM.h: - -../../../framework/API/CellularSIM.h: - -../../../framework/AT/AT_CellularSMS.h: - -../../../framework/API/CellularSMS.h: - -../../../framework/AT/AT_CellularPower.h: - -../../../framework/API/CellularPower.h: - -../../../framework/AT/AT_CellularMultiplexer.h: - -../../../framework/API/CellularMultiplexer.h: - -../../../framework/AT/AT_CellularInformation.h: - -../../../framework/API/CellularInformation.h: - -../../stubs/FileHandle_stub.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.gcda deleted file mode 100644 index f50ab3363e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.gcno deleted file mode 100644 index fda64d338c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.o deleted file mode 100644 index 810c773ce1..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/test_at_cellularnetwork.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.d b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.d deleted file mode 100644 index c544784020..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.d +++ /dev/null @@ -1,9 +0,0 @@ -objs/AT_CellularNetwork_unit/us_ticker_stub.o: \ - ../../stubs/us_ticker_stub.cpp ../../../../../hal/us_ticker_api.h \ - ../../../../../hal/ticker_api.h ../../target_h/device.h - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.gcda deleted file mode 100644 index 6e36ce41e5..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.gcno deleted file mode 100644 index eef471f811..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.o b/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.o deleted file mode 100644 index 1b61966fd0..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularnetwork/objs/AT_CellularNetwork_unit/us_ticker_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/AT_CellularPower_unit_tests b/features/cellular/UNITTESTS/at/at_cellularpower/AT_CellularPower_unit_tests deleted file mode 100755 index 0f591ed4a4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/AT_CellularPower_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/AT_CellularPower_unit_tests.txt b/features/cellular/UNITTESTS/at/at_cellularpower/AT_CellularPower_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/cpputest_AT_CellularPower.xml b/features/cellular/UNITTESTS/at/at_cellularpower/cpputest_AT_CellularPower.xml deleted file mode 100644 index 020008081f..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/cpputest_AT_CellularPower.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/AT_CellularPower.cpp.gcov b/features/cellular/UNITTESTS/at/at_cellularpower/gcov/AT_CellularPower.cpp.gcov deleted file mode 100644 index 80b2c61f1c..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/AT_CellularPower.cpp.gcov +++ /dev/null @@ -1,237 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularPower.cpp - -: 0:Graph:objs/AT_CellularPower_unit/AT_CellularPower.gcno - -: 0:Data:objs/AT_CellularPower_unit/AT_CellularPower.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include "AT_CellularPower.h" - -: 19:#include "CellularUtil.h" - -: 20:#include "CellularLog.h" - -: 21: - -: 22:static const int PSMTimerBits = 5; - -: 23: - -: 24:using namespace mbed_cellular_util; - -: 25:using namespace mbed; - -: 26: - 1: 27:AT_CellularPower::AT_CellularPower(ATHandler &at) : AT_CellularBase(at) - -: 28:{ - 1: 29:} - -: 30: - 2: 31:AT_CellularPower::~AT_CellularPower() - -: 32:{ - 2: 33:} - -: 34: - #####: 35:nsapi_error_t AT_CellularPower::on() - -: 36:{ - #####: 37: return NSAPI_ERROR_UNSUPPORTED; - -: 38:} - -: 39: - #####: 40:nsapi_error_t AT_CellularPower::off() - -: 41:{ - #####: 42: return NSAPI_ERROR_UNSUPPORTED; - -: 43:} - -: 44: - #####: 45:nsapi_error_t AT_CellularPower::set_at_mode() - -: 46:{ - #####: 47: _at.lock(); - #####: 48: _at.flush(); - #####: 49: _at.cmd_start("ATE0"); // echo off - #####: 50: _at.cmd_stop(); - #####: 51: _at.resp_start(); - #####: 52: _at.resp_stop(); - -: 53: - #####: 54: _at.cmd_start("AT+CMEE=1"); // verbose responses - #####: 55: _at.cmd_stop(); - #####: 56: _at.resp_start(); - #####: 57: _at.resp_stop(); - #####: 58: return _at.unlock_return_error(); - -: 59:} - -: 60: - #####: 61:nsapi_error_t AT_CellularPower::set_power_level(int func_level) - -: 62:{ - #####: 63: _at.lock(); - #####: 64: _at.cmd_start("AT+CFUN="); - #####: 65: _at.write_int(func_level); - #####: 66: _at.cmd_stop(); - #####: 67: _at.resp_start(); - #####: 68: _at.resp_stop(); - #####: 69: return _at.unlock_return_error(); - -: 70:} - -: 71: - #####: 72:nsapi_error_t AT_CellularPower::reset() - -: 73:{ - #####: 74: _at.lock(); - #####: 75: _at.cmd_start("AT+CFUN=");// reset to full power levels - #####: 76: _at.write_int(1); - #####: 77: _at.write_int(1); - #####: 78: _at.cmd_stop(); - #####: 79: _at.resp_start(); - #####: 80: _at.resp_stop(); - #####: 81: return _at.unlock_return_error(); - -: 82:} - -: 83: - #####: 84:nsapi_error_t AT_CellularPower::opt_power_save_mode(int periodic_time, int active_time) - -: 85:{ - #####: 86: _at.lock(); - -: 87: - #####: 88: if (periodic_time == 0 && active_time == 0) { - -: 89: // disable PSM - #####: 90: _at.cmd_start("AT+CPSMS="); - #####: 91: _at.write_int(0); - #####: 92: _at.cmd_stop(); - #####: 93: _at.resp_start(); - #####: 94: _at.resp_stop(); - -: 95: } else { - -: 96: /** - -: 97: Table 10.5.163a/3GPP TS 24.008: GPRS Timer 3 information element - -: 98: - -: 99: Bits 5 to 1 represent the binary coded timer value. - -: 100: - -: 101: Bits 6 to 8 defines the timer value unit for the GPRS timer as follows: - -: 102: 8 7 6 - -: 103: 0 0 0 value is incremented in multiples of 10 minutes - -: 104: 0 0 1 value is incremented in multiples of 1 hour - -: 105: 0 1 0 value is incremented in multiples of 10 hours - -: 106: 0 1 1 value is incremented in multiples of 2 seconds - -: 107: 1 0 0 value is incremented in multiples of 30 seconds - -: 108: 1 0 1 value is incremented in multiples of 1 minute - -: 109: 1 1 0 value is incremented in multiples of 320 hours (NOTE 1) - -: 110: 1 1 1 value indicates that the timer is deactivated (NOTE 2). - -: 111: */ - -: 112: char pt[8+1];// timer value encoded as 3GPP IE - #####: 113: const int ie_value_max = 0x1f; - #####: 114: uint32_t periodic_timer = 0; - #####: 115: if (periodic_time <= 2*ie_value_max) { // multiples of 2 seconds - #####: 116: periodic_timer = periodic_time/2; - #####: 117: strcpy(pt, "01100000"); - -: 118: } else { - #####: 119: if (periodic_time <= 30*ie_value_max) { // multiples of 30 seconds - #####: 120: periodic_timer = periodic_time/30; - #####: 121: strcpy(pt, "10000000"); - -: 122: } else { - #####: 123: if (periodic_time <= 60*ie_value_max) { // multiples of 1 minute - #####: 124: periodic_timer = periodic_time/60; - #####: 125: strcpy(pt, "10100000"); - -: 126: } else { - #####: 127: if (periodic_time <= 10*60*ie_value_max) { // multiples of 10 minutes - #####: 128: periodic_timer = periodic_time/(10*60); - #####: 129: strcpy(pt, "00000000"); - -: 130: } else { - #####: 131: if (periodic_time <= 60*60*ie_value_max) { // multiples of 1 hour - #####: 132: periodic_timer = periodic_time/(60*60); - #####: 133: strcpy(pt, "00100000"); - -: 134: } else { - #####: 135: if (periodic_time <= 10*60*60*ie_value_max) { // multiples of 10 hours - #####: 136: periodic_timer = periodic_time/(10*60*60); - #####: 137: strcpy(pt, "01000000"); - -: 138: } else { // multiples of 320 hours - #####: 139: int t = periodic_time / (320*60*60); - #####: 140: if (t > ie_value_max) { - #####: 141: t = ie_value_max; - -: 142: } - #####: 143: periodic_timer = t; - #####: 144: strcpy(pt, "11000000"); - -: 145: } - -: 146: } - -: 147: } - -: 148: } - -: 149: } - -: 150: } - -: 151: - #####: 152: uint_to_binary_str(periodic_timer, &pt[3], sizeof(pt)-3, PSMTimerBits); - #####: 153: pt[8] = '\0'; - -: 154: - -: 155: /** - -: 156: Table 10.5.172/3GPP TS 24.008: GPRS Timer information element - -: 157: - -: 158: Bits 5 to 1 represent the binary coded timer value. - -: 159: - -: 160: Bits 6 to 8 defines the timer value unit for the GPRS timer as follows: - -: 161: - -: 162: 8 7 6 - -: 163: 0 0 0 value is incremented in multiples of 2 seconds - -: 164: 0 0 1 value is incremented in multiples of 1 minute - -: 165: 0 1 0 value is incremented in multiples of decihours - -: 166: 1 1 1 value indicates that the timer is deactivated. - -: 167: - -: 168: Other values shall be interpreted as multiples of 1 minute in this version of the protocol. - -: 169: */ - -: 170: char at[8+1]; - -: 171: uint32_t active_timer; // timer value encoded as 3GPP IE - #####: 172: if (active_time <= 2*ie_value_max) { // multiples of 2 seconds - #####: 173: active_timer = active_time/2; - #####: 174: strcpy(at, "00000000"); - -: 175: } else { - #####: 176: if (active_time <= 60*ie_value_max) { // multiples of 1 minute - #####: 177: active_timer = (1<<5) | (active_time/60); - #####: 178: strcpy(at, "00100000"); - -: 179: } else { // multiples of decihours - #####: 180: int t = active_time / (6*60); - #####: 181: if (t > ie_value_max) { - #####: 182: t = ie_value_max; - -: 183: } - #####: 184: active_timer = t; - #####: 185: strcpy(at, "01000000"); - -: 186: } - -: 187: } - -: 188: - #####: 189: uint_to_binary_str(active_timer, &at[3], sizeof(at)-3, PSMTimerBits); - #####: 190: pt[8] = '\0'; - -: 191: - -: 192: // request for both GPRS and LTE - #####: 193: _at.cmd_start("AT+CPSMS="); - #####: 194: _at.write_int(1); - #####: 195: _at.write_string(pt); - #####: 196: _at.write_string(at); - #####: 197: _at.write_string(pt); - #####: 198: _at.write_string(at); - #####: 199: _at.cmd_stop(); - #####: 200: _at.resp_start(); - #####: 201: _at.resp_stop(); - -: 202: - -: 203: - #####: 204: if (_at.get_last_error() != NSAPI_ERROR_OK) { - -: 205: log_warn("Power save mode not enabled!"); - -: 206: } else { - -: 207: // network may not agree with power save options but - -: 208: // that should be fine as timeout is not longer than requested - -: 209: } - -: 210: } - -: 211: - #####: 212: return _at.unlock_return_error(); - -: 213:} - -: 214: - #####: 215:nsapi_error_t AT_CellularPower::opt_receive_period(int mode, EDRXAccessTechnology act_type, uint8_t edrx_value) - -: 216:{ - -: 217: char edrx[5]; - #####: 218: uint_to_binary_str(edrx_value, edrx, 5, 4); - #####: 219: edrx[4] = '\0'; - -: 220: - #####: 221: _at.lock(); - -: 222: - #####: 223: _at.cmd_start("AT+CEDRXS="); - #####: 224: _at.write_int(mode); - #####: 225: _at.write_int(act_type); - #####: 226: _at.write_string(edrx); - #####: 227: _at.cmd_stop(); - #####: 228: _at.resp_start(); - #####: 229: _at.resp_stop(); - -: 230: - #####: 231: return _at.unlock_return_error(); - -: 232:} diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/CellularPower.h.gcov b/features/cellular/UNITTESTS/at/at_cellularpower/gcov/CellularPower.h.gcov deleted file mode 100644 index 1648f7ae25..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/CellularPower.h.gcov +++ /dev/null @@ -1,135 +0,0 @@ - -: 0:Source:../../../framework/API/CellularPower.h - -: 0:Graph:objs/AT_CellularPower_unit/AT_CellularPower.gcno - -: 0:Data:objs/AT_CellularPower_unit/AT_CellularPower.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17:#ifndef CELLULAR_API_CELLULARPOWER_H_ - -: 18:#define CELLULAR_API_CELLULARPOWER_H_ - -: 19: - -: 20:#include "nsapi_types.h" - -: 21: - -: 22:namespace mbed { - -: 23: - -: 24:/** - -: 25: * Class CellularPower - -: 26: * - -: 27: * An abstract interface for connecting to a network and getting information from it. - -: 28: */ - 1: 29:class CellularPower - -: 30:{ - -: 31:protected: - -: 32: // friend of CellularDevice so that it's the only way to close/delete this class. - -: 33: friend class CellularDevice; - -: 34: - -: 35: /** - -: 36: * virtual Destructor - -: 37: */ - 1: 38: virtual ~CellularPower() {} - -: 39: - -: 40:public: - -: 41: /* Access technology used in method opt_receive_period */ - -: 42: enum EDRXAccessTechnology { - -: 43: EDRXGSM_EC_GSM_IoT_mode = 1, - -: 44: EDRXGSM_A_Gb_mode, - -: 45: EDRXUTRAN_Iu_mode, - -: 46: EDRXEUTRAN_WB_S1_mode, - -: 47: EDRXEUTRAN_NB_S1_mode - -: 48: }; - -: 49: - -: 50: /** Set cellular device power on. Default implementation is empty. - -: 51: * Device power on/off is modem/board specific behavior and must be done on inherited class if needed. - -: 52: * Power on is done by toggling power pin/button. - -: 53: * - -: 54: * @remark set_at_mode must be called to initialise modem - -: 55: * - -: 56: * @remark Should not be called if MUX is enabled and started. If called then start-up sequence must be done again. - -: 57: * @return zero on success - -: 58: */ - -: 59: virtual nsapi_error_t on() = 0; - -: 60: - -: 61: /** Set cellular device power off. Default implementation is empty. - -: 62: * Device power on/off is modem/board specific behavior and must be done on inherited class if needed. - -: 63: * Power off is done by toggling power pin/button. - -: 64: * - -: 65: * @remark Should not be called if MUX is enabled and started. If called then start-up sequence must be done again. - -: 66: * - -: 67: * @return zero on success - -: 68: */ - -: 69: virtual nsapi_error_t off() = 0; - -: 70: - -: 71: /** Set AT command mode. Blocking until success or failure. - -: 72: * - -: 73: * @remark must be called after power on to prepare correct AT mode - -: 74: * - -: 75: * @return zero on success - -: 76: */ - -: 77: virtual nsapi_error_t set_at_mode() = 0; - -: 78: - -: 79: /** Set cellular device power level by enabling/disabling functionality. - -: 80: * - -: 81: * @param func_level: - -: 82: * 0 minimum functionality - -: 83: * 1 full functionality. Enable (turn on) the transmit and receive RF circuits for all supported radio access technologies. - -: 84: * For MTs supporting +CSRA, this equals the RATs indicated by the response of +CSRA=?. Current +CSRA setting is ignored. - -: 85: * It is not required that the MT transmit and receive RF circuits are in a disabled state for this setting to have effect. - -: 86: * 2 disable (turn off) MT transmit RF circuits only - -: 87: * 3 disable (turn off) MT receive RF circuits only - -: 88: * 4 disable (turn off) both MT transmit and receive RF circuits - -: 89: * - -: 90: * @remark See 3GPP TS 27.007 CFUN for more details - -: 91: * @remark Should not be called if MUX is enabled and started. If called then start-up sequence must be done again. - -: 92: * - -: 93: * @return zero on success - -: 94: */ - -: 95: virtual nsapi_error_t set_power_level(int func_level) = 0; - -: 96: - -: 97: /** Reset and wake-up cellular device. - -: 98: * - -: 99: * @remark Should not be called if MUX is enabled and started. If called then start-up sequence must be done again. - -: 100: * - -: 101: * @return zero on success - -: 102: */ - -: 103: virtual nsapi_error_t reset() = 0; - -: 104: - -: 105: /** Opt for power save setting on cellular device. If both parameters are zero then disables PSM. - -: 106: * - -: 107: * @remark See 3GPP TS 27.007 PSM for details - -: 108: * - -: 109: * @param periodic_time Timeout in seconds IoT subsystem is not expecting messaging - -: 110: * @param active_time Timeout in seconds IoT subsystem waits for response - -: 111: * @return zero on success - -: 112: */ - -: 113: virtual nsapi_error_t opt_power_save_mode(int periodic_time, int active_time) = 0; - -: 114: - -: 115: /** Opt for discontinuous reception on cellular device. - -: 116: * - -: 117: * @remark See 3GPP TS 27.007 eDRX for details. - -: 118: * - -: 119: * @param mode disable or enable the use of eDRX - -: 120: * @param act_type type of access technology - -: 121: * @param edrx_value requested edxr value. Extended DRX parameters information element. - -: 122: * - -: 123: * @return zero on success - -: 124: */ - -: 125: virtual nsapi_error_t opt_receive_period(int mode, EDRXAccessTechnology act_type, uint8_t edrx_value) = 0; - -: 126:}; - -: 127: - -: 128:} // namespace mbed - -: 129: - -: 130:#endif /* CELLULAR_API_CELLULARPOWER_H_ */ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_output.txt deleted file mode 100644 index 51f166e6d1..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_output.txt +++ /dev/null @@ -1,8 +0,0 @@ -File '../../../framework/AT/AT_CellularPower.cpp' -Lines executed:3.70% of 108 -Creating 'AT_CellularPower.cpp.gcov' - -File '../../../framework/API/CellularPower.h' -Lines executed:100.00% of 2 -Creating 'CellularPower.h.gcov' - diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_report.txt deleted file mode 100644 index 35ca96d012..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_report.txt +++ /dev/null @@ -1,2 +0,0 @@ -100.00% ../framework/API/CellularPower.h - 3.70% ../framework/AT/AT_CellularPower.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_report.txt.html deleted file mode 100644 index d0c680b9f1..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/gcov/gcov_report.txt.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - -
CoverageFile
100.00% ../framework/API/CellularPower.h
3.70% ../framework/AT/AT_CellularPower.cpp
diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/lib/libAT_CellularPower_unit.a b/features/cellular/UNITTESTS/at/at_cellularpower/lib/libAT_CellularPower_unit.a deleted file mode 100644 index 29a8d0063c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/lib/libAT_CellularPower_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.d deleted file mode 100644 index c8d81e09fb..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.d +++ /dev/null @@ -1,78 +0,0 @@ -objs/AT_CellularPower_unit/ATHandler_stub.o: \ - ../../stubs/ATHandler_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/platform.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.gcda deleted file mode 100644 index 1cb2dd0b9a..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.gcno deleted file mode 100644 index ad2c7670eb..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.o deleted file mode 100644 index 4dc7d35fc0..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/ATHandler_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.d deleted file mode 100644 index 35b68f591f..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.d +++ /dev/null @@ -1,53 +0,0 @@ -objs/AT_CellularPower_unit/AT_CellularBase_stub.o: \ - ../../stubs/AT_CellularBase_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/AT_CellularBase_stub.h \ - ../../../framework/AT/ATHandler.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/AT_CellularBase_stub.h: - -../../../framework/AT/ATHandler.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.gcda deleted file mode 100644 index e914ef251d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.gcno deleted file mode 100644 index 0de5817e45..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.o deleted file mode 100644 index 1507ad8e38..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularBase_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.d deleted file mode 100644 index 62dba05b67..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.d +++ /dev/null @@ -1,72 +0,0 @@ -objs/AT_CellularPower_unit/AT_CellularPower.o: \ - ../../../framework/AT/AT_CellularPower.cpp \ - ../../../framework/AT/AT_CellularPower.h \ - ../../../framework/API/CellularPower.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h \ - ../../../framework/common/CellularUtil.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../framework/AT/AT_CellularPower.h: - -../../../framework/API/CellularPower.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../../framework/common/CellularUtil.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.gcda deleted file mode 100644 index e44b7f6ed8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.gcno deleted file mode 100644 index 764bc9ff36..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.o deleted file mode 100644 index 03b82fa3f8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/AT_CellularPower.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.d deleted file mode 100644 index d46b4a1775..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.d +++ /dev/null @@ -1,5 +0,0 @@ -objs/AT_CellularPower_unit/CellularUtil_stub.o: \ - ../../stubs/CellularUtil_stub.cpp \ - ../../../framework/common/CellularUtil.h - -../../../framework/common/CellularUtil.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.gcda deleted file mode 100644 index 03619e1d3b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.gcno deleted file mode 100644 index ab749f978b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.o deleted file mode 100644 index b3ef4e9505..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/CellularUtil_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.d deleted file mode 100644 index 1c49e17b7c..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularPower_unit/EventQueue_stub.o: \ - ../../stubs/EventQueue_stub.cpp ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.gcda deleted file mode 100644 index fa0437195d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.gcno deleted file mode 100644 index fe10c80496..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.o deleted file mode 100644 index 511aae8934..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.d deleted file mode 100644 index 7cc11eade5..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/AT_CellularPower_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.gcda deleted file mode 100644 index 71294901c8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.gcno deleted file mode 100644 index 832dbf2c34..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.o deleted file mode 100644 index 875d3347c9..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.d deleted file mode 100644 index bb9d3917f3..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/AT_CellularPower_unit/at_cellularpowertest.o: \ - at_cellularpowertest.cpp test_at_cellularpower.h - -test_at_cellularpower.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.gcda deleted file mode 100644 index 3688e36d33..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.gcno deleted file mode 100644 index 448da909c6..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.o deleted file mode 100644 index 063645cc72..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/at_cellularpowertest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.d deleted file mode 100644 index d3d67c5037..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/AT_CellularPower_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.gcda deleted file mode 100644 index b5ae36a600..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.gcno deleted file mode 100644 index fc4b08b67a..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.o deleted file mode 100644 index 22bdd942bb..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.d deleted file mode 100644 index 302b4fa610..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/AT_CellularPower_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.gcda deleted file mode 100644 index 5a2381f266..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.gcno deleted file mode 100644 index bb63620b9c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.o deleted file mode 100644 index 569ae210b8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.d b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.d deleted file mode 100644 index ac9823d9d3..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.d +++ /dev/null @@ -1,112 +0,0 @@ -objs/AT_CellularPower_unit/test_at_cellularpower.o: \ - test_at_cellularpower.cpp test_at_cellularpower.h \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/AT/ATHandler.h \ - ../../../framework/AT/AT_CellularPower.h \ - ../../../framework/API/CellularPower.h ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h - -test_at_cellularpower.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/AT/ATHandler.h: - -../../../framework/AT/AT_CellularPower.h: - -../../../framework/API/CellularPower.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.gcda b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.gcda deleted file mode 100644 index 673ee4225d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.gcno b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.gcno deleted file mode 100644 index 0fdc85b87f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.o b/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.o deleted file mode 100644 index 94b8fc0515..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularpower/objs/AT_CellularPower_unit/test_at_cellularpower.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/AT_CellularSIM_unit_tests b/features/cellular/UNITTESTS/at/at_cellularsim/AT_CellularSIM_unit_tests deleted file mode 100755 index 94f6db15bd..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/AT_CellularSIM_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/AT_CellularSIM_unit_tests.txt b/features/cellular/UNITTESTS/at/at_cellularsim/AT_CellularSIM_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/cpputest_AT_CellularSIM.xml b/features/cellular/UNITTESTS/at/at_cellularsim/cpputest_AT_CellularSIM.xml deleted file mode 100644 index 7797022eb6..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/cpputest_AT_CellularSIM.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/AT_CellularSIM.cpp.gcov b/features/cellular/UNITTESTS/at/at_cellularsim/gcov/AT_CellularSIM.cpp.gcov deleted file mode 100644 index ba5b9a5c7c..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/AT_CellularSIM.cpp.gcov +++ /dev/null @@ -1,119 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularSIM.cpp - -: 0:Graph:objs/AT_CellularSIM_unit/AT_CellularSIM.gcno - -: 0:Data:objs/AT_CellularSIM_unit/AT_CellularSIM.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include "AT_CellularSIM.h" - -: 19:#include "CellularLog.h" - -: 20: - -: 21:using namespace mbed; - -: 22: - 1: 23:AT_CellularSIM::AT_CellularSIM(ATHandler &at) : AT_CellularBase(at) - -: 24:{ - 1: 25:} - -: 26: - 2: 27:AT_CellularSIM::~AT_CellularSIM() - -: 28:{ - 2: 29:} - -: 30: - #####: 31:nsapi_error_t AT_CellularSIM::get_sim_state(SimState &state) - -: 32:{ - -: 33: char simstr[16]; - #####: 34: _at.lock(); - #####: 35: _at.flush(); - #####: 36: _at.cmd_start("AT+CPIN?"); - #####: 37: _at.cmd_stop(); - #####: 38: _at.resp_start("+CPIN:"); - #####: 39: ssize_t len = _at.read_string(simstr, sizeof (simstr)); - #####: 40: if (len != -1) { - #####: 41: if (len >= 5 && memcmp(simstr, "READY", 5) == 0) { - #####: 42: state = SimStateReady; - #####: 43: } else if (len >= 6 && memcmp(simstr, "SIM PIN", 6) == 0) { - #####: 44: state = SimStatePinNeeded; - #####: 45: } else if (len >= 6 && memcmp(simstr, "SIM PUK", 6) == 0) { - #####: 46: state = SimStatePukNeeded; - -: 47: } else { - #####: 48: simstr[len] = '\0'; - #####: 49: log_error("Unknown SIM state %s", simstr); - #####: 50: state = SimStateUnknown; - -: 51: } - -: 52: } else { - -: 53: log_warn("SIM not readable."); - #####: 54: state = SimStateUnknown; // SIM may not be ready yet or +CPIN may be unsupported command - -: 55: } - #####: 56: _at.resp_stop(); - #####: 57: return _at.unlock_return_error(); - -: 58:} - -: 59: - #####: 60:nsapi_error_t AT_CellularSIM::set_pin(const char *sim_pin) - -: 61:{ - -: 62: // if SIM is already in ready state then settings the PIN - -: 63: // will return error so let's check the state before settings the pin. - -: 64: SimState state; - #####: 65: if (get_sim_state(state) == NSAPI_ERROR_OK && state == SimStateReady) { - #####: 66: return NSAPI_ERROR_OK; - -: 67: } - -: 68: - #####: 69: _at.lock(); - #####: 70: _at.cmd_start("AT+CPIN="); - #####: 71: _at.write_string(sim_pin); - #####: 72: _at.cmd_stop(); - #####: 73: _at.resp_start(); - #####: 74: _at.resp_stop(); - #####: 75: return _at.unlock_return_error(); - -: 76:} - -: 77: - #####: 78:nsapi_error_t AT_CellularSIM::change_pin(const char *sim_pin, const char *new_pin) - -: 79:{ - #####: 80: _at.lock(); - #####: 81: _at.cmd_start("AT+CPWD="); - #####: 82: _at.write_string("SC"); - #####: 83: _at.write_string(sim_pin); - #####: 84: _at.write_string(new_pin); - #####: 85: _at.cmd_stop(); - #####: 86: _at.resp_start(); - #####: 87: _at.resp_stop(); - #####: 88: return _at.unlock_return_error(); - -: 89:} - -: 90: - #####: 91:nsapi_error_t AT_CellularSIM::set_pin_query(const char *sim_pin, bool query_pin) - -: 92:{ - #####: 93: _at.lock(); - #####: 94: if (query_pin) { - -: 95: /* use the SIM locked */ - #####: 96: _at.cmd_start("AT+CLCK="); - #####: 97: _at.write_string("SC"); - #####: 98: _at.write_int(1); - #####: 99: _at.write_string(sim_pin); - #####: 100: _at.cmd_stop(); - #####: 101: _at.resp_start(); - #####: 102: _at.resp_stop(); - -: 103: } else { - -: 104: /* use the SIM unlocked */ - #####: 105: _at.cmd_start("AT+CLCK="); - #####: 106: _at.write_string("SC"); - #####: 107: _at.write_int(0); - #####: 108: _at.write_string(sim_pin); - #####: 109: _at.cmd_stop(); - #####: 110: _at.resp_start(); - #####: 111: _at.resp_stop(); - -: 112: } - #####: 113: return _at.unlock_return_error(); - -: 114:} diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/CellularSIM.h.gcov b/features/cellular/UNITTESTS/at/at_cellularsim/gcov/CellularSIM.h.gcov deleted file mode 100644 index 27fcd704b6..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/CellularSIM.h.gcov +++ /dev/null @@ -1,90 +0,0 @@ - -: 0:Source:../../../framework/API/CellularSIM.h - -: 0:Graph:objs/AT_CellularSIM_unit/AT_CellularSIM.gcno - -: 0:Data:objs/AT_CellularSIM_unit/AT_CellularSIM.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef CELLULAR_SIM_H_ - -: 19:#define CELLULAR_SIM_H_ - -: 20: - -: 21:#include "nsapi_types.h" - -: 22: - -: 23:namespace mbed { - -: 24: - -: 25:const int MAX_SIM_READY_WAITING_TIME = 30; - -: 26: - -: 27:/** - -: 28: * Class CellularSIM - -: 29: * - -: 30: * An abstract interface for SIM card handling. - -: 31: */ - 1: 32:class CellularSIM - -: 33:{ - -: 34:protected: - -: 35: // friend of CellularDevice so that it's the only way to close/delete this class. - -: 36: friend class CellularDevice; - -: 37: - -: 38: /** - -: 39: * virtual Destructor - -: 40: */ - 1: 41: virtual ~CellularSIM() {}; - -: 42: - -: 43:public: - -: 44: /* enumeration for possible SIM states */ - -: 45: enum SimState { - -: 46: SimStateReady = 0, - -: 47: SimStatePinNeeded, - -: 48: SimStatePukNeeded, - -: 49: SimStateUnknown - -: 50: }; - -: 51: - -: 52: /** Open the SIM card by setting the pin code for SIM. - -: 53: * - -: 54: * @param sim_pin PIN for the SIM card - -: 55: * @return zero on success - -: 56: */ - -: 57: virtual nsapi_error_t set_pin(const char *sim_pin) = 0; - -: 58: - -: 59: /**Change sim pin code. - -: 60: * - -: 61: * @param sim_pin Current PIN for sim - -: 62: * @param new_pin New PIN for sim - -: 63: * @return zero on success - -: 64: */ - -: 65: virtual nsapi_error_t change_pin(const char *sim_pin, const char *new_pin) = 0; - -: 66: - -: 67: /** Change is pin query needed after boot - -: 68: * - -: 69: * @param sim_pin Valid PIN for SIM card - -: 70: * @param query_pin False is PIN query not needed, True if PIN query needed after boot. - -: 71: * @return zero on success - -: 72: */ - -: 73: virtual nsapi_error_t set_pin_query(const char *sim_pin, bool query_pin) = 0; - -: 74: - -: 75: /** Get sim card's state - -: 76: * - -: 77: * @param state current state of SIM - -: 78: * @return zero on success - -: 79: */ - -: 80: virtual nsapi_error_t get_sim_state(SimState &state) = 0; - -: 81:}; - -: 82: - -: 83:} // namespace mbed - -: 84: - -: 85:#endif // CELLULAR_SIM_H_ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_output.txt deleted file mode 100644 index 5bcc3845ce..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_output.txt +++ /dev/null @@ -1,12 +0,0 @@ -File '../../../framework/AT/AT_CellularSIM.cpp' -Lines executed:6.45% of 62 -Creating 'AT_CellularSIM.cpp.gcov' - -File '../../../framework/API/CellularSIM.h' -Lines executed:100.00% of 2 -Creating 'CellularSIM.h.gcov' - -File '../../../../../platform/mbed_debug.h' -Lines executed:0.00% of 2 -Creating 'mbed_debug.h.gcov' - diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_report.txt deleted file mode 100644 index d2de0153db..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_report.txt +++ /dev/null @@ -1,3 +0,0 @@ - 0.00% ../platform/mbed_debug.h -100.00% ../framework/API/CellularSIM.h - 6.45% ../framework/AT/AT_CellularSIM.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_report.txt.html deleted file mode 100644 index e947071c36..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/gcov_report.txt.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - -
CoverageFile
0.00% ../platform/mbed_debug.h
100.00% ../framework/API/CellularSIM.h
6.45% ../framework/AT/AT_CellularSIM.cpp
diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/mbed_debug.h.gcov b/features/cellular/UNITTESTS/at/at_cellularsim/gcov/mbed_debug.h.gcov deleted file mode 100644 index 0a5fd00fff..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/gcov/mbed_debug.h.gcov +++ /dev/null @@ -1,84 +0,0 @@ - -: 0:Source:../../../../../platform/mbed_debug.h - -: 0:Graph:objs/AT_CellularSIM_unit/AT_CellularSIM.gcno - -: 0:Data:objs/AT_CellularSIM_unit/AT_CellularSIM.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1: - -: 2:/** \addtogroup platform */ - -: 3:/** @{*/ - -: 4:/** - -: 5: * \defgroup platform_debug Debug functions - -: 6: * @{ - -: 7: */ - -: 8: - -: 9:/* mbed Microcontroller Library - -: 10: * Copyright (c) 2006-2013 ARM Limited - -: 11: * - -: 12: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 13: * you may not use this file except in compliance with the License. - -: 14: * You may obtain a copy of the License at - -: 15: * - -: 16: * http://www.apache.org/licenses/LICENSE-2.0 - -: 17: * - -: 18: * Unless required by applicable law or agreed to in writing, software - -: 19: * distributed under the License is distributed on an "AS IS" BASIS, - -: 20: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 21: * See the License for the specific language governing permissions and - -: 22: * limitations under the License. - -: 23: */ - -: 24:#ifndef MBED_DEBUG_H - -: 25:#define MBED_DEBUG_H - -: 26:#if DEVICE_STDIO_MESSAGES - -: 27:#include - -: 28:#include - -: 29:#endif - -: 30: - -: 31:#ifdef __cplusplus - -: 32:extern "C" { - -: 33:#endif - -: 34: - -: 35: - -: 36:/** Output a debug message - -: 37: * - -: 38: * @param format printf-style format string, followed by variables - -: 39: */ - #####: 40:static inline void debug(const char *format, ...) { - -: 41:#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) - -: 42: va_list args; - -: 43: va_start(args, format); - -: 44: vfprintf(stderr, format, args); - -: 45: va_end(args); - -: 46:#endif - #####: 47:} - -: 48: - -: 49: - -: 50:/** Conditionally output a debug message - -: 51: * - -: 52: * NOTE: If the condition is constant false (== 0) and the compiler optimization - -: 53: * level is greater than 0, then the whole function will be compiled away. - -: 54: * - -: 55: * @param condition output only if condition is true (!= 0) - -: 56: * @param format printf-style format string, followed by variables - -: 57: */ - -: 58:static inline void debug_if(int condition, const char *format, ...) { - -: 59:#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) - -: 60: if (condition) { - -: 61: va_list args; - -: 62: va_start(args, format); - -: 63: vfprintf(stderr, format, args); - -: 64: va_end(args); - -: 65: } - -: 66:#endif - -: 67:} - -: 68: - -: 69: - -: 70:#ifdef __cplusplus - -: 71:} - -: 72:#endif - -: 73: - -: 74:#endif - -: 75: - -: 76:/**@}*/ - -: 77: - -: 78:/**@}*/ - -: 79: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/lib/libAT_CellularSIM_unit.a b/features/cellular/UNITTESTS/at/at_cellularsim/lib/libAT_CellularSIM_unit.a deleted file mode 100644 index e433cfb5ce..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/lib/libAT_CellularSIM_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.d deleted file mode 100644 index 5826c4e342..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.d +++ /dev/null @@ -1,77 +0,0 @@ -objs/AT_CellularSIM_unit/ATHandler_stub.o: ../../stubs/ATHandler_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/platform.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.gcda deleted file mode 100644 index 4dc3a47741..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.gcno deleted file mode 100644 index d312561a8d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.o deleted file mode 100644 index c0074dc345..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/ATHandler_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.d deleted file mode 100644 index 73fca9907e..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.d +++ /dev/null @@ -1,53 +0,0 @@ -objs/AT_CellularSIM_unit/AT_CellularBase_stub.o: \ - ../../stubs/AT_CellularBase_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/AT_CellularBase_stub.h \ - ../../../framework/AT/ATHandler.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/AT_CellularBase_stub.h: - -../../../framework/AT/ATHandler.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.gcda deleted file mode 100644 index 77cabee0a8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.gcno deleted file mode 100644 index 23a1ed08d4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.o deleted file mode 100644 index 0dfa6fae45..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularBase_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.d deleted file mode 100644 index 93c109fdbb..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.d +++ /dev/null @@ -1,69 +0,0 @@ -objs/AT_CellularSIM_unit/AT_CellularSIM.o: \ - ../../../framework/AT/AT_CellularSIM.cpp \ - ../../../framework/AT/AT_CellularSIM.h \ - ../../../framework/API/CellularSIM.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../framework/AT/AT_CellularSIM.h: - -../../../framework/API/CellularSIM.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.gcda deleted file mode 100644 index d51efe53e7..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.gcno deleted file mode 100644 index 2f939f4d42..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.o deleted file mode 100644 index a30896cc6e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/AT_CellularSIM.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.d deleted file mode 100644 index db5f724c0a..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.d +++ /dev/null @@ -1,5 +0,0 @@ -objs/AT_CellularSIM_unit/CellularUtil_stub.o: \ - ../../stubs/CellularUtil_stub.cpp \ - ../../../framework/common/CellularUtil.h - -../../../framework/common/CellularUtil.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.gcda deleted file mode 100644 index 74978e7c96..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.gcno deleted file mode 100644 index cd7edbbadc..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.o deleted file mode 100644 index 48f6b352c4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/CellularUtil_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.d deleted file mode 100644 index a0173a86a7..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularSIM_unit/EventQueue_stub.o: \ - ../../stubs/EventQueue_stub.cpp ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.gcda deleted file mode 100644 index 3344911221..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.gcno deleted file mode 100644 index c8ee2eb728..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.o deleted file mode 100644 index 07afde8a56..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.d deleted file mode 100644 index e6041997f6..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/AT_CellularSIM_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.gcda deleted file mode 100644 index cb79c2e175..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.gcno deleted file mode 100644 index 94d0ec9c44..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.o deleted file mode 100644 index 3a1d648704..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.d deleted file mode 100644 index 26649926e4..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/AT_CellularSIM_unit/at_cellularsimtest.o: at_cellularsimtest.cpp \ - test_at_cellularsim.h - -test_at_cellularsim.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.gcda deleted file mode 100644 index 013496f5ac..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.gcno deleted file mode 100644 index a9a61e726f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.o deleted file mode 100644 index b302ede0e1..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/at_cellularsimtest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.d deleted file mode 100644 index 4fdd4b4d8c..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/AT_CellularSIM_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.gcda deleted file mode 100644 index fdd998ae97..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.gcno deleted file mode 100644 index 8ef51af549..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.o deleted file mode 100644 index e967765c71..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.d deleted file mode 100644 index 7d76214de7..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/AT_CellularSIM_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.gcda deleted file mode 100644 index 882379a4d2..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.gcno deleted file mode 100644 index aca99665d5..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.o deleted file mode 100644 index b713de6d06..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.d deleted file mode 100644 index 58ac98e519..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.d +++ /dev/null @@ -1,120 +0,0 @@ -objs/AT_CellularSIM_unit/test_at_cellularsim.o: test_at_cellularsim.cpp \ - test_at_cellularsim.h ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/AT/ATHandler.h ../../../framework/AT/AT_CellularSIM.h \ - ../../../framework/API/CellularSIM.h ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -test_at_cellularsim.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/AT/ATHandler.h: - -../../../framework/AT/AT_CellularSIM.h: - -../../../framework/API/CellularSIM.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.gcda deleted file mode 100644 index cec447d5d3..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.gcno deleted file mode 100644 index d16d96fdc8..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.o deleted file mode 100644 index b15df41eea..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/test_at_cellularsim.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.d b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.d deleted file mode 100644 index 11a67f5785..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.d +++ /dev/null @@ -1,9 +0,0 @@ -objs/AT_CellularSIM_unit/us_ticker_stub.o: ../../stubs/us_ticker_stub.cpp \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.gcda deleted file mode 100644 index 1fcab1aedf..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.gcno deleted file mode 100644 index aefd0c3956..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.o b/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.o deleted file mode 100644 index f661f0d345..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsim/objs/AT_CellularSIM_unit/us_ticker_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/AT_CellularSMS_unit_tests b/features/cellular/UNITTESTS/at/at_cellularsms/AT_CellularSMS_unit_tests deleted file mode 100755 index 14eab1a6fd..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/AT_CellularSMS_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/AT_CellularSMS_unit_tests.txt b/features/cellular/UNITTESTS/at/at_cellularsms/AT_CellularSMS_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/cpputest_AT_CellularSMS.xml b/features/cellular/UNITTESTS/at/at_cellularsms/cpputest_AT_CellularSMS.xml deleted file mode 100644 index f5ebd5f2eb..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/cpputest_AT_CellularSMS.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/AT_CellularSMS.cpp.gcov b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/AT_CellularSMS.cpp.gcov deleted file mode 100644 index 8f0fd60cc4..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/AT_CellularSMS.cpp.gcov +++ /dev/null @@ -1,1308 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularSMS.cpp - -: 0:Graph:objs/AT_CellularSMS_unit/AT_CellularSMS.gcno - -: 0:Data:objs/AT_CellularSMS_unit/AT_CellularSMS.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include - -: 19:#include - -: 20:#include "mbed_wait_api.h" - -: 21:#include "AT_CellularSMS.h" - -: 22:#include "CellularUtil.h" - -: 23:#include "CellularLog.h" - -: 24: - -: 25:using namespace mbed_cellular_util; - -: 26:using namespace mbed; - -: 27:using namespace std; - -: 28: - -: 29:#define CTRL_Z "\x1a" - -: 30:#define ESC "\x1b" - -: 31: - -: 32:const uint8_t SMS_STATUS_SIZE = 12 + 1; - -: 33:const uint8_t FIRST_OCTET_DELIVER_SUBMIT = 17; - -: 34:const uint8_t TP_VALIDITY_PERIOD_24_HOURS = 167; - -: 35:const uint8_t TP_PROTOCOL_IDENTIFIER = 0; - -: 36:const uint8_t SMS_DATA_CODING_SCHEME = 0; - -: 37: - -: 38:const uint8_t SMS_MAX_8BIT_CONCATENATED_SINGLE_SMS_SIZE = 134; - -: 39:const uint8_t SMS_MAX_GSM7_CONCATENATED_SINGLE_SMS_SIZE = 153; - -: 40:#define NVAM '?' // Not Valid ascii, ISO-8859-1 mark - -: 41: - -: 42:// mapping table from 7-bit GSM to ascii (ISO-8859-1) - -: 43:static const int gsm_to_ascii[] = { - -: 44: 64, // 0 - -: 45: 163, // 1 - -: 46: 36, // 2 - -: 47: 165, // 3 - -: 48: 232, // 4 - -: 49: 233, // 5 - -: 50: 249, // 6 - -: 51: 236, // 7 - -: 52: 242, // 8 - -: 53: 199, // 9 - -: 54: 10, // 10 - -: 55: 216, // 11 - -: 56: 248, // 12 - -: 57: 13, // 13 - -: 58: 197, // 14 - -: 59: 229, // 15 - -: 60: NVAM, // 16 - -: 61: 95, // 17 - -: 62: NVAM, // 18 - -: 63: NVAM, // 19 - -: 64: NVAM, // 20 - -: 65: NVAM, // 21 - -: 66: NVAM, // 22 - -: 67: NVAM, // 23 - -: 68: NVAM, // 24 - -: 69: NVAM, // 25 - -: 70: NVAM, // 26 - -: 71: 27, // 27 - -: 72: 198, // 28 - -: 73: 230, // 29 - -: 74: 223, // 30 - -: 75: 201, // 31 - -: 76: 32, // 32 - -: 77: 33, // 33 - -: 78: 34, // 34 - -: 79: 35, // 35 - -: 80: 164, // 36 - -: 81: 37, // 37 - -: 82: 38, // 38 - -: 83: 39, // 39 - -: 84: 40, // 40 - -: 85: 41, // 41 - -: 86: 42, // 42 - -: 87: 43, // 43 - -: 88: 44, // 44 - -: 89: 45, // 45 - -: 90: 46, // 46 - -: 91: 47, // 47 - -: 92: 48, // 48 - -: 93: 49, // 49 - -: 94: 50, // 50 - -: 95: 51, // 51 - -: 96: 52, // 52 - -: 97: 53, // 53 - -: 98: 54, // 54 - -: 99: 55, // 55 - -: 100: 56, // 56 - -: 101: 57, // 57 - -: 102: 58, // 58 - -: 103: 59, // 59 - -: 104: 60, // 60 - -: 105: 61, // 61 - -: 106: 62, // 62 - -: 107: 63, // 63 - -: 108: 161, // 64 - -: 109: 65, // 65 - -: 110: 66, // 66 - -: 111: 67, // 67 - -: 112: 68, // 68 - -: 113: 69, // 69 - -: 114: 70, // 70 - -: 115: 71, // 71 - -: 116: 72, // 72 - -: 117: 73, // 73 - -: 118: 74, // 74 - -: 119: 75, // 75 - -: 120: 76, // 76 - -: 121: 77, // 77 - -: 122: 78, // 78 - -: 123: 79, // 79 - -: 124: 80, // 80 - -: 125: 81, // 81 - -: 126: 82, // 82 - -: 127: 83, // 83 - -: 128: 84, // 84 - -: 129: 85, // 85 - -: 130: 86, // 86 - -: 131: 87, // 87 - -: 132: 88, // 88 - -: 133: 89, // 89 - -: 134: 90, // 90 - -: 135: 196, // 91 - -: 136: 214, // 92 - -: 137: 209, // 93 - -: 138: 220, // 94 - -: 139: 167, // 95 - -: 140: 191, // 96 - -: 141: 97, // 97 - -: 142: 98, // 98 - -: 143: 99, // 99 - -: 144: 100, // 100 - -: 145: 101, // 101 - -: 146: 102, // 102 - -: 147: 103, // 103 - -: 148: 104, // 104 - -: 149: 105, // 105 - -: 150: 106, // 106 - -: 151: 107, // 107 - -: 152: 108, // 108 - -: 153: 109, // 109 - -: 154: 110, // 110 - -: 155: 111, // 111 - -: 156: 112, // 112 - -: 157: 113, // 113 - -: 158: 114, // 114 - -: 159: 115, // 115 - -: 160: 116, // 116 - -: 161: 117, // 117 - -: 162: 118, // 118 - -: 163: 119, // 119 - -: 164: 120, // 120 - -: 165: 121, // 121 - -: 166: 122, // 122 - -: 167: 228, // 123 - -: 168: 246, // 124 - -: 169: 241, // 125 - -: 170: 252, // 126 - -: 171: 224 // 127 - -: 172:}; - -: 173: - -: 174:const int GSM_TO_ASCII_TABLE_SIZE = sizeof(gsm_to_ascii)/sizeof(gsm_to_ascii[0]); - -: 175: - 1: 176:AT_CellularSMS::AT_CellularSMS(ATHandler &at) : AT_CellularBase(at), _cb(0), _mode(CellularSMSMmodeText), - 1: 177: _use_8bit_encoding(false), _sim_wait_time(0), _sms_message_ref_number(1), _sms_info(NULL) - -: 178:{ - -: 179: /* URCs, handled out of band */ - 1: 180: _at.set_urc_handler("+CMTI: ", callback(this, &AT_CellularSMS::cmti_urc)); - 1: 181: _at.set_urc_handler("+CMT: ", callback(this, &AT_CellularSMS::cmt_urc)); - 1: 182:} - -: 183: - 2: 184:AT_CellularSMS::~AT_CellularSMS() - -: 185:{ - 2: 186:} - -: 187: - #####: 188:void AT_CellularSMS::cmt_urc() - -: 189:{ - -: 190: log_debug("CMT_URC called"); - -: 191: //+CMT: ,[],[,,,,,,,] - #####: 192: _at.consume_to_stop_tag(); - -: 193: // call user defined callback function - #####: 194: if (_cb) { - #####: 195: _cb(); - -: 196: } else { - -: 197: log_warn("cmt_urc, no user defined callback for receiving sms!"); - -: 198: } - #####: 199:} - -: 200: - #####: 201:void AT_CellularSMS::cmti_urc() - -: 202:{ - -: 203: //+CMTI: ,, - -: 204: log_debug("CMTI_URC called"); - -: 205: // call user defined callback function - #####: 206: if (_cb) { - #####: 207: _cb(); - -: 208: } else { - -: 209: log_warn("cmti_urc, no user defined callback for receiving sms!"); - -: 210: } - #####: 211:} - -: 212: - #####: 213:nsapi_error_t AT_CellularSMS::set_cnmi() - -: 214:{ - #####: 215: _at.lock(); - #####: 216: _at.cmd_start("AT+CNMI=2,1"); - #####: 217: _at.cmd_stop(); - #####: 218: _at.resp_start(); - #####: 219: _at.resp_stop(); - #####: 220: return _at.unlock_return_error(); - -: 221:} - -: 222: - #####: 223:nsapi_error_t AT_CellularSMS::set_cmgf(int msg_format) - -: 224:{ - #####: 225: _at.lock(); - #####: 226: _at.cmd_start("AT+CMGF="); - #####: 227: _at.write_int(msg_format); - #####: 228: _at.cmd_stop(); - #####: 229: _at.resp_start(); - #####: 230: _at.resp_stop(); - #####: 231: return _at.unlock_return_error(); - -: 232:} - -: 233: - #####: 234:nsapi_error_t AT_CellularSMS::set_csmp(int fo, int vp, int pid, int dcs) - -: 235:{ - #####: 236: _at.lock(); - #####: 237: _at.cmd_start("AT+CSMP="); - #####: 238: _at.write_int(fo); - #####: 239: _at.write_int(vp); - #####: 240: _at.write_int(pid); - #####: 241: _at.write_int(dcs); - #####: 242: _at.cmd_stop(); - #####: 243: _at.resp_start(); - #####: 244: _at.resp_stop(); - #####: 245: return _at.unlock_return_error(); - -: 246:} - -: 247: - #####: 248:nsapi_error_t AT_CellularSMS::set_csdh(int show_header) - -: 249:{ - #####: 250: _at.lock(); - #####: 251: _at.cmd_start("AT+CSDH="); - #####: 252: _at.write_int(show_header); - #####: 253: _at.cmd_stop(); - #####: 254: _at.resp_start(); - #####: 255: _at.resp_stop(); - #####: 256: return _at.unlock_return_error(); - -: 257:} - -: 258: - #####: 259:nsapi_error_t AT_CellularSMS::initialize(CellularSMSMmode mode) - -: 260:{ - #####: 261: _at.lock(); - #####: 262: set_cnmi(); //set new SMS indication - #####: 263: set_cmgf(mode); //set message format/PDU - -: 264: - #####: 265: if (mode == CellularSMSMmodeText) { - -: 266: set_csmp(FIRST_OCTET_DELIVER_SUBMIT, TP_VALIDITY_PERIOD_24_HOURS, TP_PROTOCOL_IDENTIFIER, - #####: 267: SMS_DATA_CODING_SCHEME); //set Set Text Mode Parameters(default values for SMS-SUBMIT and RECEIVE) - #####: 268: set_csdh(1);//set header extra info as it's needed - -: 269: } - -: 270: - #####: 271: _mode = mode; - -: 272: - #####: 273: return _at.unlock_return_error(); - -: 274:} - -: 275: - #####: 276:void AT_CellularSMS::set_extra_sim_wait_time(int sim_wait_time) - -: 277:{ - #####: 278: _sim_wait_time = sim_wait_time; - #####: 279:} - -: 280: - #####: 281:char* AT_CellularSMS::create_pdu(const char* phone_number, const char* message, uint8_t message_length, uint8_t msg_parts, - -: 282: uint8_t msg_part_number) - -: 283:{ - #####: 284: int totalPDULength = 0; - #####: 285: int number_len = strlen(phone_number); - -: 286: - #####: 287: totalPDULength += number_len; - #####: 288: if (number_len&0x01) {// if phone number length is not even length we must pad it and so +1 - #####: 289: totalPDULength += 1; - -: 290: } - -: 291: - #####: 292: totalPDULength += 16; // all other than phone number and message length - #####: 293: if (msg_parts > 1) {// add more space for UDH - #####: 294: totalPDULength += 12; - -: 295: } - -: 296: // there might be need for padding so some more space - #####: 297: totalPDULength +=2; - -: 298: - -: 299: // message 7-bit padded and it will be converted to hex so it will take twice as much space - #####: 300: totalPDULength += (message_length - (message_length/8))*2; - -: 301: - #####: 302: char* pdu = (char*)calloc(totalPDULength, sizeof(char)); - #####: 303: if (!pdu) { - #####: 304: return NULL; - -: 305: } - -: 306: - #####: 307: int x = 0; - -: 308: // See more how to create PDU from 3GPP specification 23040 - -: 309: // first two define that we use service center number which is set with +CSCA - #####: 310: pdu[x++] = '0'; - #####: 311: pdu[x++] = '0'; - -: 312: // First Octet of the TPDU. 41 means SMS SUBMIT, no validity period, no status report, use User Data Header. - -: 313: // 01 means SMS SUBMIT, no validity period, no status report, NO User Data Header. - #####: 314: if (msg_parts > 1) { // concatenated, must use UDH - #####: 315: pdu[x++] = '4'; - -: 316: } else { - #####: 317: pdu[x++] = '0'; - -: 318: } - #####: 319: pdu[x++] = '1'; - -: 320: // assign a message reference automatically. We have defined TP-RD bit as 0 so duplicates are not rejected. - #####: 321: pdu[x++] = '0'; - #####: 322: pdu[x++] = '0'; - -: 323: // [6] and [7] Length of the Destination Phone Number - #####: 324: int_to_hex_str(number_len, pdu+x); - #####: 325: x+=2; - -: 326: // Type of the Destination Phone Number - #####: 327: pdu[x++] = '8'; - #####: 328: pdu[x++] = '1'; - -: 329: - -: 330: // phone number as reverse nibble encoded - #####: 331: int i = 0; - #####: 332: for (; i < number_len; i += 2) { - #####: 333: if (i+1 == number_len) { - #####: 334: pdu[x++] = 'f'; - -: 335: } else { - #####: 336: pdu[x++] = phone_number[i+1]; - -: 337: } - #####: 338: pdu[x++] = phone_number[i]; - -: 339: } - -: 340: - -: 341: // Protocol Identifier - #####: 342: pdu[x++] = '0'; - #####: 343: pdu[x++] = '0'; - -: 344: // Data Coding Scheme, GSM 7-bit default alphabet = '00', 8-bit '04' - #####: 345: pdu[x++] = '0'; - -: 346: - #####: 347: if (_use_8bit_encoding) { - #####: 348: pdu[x++] = '4'; - -: 349: } else { - #####: 350: pdu[x++] = '0'; - -: 351: } - -: 352: - -: 353: // possible to use 16 bit identifier, can't be defined yet from outside - #####: 354: bool use_16_bit_identifier = false; - #####: 355: uint8_t udhlen = 0; - -: 356: // Length can be update after we have created PDU, store position for later use. - #####: 357: int lengthPos = x; - #####: 358: x +=2; - -: 359: - #####: 360: int paddingBits = 0; - #####: 361: if (msg_parts > 1) { // concatenated, must use UDH - -: 362: // user data header length in chars - #####: 363: pdu[x++] = '0'; - #####: 364: if (use_16_bit_identifier) { - #####: 365: udhlen = 7; // udh length in chars (6) + udhl length in chars - #####: 366: pdu[x++] = '6'; - -: 367: } else { - #####: 368: udhlen = 6; // udh length in chars (5) + udhl length in chars - #####: 369: pdu[x++] = '5'; - -: 370: } - -: 371: // Information element identifier - #####: 372: pdu[x++] = '0'; - #####: 373: if (use_16_bit_identifier) { - #####: 374: pdu[x++] = '8'; - -: 375: } else { - #####: 376: pdu[x++] = '0'; - -: 377: } - -: 378: // Information element data length - #####: 379: pdu[x++] = '0'; - #####: 380: if (use_16_bit_identifier) { - #####: 381: pdu[x++] = '4'; - -: 382: } else { - #####: 383: pdu[x++] = '3'; - -: 384: } - -: 385: // A reference number (must be the same for all parts of the same larger messages) - #####: 386: int_to_hex_str(_sms_message_ref_number&0xFF, pdu+x); - #####: 387: x +=2; - #####: 388: if (use_16_bit_identifier) { - #####: 389: int_to_hex_str((_sms_message_ref_number>>16)&0xFF, pdu+x); - #####: 390: x +=2; - -: 391: } - -: 392: // How many parts does this message have? - #####: 393: int_to_hex_str(msg_parts, pdu+x); - #####: 394: x +=2; - -: 395: // this is a part number - #####: 396: int_to_hex_str(msg_part_number, pdu+x); - #####: 397: x +=2; - -: 398: - -: 399: // if there is padding bits then udhlen is octet bigger as we need to keep septet boundary - #####: 400: paddingBits = (udhlen * 8 ) % 7; - #####: 401: if (paddingBits) { - #####: 402: paddingBits = 7 - paddingBits; - #####: 403: udhlen += 1; - -: 404: } - -: 405: } - -: 406: - #####: 407: if (_use_8bit_encoding) { - #####: 408: char_str_to_hex_str(message, message_length, pdu+x); - -: 409: } else { - -: 410: // we might need to send zero length sms - #####: 411: if (message_length) { - #####: 412: if (pack_7_bit_gsm_and_hex(message, message_length, pdu+x, paddingBits) == 0) { - #####: 413: free(pdu); - #####: 414: return NULL; - -: 415: } - -: 416: } - -: 417: } - -: 418: - -: 419: // now we know the correct length of the UDL (User Data Length) - #####: 420: int_to_hex_str(message_length + udhlen, pdu+lengthPos); - -: 421: - #####: 422: return pdu; - -: 423:} - -: 424: - #####: 425:nsapi_size_or_error_t AT_CellularSMS::send_sms(const char* phone_number, const char* message, int msg_len) - -: 426:{ - #####: 427: int single_sms_max_length = _use_8bit_encoding ? SMS_MAX_SIZE_8BIT_SINGLE_SMS_SIZE : - #####: 428: SMS_MAX_SIZE_GSM7_SINGLE_SMS_SIZE; - #####: 429: if ((_mode == CellularSMSMmodeText && msg_len > single_sms_max_length) || !phone_number) { - #####: 430: return NSAPI_ERROR_PARAMETER; - -: 431: } - -: 432: - #####: 433: _at.lock(); - -: 434: - #####: 435: int write_size = 0; - #####: 436: int remove_plus_sign = (phone_number[0] == '+') ? 1 : 0; - -: 437: - #####: 438: wait_ms(_sim_wait_time); - -: 439: - #####: 440: if (_mode == CellularSMSMmodeText) { - #####: 441: _at.cmd_start("AT+CMGS="); - #####: 442: _at.write_string(phone_number+remove_plus_sign); - #####: 443: _at.cmd_stop(); - -: 444: - #####: 445: wait_ms(_sim_wait_time); - #####: 446: _at.resp_start("> ", true); - -: 447: - #####: 448: if (_at.get_last_error() == NSAPI_ERROR_OK) { - #####: 449: write_size = _at.write_bytes((uint8_t*)message, msg_len); - #####: 450: if (write_size < msg_len) { - -: 451: // sending can be cancelled by giving character (IRA 27). - #####: 452: _at.cmd_start(ESC); - #####: 453: _at.cmd_stop(); - #####: 454: _at.unlock(); - #####: 455: return write_size; - -: 456: } - -: 457: // (IRA 26) must be used to indicate the ending of the message body. - #####: 458: _at.cmd_start(CTRL_Z); - #####: 459: _at.cmd_stop(); - #####: 460: _at.resp_start("+CMGS: "); - #####: 461: _at.resp_stop(); - -: 462: } - -: 463: } else { - -: 464: // supports uncompressed 8 bit data and GSM 7 bit default alphabet data. Current implementation uses only - -: 465: // GSM 7 bit default but support is done for 8 bit data. - -: 466: int sms_count; - #####: 467: int concatenated_sms_length = _use_8bit_encoding ? SMS_MAX_8BIT_CONCATENATED_SINGLE_SMS_SIZE : - #####: 468: SMS_MAX_GSM7_CONCATENATED_SINGLE_SMS_SIZE; - -: 469: - #####: 470: if (msg_len <= single_sms_max_length) { - -: 471: // single message - #####: 472: sms_count = 1; - -: 473: } else { - -: 474: // concatenated message - #####: 475: sms_count = msg_len/concatenated_sms_length; - #####: 476: if (msg_len%concatenated_sms_length != 0) { - #####: 477: sms_count++; - -: 478: } - -: 479: } - -: 480: - #####: 481: int remaining_len = msg_len; - -: 482: int pdu_len; - -: 483: char *pdu_str; - #####: 484: for (int i = 0; i< sms_count; i++) { - -: 485: - #####: 486: if (sms_count == 1) { - #####: 487: pdu_len = msg_len; - -: 488: } else { - #####: 489: pdu_len = remaining_len > concatenated_sms_length ? concatenated_sms_length : remaining_len; - -: 490: } - -: 491: - #####: 492: pdu_str = create_pdu(phone_number+remove_plus_sign, message + i*concatenated_sms_length, pdu_len, - #####: 493: sms_count, i+1); - #####: 494: if (!pdu_str) { - #####: 495: _at.unlock(); - #####: 496: return NSAPI_ERROR_NO_MEMORY; - -: 497: } - #####: 498: pdu_len = strlen(pdu_str); - -: 499: - -: 500: // specification says that service center number should not be included so we subtract -2 from pdu_len as we use '00' for automatic service center number - #####: 501: _at.cmd_start("AT+CMGS="); - #####: 502: _at.write_int((pdu_len-2)/2); - #####: 503: _at.cmd_stop(); - -: 504: - #####: 505: wait_ms(_sim_wait_time); - #####: 506: _at.resp_start("> ", true); - -: 507: - #####: 508: if (_at.get_last_error() == NSAPI_ERROR_OK) { - #####: 509: write_size = _at.write_bytes((uint8_t*)pdu_str, pdu_len); - #####: 510: if (write_size < pdu_len) { - -: 511: // sending can be cancelled by giving character (IRA 27). - #####: 512: _at.cmd_start(ESC); - #####: 513: _at.cmd_stop(); - #####: 514: _at.unlock(); - #####: 515: free(pdu_str); - #####: 516: return write_size; - -: 517: } - -: 518: - -: 519: // (IRA 26) must be used to indicate the ending of the message body. - #####: 520: _at.cmd_start(CTRL_Z); - #####: 521: _at.cmd_stop(); - #####: 522: _at.resp_start("+CMGS: "); - #####: 523: _at.resp_stop(); - -: 524: } - #####: 525: free(pdu_str); - #####: 526: remaining_len -= concatenated_sms_length; - #####: 527: if (_at.get_last_error() != NSAPI_ERROR_OK) { - #####: 528: return _at.unlock_return_error(); - -: 529: } - -: 530: } - -: 531: } - -: 532: - #####: 533: _sms_message_ref_number++; - #####: 534: nsapi_error_t ret = _at.get_last_error(); - #####: 535: _at.unlock(); - -: 536: - #####: 537: return (ret == NSAPI_ERROR_OK) ? write_size : ret; - -: 538:} - -: 539: - #####: 540:void AT_CellularSMS::set_sms_callback(Callback func) - -: 541:{ - #####: 542: _cb = func; - #####: 543:} - -: 544: - #####: 545:nsapi_error_t AT_CellularSMS::set_cpms(const char *memr, const char *memw, const char *mems) - -: 546:{ - #####: 547: _at.lock(); - #####: 548: _at.cmd_start("AT+CPMS="); - #####: 549: _at.write_string(memr); - #####: 550: _at.write_string(memw); - #####: 551: _at.write_string(mems); - #####: 552: _at.cmd_stop(); - #####: 553: _at.resp_start(); - #####: 554: _at.resp_stop(); - -: 555: - #####: 556: return _at.unlock_return_error(); - -: 557:} - -: 558: - #####: 559:nsapi_error_t AT_CellularSMS::set_csca(const char *sca, int type) - -: 560:{ - #####: 561: _at.lock(); - #####: 562: _at.cmd_start("AT+CSCA="); - #####: 563: _at.write_string(sca); - #####: 564: _at.write_int(type); - #####: 565: _at.cmd_stop(); - #####: 566: _at.resp_start(); - #####: 567: _at.resp_stop(); - -: 568: - #####: 569: return _at.unlock_return_error(); - -: 570:} - -: 571: - #####: 572:nsapi_size_or_error_t AT_CellularSMS::set_cscs(const char *chr_set) - -: 573:{ - #####: 574: _at.lock(); - #####: 575: _at.cmd_start("AT+CSCS="); - #####: 576: _at.write_string(chr_set); - #####: 577: _at.cmd_stop(); - #####: 578: _at.resp_start(); - #####: 579: _at.resp_stop(); - -: 580: - #####: 581: return _at.unlock_return_error(); - -: 582:} - -: 583: - #####: 584:nsapi_error_t AT_CellularSMS::set_csms(int msg_service) - -: 585:{ - #####: 586: _at.lock(); - #####: 587: _at.cmd_start("AT+CSMS="); - #####: 588: _at.write_int(msg_service); - #####: 589: _at.cmd_stop(); - #####: 590: _at.resp_start(); - #####: 591: _at.resp_stop(); - -: 592: - #####: 593: return _at.unlock_return_error(); - -: 594:} - -: 595: - #####: 596:nsapi_error_t AT_CellularSMS::delete_sms(sms_info_t* sms) - -: 597:{ - #####: 598: _at.lock(); - #####: 599: for (int i = 0; i < sms->parts; i++) { - #####: 600: _at.cmd_start("AT+CMGD="); - #####: 601: _at.write_int(sms->msg_index[i]); - #####: 602: _at.cmd_stop(); - #####: 603: _at.resp_start(); - #####: 604: _at.resp_stop(); - -: 605: } - -: 606: - #####: 607: return _at.unlock_return_error(); - -: 608:} - -: 609: - -: 610:// we need this as for example concatenated sms can get different sms reference numbers - -: 611:// if for example last part take much more time to arrive. This situation happened while testing. - -: 612:// What this means that after this we can't read another sms because we always read the oldest sms - -: 613:// that was corrupted. So we need to have delete all messages. - #####: 614:nsapi_error_t AT_CellularSMS::delete_all_messages() - -: 615:{ - #####: 616: _at.lock(); - #####: 617: _at.cmd_start("AT+CMGD=1,4"); - #####: 618: _at.cmd_stop(); - #####: 619: _at.resp_start(); - #####: 620: _at.resp_stop(); - #####: 621: return _at.unlock_return_error(); - -: 622:} - -: 623: - -: 624:// read msg in text mode - #####: 625:nsapi_size_or_error_t AT_CellularSMS::read_sms_from_index(int msg_index, char* buf, uint16_t len, char* phone_num, - -: 626: char* time_stamp) - -: 627:{ - -: 628: /* - -: 629: * +CMGR: ,,,[,,,,,,,]OK - -: 630: */ - #####: 631: wait_ms(_sim_wait_time); - #####: 632: _at.cmd_start("AT+CMGR="); - #####: 633: _at.write_int(msg_index); - #####: 634: _at.cmd_stop(); - -: 635: - -: 636: // TODO: NOTE: If the selected can contain different types of SMs (e.g. SMS-DELIVERs, SMS-SUBMITs, SMS-STATUS-REPORTs and SMS-COMMANDs), - -: 637: // the response may be a mix of the responses of different SM types. TE application can recognize the response format by examining the third response parameter. - -: 638: // for now we support sms reading of received messages - #####: 639: int buf_len = 0; - #####: 640: if (_at.get_last_error() == NSAPI_ERROR_OK) { - -: 641: char status[SMS_STATUS_SIZE]; - -: 642: // first we read msg status and with that we can decide how the rest of message format - #####: 643: _at.resp_start("+CMGR: "); - -: 644: - #####: 645: if (_at.info_resp()) { - #####: 646: _at.read_string(status, SMS_STATUS_SIZE); - #####: 647: uint16_t status_len = strlen(status); - #####: 648: if (((status_len == sizeof("REC READ") - 1) && memcmp("REC READ", status, status_len) == 0) - #####: 649: || ((status_len == sizeof("REC UNREAD") - 1) && memcmp("REC UNREAD", status, status_len) == 0)) { - -: 650: // Received message - #####: 651: if (phone_num) { - #####: 652: _at.read_string(phone_num, SMS_MAX_PHONE_NUMBER_SIZE); - -: 653: } - -: 654: else { - #####: 655: _at.skip_param(); // , - -: 656: } - #####: 657: _at.skip_param(); // - #####: 658: if (time_stamp) { - #####: 659: _at.read_string(time_stamp, SMS_MAX_TIME_STAMP_SIZE); - -: 660: } - #####: 661: (void)_at.consume_to_stop_tag(); // consume until - #####: 662: if (buf) { - #####: 663: _at.read_string(buf, len); - #####: 664: buf_len = strlen(buf); - -: 665: } - -: 666: } - -: 667: } - #####: 668: _at.resp_stop(); - -: 669: } - -: 670: - #####: 671: return (_at.get_last_error() == NSAPI_ERROR_OK) ? buf_len : _at.get_last_error(); - -: 672:} - -: 673: - -: 674:// read msg in PDU mode - #####: 675:nsapi_size_or_error_t AT_CellularSMS::read_sms(sms_info_t* sms, char* buf, char* phone_num, char* time_stamp) - -: 676:{ - -: 677: // +CMGR: ,[], - #####: 678: int index = -1; - #####: 679: if (sms->parts == sms->parts_added) { - -: 680: char *pdu; // we need a temp buffer as payload is hexencoded ---> can't use buf as it might be enough for message but not hexenconded pdu. - #####: 681: int status = -1; - #####: 682: int msg_len = 0; - #####: 683: index = 0; - #####: 684: int pduSize = 0; - -: 685: - #####: 686: for (int i = 0; i < sms->parts; i++) { - #####: 687: wait_ms(_sim_wait_time); - #####: 688: _at.cmd_start("AT+CMGR="); - #####: 689: _at.write_int(sms->msg_index[i]); - #####: 690: _at.cmd_stop(); - #####: 691: _at.resp_start("+CMGR: "); - -: 692: - #####: 693: if (_at.info_resp()) { - #####: 694: status = _at.read_int(); - #####: 695: _at.skip_param(); // - #####: 696: if ((_at.get_last_error() == NSAPI_ERROR_OK) && (status == 0 || status == 1)) { - #####: 697: msg_len = _at.read_int(); - #####: 698: if (msg_len > 0) { - #####: 699: pduSize = msg_len*2 + 20;// *2 as it's hex encoded and +20 as service center number is not included in size given by CMGR - #####: 700: pdu = (char*)calloc(pduSize, sizeof(char)); - #####: 701: if (!pdu) { - #####: 702: _at.resp_stop(); - #####: 703: return NSAPI_ERROR_NO_MEMORY; - -: 704: } - #####: 705: _at.read_string(pdu, pduSize, true); - #####: 706: if (_at.get_last_error() == NSAPI_ERROR_OK) { - #####: 707: msg_len = get_data_from_pdu(pdu, NULL, NULL, phone_num, buf+index); - #####: 708: if (msg_len >= 0) { // we need to allow zero length messages - #####: 709: index += msg_len; - -: 710: } else { - #####: 711: free(pdu); - #####: 712: _at.resp_stop(); - #####: 713: return -1; - -: 714: } - -: 715: } - #####: 716: free(pdu); - -: 717: } - -: 718: } - -: 719: } - #####: 720: _at.resp_stop(); - -: 721: } - -: 722: - #####: 723: if (_at.get_last_error() == NSAPI_ERROR_OK) { - #####: 724: if (time_stamp) { - #####: 725: strcpy(time_stamp, sms->date); - -: 726: } - #####: 727: buf[index] = '\0'; - -: 728: } - -: 729: } - -: 730: else { - -: 731: log_warn("NOT all concatenated parts were received..."); - #####: 732: index = SMS_ERROR_MULTIPART_ALL_PARTS_NOT_READ; - -: 733: } - -: 734: - #####: 735: return index; - -: 736:} - -: 737: - #####: 738:nsapi_size_or_error_t AT_CellularSMS::get_sms(char* buf, uint16_t len, char* phone_num, uint16_t phone_len, - -: 739: char* time_stamp, uint16_t time_len, int *buf_size) - -: 740:{ - -: 741: // validate buffer sizes already here to avoid any necessary function calls and locking of _at - #####: 742: if ((phone_num && phone_len < SMS_MAX_PHONE_NUMBER_SIZE) || (time_stamp && time_len < SMS_MAX_TIME_STAMP_SIZE) || - -: 743: buf == NULL) { - #####: 744: return NSAPI_ERROR_PARAMETER; - -: 745: } - -: 746: - #####: 747: _at.lock(); - -: 748: - #####: 749: nsapi_size_or_error_t err = list_messages(); - #####: 750: if (err == NSAPI_ERROR_OK) { - -: 751: // we return the oldest sms and delete it after successful read - #####: 752: sms_info_t* info = get_oldest_sms_index(); - -: 753: - #####: 754: if (info) { - #####: 755: if (info->msg_size+1 > len) { // +1 for '\0' - -: 756: log_warn("Given buf too small, len is: %d but is must be: %d", len, info->msg_size); - #####: 757: if (buf_size) { - #####: 758: *buf_size = info->msg_size; - -: 759: } - #####: 760: free_linked_list(); - #####: 761: _at.unlock(); - #####: 762: return NSAPI_ERROR_PARAMETER; - -: 763: } - -: 764: - #####: 765: if (_mode == CellularSMSMmodePDU) { - #####: 766: err = read_sms(info, buf, phone_num, time_stamp); - -: 767: } else { - #####: 768: err = read_sms_from_index(info->msg_index[0], buf, len, phone_num, time_stamp); - -: 769: } - -: 770: - #####: 771: if (err > 0) { - #####: 772: int delerr = delete_sms(info); - #####: 773: if (delerr) { - #####: 774: err = delerr; - -: 775: } - -: 776: } - -: 777: } else { - -: 778: // No messages were found, return -1 - #####: 779: err = -1; - -: 780: } - -: 781: } - -: 782: - #####: 783: free_linked_list(); - -: 784: - #####: 785: _at.unlock(); - -: 786: - -: 787: // update error only when there really was an error, otherwise we return the length - #####: 788: if (_at.get_last_error()) { - #####: 789: err = _at.get_last_error(); - -: 790: } - #####: 791: return err; - -: 792:} - -: 793: - #####: 794: nsapi_size_or_error_t AT_CellularSMS::get_data_from_pdu(const char* pdu, sms_info_t *info, int *part_number, - -: 795: char *phone_number, char *msg) - -: 796:{ - #####: 797: int index = 0; - -: 798: int tmp; - -: 799: bool userDataHeader; - -: 800: int oaLength; - -: 801: int dataScheme; - #####: 802: nsapi_size_or_error_t err = NSAPI_ERROR_OK; - -: 803: - -: 804: // read Length of the SMSC information - #####: 805: oaLength = hex_str_to_int(pdu, 2); - #####: 806: index += 2; // length we just read - #####: 807: index += oaLength*2; // skip service center number - -: 808: - -: 809: // read first the lower part of first octet as there is message type - #####: 810: index++; - #####: 811: tmp = hex_str_to_int(pdu+index, 1); - -: 812: //wait_ms(200); - #####: 813: if ((tmp & 0x03) == 0) {// SMS-DELIVER type, last two bits should be zero - -: 814: // UDH present? Check from first octets higher part - #####: 815: tmp = hex_str_to_int(pdu + (--index), 1); - #####: 816: userDataHeader = ((tmp & 0x04) == 0) ? false : true; - -: 817: - #####: 818: index +=2; // we just read the high bits of first octet so move +2 - -: 819: // originating address length - #####: 820: oaLength = hex_str_to_int(pdu+index, 2); - #####: 821: index +=2; // add index over address length - #####: 822: index +=2; // skip number type - #####: 823: if (phone_number) { - -: 824: // phone number as reverse nibble encoded - #####: 825: int a = 0; - #####: 826: for (; a < oaLength; a +=2) { - #####: 827: if (a+1 == oaLength) { - #####: 828: phone_number[a] = pdu[index+a+1]; - -: 829: } else { - #####: 830: phone_number[a] = pdu[index+a+1]; - #####: 831: phone_number[a+1] = pdu[index+a]; - -: 832: } - -: 833: } - #####: 834: phone_number[oaLength] = '\0'; - -: 835: } - -: 836: - #####: 837: index += oaLength; - #####: 838: if (oaLength&0x01) { // if phone number length is odd then it has padded F so skip that - #####: 839: index++; - -: 840: } - #####: 841: index +=2; // skip TP-Protocol identifier - -: 842: - #####: 843: dataScheme = hex_str_to_int(pdu+index, 2); - #####: 844: index +=2; // skip TP-Data-Coding-Scheme - -: 845: - -: 846: // next one is date, it's length is 7 octets according to 3GPP TS 23.040 - -: 847: // create time string - #####: 848: if (info) { - #####: 849: int i = 0; - -: 850: // year - #####: 851: info->date[i++] = pdu[index+1]; - #####: 852: info->date[i++] = pdu[index]; - #####: 853: index+=2; - #####: 854: info->date[i++] = '/'; - -: 855: // month - #####: 856: info->date[i++] = pdu[index+1]; - #####: 857: info->date[i++] = pdu[index]; - #####: 858: index+=2; - #####: 859: info->date[i++] = '/'; - -: 860: // Day - #####: 861: info->date[i++] = pdu[index+1]; - #####: 862: info->date[i++] = pdu[index]; - #####: 863: index+=2; - #####: 864: info->date[i++] = ','; - -: 865: // Hour - #####: 866: info->date[i++] = pdu[index+1]; - #####: 867: info->date[i++] = pdu[index]; - #####: 868: index+=2; - #####: 869: info->date[i++] = ':'; - -: 870: // Minute - #####: 871: info->date[i++] = pdu[index+1]; - #####: 872: info->date[i++] = pdu[index]; - #####: 873: index+=2; - #####: 874: info->date[i++] = ':'; - -: 875: // Second - #####: 876: info->date[i++] = pdu[index+1]; - #####: 877: info->date[i++] = pdu[index]; - #####: 878: index+=2; - -: 879: // timezone related to GMT. pdu[index+1] most significant bit indicates the sign related to gmt - #####: 880: tmp = hex_str_to_int(pdu+index+1, 1); - #####: 881: if (tmp&0x08) { - #####: 882: info->date[i++] = '-'; - -: 883: } else { - #####: 884: info->date[i++] = '+'; - -: 885: } - -: 886: - -: 887: // pdu[index+1 & 0x07 is the most significant bits of the timezone - -: 888: // pdu [index] is the least significant bits - #####: 889: info->date[i++] = '0' + (tmp & 0x07); - #####: 890: info->date[i++] = pdu[index]; - #####: 891: info->date[i] = '\0'; - #####: 892: index+=2; - -: 893: } else { - #####: 894: index+=14; - -: 895: } - -: 896: - #####: 897: index +=2; - #####: 898: int paddingBits = 0; - #####: 899: int parts = 1; - #####: 900: int partnro = 1; - #####: 901: if (userDataHeader) { - -: 902: // we need to read User Defined Header to know what part number this message is. - #####: 903: index += read_udh_from_pdu(pdu+index, info, partnro, parts, paddingBits); - -: 904: } - -: 905: - #####: 906: if (part_number) { - #####: 907: *part_number = partnro; - -: 908: } - -: 909: - #####: 910: if (msg) { - -: 911: // we are reading the message - #####: 912: err = read_pdu_payload(pdu+index, dataScheme, msg, paddingBits, partnro == parts); - -: 913: } - -: 914: else { - #####: 915: if (dataScheme == 0x00) { - -: 916: // when listing messages we need to calculated length. Other way would be unpacking the whole message. - #####: 917: err = strlen(pdu+index) >> 1; - #####: 918: err *= 8; - #####: 919: err /= 7; - #####: 920: } else if (dataScheme == 0x04) { - #####: 921: err = strlen(pdu+index) >> 1; - -: 922: } else { - #####: 923: return NSAPI_ERROR_UNSUPPORTED; - -: 924: } - -: 925: } - -: 926: - #####: 927: return err; - -: 928: } - -: 929: else { - -: 930: // message was not DELIVER so discard it - #####: 931: return NSAPI_ERROR_UNSUPPORTED; - -: 932: } - -: 933:} - -: 934: - -: 935: // read params from User DEfined Header - #####: 936:int AT_CellularSMS::read_udh_from_pdu(const char* pdu, sms_info_t *info, int &part_number, int &parts, - -: 937: int &padding_bits) { - -: 938: - #####: 939: int index = 0; - #####: 940: int udhLength = hex_str_to_int(pdu, 2); - #####: 941: index +=2; - -: 942: - -: 943: // if there is padding bits then udhlen is octet bigger as we need to keep septet boundary - #####: 944: padding_bits = ((udhLength+1) * 8 ) % 7; // +1 is for udhLength itself - #####: 945: if (padding_bits) { - #####: 946: padding_bits = 7 - padding_bits; - -: 947: } else { - #####: 948: padding_bits = 0; - -: 949: } - -: 950: - #####: 951: int tmp = hex_str_to_int(pdu+index, 2); - #####: 952: index +=4; - -: 953: - #####: 954: if (tmp == 0) { // 8-bit reference number - #####: 955: if (info) { - #####: 956: info->msg_ref_number = (uint16_t)hex_str_to_int(pdu+index, 2); - -: 957: } - #####: 958: index +=2; - -: 959: } else { // 16-bit reference number - #####: 960: if (info) { - #####: 961: info->msg_ref_number = (uint16_t)hex_str_to_int(pdu+index+2, 2); - #####: 962: tmp = hex_str_to_int(pdu+index, 2); - #####: 963: info->msg_ref_number |= (tmp << 8); - -: 964: } - #####: 965: index +=4; - -: 966: } - -: 967: - #####: 968: parts = hex_str_to_int(pdu+index, 2); - #####: 969: if (info) { - #####: 970: info->parts = parts; - -: 971: } - #####: 972: index +=2; - -: 973: - #####: 974: part_number = hex_str_to_int(pdu+index, 2); - #####: 975: index +=2; - -: 976: - #####: 977: return (udhLength*2 + 2); // udh in hex and udhl - -: 978:} - -: 979: - #####: 980:nsapi_size_or_error_t AT_CellularSMS::read_pdu_payload(const char* pdu, int scheme, char *msg, int padding_bits, - -: 981: bool last_part) - -: 982:{ - #####: 983: if (scheme == 0x00) { - -: 984: // 7 bit gsm encoding, must do the conversions from hex to 7-bit encoding and to ascii - #####: 985: return unpack_7_bit_gsm_to_str(pdu, strlen(pdu)/2, msg, padding_bits, last_part); - -: 986: - #####: 987: } else if (scheme == 0x04) { - -: 988: // 8bit scheme so just convert hexstring to charstring - #####: 989: return hex_str_to_char_str(pdu, strlen(pdu), msg); - -: 990: } else { - #####: 991: log_error("Received unsupported data coding scheme: 0x%02x", scheme); - #####: 992: return NSAPI_ERROR_UNSUPPORTED; - -: 993: } - -: 994:} - -: 995: - #####: 996:void AT_CellularSMS::free_linked_list() - -: 997:{ - #####: 998: sms_info_t* info = _sms_info; - -: 999: sms_info_t* old; - #####: 1000: while (info) { - #####: 1001: old = info; - #####: 1002: info = info->next_info; - #####: 1003: delete old; - -: 1004: } - #####: 1005: _sms_info = NULL; - #####: 1006:} - -: 1007: - #####: 1008:void AT_CellularSMS::add_info(sms_info_t* info, int index, int part_number) { - -: 1009: // check for same message reference id. If found, update it and delete the given info. - -: 1010: // if NOT found then add to the end of the list. - -: 1011: - #####: 1012: if (!_sms_info) { - #####: 1013: info->msg_index[part_number-1] = index; // part numbering starts from 1 so -1 to put to right index - #####: 1014: _sms_info = info; - #####: 1015: return; - -: 1016: } - #####: 1017: sms_info_t* current = _sms_info; - -: 1018: sms_info_t* prev; - #####: 1019: bool found_msg = false; - #####: 1020: while (current) { - #####: 1021: prev = current; - -: 1022: // sms messages can have same reference number so additional checks are needed. - -: 1023: // TODO: should we include phone number also? - #####: 1024: if (current->msg_ref_number == info->msg_ref_number && current->parts > current->parts_added && - #####: 1025: info->parts > info->parts_added) { - -: 1026: // multipart sms, update msg size and index - #####: 1027: current->msg_size += info->msg_size; - #####: 1028: current->msg_index[part_number-1] = index; // part numbering starts from 1 so -1 to put to right index - #####: 1029: current->parts_added++; - -: 1030: // update oldest part as date - #####: 1031: if (compare_time_strings(info->date, current->date) == -1) { - #####: 1032: strcpy(current->date, info->date); - -: 1033: } - #####: 1034: found_msg = true; - #####: 1035: break; - -: 1036: } - #####: 1037: current = current->next_info; - -: 1038: } - -: 1039: - #####: 1040: if (found_msg) { - -: 1041: // info was added to existing item in linked list, must be deleted - #####: 1042: delete info; - -: 1043: } else { - -: 1044: // message not found, add to linked list - #####: 1045: info->msg_index[part_number-1] = index; - #####: 1046: prev->next_info = info; - -: 1047: } - -: 1048:} - -: 1049: - -: 1050:// reads all the messages to the linked list AT_CellularSMS::_sms_info - #####: 1051:nsapi_error_t AT_CellularSMS::list_messages() - -: 1052:{ - -: 1053: // TODO: NOTE: If the selected can contain different types of SMs (e.g. SMS-DELIVERs, SMS-SUBMITs, SMS-STATUS-REPORTs and SMS-COMMANDs), - -: 1054: // the response may be a mix of the responses of different SM types. TE application can recognize the response format by examining the third response parameter. - -: 1055: // for now we assume that only SMS-DELIVER messages are read. - #####: 1056: if (_mode == CellularSMSMmodePDU) { - #####: 1057: _at.cmd_start("AT+CMGL=4"); - -: 1058: } else { - #####: 1059: _at.cmd_start("AT+CMGL=\"ALL\""); - -: 1060: } - #####: 1061: _at.cmd_stop(); - -: 1062: - #####: 1063: sms_info_t* info = NULL; - -: 1064: // init for 1 so that in text mode we will add to the correct place without any additional logic in addInfo() in text mode - #####: 1065: int part_number = 1; - #####: 1066: int index = 0; - #####: 1067: int length = 0; - #####: 1068: char *pdu = NULL; - -: 1069: - #####: 1070: _at.resp_start("+CMGL: "); - #####: 1071: while (_at.info_resp()) { - #####: 1072: info = new sms_info_t(); - #####: 1073: if (!info) { - #####: 1074: _at.resp_stop(); - #####: 1075: return NSAPI_ERROR_NO_MEMORY; - -: 1076: } - -: 1077: - #####: 1078: if (_mode == CellularSMSMmodePDU) { - -: 1079: //+CMGL: ,,[],[ - -: 1080: // +CMGL:,,[], - -: 1081: //[...]] - #####: 1082: index = _at.read_int(); - #####: 1083: _at.skip_param(2); // ,[] - #####: 1084: length = _at.read_int(); - #####: 1085: length = length*2 + 20;// *2 as it's hex encoded and +20 as service center number is not included in size given by CMGL - #####: 1086: pdu = (char*)calloc(length, sizeof(char)); - #####: 1087: if (!pdu) { - #####: 1088: delete info; - #####: 1089: _at.resp_stop(); - #####: 1090: return NSAPI_ERROR_NO_MEMORY; - -: 1091: } - #####: 1092: _at.read_string(pdu, length, true); - #####: 1093: if (_at.get_last_error() == NSAPI_ERROR_OK) { - #####: 1094: info->msg_size = get_data_from_pdu(pdu, info, &part_number); - -: 1095: } - -: 1096: } else { - -: 1097: // +CMGL: ,,,[],[][,,][ - -: 1098: // +CMGL: ,,,[],[][,,][...]] - #####: 1099: index = _at.read_int(); - #####: 1100: (void)_at.consume_to_stop_tag(); // consume until - #####: 1101: (void)_at.consume_to_stop_tag(); // consume until - -: 1102: } - -: 1103: - #####: 1104: if (index > 0) { - #####: 1105: add_info(info, index, part_number); - -: 1106: } else { - #####: 1107: delete info; - #####: 1108: info = NULL; - -: 1109: } - #####: 1110: free(pdu); - #####: 1111: pdu = NULL; - -: 1112: } - -: 1113: - -: 1114: - #####: 1115: _at.resp_stop(); - -: 1116: - #####: 1117: return _at.get_last_error(); - -: 1118:} - -: 1119: - #####: 1120:AT_CellularSMS::sms_info_t* AT_CellularSMS::get_oldest_sms_index() - -: 1121:{ - -: 1122: /* - -: 1123: * Different scenarios when finding the oldest concatenated sms - -: 1124: * - -: 1125: * 1. Find first parts first and it was received first - -: 1126: * 2. Find first parts first and it was NOT received first -> older timestamp might exist in some other part - -: 1127: * 3. Find other than first part first and it was received first - -: 1128: * 4. Find other than first part first and it was NOT received first -> older timestamp might exist in some other part - -: 1129: * - -: 1130: * So must take all message to a linked list and loop that for the oldest - -: 1131: */ - -: 1132: - -: 1133: // if text mode we need to read sms with +CMGR because time stamp is optional while looping with +CMGL - #####: 1134: sms_info_t* retVal = NULL; - #####: 1135: sms_info_t* current = _sms_info; - #####: 1136: nsapi_size_or_error_t err = 0; - #####: 1137: while (current) { - #####: 1138: if (_mode == CellularSMSMmodeText) { - #####: 1139: wait_ms(_sim_wait_time); - #####: 1140: err = read_sms_from_index(current->msg_index[0], NULL, 0, NULL, current->date); - #####: 1141: if (err != 0) { - #####: 1142: return NULL; - -: 1143: } - -: 1144: } - -: 1145: - #####: 1146: if (retVal == NULL) { - #####: 1147: retVal = current; - #####: 1148: } else if (compare_time_strings(current->date, retVal->date) == -1) { - -: 1149: // found older sms, update return value to oldest - #####: 1150: retVal = current; - -: 1151: } - #####: 1152: current = current->next_info; - -: 1153: } - -: 1154: - #####: 1155: return retVal; - -: 1156:} - -: 1157: - -: 1158:// if time_string_1 is greater (more fresh date) then return 1, same 0, smaller -1. Error -2 - #####: 1159:int AT_CellularSMS::compare_time_strings(const char* time_string_1, const char* time_string_2) - -: 1160:{ - -: 1161: time_t t1; - -: 1162: time_t t2; - -: 1163: - #####: 1164: bool success = create_time(time_string_1, &t1) && create_time(time_string_2, &t2); - #####: 1165: int retVal = -2; - -: 1166: - #####: 1167: if (success) { - #####: 1168: double diff = difftime(t1, t2); - -: 1169: - #####: 1170: if (diff > 0) { - #####: 1171: retVal = 1; - #####: 1172: } else if (diff == 0) { - #####: 1173: retVal = 0; - -: 1174: } else { - #####: 1175: retVal = -1; - -: 1176: } - -: 1177: } - -: 1178: - #####: 1179: return retVal; - -: 1180:} - -: 1181: - #####: 1182:bool AT_CellularSMS::create_time(const char* time_string, time_t* time) - -: 1183:{ - #####: 1184: const int kNumberOfElements = 8; - #####: 1185: tm time_struct = { 0 }; - #####: 1186: int gmt = 0; - -: 1187: char sign; - #####: 1188: bool retVal = false; - -: 1189: - #####: 1190: if (sscanf(time_string, "%d/%d/%d,%d:%d:%d%c%d", &time_struct.tm_year, &time_struct.tm_mon, &time_struct.tm_mday, - -: 1191: &time_struct.tm_hour, &time_struct.tm_min, &time_struct.tm_sec, &sign, &gmt) == kNumberOfElements) { - #####: 1192: *time = mktime(&time_struct); - -: 1193: // add timezone as seconds. gmt is in quarter of hours. - #####: 1194: int x = 60 * 60 * gmt * 0.25; - #####: 1195: if (sign == '+') { - #####: 1196: *time += x; - -: 1197: } else { - #####: 1198: *time -= x; - -: 1199: } - #####: 1200: retVal = true; - -: 1201: } - -: 1202: - #####: 1203: return retVal; - -: 1204:} - -: 1205: - #####: 1206:uint16_t AT_CellularSMS::pack_7_bit_gsm_and_hex(const char* str, uint16_t len, char *buf, - -: 1207: int number_of_padding_bit) - -: 1208:{ - #####: 1209: uint16_t strCnt = 0; - #####: 1210: uint16_t i = 0; - -: 1211: uint8_t shift; - -: 1212: char tmp; - -: 1213: - -: 1214: // convert to 7bit gsm first - #####: 1215: char* gsm_str = (char*)malloc(len); - #####: 1216: if (!gsm_str) { - #####: 1217: return 0; - -: 1218: } - #####: 1219: for (uint16_t y = 0; y < len; y++) { - #####: 1220: for (int x=0; x < GSM_TO_ASCII_TABLE_SIZE; x++) { - #####: 1221: if (gsm_to_ascii[x] == str[y]) { - #####: 1222: gsm_str[y] = x; - -: 1223: } - -: 1224: } - -: 1225: } - -: 1226: - -: 1227: // then packing and converting to hex - #####: 1228: if (number_of_padding_bit) { - #####: 1229: tmp = gsm_str[strCnt]<>shift); - -: 1244: } else { - #####: 1245: tmp = (gsm_str[strCnt]>>shift) | (gsm_str[strCnt+1] <<(7-shift)); - -: 1246: } - -: 1247: - #####: 1248: char_str_to_hex_str(&tmp, 1, buf+(i*2)); - -: 1249: - #####: 1250: if (shift == 6) { - #####: 1251: strCnt++; - -: 1252: } - #####: 1253: strCnt++; - #####: 1254: i++; - -: 1255: } - -: 1256: - #####: 1257: free(gsm_str); - -: 1258: - #####: 1259: return i; - -: 1260:} - -: 1261: - #####: 1262: uint16_t AT_CellularSMS::unpack_7_bit_gsm_to_str(const char* str, int len, char *buf, int padding_bits, - -: 1263: bool last_part) - -: 1264:{ - #####: 1265: int strCount = 0; - #####: 1266: uint16_t decodedCount = 0; - -: 1267: uint8_t shift; - -: 1268: char tmp; - -: 1269: char tmp1; - -: 1270: - #####: 1271: if (padding_bits) { - #####: 1272: hex_str_to_char_str(str, 2, &tmp); - #####: 1273: buf[decodedCount] = gsm_to_ascii[(tmp>>padding_bits) & 0x7F]; - #####: 1274: strCount++; - #####: 1275: decodedCount++; - -: 1276: } - -: 1277: - #####: 1278: while (strCount < len) { - #####: 1279: shift = (strCount-padding_bits)%7; - #####: 1280: hex_str_to_char_str(str + strCount*2, 2, &tmp); - #####: 1281: if (shift == 0) { - #####: 1282: buf[decodedCount] = gsm_to_ascii[tmp & 0x7F]; - #####: 1283: } else if (shift == 6) { - #####: 1284: hex_str_to_char_str(str + (strCount-1)*2, 2, &tmp1); - #####: 1285: buf[decodedCount] = gsm_to_ascii[(((tmp1>>2)) | (tmp << 6)) & 0x7F]; - -: 1286: // we are unpacking the last byte and so tmp is not complete as it's not completed by the next byte. - -: 1287: // unless this is a multipart message and not the last part. - #####: 1288: if (!((strCount+1 == len) && last_part)) { - #####: 1289: hex_str_to_char_str(str + strCount*2, 2, &tmp); - #####: 1290: decodedCount++; - #####: 1291: buf[decodedCount] = gsm_to_ascii[(tmp>>1) & 0x7F]; - -: 1292: } - -: 1293: } else { - #####: 1294: hex_str_to_char_str(str + (strCount-1)*2, 2, &tmp1); - #####: 1295: buf[decodedCount] = gsm_to_ascii[(((tmp1>>(8- shift))) | ((tmp << shift))) & 0x7F]; - -: 1296: } - -: 1297: - #####: 1298: strCount++; - #####: 1299: decodedCount++; - -: 1300: } - -: 1301: - #####: 1302: return decodedCount; - -: 1303:} diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/AT_CellularSMS.h.gcov b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/AT_CellularSMS.h.gcov deleted file mode 100644 index 9f07639c53..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/AT_CellularSMS.h.gcov +++ /dev/null @@ -1,250 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularSMS.h - -: 0:Graph:objs/AT_CellularSMS_unit/AT_CellularSMS.gcno - -: 0:Data:objs/AT_CellularSMS_unit/AT_CellularSMS.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef AT_CELLULAR_SMS_H_ - -: 19:#define AT_CELLULAR_SMS_H_ - -: 20: - -: 21:#include "CellularSMS.h" - -: 22:#include "AT_CellularBase.h" - -: 23:#include - -: 24:#include - -: 25: - -: 26:namespace mbed { - -: 27: - -: 28:class AT_CellularSMS: public CellularSMS, public AT_CellularBase - -: 29:{ - -: 30: - -: 31:public: - -: 32: AT_CellularSMS(ATHandler &atHandler); - -: 33: virtual ~AT_CellularSMS(); - -: 34: - -: 35:public: - -: 36: // from CellularSMS - -: 37: - -: 38: /** Does all the necessary initializations needed for receiving and sending sms. - -: 39: * - -: 40: * @param mode enumeration for choosing the correct mode: text/pdu - -: 41: * @return zero on success - -: 42: */ - -: 43: virtual nsapi_error_t initialize(CellularSMSMmode mode); - -: 44: - -: 45: /** Send the SMS with the given parameters - -: 46: * - -: 47: * @param phone_number Phone number where to send sms - -: 48: * @param message SMS message content - -: 49: * @param msg_len Length of the message - -: 50: * @return possible error code or length of the sent sms - -: 51: */ - -: 52: virtual nsapi_size_or_error_t send_sms(const char* phone_number, const char* message, int msg_len); - -: 53: - -: 54: /** Gets the oldest received sms. - -: 55: * - -: 56: * @param buf preallocated buffer for sms message content - -: 57: * @param buf_len length of allocated buf - -: 58: * @param phone_num preallocated buffer for phone number where sms was sent - -: 59: * @param phone_len length of allocated phone_num buffer - -: 60: * @param time_stamp preallocated buffer for TP-Service Centre Time Stamp (format: yy/MM/dd,hh:mm:ss-+zz). +-zz is timezone. - -: 61: * The unit of time zone is a quarter of an hour relative to GMT. For example +32 would be GMT+8. - -: 62: * @param time_len length of allocated time_stamp buffer - -: 63: * @param buf_size if method return error NSAPI_ERROR_NO_MEMORY because the given buf was not big enough this will - -: 64: * hold the size which is enough. Otherwise zero. - -: 65: * @return possible error code or size of buf. Will return SMS_ERROR_MULTIPART_ALL_PARTS_NOT_READ - -: 66: * if sms was multipart but not all parts are present/failed to read. - -: 67: */ - -: 68: virtual nsapi_size_or_error_t get_sms(char* buf, uint16_t buf_len, char* phone_num, uint16_t phone_len, - -: 69: char* time_stamp, uint16_t time_len, int *buf_size); - -: 70: - -: 71: /** Callback which is called when new sms is received. SMS can be fetched via method get_sms(). - -: 72: * - -: 73: * @remark In PDU mode there can be multipart sms and callback is called for every received part. - -: 74: * - -: 75: * @param func Callback function which is called when new sms is received. - -: 76: */ - -: 77: virtual void set_sms_callback(Callback func); - -: 78: - -: 79: /** CPMS preferred message storage - -: 80: * - -: 81: * @param memr memory from which messages are read and deleted - -: 82: * "SM" - SIM SMS memory storage (default) - -: 83: * "ME" - NVM SMS storage - -: 84: * @param memw memory to which writing and sending operations are made - -: 85: * "SM" - SIM SMS memory storage (default) - -: 86: * "ME" - NVM SMS storage - -: 87: * @param mems memory to which received SMs are preferred to be stored - -: 88: * "SM" - SIM SMS memory storage (default) - -: 89: * "ME" - NVM SMS storage - -: 90: * - -: 91: * @return zero for success - -: 92: */ - -: 93: virtual nsapi_error_t set_cpms(const char *memr, const char *memw, const char *mems); - -: 94: - -: 95: /** CSCA - set Service Center Address - -: 96: * - -: 97: * @param sca Service Center Address to be used for mobile originated SMS transmissions. - -: 98: * @param type 129 - national numbering scheme, 145 - international numbering scheme (contains the character "+") - -: 99: * - -: 100: * @return zero for success - -: 101: */ - -: 102: virtual nsapi_error_t set_csca(const char *sca, int type); - -: 103: - -: 104: /** Set command sets the current character set used by the device. "GSM", "IRA",.... - -: 105: * - -: 106: * @remark Current implementation support only ASCII so choose the correct character set. - -: 107: * - -: 108: * @param chr_set preferred character set list (comma separated). Modem might not support the wanted character set - -: 109: * so chr_set list is looped from start until supported set is found. Used character set index is returned. - -: 110: * See more from 3GPP TS 27.005. - -: 111: * @return Used character set index from the given list in case of success. Otherwise negative errorcode. - -: 112: */ - -: 113: virtual nsapi_size_or_error_t set_cscs(const char *chr_set); - -: 114: - -: 115: /** Deletes all messages from the currently set memory/SIM - -: 116: * - -: 117: * @return zero for success - -: 118: */ - -: 119: virtual nsapi_error_t delete_all_messages(); - -: 120: - -: 121: /** Some modems need extra time between AT commands and responses or there will be error -314, SIM busy. - -: 122: * If SIM busy errors are an issue this time should be increased. It can also be set to zero to make - -: 123: * operations faster and more energy efficient if no errors will follow. By default wait time is zero. - -: 124: * - -: 125: * @param sim_wait_time - -: 126: */ - -: 127: virtual void set_extra_sim_wait_time(int sim_wait_time); - -: 128: - -: 129:private: - -: 130: - -: 131: struct sms_info_t { - -: 132: char date[SMS_MAX_TIME_STAMP_SIZE]; - -: 133: uint16_t msg_index[50]; // can hold up to 50 concatenated msg parts, indexes are in correct order. So max sms size is 50*140 = 7kb - -: 134: uint16_t msg_size; - -: 135: uint8_t parts; - -: 136: uint8_t parts_added; - -: 137: uint16_t msg_ref_number; - -: 138: struct sms_info_t *next_info; - #####: 139: sms_info_t() : msg_size(0), parts(1), parts_added(1), msg_ref_number(0), next_info(0){}; - -: 140: }; - -: 141: - -: 142: // application callback function for received sms - -: 143: Callback _cb; - -: 144: CellularSMSMmode _mode; - -: 145: bool _use_8bit_encoding; - -: 146: uint32_t _sim_wait_time; - -: 147: uint16_t _sms_message_ref_number; - -: 148: sms_info_t *_sms_info; - -: 149: - -: 150: // SMS urc's - -: 151: void cmt_urc(); - -: 152: void cmti_urc(); - -: 153: - -: 154: /** Set command selects the format of messages used with send, list, read and write commands. - -: 155: * - -: 156: * @param msg_format 0 PDU mode, 1 text mode - -: 157: * @return zero for success - -: 158: */ - -: 159: nsapi_error_t set_cmgf(int msg_format); - -: 160: - -: 161: /** Select message service (AT+CSMS select message service) - -: 162: * - -: 163: * @param msg_service 0 or 1. See more from 3GPP TS 27.005 - -: 164: * - -: 165: * @return zero for success - -: 166: */ - -: 167: nsapi_error_t set_csms(int msg_service); - -: 168: - -: 169: /* Set how receiving of new messages from the network is indicated to the TE. - -: 170: * - -: 171: * @return zero for success - -: 172: */ - -: 173: nsapi_error_t set_cnmi(); - -: 174: - -: 175: /** Set Text Mode Parameters - -: 176: * - -: 177: * @param fo See more from 3GPP TS 27.005 for all params. - -: 178: * @param vp - -: 179: * @param pid - -: 180: * @param dcs - -: 181: * @return zero for success - -: 182: */ - -: 183: nsapi_error_t set_csmp(int fo, int vp, int pid, int dcs); - -: 184: - -: 185: /** CSDH - Set command controls whether detailed header information is shown in text mode (AT+CMGF=1) result codes. - -: 186: * - -: 187: * @param show_header 1 to show detailed header in text mode, 0 for not showing. - -: 188: * @return zero for success - -: 189: */ - -: 190: nsapi_error_t set_csdh(int show_header); - -: 191: - -: 192: /** Delete SMS in the given message position(s) in the storage - -: 193: * - -: 194: * @param sms struct containing index array to delete - -: 195: * @return zero for success - -: 196: */ - -: 197: nsapi_error_t delete_sms(sms_info_t* sms); - -: 198: - -: 199: /** - -: 200: * Internal helper methods - -: 201: */ - -: 202: nsapi_error_t list_messages(); - -: 203: int read_sms_params(char *, char *); - -: 204: void free_linked_list(); - -: 205: void add_info(sms_info_t* info, int index, int part_number); - -: 206: int read_udh_from_pdu(const char* pdu, sms_info_t *info, int &part_number, int &parts, int &padding_bits); - -: 207: nsapi_size_or_error_t get_data_from_pdu(const char* pdu, sms_info_t *info, int *part_number, - -: 208: char *phone_number = NULL, char *msg = NULL); - -: 209: nsapi_size_or_error_t read_pdu_payload(const char* pdu, int scheme, char *msg, int padding_bits, bool last_part); - -: 210: sms_info_t* get_oldest_sms_index(); - -: 211: bool create_time(const char* time_string, time_t* time); - -: 212: int compare_time_strings(const char* time_string_1, const char* time_string_2); - -: 213: char* create_pdu(const char* phone_number, const char* message, uint8_t message_length, uint8_t msg_parts, - -: 214: uint8_t msg_part_number); - -: 215: nsapi_size_or_error_t read_sms_from_index(int msg_index, char* buf, uint16_t len, char* phone_num, - -: 216: char* time_stamp); - -: 217: nsapi_size_or_error_t read_sms(sms_info_t* sms, char* buf, char* phone_num, char* time_stamp); - -: 218: - -: 219: /** Packs the given str from ascii to 7bit gsm format and converts it to hex to the given buf. - -: 220: * - -: 221: * @param str string which is to be converted - -: 222: * @param len length of the str buffer - -: 223: * @param buf preallocated buffer which holds the converted string in hex format after successful call - -: 224: * @param number_of_padding_bit padding bits needed to keep the octet boundary - -: 225: * @return length of buffer buf or zero on failure - -: 226: */ - -: 227: uint16_t pack_7_bit_gsm_and_hex(const char* str, uint16_t len, char *buf, int number_of_padding_bit); - -: 228: - -: 229: /** Unpacks the given hex- and 7-bit gsm encoded str to ascii string - -: 230: * - -: 231: * @param str string which converted to ascii string to buf - -: 232: * @param len length of the str divided by two as str is hexencoded - -: 233: * @param buf preallocated destination buffer - -: 234: * @param padding_bits number of padding bits which were needed to hold the octet boundary - -: 235: * @param last_part true is last part of the encoded message - -: 236: * @return length of the destination buffer buf - -: 237: * - -: 238: */ - -: 239: uint16_t unpack_7_bit_gsm_to_str(const char* str, int len, char *buf, int padding_bits, - -: 240: bool last_part); - -: 241:}; - -: 242: - -: 243:} // namespace mbed - -: 244: - -: 245:#endif // AT_CELLULAR_SMS_H_ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/Callback.h.gcov b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/Callback.h.gcov deleted file mode 100644 index 3946a74e93..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/Callback.h.gcov +++ /dev/null @@ -1,4557 +0,0 @@ - -: 0:Source:../../../../../platform/Callback.h - -: 0:Graph:objs/AT_CellularSMS_unit/AT_CellularSMS.gcno - -: 0:Data:objs/AT_CellularSMS_unit/AT_CellularSMS.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* mbed Microcontroller Library - -: 2: * Copyright (c) 2006-2015 ARM Limited - -: 3: * - -: 4: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 5: * you may not use this file except in compliance with the License. - -: 6: * You may obtain a copy of the License at - -: 7: * - -: 8: * http://www.apache.org/licenses/LICENSE-2.0 - -: 9: * - -: 10: * Unless required by applicable law or agreed to in writing, software - -: 11: * distributed under the License is distributed on an "AS IS" BASIS, - -: 12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 13: * See the License for the specific language governing permissions and - -: 14: * limitations under the License. - -: 15: */ - -: 16:#ifndef MBED_CALLBACK_H - -: 17:#define MBED_CALLBACK_H - -: 18: - -: 19:#include - -: 20:#include - -: 21:#include - -: 22:#include "platform/mbed_assert.h" - -: 23:#include "platform/mbed_toolchain.h" - -: 24: - -: 25:namespace mbed { - -: 26:/** \addtogroup platform */ - -: 27:/** @{*/ - -: 28:/** - -: 29: * \defgroup platform_Callback Callback class - -: 30: * @{ - -: 31: */ - -: 32: - -: 33:/** Callback class based on template specialization - -: 34: * - -: 35: * @note Synchronization level: Not protected - -: 36: */ - -: 37:template - -: 38:class Callback; - -: 39: - -: 40:// Internal sfinae declarations - -: 41:// - -: 42:// These are used to eliminate overloads based on type attributes - -: 43:// 1. Does a function object have a call operator - -: 44:// 2. Does a function object fit in the available storage - -: 45:// - -: 46:// These eliminations are handled cleanly by the compiler and avoid - -: 47:// massive and misleading error messages when confronted with an - -: 48:// invalid type (or worse, runtime failures) - -: 49:namespace detail { - -: 50: struct nil {}; - -: 51: - -: 52: template - -: 53: struct enable_if { typedef R type; }; - -: 54: - -: 55: template - -: 56: struct enable_if {}; - -: 57: - -: 58: template - -: 59: struct is_type { - -: 60: static const bool value = true; - -: 61: }; - -: 62:} - -: 63: - -: 64:#define MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M) \ - -: 65: typename detail::enable_if< \ - -: 66: detail::is_type::value && \ - -: 67: sizeof(F) <= sizeof(uintptr_t) \ - -: 68: >::type = detail::nil() - -: 69: - -: 70:/** Callback class based on template specialization - -: 71: * - -: 72: * @note Synchronization level: Not protected - -: 73: */ - -: 74:template - -: 75:class Callback { - -: 76:public: - -: 77: /** Create a Callback with a static function - -: 78: * @param func Static function to attach - -: 79: */ - #####: 80: Callback(R (*func)() = 0) { - #####: 81: if (!func) { - #####: 82: memset(this, 0, sizeof(Callback)); - -: 83: } else { - #####: 84: generate(func); - -: 85: } - #####: 86: } - -: 87: - -: 88: /** Attach a Callback - -: 89: * @param func The Callback to attach - -: 90: */ - #####: 91: Callback(const Callback &func) { - #####: 92: if (func._ops) { - #####: 93: func._ops->move(this, &func); - -: 94: } - #####: 95: _ops = func._ops; - #####: 96: } - -: 97: - -: 98: /** Create a Callback with a member function - -: 99: * @param obj Pointer to object to invoke member function on - -: 100: * @param method Member function to attach - -: 101: */ - -: 102: template - 2: 103: Callback(U *obj, R (T::*method)()) { - 2: 104: generate(method_context(obj, method)); - 2: 105: } - -: 106: - -: 107: /** Create a Callback with a member function - -: 108: * @param obj Pointer to object to invoke member function on - -: 109: * @param method Member function to attach - -: 110: */ - -: 111: template - -: 112: Callback(const U *obj, R (T::*method)() const) { - -: 113: generate(method_context(obj, method)); - -: 114: } - -: 115: - -: 116: /** Create a Callback with a member function - -: 117: * @param obj Pointer to object to invoke member function on - -: 118: * @param method Member function to attach - -: 119: */ - -: 120: template - -: 121: Callback(volatile U *obj, R (T::*method)() volatile) { - -: 122: generate(method_context(obj, method)); - -: 123: } - -: 124: - -: 125: /** Create a Callback with a member function - -: 126: * @param obj Pointer to object to invoke member function on - -: 127: * @param method Member function to attach - -: 128: */ - -: 129: template - -: 130: Callback(const volatile U *obj, R (T::*method)() const volatile) { - -: 131: generate(method_context(obj, method)); - -: 132: } - -: 133: - -: 134: /** Create a Callback with a static function and bound pointer - -: 135: * @param func Static function to attach - -: 136: * @param arg Pointer argument to function - -: 137: */ - -: 138: template - -: 139: Callback(R (*func)(T*), U *arg) { - -: 140: generate(function_context(func, arg)); - -: 141: } - -: 142: - -: 143: /** Create a Callback with a static function and bound pointer - -: 144: * @param func Static function to attach - -: 145: * @param arg Pointer argument to function - -: 146: */ - -: 147: template - -: 148: Callback(R (*func)(const T*), const U *arg) { - -: 149: generate(function_context(func, arg)); - -: 150: } - -: 151: - -: 152: /** Create a Callback with a static function and bound pointer - -: 153: * @param func Static function to attach - -: 154: * @param arg Pointer argument to function - -: 155: */ - -: 156: template - -: 157: Callback(R (*func)(volatile T*), volatile U *arg) { - -: 158: generate(function_context(func, arg)); - -: 159: } - -: 160: - -: 161: /** Create a Callback with a static function and bound pointer - -: 162: * @param func Static function to attach - -: 163: * @param arg Pointer argument to function - -: 164: */ - -: 165: template - -: 166: Callback(R (*func)(const volatile T*), const volatile U *arg) { - -: 167: generate(function_context(func, arg)); - -: 168: } - -: 169: - -: 170: /** Create a Callback with a function object - -: 171: * @param f Function object to attach - -: 172: * @note The function object is limited to a single word of storage - -: 173: */ - -: 174: template - -: 175: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { - -: 176: generate(f); - -: 177: } - -: 178: - -: 179: /** Create a Callback with a function object - -: 180: * @param f Function object to attach - -: 181: * @note The function object is limited to a single word of storage - -: 182: */ - -: 183: template - -: 184: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { - -: 185: generate(f); - -: 186: } - -: 187: - -: 188: /** Create a Callback with a function object - -: 189: * @param f Function object to attach - -: 190: * @note The function object is limited to a single word of storage - -: 191: */ - -: 192: template - -: 193: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { - -: 194: generate(f); - -: 195: } - -: 196: - -: 197: /** Create a Callback with a function object - -: 198: * @param f Function object to attach - -: 199: * @note The function object is limited to a single word of storage - -: 200: */ - -: 201: template - -: 202: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { - -: 203: generate(f); - -: 204: } - -: 205: - -: 206: /** Create a Callback with a static function and bound pointer - -: 207: * @param obj Pointer to object to bind to function - -: 208: * @param func Static function to attach - -: 209: * @deprecated - -: 210: * Arguments to callback have been reordered to Callback(func, arg) - -: 211: */ - -: 212: template - -: 213: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 214: "Arguments to callback have been reordered to Callback(func, arg)") - -: 215: Callback(U *obj, R (*func)(T*)) { - -: 216: new (this) Callback(func, obj); - -: 217: } - -: 218: - -: 219: /** Create a Callback with a static function and bound pointer - -: 220: * @param obj Pointer to object to bind to function - -: 221: * @param func Static function to attach - -: 222: * @deprecated - -: 223: * Arguments to callback have been reordered to Callback(func, arg) - -: 224: */ - -: 225: template - -: 226: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 227: "Arguments to callback have been reordered to Callback(func, arg)") - -: 228: Callback(const U *obj, R (*func)(const T*)) { - -: 229: new (this) Callback(func, obj); - -: 230: } - -: 231: - -: 232: /** Create a Callback with a static function and bound pointer - -: 233: * @param obj Pointer to object to bind to function - -: 234: * @param func Static function to attach - -: 235: * @deprecated - -: 236: * Arguments to callback have been reordered to Callback(func, arg) - -: 237: */ - -: 238: template - -: 239: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 240: "Arguments to callback have been reordered to Callback(func, arg)") - -: 241: Callback(volatile U *obj, R (*func)(volatile T*)) { - -: 242: new (this) Callback(func, obj); - -: 243: } - -: 244: - -: 245: /** Create a Callback with a static function and bound pointer - -: 246: * @param obj Pointer to object to bind to function - -: 247: * @param func Static function to attach - -: 248: * @deprecated - -: 249: * Arguments to callback have been reordered to Callback(func, arg) - -: 250: */ - -: 251: template - -: 252: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 253: "Arguments to callback have been reordered to Callback(func, arg)") - -: 254: Callback(const volatile U *obj, R (*func)(const volatile T*)) { - -: 255: new (this) Callback(func, obj); - -: 256: } - -: 257: - -: 258: /** Destroy a callback - -: 259: */ - #####: 260: ~Callback() { - #####: 261: if (_ops) { - #####: 262: _ops->dtor(this); - -: 263: } - #####: 264: } - -: 265: - -: 266: /** Attach a static function - -: 267: * @param func Static function to attach - -: 268: * @deprecated - -: 269: * Replaced by simple assignment 'Callback cb = func' - -: 270: */ - -: 271: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 272: "Replaced by simple assignment 'Callback cb = func") - -: 273: void attach(R (*func)()) { - -: 274: this->~Callback(); - -: 275: new (this) Callback(func); - -: 276: } - -: 277: - -: 278: /** Attach a Callback - -: 279: * @param func The Callback to attach - -: 280: * @deprecated - -: 281: * Replaced by simple assignment 'Callback cb = func' - -: 282: */ - -: 283: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 284: "Replaced by simple assignment 'Callback cb = func") - -: 285: void attach(const Callback &func) { - -: 286: this->~Callback(); - -: 287: new (this) Callback(func); - -: 288: } - -: 289: - -: 290: /** Attach a member function - -: 291: * @param obj Pointer to object to invoke member function on - -: 292: * @param method Member function to attach - -: 293: * @deprecated - -: 294: * Replaced by simple assignment 'Callback cb = func' - -: 295: */ - -: 296: template - -: 297: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 298: "Replaced by simple assignment 'Callback cb = func") - -: 299: void attach(U *obj, R (T::*method)()) { - -: 300: this->~Callback(); - -: 301: new (this) Callback(obj, method); - -: 302: } - -: 303: - -: 304: /** Attach a member function - -: 305: * @param obj Pointer to object to invoke member function on - -: 306: * @param method Member function to attach - -: 307: * @deprecated - -: 308: * Replaced by simple assignment 'Callback cb = func' - -: 309: */ - -: 310: template - -: 311: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 312: "Replaced by simple assignment 'Callback cb = func") - -: 313: void attach(const U *obj, R (T::*method)() const) { - -: 314: this->~Callback(); - -: 315: new (this) Callback(obj, method); - -: 316: } - -: 317: - -: 318: /** Attach a member function - -: 319: * @param obj Pointer to object to invoke member function on - -: 320: * @param method Member function to attach - -: 321: * @deprecated - -: 322: * Replaced by simple assignment 'Callback cb = func' - -: 323: */ - -: 324: template - -: 325: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 326: "Replaced by simple assignment 'Callback cb = func") - -: 327: void attach(volatile U *obj, R (T::*method)() volatile) { - -: 328: this->~Callback(); - -: 329: new (this) Callback(obj, method); - -: 330: } - -: 331: - -: 332: /** Attach a member function - -: 333: * @param obj Pointer to object to invoke member function on - -: 334: * @param method Member function to attach - -: 335: * @deprecated - -: 336: * Replaced by simple assignment 'Callback cb = func' - -: 337: */ - -: 338: template - -: 339: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 340: "Replaced by simple assignment 'Callback cb = func") - -: 341: void attach(const volatile U *obj, R (T::*method)() const volatile) { - -: 342: this->~Callback(); - -: 343: new (this) Callback(obj, method); - -: 344: } - -: 345: - -: 346: /** Attach a static function with a bound pointer - -: 347: * @param func Static function to attach - -: 348: * @param arg Pointer argument to function - -: 349: * @deprecated - -: 350: * Replaced by simple assignment 'Callback cb = func' - -: 351: */ - -: 352: template - -: 353: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 354: "Replaced by simple assignment 'Callback cb = func") - -: 355: void attach(R (*func)(T*), U *arg) { - -: 356: this->~Callback(); - -: 357: new (this) Callback(func, arg); - -: 358: } - -: 359: - -: 360: /** Attach a static function with a bound pointer - -: 361: * @param func Static function to attach - -: 362: * @param arg Pointer argument to function - -: 363: * @deprecated - -: 364: * Replaced by simple assignment 'Callback cb = func' - -: 365: */ - -: 366: template - -: 367: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 368: "Replaced by simple assignment 'Callback cb = func") - -: 369: void attach(R (*func)(const T*), const U *arg) { - -: 370: this->~Callback(); - -: 371: new (this) Callback(func, arg); - -: 372: } - -: 373: - -: 374: /** Attach a static function with a bound pointer - -: 375: * @param func Static function to attach - -: 376: * @param arg Pointer argument to function - -: 377: * @deprecated - -: 378: * Replaced by simple assignment 'Callback cb = func' - -: 379: */ - -: 380: template - -: 381: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 382: "Replaced by simple assignment 'Callback cb = func") - -: 383: void attach(R (*func)(volatile T*), volatile U *arg) { - -: 384: this->~Callback(); - -: 385: new (this) Callback(func, arg); - -: 386: } - -: 387: - -: 388: /** Attach a static function with a bound pointer - -: 389: * @param func Static function to attach - -: 390: * @param arg Pointer argument to function - -: 391: * @deprecated - -: 392: * Replaced by simple assignment 'Callback cb = func' - -: 393: */ - -: 394: template - -: 395: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 396: "Replaced by simple assignment 'Callback cb = func") - -: 397: void attach(R (*func)(const volatile T*), const volatile U *arg) { - -: 398: this->~Callback(); - -: 399: new (this) Callback(func, arg); - -: 400: } - -: 401: - -: 402: /** Attach a function object - -: 403: * @param f Function object to attach - -: 404: * @note The function object is limited to a single word of storage - -: 405: * @deprecated - -: 406: * Replaced by simple assignment 'Callback cb = func' - -: 407: */ - -: 408: template - -: 409: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 410: "Replaced by simple assignment 'Callback cb = func") - -: 411: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { - -: 412: this->~Callback(); - -: 413: new (this) Callback(f); - -: 414: } - -: 415: - -: 416: /** Attach a function object - -: 417: * @param f Function object to attach - -: 418: * @note The function object is limited to a single word of storage - -: 419: * @deprecated - -: 420: * Replaced by simple assignment 'Callback cb = func' - -: 421: */ - -: 422: template - -: 423: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 424: "Replaced by simple assignment 'Callback cb = func") - -: 425: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { - -: 426: this->~Callback(); - -: 427: new (this) Callback(f); - -: 428: } - -: 429: - -: 430: /** Attach a function object - -: 431: * @param f Function object to attach - -: 432: * @note The function object is limited to a single word of storage - -: 433: * @deprecated - -: 434: * Replaced by simple assignment 'Callback cb = func' - -: 435: */ - -: 436: template - -: 437: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 438: "Replaced by simple assignment 'Callback cb = func") - -: 439: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { - -: 440: this->~Callback(); - -: 441: new (this) Callback(f); - -: 442: } - -: 443: - -: 444: /** Attach a function object - -: 445: * @param f Function object to attach - -: 446: * @note The function object is limited to a single word of storage - -: 447: * @deprecated - -: 448: * Replaced by simple assignment 'Callback cb = func' - -: 449: */ - -: 450: template - -: 451: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 452: "Replaced by simple assignment 'Callback cb = func") - -: 453: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { - -: 454: this->~Callback(); - -: 455: new (this) Callback(f); - -: 456: } - -: 457: - -: 458: /** Attach a static function with a bound pointer - -: 459: * @param obj Pointer to object to bind to function - -: 460: * @param func Static function to attach - -: 461: * @deprecated - -: 462: * Arguments to callback have been reordered to attach(func, arg) - -: 463: */ - -: 464: template - -: 465: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 466: "Arguments to callback have been reordered to attach(func, arg)") - -: 467: void attach(U *obj, R (*func)(T*)) { - -: 468: this->~Callback(); - -: 469: new (this) Callback(func, obj); - -: 470: } - -: 471: - -: 472: /** Attach a static function with a bound pointer - -: 473: * @param obj Pointer to object to bind to function - -: 474: * @param func Static function to attach - -: 475: * @deprecated - -: 476: * Arguments to callback have been reordered to attach(func, arg) - -: 477: */ - -: 478: template - -: 479: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 480: "Arguments to callback have been reordered to attach(func, arg)") - -: 481: void attach(const U *obj, R (*func)(const T*)) { - -: 482: this->~Callback(); - -: 483: new (this) Callback(func, obj); - -: 484: } - -: 485: - -: 486: /** Attach a static function with a bound pointer - -: 487: * @param obj Pointer to object to bind to function - -: 488: * @param func Static function to attach - -: 489: * @deprecated - -: 490: * Arguments to callback have been reordered to attach(func, arg) - -: 491: */ - -: 492: template - -: 493: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 494: "Arguments to callback have been reordered to attach(func, arg)") - -: 495: void attach(volatile U *obj, R (*func)(volatile T*)) { - -: 496: this->~Callback(); - -: 497: new (this) Callback(func, obj); - -: 498: } - -: 499: - -: 500: /** Attach a static function with a bound pointer - -: 501: * @param obj Pointer to object to bind to function - -: 502: * @param func Static function to attach - -: 503: * @deprecated - -: 504: * Arguments to callback have been reordered to attach(func, arg) - -: 505: */ - -: 506: template - -: 507: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 508: "Arguments to callback have been reordered to attach(func, arg)") - -: 509: void attach(const volatile U *obj, R (*func)(const volatile T*)) { - -: 510: this->~Callback(); - -: 511: new (this) Callback(func, obj); - -: 512: } - -: 513: - -: 514: /** Assign a callback - -: 515: */ - #####: 516: Callback &operator=(const Callback &that) { - #####: 517: if (this != &that) { - #####: 518: this->~Callback(); - #####: 519: new (this) Callback(that); - -: 520: } - -: 521: - #####: 522: return *this; - -: 523: } - -: 524: - -: 525: /** Call the attached function - -: 526: */ - #####: 527: R call() const { - #####: 528: MBED_ASSERT(_ops); - #####: 529: return _ops->call(this); - -: 530: } - -: 531: - -: 532: /** Call the attached function - -: 533: */ - #####: 534: R operator()() const { - #####: 535: return call(); - -: 536: } - -: 537: - -: 538: /** Test if function has been attached - -: 539: */ - #####: 540: operator bool() const { - #####: 541: return _ops; - -: 542: } - -: 543: - -: 544: /** Test for equality - -: 545: */ - -: 546: friend bool operator==(const Callback &l, const Callback &r) { - -: 547: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 548: } - -: 549: - -: 550: /** Test for inequality - -: 551: */ - -: 552: friend bool operator!=(const Callback &l, const Callback &r) { - -: 553: return !(l == r); - -: 554: } - -: 555: - -: 556: /** Static thunk for passing as C-style function - -: 557: * @param func Callback to call passed as void pointer - -: 558: * @return the value as determined by func which is of - -: 559: * type and determined by the signiture of func - -: 560: */ - -: 561: static R thunk(void *func) { - -: 562: return static_cast(func)->call(); - -: 563: } - -: 564: - -: 565:private: - -: 566: // Stored as pointer to function and pointer to optional object - -: 567: // Function pointer is stored as union of possible function types - -: 568: // to garuntee proper size and alignment - -: 569: struct _class; - -: 570: union { - -: 571: void (*_staticfunc)(); - -: 572: void (*_boundfunc)(_class*); - -: 573: void (_class::*_methodfunc)(); - -: 574: } _func; - -: 575: void *_obj; - -: 576: - -: 577: // Dynamically dispatched operations - -: 578: const struct ops { - -: 579: R (*call)(const void*); - -: 580: void (*move)(void*, const void*); - -: 581: void (*dtor)(void*); - -: 582: } *_ops; - -: 583: - -: 584: // Generate operations for function object - -: 585: template - 2: 586: void generate(const F &f) { - -: 587: static const ops ops = { - -: 588: &Callback::function_call, - -: 589: &Callback::function_move, - -: 590: &Callback::function_dtor, - -: 591: }; - -: 592: - -: 593: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 594: "Type F must not exceed the size of the Callback class"); - 2: 595: memset(this, 0, sizeof(Callback)); - 2: 596: new (this) F(f); - 2: 597: _ops = &ops; - 2: 598: } - -: 599: - -: 600: // Function attributes - -: 601: template - #####: 602: static R function_call(const void *p) { - #####: 603: return (*(F*)p)(); - -: 604: } - -: 605: - -: 606: template - 2: 607: static void function_move(void *d, const void *p) { - 2: 608: new (d) F(*(F*)p); - 2: 609: } - -: 610: - -: 611: template - 4: 612: static void function_dtor(void *p) { - -: 613: ((F*)p)->~F(); - 4: 614: } - -: 615: - -: 616: // Wrappers for functions with context - -: 617: template - -: 618: struct method_context { - -: 619: M method; - -: 620: O *obj; - -: 621: - 2: 622: method_context(O *obj, M method) - 2: 623: : method(method), obj(obj) {} - -: 624: - #####: 625: R operator()() const { - #####: 626: return (obj->*method)(); - -: 627: } - -: 628: }; - -: 629: - -: 630: template - -: 631: struct function_context { - -: 632: F func; - -: 633: A *arg; - -: 634: - -: 635: function_context(F func, A *arg) - -: 636: : func(func), arg(arg) {} - -: 637: - -: 638: R operator()() const { - -: 639: return func(arg); - -: 640: } - -: 641: }; - -: 642:}; - -: 643: - -: 644:/** Callback class based on template specialization - -: 645: * - -: 646: * @note Synchronization level: Not protected - -: 647: */ - -: 648:template - -: 649:class Callback { - -: 650:public: - -: 651: /** Create a Callback with a static function - -: 652: * @param func Static function to attach - -: 653: */ - -: 654: Callback(R (*func)(A0) = 0) { - -: 655: if (!func) { - -: 656: memset(this, 0, sizeof(Callback)); - -: 657: } else { - -: 658: generate(func); - -: 659: } - -: 660: } - -: 661: - -: 662: /** Attach a Callback - -: 663: * @param func The Callback to attach - -: 664: */ - -: 665: Callback(const Callback &func) { - -: 666: if (func._ops) { - -: 667: func._ops->move(this, &func); - -: 668: } - -: 669: _ops = func._ops; - -: 670: } - -: 671: - -: 672: /** Create a Callback with a member function - -: 673: * @param obj Pointer to object to invoke member function on - -: 674: * @param method Member function to attach - -: 675: */ - -: 676: template - -: 677: Callback(U *obj, R (T::*method)(A0)) { - -: 678: generate(method_context(obj, method)); - -: 679: } - -: 680: - -: 681: /** Create a Callback with a member function - -: 682: * @param obj Pointer to object to invoke member function on - -: 683: * @param method Member function to attach - -: 684: */ - -: 685: template - -: 686: Callback(const U *obj, R (T::*method)(A0) const) { - -: 687: generate(method_context(obj, method)); - -: 688: } - -: 689: - -: 690: /** Create a Callback with a member function - -: 691: * @param obj Pointer to object to invoke member function on - -: 692: * @param method Member function to attach - -: 693: */ - -: 694: template - -: 695: Callback(volatile U *obj, R (T::*method)(A0) volatile) { - -: 696: generate(method_context(obj, method)); - -: 697: } - -: 698: - -: 699: /** Create a Callback with a member function - -: 700: * @param obj Pointer to object to invoke member function on - -: 701: * @param method Member function to attach - -: 702: */ - -: 703: template - -: 704: Callback(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 705: generate(method_context(obj, method)); - -: 706: } - -: 707: - -: 708: /** Create a Callback with a static function and bound pointer - -: 709: * @param func Static function to attach - -: 710: * @param arg Pointer argument to function - -: 711: */ - -: 712: template - -: 713: Callback(R (*func)(T*, A0), U *arg) { - -: 714: generate(function_context(func, arg)); - -: 715: } - -: 716: - -: 717: /** Create a Callback with a static function and bound pointer - -: 718: * @param func Static function to attach - -: 719: * @param arg Pointer argument to function - -: 720: */ - -: 721: template - -: 722: Callback(R (*func)(const T*, A0), const U *arg) { - -: 723: generate(function_context(func, arg)); - -: 724: } - -: 725: - -: 726: /** Create a Callback with a static function and bound pointer - -: 727: * @param func Static function to attach - -: 728: * @param arg Pointer argument to function - -: 729: */ - -: 730: template - -: 731: Callback(R (*func)(volatile T*, A0), volatile U *arg) { - -: 732: generate(function_context(func, arg)); - -: 733: } - -: 734: - -: 735: /** Create a Callback with a static function and bound pointer - -: 736: * @param func Static function to attach - -: 737: * @param arg Pointer argument to function - -: 738: */ - -: 739: template - -: 740: Callback(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 741: generate(function_context(func, arg)); - -: 742: } - -: 743: - -: 744: /** Create a Callback with a function object - -: 745: * @param f Function object to attach - -: 746: * @note The function object is limited to a single word of storage - -: 747: */ - -: 748: template - -: 749: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { - -: 750: generate(f); - -: 751: } - -: 752: - -: 753: /** Create a Callback with a function object - -: 754: * @param f Function object to attach - -: 755: * @note The function object is limited to a single word of storage - -: 756: */ - -: 757: template - -: 758: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { - -: 759: generate(f); - -: 760: } - -: 761: - -: 762: /** Create a Callback with a function object - -: 763: * @param f Function object to attach - -: 764: * @note The function object is limited to a single word of storage - -: 765: */ - -: 766: template - -: 767: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { - -: 768: generate(f); - -: 769: } - -: 770: - -: 771: /** Create a Callback with a function object - -: 772: * @param f Function object to attach - -: 773: * @note The function object is limited to a single word of storage - -: 774: */ - -: 775: template - -: 776: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { - -: 777: generate(f); - -: 778: } - -: 779: - -: 780: /** Create a Callback with a static function and bound pointer - -: 781: * @param obj Pointer to object to bind to function - -: 782: * @param func Static function to attach - -: 783: * @deprecated - -: 784: * Arguments to callback have been reordered to Callback(func, arg) - -: 785: */ - -: 786: template - -: 787: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 788: "Arguments to callback have been reordered to Callback(func, arg)") - -: 789: Callback(U *obj, R (*func)(T*, A0)) { - -: 790: new (this) Callback(func, obj); - -: 791: } - -: 792: - -: 793: /** Create a Callback with a static function and bound pointer - -: 794: * @param obj Pointer to object to bind to function - -: 795: * @param func Static function to attach - -: 796: * @deprecated - -: 797: * Arguments to callback have been reordered to Callback(func, arg) - -: 798: */ - -: 799: template - -: 800: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 801: "Arguments to callback have been reordered to Callback(func, arg)") - -: 802: Callback(const U *obj, R (*func)(const T*, A0)) { - -: 803: new (this) Callback(func, obj); - -: 804: } - -: 805: - -: 806: /** Create a Callback with a static function and bound pointer - -: 807: * @param obj Pointer to object to bind to function - -: 808: * @param func Static function to attach - -: 809: * @deprecated - -: 810: * Arguments to callback have been reordered to Callback(func, arg) - -: 811: */ - -: 812: template - -: 813: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 814: "Arguments to callback have been reordered to Callback(func, arg)") - -: 815: Callback(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 816: new (this) Callback(func, obj); - -: 817: } - -: 818: - -: 819: /** Create a Callback with a static function and bound pointer - -: 820: * @param obj Pointer to object to bind to function - -: 821: * @param func Static function to attach - -: 822: * @deprecated - -: 823: * Arguments to callback have been reordered to Callback(func, arg) - -: 824: */ - -: 825: template - -: 826: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 827: "Arguments to callback have been reordered to Callback(func, arg)") - -: 828: Callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 829: new (this) Callback(func, obj); - -: 830: } - -: 831: - -: 832: /** Destroy a callback - -: 833: */ - -: 834: ~Callback() { - -: 835: if (_ops) { - -: 836: _ops->dtor(this); - -: 837: } - -: 838: } - -: 839: - -: 840: /** Attach a static function - -: 841: * @param func Static function to attach - -: 842: * @deprecated - -: 843: * Replaced by simple assignment 'Callback cb = func' - -: 844: */ - -: 845: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 846: "Replaced by simple assignment 'Callback cb = func") - -: 847: void attach(R (*func)(A0)) { - -: 848: this->~Callback(); - -: 849: new (this) Callback(func); - -: 850: } - -: 851: - -: 852: /** Attach a Callback - -: 853: * @param func The Callback to attach - -: 854: * @deprecated - -: 855: * Replaced by simple assignment 'Callback cb = func' - -: 856: */ - -: 857: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 858: "Replaced by simple assignment 'Callback cb = func") - -: 859: void attach(const Callback &func) { - -: 860: this->~Callback(); - -: 861: new (this) Callback(func); - -: 862: } - -: 863: - -: 864: /** Attach a member function - -: 865: * @param obj Pointer to object to invoke member function on - -: 866: * @param method Member function to attach - -: 867: * @deprecated - -: 868: * Replaced by simple assignment 'Callback cb = func' - -: 869: */ - -: 870: template - -: 871: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 872: "Replaced by simple assignment 'Callback cb = func") - -: 873: void attach(U *obj, R (T::*method)(A0)) { - -: 874: this->~Callback(); - -: 875: new (this) Callback(obj, method); - -: 876: } - -: 877: - -: 878: /** Attach a member function - -: 879: * @param obj Pointer to object to invoke member function on - -: 880: * @param method Member function to attach - -: 881: * @deprecated - -: 882: * Replaced by simple assignment 'Callback cb = func' - -: 883: */ - -: 884: template - -: 885: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 886: "Replaced by simple assignment 'Callback cb = func") - -: 887: void attach(const U *obj, R (T::*method)(A0) const) { - -: 888: this->~Callback(); - -: 889: new (this) Callback(obj, method); - -: 890: } - -: 891: - -: 892: /** Attach a member function - -: 893: * @param obj Pointer to object to invoke member function on - -: 894: * @param method Member function to attach - -: 895: * @deprecated - -: 896: * Replaced by simple assignment 'Callback cb = func' - -: 897: */ - -: 898: template - -: 899: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 900: "Replaced by simple assignment 'Callback cb = func") - -: 901: void attach(volatile U *obj, R (T::*method)(A0) volatile) { - -: 902: this->~Callback(); - -: 903: new (this) Callback(obj, method); - -: 904: } - -: 905: - -: 906: /** Attach a member function - -: 907: * @param obj Pointer to object to invoke member function on - -: 908: * @param method Member function to attach - -: 909: * @deprecated - -: 910: * Replaced by simple assignment 'Callback cb = func' - -: 911: */ - -: 912: template - -: 913: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 914: "Replaced by simple assignment 'Callback cb = func") - -: 915: void attach(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 916: this->~Callback(); - -: 917: new (this) Callback(obj, method); - -: 918: } - -: 919: - -: 920: /** Attach a static function with a bound pointer - -: 921: * @param func Static function to attach - -: 922: * @param arg Pointer argument to function - -: 923: * @deprecated - -: 924: * Replaced by simple assignment 'Callback cb = func' - -: 925: */ - -: 926: template - -: 927: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 928: "Replaced by simple assignment 'Callback cb = func") - -: 929: void attach(R (*func)(T*, A0), U *arg) { - -: 930: this->~Callback(); - -: 931: new (this) Callback(func, arg); - -: 932: } - -: 933: - -: 934: /** Attach a static function with a bound pointer - -: 935: * @param func Static function to attach - -: 936: * @param arg Pointer argument to function - -: 937: * @deprecated - -: 938: * Replaced by simple assignment 'Callback cb = func' - -: 939: */ - -: 940: template - -: 941: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 942: "Replaced by simple assignment 'Callback cb = func") - -: 943: void attach(R (*func)(const T*, A0), const U *arg) { - -: 944: this->~Callback(); - -: 945: new (this) Callback(func, arg); - -: 946: } - -: 947: - -: 948: /** Attach a static function with a bound pointer - -: 949: * @param func Static function to attach - -: 950: * @param arg Pointer argument to function - -: 951: * @deprecated - -: 952: * Replaced by simple assignment 'Callback cb = func' - -: 953: */ - -: 954: template - -: 955: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 956: "Replaced by simple assignment 'Callback cb = func") - -: 957: void attach(R (*func)(volatile T*, A0), volatile U *arg) { - -: 958: this->~Callback(); - -: 959: new (this) Callback(func, arg); - -: 960: } - -: 961: - -: 962: /** Attach a static function with a bound pointer - -: 963: * @param func Static function to attach - -: 964: * @param arg Pointer argument to function - -: 965: * @deprecated - -: 966: * Replaced by simple assignment 'Callback cb = func' - -: 967: */ - -: 968: template - -: 969: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 970: "Replaced by simple assignment 'Callback cb = func") - -: 971: void attach(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 972: this->~Callback(); - -: 973: new (this) Callback(func, arg); - -: 974: } - -: 975: - -: 976: /** Attach a function object - -: 977: * @param f Function object to attach - -: 978: * @note The function object is limited to a single word of storage - -: 979: * @deprecated - -: 980: * Replaced by simple assignment 'Callback cb = func' - -: 981: */ - -: 982: template - -: 983: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 984: "Replaced by simple assignment 'Callback cb = func") - -: 985: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { - -: 986: this->~Callback(); - -: 987: new (this) Callback(f); - -: 988: } - -: 989: - -: 990: /** Attach a function object - -: 991: * @param f Function object to attach - -: 992: * @note The function object is limited to a single word of storage - -: 993: * @deprecated - -: 994: * Replaced by simple assignment 'Callback cb = func' - -: 995: */ - -: 996: template - -: 997: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 998: "Replaced by simple assignment 'Callback cb = func") - -: 999: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { - -: 1000: this->~Callback(); - -: 1001: new (this) Callback(f); - -: 1002: } - -: 1003: - -: 1004: /** Attach a function object - -: 1005: * @param f Function object to attach - -: 1006: * @note The function object is limited to a single word of storage - -: 1007: * @deprecated - -: 1008: * Replaced by simple assignment 'Callback cb = func' - -: 1009: */ - -: 1010: template - -: 1011: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1012: "Replaced by simple assignment 'Callback cb = func") - -: 1013: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { - -: 1014: this->~Callback(); - -: 1015: new (this) Callback(f); - -: 1016: } - -: 1017: - -: 1018: /** Attach a function object - -: 1019: * @param f Function object to attach - -: 1020: * @note The function object is limited to a single word of storage - -: 1021: * @deprecated - -: 1022: * Replaced by simple assignment 'Callback cb = func' - -: 1023: */ - -: 1024: template - -: 1025: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1026: "Replaced by simple assignment 'Callback cb = func") - -: 1027: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { - -: 1028: this->~Callback(); - -: 1029: new (this) Callback(f); - -: 1030: } - -: 1031: - -: 1032: /** Attach a static function with a bound pointer - -: 1033: * @param obj Pointer to object to bind to function - -: 1034: * @param func Static function to attach - -: 1035: * @deprecated - -: 1036: * Arguments to callback have been reordered to attach(func, arg) - -: 1037: */ - -: 1038: template - -: 1039: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1040: "Arguments to callback have been reordered to attach(func, arg)") - -: 1041: void attach(U *obj, R (*func)(T*, A0)) { - -: 1042: this->~Callback(); - -: 1043: new (this) Callback(func, obj); - -: 1044: } - -: 1045: - -: 1046: /** Attach a static function with a bound pointer - -: 1047: * @param obj Pointer to object to bind to function - -: 1048: * @param func Static function to attach - -: 1049: * @deprecated - -: 1050: * Arguments to callback have been reordered to attach(func, arg) - -: 1051: */ - -: 1052: template - -: 1053: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1054: "Arguments to callback have been reordered to attach(func, arg)") - -: 1055: void attach(const U *obj, R (*func)(const T*, A0)) { - -: 1056: this->~Callback(); - -: 1057: new (this) Callback(func, obj); - -: 1058: } - -: 1059: - -: 1060: /** Attach a static function with a bound pointer - -: 1061: * @param obj Pointer to object to bind to function - -: 1062: * @param func Static function to attach - -: 1063: * @deprecated - -: 1064: * Arguments to callback have been reordered to attach(func, arg) - -: 1065: */ - -: 1066: template - -: 1067: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1068: "Arguments to callback have been reordered to attach(func, arg)") - -: 1069: void attach(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 1070: this->~Callback(); - -: 1071: new (this) Callback(func, obj); - -: 1072: } - -: 1073: - -: 1074: /** Attach a static function with a bound pointer - -: 1075: * @param obj Pointer to object to bind to function - -: 1076: * @param func Static function to attach - -: 1077: * @deprecated - -: 1078: * Arguments to callback have been reordered to attach(func, arg) - -: 1079: */ - -: 1080: template - -: 1081: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1082: "Arguments to callback have been reordered to attach(func, arg)") - -: 1083: void attach(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 1084: this->~Callback(); - -: 1085: new (this) Callback(func, obj); - -: 1086: } - -: 1087: - -: 1088: /** Assign a callback - -: 1089: */ - -: 1090: Callback &operator=(const Callback &that) { - -: 1091: if (this != &that) { - -: 1092: this->~Callback(); - -: 1093: new (this) Callback(that); - -: 1094: } - -: 1095: - -: 1096: return *this; - -: 1097: } - -: 1098: - -: 1099: /** Call the attached function - -: 1100: */ - -: 1101: R call(A0 a0) const { - -: 1102: MBED_ASSERT(_ops); - -: 1103: return _ops->call(this, a0); - -: 1104: } - -: 1105: - -: 1106: /** Call the attached function - -: 1107: */ - -: 1108: R operator()(A0 a0) const { - -: 1109: return call(a0); - -: 1110: } - -: 1111: - -: 1112: /** Test if function has been attached - -: 1113: */ - -: 1114: operator bool() const { - -: 1115: return _ops; - -: 1116: } - -: 1117: - -: 1118: /** Test for equality - -: 1119: */ - -: 1120: friend bool operator==(const Callback &l, const Callback &r) { - -: 1121: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 1122: } - -: 1123: - -: 1124: /** Test for inequality - -: 1125: */ - -: 1126: friend bool operator!=(const Callback &l, const Callback &r) { - -: 1127: return !(l == r); - -: 1128: } - -: 1129: - -: 1130: /** Static thunk for passing as C-style function - -: 1131: * @param func Callback to call passed as void pointer - -: 1132: * @param a0 An argument to be called with function func - -: 1133: * @return the value as determined by func which is of - -: 1134: * type and determined by the signiture of func - -: 1135: */ - -: 1136: static R thunk(void *func, A0 a0) { - -: 1137: return static_cast(func)->call(a0); - -: 1138: } - -: 1139: - -: 1140:private: - -: 1141: // Stored as pointer to function and pointer to optional object - -: 1142: // Function pointer is stored as union of possible function types - -: 1143: // to garuntee proper size and alignment - -: 1144: struct _class; - -: 1145: union { - -: 1146: void (*_staticfunc)(A0); - -: 1147: void (*_boundfunc)(_class*, A0); - -: 1148: void (_class::*_methodfunc)(A0); - -: 1149: } _func; - -: 1150: void *_obj; - -: 1151: - -: 1152: // Dynamically dispatched operations - -: 1153: const struct ops { - -: 1154: R (*call)(const void*, A0); - -: 1155: void (*move)(void*, const void*); - -: 1156: void (*dtor)(void*); - -: 1157: } *_ops; - -: 1158: - -: 1159: // Generate operations for function object - -: 1160: template - -: 1161: void generate(const F &f) { - -: 1162: static const ops ops = { - -: 1163: &Callback::function_call, - -: 1164: &Callback::function_move, - -: 1165: &Callback::function_dtor, - -: 1166: }; - -: 1167: - -: 1168: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 1169: "Type F must not exceed the size of the Callback class"); - -: 1170: memset(this, 0, sizeof(Callback)); - -: 1171: new (this) F(f); - -: 1172: _ops = &ops; - -: 1173: } - -: 1174: - -: 1175: // Function attributes - -: 1176: template - -: 1177: static R function_call(const void *p, A0 a0) { - -: 1178: return (*(F*)p)(a0); - -: 1179: } - -: 1180: - -: 1181: template - -: 1182: static void function_move(void *d, const void *p) { - -: 1183: new (d) F(*(F*)p); - -: 1184: } - -: 1185: - -: 1186: template - -: 1187: static void function_dtor(void *p) { - -: 1188: ((F*)p)->~F(); - -: 1189: } - -: 1190: - -: 1191: // Wrappers for functions with context - -: 1192: template - -: 1193: struct method_context { - -: 1194: M method; - -: 1195: O *obj; - -: 1196: - -: 1197: method_context(O *obj, M method) - -: 1198: : method(method), obj(obj) {} - -: 1199: - -: 1200: R operator()(A0 a0) const { - -: 1201: return (obj->*method)(a0); - -: 1202: } - -: 1203: }; - -: 1204: - -: 1205: template - -: 1206: struct function_context { - -: 1207: F func; - -: 1208: A *arg; - -: 1209: - -: 1210: function_context(F func, A *arg) - -: 1211: : func(func), arg(arg) {} - -: 1212: - -: 1213: R operator()(A0 a0) const { - -: 1214: return func(arg, a0); - -: 1215: } - -: 1216: }; - -: 1217:}; - -: 1218: - -: 1219:/** Callback class based on template specialization - -: 1220: * - -: 1221: * @note Synchronization level: Not protected - -: 1222: */ - -: 1223:template - -: 1224:class Callback { - -: 1225:public: - -: 1226: /** Create a Callback with a static function - -: 1227: * @param func Static function to attach - -: 1228: */ - -: 1229: Callback(R (*func)(A0, A1) = 0) { - -: 1230: if (!func) { - -: 1231: memset(this, 0, sizeof(Callback)); - -: 1232: } else { - -: 1233: generate(func); - -: 1234: } - -: 1235: } - -: 1236: - -: 1237: /** Attach a Callback - -: 1238: * @param func The Callback to attach - -: 1239: */ - -: 1240: Callback(const Callback &func) { - -: 1241: if (func._ops) { - -: 1242: func._ops->move(this, &func); - -: 1243: } - -: 1244: _ops = func._ops; - -: 1245: } - -: 1246: - -: 1247: /** Create a Callback with a member function - -: 1248: * @param obj Pointer to object to invoke member function on - -: 1249: * @param method Member function to attach - -: 1250: */ - -: 1251: template - -: 1252: Callback(U *obj, R (T::*method)(A0, A1)) { - -: 1253: generate(method_context(obj, method)); - -: 1254: } - -: 1255: - -: 1256: /** Create a Callback with a member function - -: 1257: * @param obj Pointer to object to invoke member function on - -: 1258: * @param method Member function to attach - -: 1259: */ - -: 1260: template - -: 1261: Callback(const U *obj, R (T::*method)(A0, A1) const) { - -: 1262: generate(method_context(obj, method)); - -: 1263: } - -: 1264: - -: 1265: /** Create a Callback with a member function - -: 1266: * @param obj Pointer to object to invoke member function on - -: 1267: * @param method Member function to attach - -: 1268: */ - -: 1269: template - -: 1270: Callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 1271: generate(method_context(obj, method)); - -: 1272: } - -: 1273: - -: 1274: /** Create a Callback with a member function - -: 1275: * @param obj Pointer to object to invoke member function on - -: 1276: * @param method Member function to attach - -: 1277: */ - -: 1278: template - -: 1279: Callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 1280: generate(method_context(obj, method)); - -: 1281: } - -: 1282: - -: 1283: /** Create a Callback with a static function and bound pointer - -: 1284: * @param func Static function to attach - -: 1285: * @param arg Pointer argument to function - -: 1286: */ - -: 1287: template - -: 1288: Callback(R (*func)(T*, A0, A1), U *arg) { - -: 1289: generate(function_context(func, arg)); - -: 1290: } - -: 1291: - -: 1292: /** Create a Callback with a static function and bound pointer - -: 1293: * @param func Static function to attach - -: 1294: * @param arg Pointer argument to function - -: 1295: */ - -: 1296: template - -: 1297: Callback(R (*func)(const T*, A0, A1), const U *arg) { - -: 1298: generate(function_context(func, arg)); - -: 1299: } - -: 1300: - -: 1301: /** Create a Callback with a static function and bound pointer - -: 1302: * @param func Static function to attach - -: 1303: * @param arg Pointer argument to function - -: 1304: */ - -: 1305: template - -: 1306: Callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 1307: generate(function_context(func, arg)); - -: 1308: } - -: 1309: - -: 1310: /** Create a Callback with a static function and bound pointer - -: 1311: * @param func Static function to attach - -: 1312: * @param arg Pointer argument to function - -: 1313: */ - -: 1314: template - -: 1315: Callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 1316: generate(function_context(func, arg)); - -: 1317: } - -: 1318: - -: 1319: /** Create a Callback with a function object - -: 1320: * @param f Function object to attach - -: 1321: * @note The function object is limited to a single word of storage - -: 1322: */ - -: 1323: template - -: 1324: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { - -: 1325: generate(f); - -: 1326: } - -: 1327: - -: 1328: /** Create a Callback with a function object - -: 1329: * @param f Function object to attach - -: 1330: * @note The function object is limited to a single word of storage - -: 1331: */ - -: 1332: template - -: 1333: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { - -: 1334: generate(f); - -: 1335: } - -: 1336: - -: 1337: /** Create a Callback with a function object - -: 1338: * @param f Function object to attach - -: 1339: * @note The function object is limited to a single word of storage - -: 1340: */ - -: 1341: template - -: 1342: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { - -: 1343: generate(f); - -: 1344: } - -: 1345: - -: 1346: /** Create a Callback with a function object - -: 1347: * @param f Function object to attach - -: 1348: * @note The function object is limited to a single word of storage - -: 1349: */ - -: 1350: template - -: 1351: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { - -: 1352: generate(f); - -: 1353: } - -: 1354: - -: 1355: /** Create a Callback with a static function and bound pointer - -: 1356: * @param obj Pointer to object to bind to function - -: 1357: * @param func Static function to attach - -: 1358: * @deprecated - -: 1359: * Arguments to callback have been reordered to Callback(func, arg) - -: 1360: */ - -: 1361: template - -: 1362: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1363: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1364: Callback(U *obj, R (*func)(T*, A0, A1)) { - -: 1365: new (this) Callback(func, obj); - -: 1366: } - -: 1367: - -: 1368: /** Create a Callback with a static function and bound pointer - -: 1369: * @param obj Pointer to object to bind to function - -: 1370: * @param func Static function to attach - -: 1371: * @deprecated - -: 1372: * Arguments to callback have been reordered to Callback(func, arg) - -: 1373: */ - -: 1374: template - -: 1375: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1376: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1377: Callback(const U *obj, R (*func)(const T*, A0, A1)) { - -: 1378: new (this) Callback(func, obj); - -: 1379: } - -: 1380: - -: 1381: /** Create a Callback with a static function and bound pointer - -: 1382: * @param obj Pointer to object to bind to function - -: 1383: * @param func Static function to attach - -: 1384: * @deprecated - -: 1385: * Arguments to callback have been reordered to Callback(func, arg) - -: 1386: */ - -: 1387: template - -: 1388: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1389: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1390: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 1391: new (this) Callback(func, obj); - -: 1392: } - -: 1393: - -: 1394: /** Create a Callback with a static function and bound pointer - -: 1395: * @param obj Pointer to object to bind to function - -: 1396: * @param func Static function to attach - -: 1397: * @deprecated - -: 1398: * Arguments to callback have been reordered to Callback(func, arg) - -: 1399: */ - -: 1400: template - -: 1401: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1402: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1403: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 1404: new (this) Callback(func, obj); - -: 1405: } - -: 1406: - -: 1407: /** Destroy a callback - -: 1408: */ - -: 1409: ~Callback() { - -: 1410: if (_ops) { - -: 1411: _ops->dtor(this); - -: 1412: } - -: 1413: } - -: 1414: - -: 1415: /** Attach a static function - -: 1416: * @param func Static function to attach - -: 1417: * @deprecated - -: 1418: * Replaced by simple assignment 'Callback cb = func' - -: 1419: */ - -: 1420: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1421: "Replaced by simple assignment 'Callback cb = func") - -: 1422: void attach(R (*func)(A0, A1)) { - -: 1423: this->~Callback(); - -: 1424: new (this) Callback(func); - -: 1425: } - -: 1426: - -: 1427: /** Attach a Callback - -: 1428: * @param func The Callback to attach - -: 1429: * @deprecated - -: 1430: * Replaced by simple assignment 'Callback cb = func' - -: 1431: */ - -: 1432: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1433: "Replaced by simple assignment 'Callback cb = func") - -: 1434: void attach(const Callback &func) { - -: 1435: this->~Callback(); - -: 1436: new (this) Callback(func); - -: 1437: } - -: 1438: - -: 1439: /** Attach a member function - -: 1440: * @param obj Pointer to object to invoke member function on - -: 1441: * @param method Member function to attach - -: 1442: * @deprecated - -: 1443: * Replaced by simple assignment 'Callback cb = func' - -: 1444: */ - -: 1445: template - -: 1446: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1447: "Replaced by simple assignment 'Callback cb = func") - -: 1448: void attach(U *obj, R (T::*method)(A0, A1)) { - -: 1449: this->~Callback(); - -: 1450: new (this) Callback(obj, method); - -: 1451: } - -: 1452: - -: 1453: /** Attach a member function - -: 1454: * @param obj Pointer to object to invoke member function on - -: 1455: * @param method Member function to attach - -: 1456: * @deprecated - -: 1457: * Replaced by simple assignment 'Callback cb = func' - -: 1458: */ - -: 1459: template - -: 1460: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1461: "Replaced by simple assignment 'Callback cb = func") - -: 1462: void attach(const U *obj, R (T::*method)(A0, A1) const) { - -: 1463: this->~Callback(); - -: 1464: new (this) Callback(obj, method); - -: 1465: } - -: 1466: - -: 1467: /** Attach a member function - -: 1468: * @param obj Pointer to object to invoke member function on - -: 1469: * @param method Member function to attach - -: 1470: * @deprecated - -: 1471: * Replaced by simple assignment 'Callback cb = func' - -: 1472: */ - -: 1473: template - -: 1474: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1475: "Replaced by simple assignment 'Callback cb = func") - -: 1476: void attach(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 1477: this->~Callback(); - -: 1478: new (this) Callback(obj, method); - -: 1479: } - -: 1480: - -: 1481: /** Attach a member function - -: 1482: * @param obj Pointer to object to invoke member function on - -: 1483: * @param method Member function to attach - -: 1484: * @deprecated - -: 1485: * Replaced by simple assignment 'Callback cb = func' - -: 1486: */ - -: 1487: template - -: 1488: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1489: "Replaced by simple assignment 'Callback cb = func") - -: 1490: void attach(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 1491: this->~Callback(); - -: 1492: new (this) Callback(obj, method); - -: 1493: } - -: 1494: - -: 1495: /** Attach a static function with a bound pointer - -: 1496: * @param func Static function to attach - -: 1497: * @param arg Pointer argument to function - -: 1498: * @deprecated - -: 1499: * Replaced by simple assignment 'Callback cb = func' - -: 1500: */ - -: 1501: template - -: 1502: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1503: "Replaced by simple assignment 'Callback cb = func") - -: 1504: void attach(R (*func)(T*, A0, A1), U *arg) { - -: 1505: this->~Callback(); - -: 1506: new (this) Callback(func, arg); - -: 1507: } - -: 1508: - -: 1509: /** Attach a static function with a bound pointer - -: 1510: * @param func Static function to attach - -: 1511: * @param arg Pointer argument to function - -: 1512: * @deprecated - -: 1513: * Replaced by simple assignment 'Callback cb = func' - -: 1514: */ - -: 1515: template - -: 1516: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1517: "Replaced by simple assignment 'Callback cb = func") - -: 1518: void attach(R (*func)(const T*, A0, A1), const U *arg) { - -: 1519: this->~Callback(); - -: 1520: new (this) Callback(func, arg); - -: 1521: } - -: 1522: - -: 1523: /** Attach a static function with a bound pointer - -: 1524: * @param func Static function to attach - -: 1525: * @param arg Pointer argument to function - -: 1526: * @deprecated - -: 1527: * Replaced by simple assignment 'Callback cb = func' - -: 1528: */ - -: 1529: template - -: 1530: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1531: "Replaced by simple assignment 'Callback cb = func") - -: 1532: void attach(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 1533: this->~Callback(); - -: 1534: new (this) Callback(func, arg); - -: 1535: } - -: 1536: - -: 1537: /** Attach a static function with a bound pointer - -: 1538: * @param func Static function to attach - -: 1539: * @param arg Pointer argument to function - -: 1540: * @deprecated - -: 1541: * Replaced by simple assignment 'Callback cb = func' - -: 1542: */ - -: 1543: template - -: 1544: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1545: "Replaced by simple assignment 'Callback cb = func") - -: 1546: void attach(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 1547: this->~Callback(); - -: 1548: new (this) Callback(func, arg); - -: 1549: } - -: 1550: - -: 1551: /** Attach a function object - -: 1552: * @param f Function object to attach - -: 1553: * @note The function object is limited to a single word of storage - -: 1554: * @deprecated - -: 1555: * Replaced by simple assignment 'Callback cb = func' - -: 1556: */ - -: 1557: template - -: 1558: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1559: "Replaced by simple assignment 'Callback cb = func") - -: 1560: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { - -: 1561: this->~Callback(); - -: 1562: new (this) Callback(f); - -: 1563: } - -: 1564: - -: 1565: /** Attach a function object - -: 1566: * @param f Function object to attach - -: 1567: * @note The function object is limited to a single word of storage - -: 1568: * @deprecated - -: 1569: * Replaced by simple assignment 'Callback cb = func' - -: 1570: */ - -: 1571: template - -: 1572: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1573: "Replaced by simple assignment 'Callback cb = func") - -: 1574: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { - -: 1575: this->~Callback(); - -: 1576: new (this) Callback(f); - -: 1577: } - -: 1578: - -: 1579: /** Attach a function object - -: 1580: * @param f Function object to attach - -: 1581: * @note The function object is limited to a single word of storage - -: 1582: * @deprecated - -: 1583: * Replaced by simple assignment 'Callback cb = func' - -: 1584: */ - -: 1585: template - -: 1586: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1587: "Replaced by simple assignment 'Callback cb = func") - -: 1588: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { - -: 1589: this->~Callback(); - -: 1590: new (this) Callback(f); - -: 1591: } - -: 1592: - -: 1593: /** Attach a function object - -: 1594: * @param f Function object to attach - -: 1595: * @note The function object is limited to a single word of storage - -: 1596: * @deprecated - -: 1597: * Replaced by simple assignment 'Callback cb = func' - -: 1598: */ - -: 1599: template - -: 1600: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1601: "Replaced by simple assignment 'Callback cb = func") - -: 1602: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { - -: 1603: this->~Callback(); - -: 1604: new (this) Callback(f); - -: 1605: } - -: 1606: - -: 1607: /** Attach a static function with a bound pointer - -: 1608: * @param obj Pointer to object to bind to function - -: 1609: * @param func Static function to attach - -: 1610: * @deprecated - -: 1611: * Arguments to callback have been reordered to attach(func, arg) - -: 1612: */ - -: 1613: template - -: 1614: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1615: "Arguments to callback have been reordered to attach(func, arg)") - -: 1616: void attach(U *obj, R (*func)(T*, A0, A1)) { - -: 1617: this->~Callback(); - -: 1618: new (this) Callback(func, obj); - -: 1619: } - -: 1620: - -: 1621: /** Attach a static function with a bound pointer - -: 1622: * @param obj Pointer to object to bind to function - -: 1623: * @param func Static function to attach - -: 1624: * @deprecated - -: 1625: * Arguments to callback have been reordered to attach(func, arg) - -: 1626: */ - -: 1627: template - -: 1628: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1629: "Arguments to callback have been reordered to attach(func, arg)") - -: 1630: void attach(const U *obj, R (*func)(const T*, A0, A1)) { - -: 1631: this->~Callback(); - -: 1632: new (this) Callback(func, obj); - -: 1633: } - -: 1634: - -: 1635: /** Attach a static function with a bound pointer - -: 1636: * @param obj Pointer to object to bind to function - -: 1637: * @param func Static function to attach - -: 1638: * @deprecated - -: 1639: * Arguments to callback have been reordered to attach(func, arg) - -: 1640: */ - -: 1641: template - -: 1642: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1643: "Arguments to callback have been reordered to attach(func, arg)") - -: 1644: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 1645: this->~Callback(); - -: 1646: new (this) Callback(func, obj); - -: 1647: } - -: 1648: - -: 1649: /** Attach a static function with a bound pointer - -: 1650: * @param obj Pointer to object to bind to function - -: 1651: * @param func Static function to attach - -: 1652: * @deprecated - -: 1653: * Arguments to callback have been reordered to attach(func, arg) - -: 1654: */ - -: 1655: template - -: 1656: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1657: "Arguments to callback have been reordered to attach(func, arg)") - -: 1658: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 1659: this->~Callback(); - -: 1660: new (this) Callback(func, obj); - -: 1661: } - -: 1662: - -: 1663: /** Assign a callback - -: 1664: */ - -: 1665: Callback &operator=(const Callback &that) { - -: 1666: if (this != &that) { - -: 1667: this->~Callback(); - -: 1668: new (this) Callback(that); - -: 1669: } - -: 1670: - -: 1671: return *this; - -: 1672: } - -: 1673: - -: 1674: /** Call the attached function - -: 1675: */ - -: 1676: R call(A0 a0, A1 a1) const { - -: 1677: MBED_ASSERT(_ops); - -: 1678: return _ops->call(this, a0, a1); - -: 1679: } - -: 1680: - -: 1681: /** Call the attached function - -: 1682: */ - -: 1683: R operator()(A0 a0, A1 a1) const { - -: 1684: return call(a0, a1); - -: 1685: } - -: 1686: - -: 1687: /** Test if function has been attached - -: 1688: */ - -: 1689: operator bool() const { - -: 1690: return _ops; - -: 1691: } - -: 1692: - -: 1693: /** Test for equality - -: 1694: */ - -: 1695: friend bool operator==(const Callback &l, const Callback &r) { - -: 1696: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 1697: } - -: 1698: - -: 1699: /** Test for inequality - -: 1700: */ - -: 1701: friend bool operator!=(const Callback &l, const Callback &r) { - -: 1702: return !(l == r); - -: 1703: } - -: 1704: - -: 1705: /** Static thunk for passing as C-style function - -: 1706: * @param func Callback to call passed as void pointer - -: 1707: * @param a0 An argument to be called with function func - -: 1708: * @param a1 An argument to be called with function func - -: 1709: * @return the value as determined by func which is of - -: 1710: * type and determined by the signiture of func - -: 1711: */ - -: 1712: static R thunk(void *func, A0 a0, A1 a1) { - -: 1713: return static_cast(func)->call(a0, a1); - -: 1714: } - -: 1715: - -: 1716:private: - -: 1717: // Stored as pointer to function and pointer to optional object - -: 1718: // Function pointer is stored as union of possible function types - -: 1719: // to garuntee proper size and alignment - -: 1720: struct _class; - -: 1721: union { - -: 1722: void (*_staticfunc)(A0, A1); - -: 1723: void (*_boundfunc)(_class*, A0, A1); - -: 1724: void (_class::*_methodfunc)(A0, A1); - -: 1725: } _func; - -: 1726: void *_obj; - -: 1727: - -: 1728: // Dynamically dispatched operations - -: 1729: const struct ops { - -: 1730: R (*call)(const void*, A0, A1); - -: 1731: void (*move)(void*, const void*); - -: 1732: void (*dtor)(void*); - -: 1733: } *_ops; - -: 1734: - -: 1735: // Generate operations for function object - -: 1736: template - -: 1737: void generate(const F &f) { - -: 1738: static const ops ops = { - -: 1739: &Callback::function_call, - -: 1740: &Callback::function_move, - -: 1741: &Callback::function_dtor, - -: 1742: }; - -: 1743: - -: 1744: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 1745: "Type F must not exceed the size of the Callback class"); - -: 1746: memset(this, 0, sizeof(Callback)); - -: 1747: new (this) F(f); - -: 1748: _ops = &ops; - -: 1749: } - -: 1750: - -: 1751: // Function attributes - -: 1752: template - -: 1753: static R function_call(const void *p, A0 a0, A1 a1) { - -: 1754: return (*(F*)p)(a0, a1); - -: 1755: } - -: 1756: - -: 1757: template - -: 1758: static void function_move(void *d, const void *p) { - -: 1759: new (d) F(*(F*)p); - -: 1760: } - -: 1761: - -: 1762: template - -: 1763: static void function_dtor(void *p) { - -: 1764: ((F*)p)->~F(); - -: 1765: } - -: 1766: - -: 1767: // Wrappers for functions with context - -: 1768: template - -: 1769: struct method_context { - -: 1770: M method; - -: 1771: O *obj; - -: 1772: - -: 1773: method_context(O *obj, M method) - -: 1774: : method(method), obj(obj) {} - -: 1775: - -: 1776: R operator()(A0 a0, A1 a1) const { - -: 1777: return (obj->*method)(a0, a1); - -: 1778: } - -: 1779: }; - -: 1780: - -: 1781: template - -: 1782: struct function_context { - -: 1783: F func; - -: 1784: A *arg; - -: 1785: - -: 1786: function_context(F func, A *arg) - -: 1787: : func(func), arg(arg) {} - -: 1788: - -: 1789: R operator()(A0 a0, A1 a1) const { - -: 1790: return func(arg, a0, a1); - -: 1791: } - -: 1792: }; - -: 1793:}; - -: 1794: - -: 1795:/** Callback class based on template specialization - -: 1796: * - -: 1797: * @note Synchronization level: Not protected - -: 1798: */ - -: 1799:template - -: 1800:class Callback { - -: 1801:public: - -: 1802: /** Create a Callback with a static function - -: 1803: * @param func Static function to attach - -: 1804: */ - -: 1805: Callback(R (*func)(A0, A1, A2) = 0) { - -: 1806: if (!func) { - -: 1807: memset(this, 0, sizeof(Callback)); - -: 1808: } else { - -: 1809: generate(func); - -: 1810: } - -: 1811: } - -: 1812: - -: 1813: /** Attach a Callback - -: 1814: * @param func The Callback to attach - -: 1815: */ - -: 1816: Callback(const Callback &func) { - -: 1817: if (func._ops) { - -: 1818: func._ops->move(this, &func); - -: 1819: } - -: 1820: _ops = func._ops; - -: 1821: } - -: 1822: - -: 1823: /** Create a Callback with a member function - -: 1824: * @param obj Pointer to object to invoke member function on - -: 1825: * @param method Member function to attach - -: 1826: */ - -: 1827: template - -: 1828: Callback(U *obj, R (T::*method)(A0, A1, A2)) { - -: 1829: generate(method_context(obj, method)); - -: 1830: } - -: 1831: - -: 1832: /** Create a Callback with a member function - -: 1833: * @param obj Pointer to object to invoke member function on - -: 1834: * @param method Member function to attach - -: 1835: */ - -: 1836: template - -: 1837: Callback(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 1838: generate(method_context(obj, method)); - -: 1839: } - -: 1840: - -: 1841: /** Create a Callback with a member function - -: 1842: * @param obj Pointer to object to invoke member function on - -: 1843: * @param method Member function to attach - -: 1844: */ - -: 1845: template - -: 1846: Callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 1847: generate(method_context(obj, method)); - -: 1848: } - -: 1849: - -: 1850: /** Create a Callback with a member function - -: 1851: * @param obj Pointer to object to invoke member function on - -: 1852: * @param method Member function to attach - -: 1853: */ - -: 1854: template - -: 1855: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 1856: generate(method_context(obj, method)); - -: 1857: } - -: 1858: - -: 1859: /** Create a Callback with a static function and bound pointer - -: 1860: * @param func Static function to attach - -: 1861: * @param arg Pointer argument to function - -: 1862: */ - -: 1863: template - -: 1864: Callback(R (*func)(T*, A0, A1, A2), U *arg) { - -: 1865: generate(function_context(func, arg)); - -: 1866: } - -: 1867: - -: 1868: /** Create a Callback with a static function and bound pointer - -: 1869: * @param func Static function to attach - -: 1870: * @param arg Pointer argument to function - -: 1871: */ - -: 1872: template - -: 1873: Callback(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 1874: generate(function_context(func, arg)); - -: 1875: } - -: 1876: - -: 1877: /** Create a Callback with a static function and bound pointer - -: 1878: * @param func Static function to attach - -: 1879: * @param arg Pointer argument to function - -: 1880: */ - -: 1881: template - -: 1882: Callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 1883: generate(function_context(func, arg)); - -: 1884: } - -: 1885: - -: 1886: /** Create a Callback with a static function and bound pointer - -: 1887: * @param func Static function to attach - -: 1888: * @param arg Pointer argument to function - -: 1889: */ - -: 1890: template - -: 1891: Callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 1892: generate(function_context(func, arg)); - -: 1893: } - -: 1894: - -: 1895: /** Create a Callback with a function object - -: 1896: * @param f Function object to attach - -: 1897: * @note The function object is limited to a single word of storage - -: 1898: */ - -: 1899: template - -: 1900: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { - -: 1901: generate(f); - -: 1902: } - -: 1903: - -: 1904: /** Create a Callback with a function object - -: 1905: * @param f Function object to attach - -: 1906: * @note The function object is limited to a single word of storage - -: 1907: */ - -: 1908: template - -: 1909: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { - -: 1910: generate(f); - -: 1911: } - -: 1912: - -: 1913: /** Create a Callback with a function object - -: 1914: * @param f Function object to attach - -: 1915: * @note The function object is limited to a single word of storage - -: 1916: */ - -: 1917: template - -: 1918: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { - -: 1919: generate(f); - -: 1920: } - -: 1921: - -: 1922: /** Create a Callback with a function object - -: 1923: * @param f Function object to attach - -: 1924: * @note The function object is limited to a single word of storage - -: 1925: */ - -: 1926: template - -: 1927: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { - -: 1928: generate(f); - -: 1929: } - -: 1930: - -: 1931: /** Create a Callback with a static function and bound pointer - -: 1932: * @param obj Pointer to object to bind to function - -: 1933: * @param func Static function to attach - -: 1934: * @deprecated - -: 1935: * Arguments to callback have been reordered to Callback(func, arg) - -: 1936: */ - -: 1937: template - -: 1938: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1939: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1940: Callback(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 1941: new (this) Callback(func, obj); - -: 1942: } - -: 1943: - -: 1944: /** Create a Callback with a static function and bound pointer - -: 1945: * @param obj Pointer to object to bind to function - -: 1946: * @param func Static function to attach - -: 1947: * @deprecated - -: 1948: * Arguments to callback have been reordered to Callback(func, arg) - -: 1949: */ - -: 1950: template - -: 1951: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1952: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1953: Callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 1954: new (this) Callback(func, obj); - -: 1955: } - -: 1956: - -: 1957: /** Create a Callback with a static function and bound pointer - -: 1958: * @param obj Pointer to object to bind to function - -: 1959: * @param func Static function to attach - -: 1960: * @deprecated - -: 1961: * Arguments to callback have been reordered to Callback(func, arg) - -: 1962: */ - -: 1963: template - -: 1964: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1965: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1966: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 1967: new (this) Callback(func, obj); - -: 1968: } - -: 1969: - -: 1970: /** Create a Callback with a static function and bound pointer - -: 1971: * @param obj Pointer to object to bind to function - -: 1972: * @param func Static function to attach - -: 1973: * @deprecated - -: 1974: * Arguments to callback have been reordered to Callback(func, arg) - -: 1975: */ - -: 1976: template - -: 1977: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1978: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1979: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 1980: new (this) Callback(func, obj); - -: 1981: } - -: 1982: - -: 1983: /** Destroy a callback - -: 1984: */ - -: 1985: ~Callback() { - -: 1986: if (_ops) { - -: 1987: _ops->dtor(this); - -: 1988: } - -: 1989: } - -: 1990: - -: 1991: /** Attach a static function - -: 1992: * @param func Static function to attach - -: 1993: * @deprecated - -: 1994: * Replaced by simple assignment 'Callback cb = func' - -: 1995: */ - -: 1996: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1997: "Replaced by simple assignment 'Callback cb = func") - -: 1998: void attach(R (*func)(A0, A1, A2)) { - -: 1999: this->~Callback(); - -: 2000: new (this) Callback(func); - -: 2001: } - -: 2002: - -: 2003: /** Attach a Callback - -: 2004: * @param func The Callback to attach - -: 2005: * @deprecated - -: 2006: * Replaced by simple assignment 'Callback cb = func' - -: 2007: */ - -: 2008: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2009: "Replaced by simple assignment 'Callback cb = func") - -: 2010: void attach(const Callback &func) { - -: 2011: this->~Callback(); - -: 2012: new (this) Callback(func); - -: 2013: } - -: 2014: - -: 2015: /** Attach a member function - -: 2016: * @param obj Pointer to object to invoke member function on - -: 2017: * @param method Member function to attach - -: 2018: * @deprecated - -: 2019: * Replaced by simple assignment 'Callback cb = func' - -: 2020: */ - -: 2021: template - -: 2022: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2023: "Replaced by simple assignment 'Callback cb = func") - -: 2024: void attach(U *obj, R (T::*method)(A0, A1, A2)) { - -: 2025: this->~Callback(); - -: 2026: new (this) Callback(obj, method); - -: 2027: } - -: 2028: - -: 2029: /** Attach a member function - -: 2030: * @param obj Pointer to object to invoke member function on - -: 2031: * @param method Member function to attach - -: 2032: * @deprecated - -: 2033: * Replaced by simple assignment 'Callback cb = func' - -: 2034: */ - -: 2035: template - -: 2036: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2037: "Replaced by simple assignment 'Callback cb = func") - -: 2038: void attach(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 2039: this->~Callback(); - -: 2040: new (this) Callback(obj, method); - -: 2041: } - -: 2042: - -: 2043: /** Attach a member function - -: 2044: * @param obj Pointer to object to invoke member function on - -: 2045: * @param method Member function to attach - -: 2046: * @deprecated - -: 2047: * Replaced by simple assignment 'Callback cb = func' - -: 2048: */ - -: 2049: template - -: 2050: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2051: "Replaced by simple assignment 'Callback cb = func") - -: 2052: void attach(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 2053: this->~Callback(); - -: 2054: new (this) Callback(obj, method); - -: 2055: } - -: 2056: - -: 2057: /** Attach a member function - -: 2058: * @param obj Pointer to object to invoke member function on - -: 2059: * @param method Member function to attach - -: 2060: * @deprecated - -: 2061: * Replaced by simple assignment 'Callback cb = func' - -: 2062: */ - -: 2063: template - -: 2064: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2065: "Replaced by simple assignment 'Callback cb = func") - -: 2066: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 2067: this->~Callback(); - -: 2068: new (this) Callback(obj, method); - -: 2069: } - -: 2070: - -: 2071: /** Attach a static function with a bound pointer - -: 2072: * @param func Static function to attach - -: 2073: * @param arg Pointer argument to function - -: 2074: * @deprecated - -: 2075: * Replaced by simple assignment 'Callback cb = func' - -: 2076: */ - -: 2077: template - -: 2078: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2079: "Replaced by simple assignment 'Callback cb = func") - -: 2080: void attach(R (*func)(T*, A0, A1, A2), U *arg) { - -: 2081: this->~Callback(); - -: 2082: new (this) Callback(func, arg); - -: 2083: } - -: 2084: - -: 2085: /** Attach a static function with a bound pointer - -: 2086: * @param func Static function to attach - -: 2087: * @param arg Pointer argument to function - -: 2088: * @deprecated - -: 2089: * Replaced by simple assignment 'Callback cb = func' - -: 2090: */ - -: 2091: template - -: 2092: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2093: "Replaced by simple assignment 'Callback cb = func") - -: 2094: void attach(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 2095: this->~Callback(); - -: 2096: new (this) Callback(func, arg); - -: 2097: } - -: 2098: - -: 2099: /** Attach a static function with a bound pointer - -: 2100: * @param func Static function to attach - -: 2101: * @param arg Pointer argument to function - -: 2102: * @deprecated - -: 2103: * Replaced by simple assignment 'Callback cb = func' - -: 2104: */ - -: 2105: template - -: 2106: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2107: "Replaced by simple assignment 'Callback cb = func") - -: 2108: void attach(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 2109: this->~Callback(); - -: 2110: new (this) Callback(func, arg); - -: 2111: } - -: 2112: - -: 2113: /** Attach a static function with a bound pointer - -: 2114: * @param func Static function to attach - -: 2115: * @param arg Pointer argument to function - -: 2116: * @deprecated - -: 2117: * Replaced by simple assignment 'Callback cb = func' - -: 2118: */ - -: 2119: template - -: 2120: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2121: "Replaced by simple assignment 'Callback cb = func") - -: 2122: void attach(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 2123: this->~Callback(); - -: 2124: new (this) Callback(func, arg); - -: 2125: } - -: 2126: - -: 2127: /** Attach a function object - -: 2128: * @param f Function object to attach - -: 2129: * @note The function object is limited to a single word of storage - -: 2130: * @deprecated - -: 2131: * Replaced by simple assignment 'Callback cb = func' - -: 2132: */ - -: 2133: template - -: 2134: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2135: "Replaced by simple assignment 'Callback cb = func") - -: 2136: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { - -: 2137: this->~Callback(); - -: 2138: new (this) Callback(f); - -: 2139: } - -: 2140: - -: 2141: /** Attach a function object - -: 2142: * @param f Function object to attach - -: 2143: * @note The function object is limited to a single word of storage - -: 2144: * @deprecated - -: 2145: * Replaced by simple assignment 'Callback cb = func' - -: 2146: */ - -: 2147: template - -: 2148: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2149: "Replaced by simple assignment 'Callback cb = func") - -: 2150: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { - -: 2151: this->~Callback(); - -: 2152: new (this) Callback(f); - -: 2153: } - -: 2154: - -: 2155: /** Attach a function object - -: 2156: * @param f Function object to attach - -: 2157: * @note The function object is limited to a single word of storage - -: 2158: * @deprecated - -: 2159: * Replaced by simple assignment 'Callback cb = func' - -: 2160: */ - -: 2161: template - -: 2162: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2163: "Replaced by simple assignment 'Callback cb = func") - -: 2164: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { - -: 2165: this->~Callback(); - -: 2166: new (this) Callback(f); - -: 2167: } - -: 2168: - -: 2169: /** Attach a function object - -: 2170: * @param f Function object to attach - -: 2171: * @note The function object is limited to a single word of storage - -: 2172: * @deprecated - -: 2173: * Replaced by simple assignment 'Callback cb = func' - -: 2174: */ - -: 2175: template - -: 2176: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2177: "Replaced by simple assignment 'Callback cb = func") - -: 2178: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { - -: 2179: this->~Callback(); - -: 2180: new (this) Callback(f); - -: 2181: } - -: 2182: - -: 2183: /** Attach a static function with a bound pointer - -: 2184: * @param obj Pointer to object to bind to function - -: 2185: * @param func Static function to attach - -: 2186: * @deprecated - -: 2187: * Arguments to callback have been reordered to attach(func, arg) - -: 2188: */ - -: 2189: template - -: 2190: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2191: "Arguments to callback have been reordered to attach(func, arg)") - -: 2192: void attach(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 2193: this->~Callback(); - -: 2194: new (this) Callback(func, obj); - -: 2195: } - -: 2196: - -: 2197: /** Attach a static function with a bound pointer - -: 2198: * @param obj Pointer to object to bind to function - -: 2199: * @param func Static function to attach - -: 2200: * @deprecated - -: 2201: * Arguments to callback have been reordered to attach(func, arg) - -: 2202: */ - -: 2203: template - -: 2204: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2205: "Arguments to callback have been reordered to attach(func, arg)") - -: 2206: void attach(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 2207: this->~Callback(); - -: 2208: new (this) Callback(func, obj); - -: 2209: } - -: 2210: - -: 2211: /** Attach a static function with a bound pointer - -: 2212: * @param obj Pointer to object to bind to function - -: 2213: * @param func Static function to attach - -: 2214: * @deprecated - -: 2215: * Arguments to callback have been reordered to attach(func, arg) - -: 2216: */ - -: 2217: template - -: 2218: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2219: "Arguments to callback have been reordered to attach(func, arg)") - -: 2220: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 2221: this->~Callback(); - -: 2222: new (this) Callback(func, obj); - -: 2223: } - -: 2224: - -: 2225: /** Attach a static function with a bound pointer - -: 2226: * @param obj Pointer to object to bind to function - -: 2227: * @param func Static function to attach - -: 2228: * @deprecated - -: 2229: * Arguments to callback have been reordered to attach(func, arg) - -: 2230: */ - -: 2231: template - -: 2232: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2233: "Arguments to callback have been reordered to attach(func, arg)") - -: 2234: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 2235: this->~Callback(); - -: 2236: new (this) Callback(func, obj); - -: 2237: } - -: 2238: - -: 2239: /** Assign a callback - -: 2240: */ - -: 2241: Callback &operator=(const Callback &that) { - -: 2242: if (this != &that) { - -: 2243: this->~Callback(); - -: 2244: new (this) Callback(that); - -: 2245: } - -: 2246: - -: 2247: return *this; - -: 2248: } - -: 2249: - -: 2250: /** Call the attached function - -: 2251: */ - -: 2252: R call(A0 a0, A1 a1, A2 a2) const { - -: 2253: MBED_ASSERT(_ops); - -: 2254: return _ops->call(this, a0, a1, a2); - -: 2255: } - -: 2256: - -: 2257: /** Call the attached function - -: 2258: */ - -: 2259: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2260: return call(a0, a1, a2); - -: 2261: } - -: 2262: - -: 2263: /** Test if function has been attached - -: 2264: */ - -: 2265: operator bool() const { - -: 2266: return _ops; - -: 2267: } - -: 2268: - -: 2269: /** Test for equality - -: 2270: */ - -: 2271: friend bool operator==(const Callback &l, const Callback &r) { - -: 2272: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 2273: } - -: 2274: - -: 2275: /** Test for inequality - -: 2276: */ - -: 2277: friend bool operator!=(const Callback &l, const Callback &r) { - -: 2278: return !(l == r); - -: 2279: } - -: 2280: - -: 2281: /** Static thunk for passing as C-style function - -: 2282: * @param func Callback to call passed as void pointer - -: 2283: * @param a0 An argument to be called with function func - -: 2284: * @param a1 An argument to be called with function func - -: 2285: * @param a2 An argument to be called with function func - -: 2286: * @return the value as determined by func which is of - -: 2287: * type and determined by the signiture of func - -: 2288: */ - -: 2289: static R thunk(void *func, A0 a0, A1 a1, A2 a2) { - -: 2290: return static_cast(func)->call(a0, a1, a2); - -: 2291: } - -: 2292: - -: 2293:private: - -: 2294: // Stored as pointer to function and pointer to optional object - -: 2295: // Function pointer is stored as union of possible function types - -: 2296: // to garuntee proper size and alignment - -: 2297: struct _class; - -: 2298: union { - -: 2299: void (*_staticfunc)(A0, A1, A2); - -: 2300: void (*_boundfunc)(_class*, A0, A1, A2); - -: 2301: void (_class::*_methodfunc)(A0, A1, A2); - -: 2302: } _func; - -: 2303: void *_obj; - -: 2304: - -: 2305: // Dynamically dispatched operations - -: 2306: const struct ops { - -: 2307: R (*call)(const void*, A0, A1, A2); - -: 2308: void (*move)(void*, const void*); - -: 2309: void (*dtor)(void*); - -: 2310: } *_ops; - -: 2311: - -: 2312: // Generate operations for function object - -: 2313: template - -: 2314: void generate(const F &f) { - -: 2315: static const ops ops = { - -: 2316: &Callback::function_call, - -: 2317: &Callback::function_move, - -: 2318: &Callback::function_dtor, - -: 2319: }; - -: 2320: - -: 2321: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 2322: "Type F must not exceed the size of the Callback class"); - -: 2323: memset(this, 0, sizeof(Callback)); - -: 2324: new (this) F(f); - -: 2325: _ops = &ops; - -: 2326: } - -: 2327: - -: 2328: // Function attributes - -: 2329: template - -: 2330: static R function_call(const void *p, A0 a0, A1 a1, A2 a2) { - -: 2331: return (*(F*)p)(a0, a1, a2); - -: 2332: } - -: 2333: - -: 2334: template - -: 2335: static void function_move(void *d, const void *p) { - -: 2336: new (d) F(*(F*)p); - -: 2337: } - -: 2338: - -: 2339: template - -: 2340: static void function_dtor(void *p) { - -: 2341: ((F*)p)->~F(); - -: 2342: } - -: 2343: - -: 2344: // Wrappers for functions with context - -: 2345: template - -: 2346: struct method_context { - -: 2347: M method; - -: 2348: O *obj; - -: 2349: - -: 2350: method_context(O *obj, M method) - -: 2351: : method(method), obj(obj) {} - -: 2352: - -: 2353: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2354: return (obj->*method)(a0, a1, a2); - -: 2355: } - -: 2356: }; - -: 2357: - -: 2358: template - -: 2359: struct function_context { - -: 2360: F func; - -: 2361: A *arg; - -: 2362: - -: 2363: function_context(F func, A *arg) - -: 2364: : func(func), arg(arg) {} - -: 2365: - -: 2366: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2367: return func(arg, a0, a1, a2); - -: 2368: } - -: 2369: }; - -: 2370:}; - -: 2371: - -: 2372:/** Callback class based on template specialization - -: 2373: * - -: 2374: * @note Synchronization level: Not protected - -: 2375: */ - -: 2376:template - -: 2377:class Callback { - -: 2378:public: - -: 2379: /** Create a Callback with a static function - -: 2380: * @param func Static function to attach - -: 2381: */ - -: 2382: Callback(R (*func)(A0, A1, A2, A3) = 0) { - -: 2383: if (!func) { - -: 2384: memset(this, 0, sizeof(Callback)); - -: 2385: } else { - -: 2386: generate(func); - -: 2387: } - -: 2388: } - -: 2389: - -: 2390: /** Attach a Callback - -: 2391: * @param func The Callback to attach - -: 2392: */ - -: 2393: Callback(const Callback &func) { - -: 2394: if (func._ops) { - -: 2395: func._ops->move(this, &func); - -: 2396: } - -: 2397: _ops = func._ops; - -: 2398: } - -: 2399: - -: 2400: /** Create a Callback with a member function - -: 2401: * @param obj Pointer to object to invoke member function on - -: 2402: * @param method Member function to attach - -: 2403: */ - -: 2404: template - -: 2405: Callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 2406: generate(method_context(obj, method)); - -: 2407: } - -: 2408: - -: 2409: /** Create a Callback with a member function - -: 2410: * @param obj Pointer to object to invoke member function on - -: 2411: * @param method Member function to attach - -: 2412: */ - -: 2413: template - -: 2414: Callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 2415: generate(method_context(obj, method)); - -: 2416: } - -: 2417: - -: 2418: /** Create a Callback with a member function - -: 2419: * @param obj Pointer to object to invoke member function on - -: 2420: * @param method Member function to attach - -: 2421: */ - -: 2422: template - -: 2423: Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 2424: generate(method_context(obj, method)); - -: 2425: } - -: 2426: - -: 2427: /** Create a Callback with a member function - -: 2428: * @param obj Pointer to object to invoke member function on - -: 2429: * @param method Member function to attach - -: 2430: */ - -: 2431: template - -: 2432: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 2433: generate(method_context(obj, method)); - -: 2434: } - -: 2435: - -: 2436: /** Create a Callback with a static function and bound pointer - -: 2437: * @param func Static function to attach - -: 2438: * @param arg Pointer argument to function - -: 2439: */ - -: 2440: template - -: 2441: Callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 2442: generate(function_context(func, arg)); - -: 2443: } - -: 2444: - -: 2445: /** Create a Callback with a static function and bound pointer - -: 2446: * @param func Static function to attach - -: 2447: * @param arg Pointer argument to function - -: 2448: */ - -: 2449: template - -: 2450: Callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 2451: generate(function_context(func, arg)); - -: 2452: } - -: 2453: - -: 2454: /** Create a Callback with a static function and bound pointer - -: 2455: * @param func Static function to attach - -: 2456: * @param arg Pointer argument to function - -: 2457: */ - -: 2458: template - -: 2459: Callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 2460: generate(function_context(func, arg)); - -: 2461: } - -: 2462: - -: 2463: /** Create a Callback with a static function and bound pointer - -: 2464: * @param func Static function to attach - -: 2465: * @param arg Pointer argument to function - -: 2466: */ - -: 2467: template - -: 2468: Callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 2469: generate(function_context(func, arg)); - -: 2470: } - -: 2471: - -: 2472: /** Create a Callback with a function object - -: 2473: * @param f Function object to attach - -: 2474: * @note The function object is limited to a single word of storage - -: 2475: */ - -: 2476: template - -: 2477: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { - -: 2478: generate(f); - -: 2479: } - -: 2480: - -: 2481: /** Create a Callback with a function object - -: 2482: * @param f Function object to attach - -: 2483: * @note The function object is limited to a single word of storage - -: 2484: */ - -: 2485: template - -: 2486: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { - -: 2487: generate(f); - -: 2488: } - -: 2489: - -: 2490: /** Create a Callback with a function object - -: 2491: * @param f Function object to attach - -: 2492: * @note The function object is limited to a single word of storage - -: 2493: */ - -: 2494: template - -: 2495: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { - -: 2496: generate(f); - -: 2497: } - -: 2498: - -: 2499: /** Create a Callback with a function object - -: 2500: * @param f Function object to attach - -: 2501: * @note The function object is limited to a single word of storage - -: 2502: */ - -: 2503: template - -: 2504: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { - -: 2505: generate(f); - -: 2506: } - -: 2507: - -: 2508: /** Create a Callback with a static function and bound pointer - -: 2509: * @param obj Pointer to object to bind to function - -: 2510: * @param func Static function to attach - -: 2511: * @deprecated - -: 2512: * Arguments to callback have been reordered to Callback(func, arg) - -: 2513: */ - -: 2514: template - -: 2515: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2516: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2517: Callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 2518: new (this) Callback(func, obj); - -: 2519: } - -: 2520: - -: 2521: /** Create a Callback with a static function and bound pointer - -: 2522: * @param obj Pointer to object to bind to function - -: 2523: * @param func Static function to attach - -: 2524: * @deprecated - -: 2525: * Arguments to callback have been reordered to Callback(func, arg) - -: 2526: */ - -: 2527: template - -: 2528: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2529: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2530: Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 2531: new (this) Callback(func, obj); - -: 2532: } - -: 2533: - -: 2534: /** Create a Callback with a static function and bound pointer - -: 2535: * @param obj Pointer to object to bind to function - -: 2536: * @param func Static function to attach - -: 2537: * @deprecated - -: 2538: * Arguments to callback have been reordered to Callback(func, arg) - -: 2539: */ - -: 2540: template - -: 2541: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2542: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2543: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 2544: new (this) Callback(func, obj); - -: 2545: } - -: 2546: - -: 2547: /** Create a Callback with a static function and bound pointer - -: 2548: * @param obj Pointer to object to bind to function - -: 2549: * @param func Static function to attach - -: 2550: * @deprecated - -: 2551: * Arguments to callback have been reordered to Callback(func, arg) - -: 2552: */ - -: 2553: template - -: 2554: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2555: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2556: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 2557: new (this) Callback(func, obj); - -: 2558: } - -: 2559: - -: 2560: /** Destroy a callback - -: 2561: */ - -: 2562: ~Callback() { - -: 2563: if (_ops) { - -: 2564: _ops->dtor(this); - -: 2565: } - -: 2566: } - -: 2567: - -: 2568: /** Attach a static function - -: 2569: * @param func Static function to attach - -: 2570: * @deprecated - -: 2571: * Replaced by simple assignment 'Callback cb = func' - -: 2572: */ - -: 2573: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2574: "Replaced by simple assignment 'Callback cb = func") - -: 2575: void attach(R (*func)(A0, A1, A2, A3)) { - -: 2576: this->~Callback(); - -: 2577: new (this) Callback(func); - -: 2578: } - -: 2579: - -: 2580: /** Attach a Callback - -: 2581: * @param func The Callback to attach - -: 2582: * @deprecated - -: 2583: * Replaced by simple assignment 'Callback cb = func' - -: 2584: */ - -: 2585: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2586: "Replaced by simple assignment 'Callback cb = func") - -: 2587: void attach(const Callback &func) { - -: 2588: this->~Callback(); - -: 2589: new (this) Callback(func); - -: 2590: } - -: 2591: - -: 2592: /** Attach a member function - -: 2593: * @param obj Pointer to object to invoke member function on - -: 2594: * @param method Member function to attach - -: 2595: * @deprecated - -: 2596: * Replaced by simple assignment 'Callback cb = func' - -: 2597: */ - -: 2598: template - -: 2599: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2600: "Replaced by simple assignment 'Callback cb = func") - -: 2601: void attach(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 2602: this->~Callback(); - -: 2603: new (this) Callback(obj, method); - -: 2604: } - -: 2605: - -: 2606: /** Attach a member function - -: 2607: * @param obj Pointer to object to invoke member function on - -: 2608: * @param method Member function to attach - -: 2609: * @deprecated - -: 2610: * Replaced by simple assignment 'Callback cb = func' - -: 2611: */ - -: 2612: template - -: 2613: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2614: "Replaced by simple assignment 'Callback cb = func") - -: 2615: void attach(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 2616: this->~Callback(); - -: 2617: new (this) Callback(obj, method); - -: 2618: } - -: 2619: - -: 2620: /** Attach a member function - -: 2621: * @param obj Pointer to object to invoke member function on - -: 2622: * @param method Member function to attach - -: 2623: * @deprecated - -: 2624: * Replaced by simple assignment 'Callback cb = func' - -: 2625: */ - -: 2626: template - -: 2627: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2628: "Replaced by simple assignment 'Callback cb = func") - -: 2629: void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 2630: this->~Callback(); - -: 2631: new (this) Callback(obj, method); - -: 2632: } - -: 2633: - -: 2634: /** Attach a member function - -: 2635: * @param obj Pointer to object to invoke member function on - -: 2636: * @param method Member function to attach - -: 2637: * @deprecated - -: 2638: * Replaced by simple assignment 'Callback cb = func' - -: 2639: */ - -: 2640: template - -: 2641: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2642: "Replaced by simple assignment 'Callback cb = func") - -: 2643: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 2644: this->~Callback(); - -: 2645: new (this) Callback(obj, method); - -: 2646: } - -: 2647: - -: 2648: /** Attach a static function with a bound pointer - -: 2649: * @param func Static function to attach - -: 2650: * @param arg Pointer argument to function - -: 2651: * @deprecated - -: 2652: * Replaced by simple assignment 'Callback cb = func' - -: 2653: */ - -: 2654: template - -: 2655: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2656: "Replaced by simple assignment 'Callback cb = func") - -: 2657: void attach(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 2658: this->~Callback(); - -: 2659: new (this) Callback(func, arg); - -: 2660: } - -: 2661: - -: 2662: /** Attach a static function with a bound pointer - -: 2663: * @param func Static function to attach - -: 2664: * @param arg Pointer argument to function - -: 2665: * @deprecated - -: 2666: * Replaced by simple assignment 'Callback cb = func' - -: 2667: */ - -: 2668: template - -: 2669: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2670: "Replaced by simple assignment 'Callback cb = func") - -: 2671: void attach(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 2672: this->~Callback(); - -: 2673: new (this) Callback(func, arg); - -: 2674: } - -: 2675: - -: 2676: /** Attach a static function with a bound pointer - -: 2677: * @param func Static function to attach - -: 2678: * @param arg Pointer argument to function - -: 2679: * @deprecated - -: 2680: * Replaced by simple assignment 'Callback cb = func' - -: 2681: */ - -: 2682: template - -: 2683: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2684: "Replaced by simple assignment 'Callback cb = func") - -: 2685: void attach(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 2686: this->~Callback(); - -: 2687: new (this) Callback(func, arg); - -: 2688: } - -: 2689: - -: 2690: /** Attach a static function with a bound pointer - -: 2691: * @param func Static function to attach - -: 2692: * @param arg Pointer argument to function - -: 2693: * @deprecated - -: 2694: * Replaced by simple assignment 'Callback cb = func' - -: 2695: */ - -: 2696: template - -: 2697: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2698: "Replaced by simple assignment 'Callback cb = func") - -: 2699: void attach(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 2700: this->~Callback(); - -: 2701: new (this) Callback(func, arg); - -: 2702: } - -: 2703: - -: 2704: /** Attach a function object - -: 2705: * @param f Function object to attach - -: 2706: * @note The function object is limited to a single word of storage - -: 2707: * @deprecated - -: 2708: * Replaced by simple assignment 'Callback cb = func' - -: 2709: */ - -: 2710: template - -: 2711: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2712: "Replaced by simple assignment 'Callback cb = func") - -: 2713: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { - -: 2714: this->~Callback(); - -: 2715: new (this) Callback(f); - -: 2716: } - -: 2717: - -: 2718: /** Attach a function object - -: 2719: * @param f Function object to attach - -: 2720: * @note The function object is limited to a single word of storage - -: 2721: * @deprecated - -: 2722: * Replaced by simple assignment 'Callback cb = func' - -: 2723: */ - -: 2724: template - -: 2725: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2726: "Replaced by simple assignment 'Callback cb = func") - -: 2727: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { - -: 2728: this->~Callback(); - -: 2729: new (this) Callback(f); - -: 2730: } - -: 2731: - -: 2732: /** Attach a function object - -: 2733: * @param f Function object to attach - -: 2734: * @note The function object is limited to a single word of storage - -: 2735: * @deprecated - -: 2736: * Replaced by simple assignment 'Callback cb = func' - -: 2737: */ - -: 2738: template - -: 2739: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2740: "Replaced by simple assignment 'Callback cb = func") - -: 2741: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { - -: 2742: this->~Callback(); - -: 2743: new (this) Callback(f); - -: 2744: } - -: 2745: - -: 2746: /** Attach a function object - -: 2747: * @param f Function object to attach - -: 2748: * @note The function object is limited to a single word of storage - -: 2749: * @deprecated - -: 2750: * Replaced by simple assignment 'Callback cb = func' - -: 2751: */ - -: 2752: template - -: 2753: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2754: "Replaced by simple assignment 'Callback cb = func") - -: 2755: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { - -: 2756: this->~Callback(); - -: 2757: new (this) Callback(f); - -: 2758: } - -: 2759: - -: 2760: /** Attach a static function with a bound pointer - -: 2761: * @param obj Pointer to object to bind to function - -: 2762: * @param func Static function to attach - -: 2763: * @deprecated - -: 2764: * Arguments to callback have been reordered to attach(func, arg) - -: 2765: */ - -: 2766: template - -: 2767: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2768: "Arguments to callback have been reordered to attach(func, arg)") - -: 2769: void attach(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 2770: this->~Callback(); - -: 2771: new (this) Callback(func, obj); - -: 2772: } - -: 2773: - -: 2774: /** Attach a static function with a bound pointer - -: 2775: * @param obj Pointer to object to bind to function - -: 2776: * @param func Static function to attach - -: 2777: * @deprecated - -: 2778: * Arguments to callback have been reordered to attach(func, arg) - -: 2779: */ - -: 2780: template - -: 2781: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2782: "Arguments to callback have been reordered to attach(func, arg)") - -: 2783: void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 2784: this->~Callback(); - -: 2785: new (this) Callback(func, obj); - -: 2786: } - -: 2787: - -: 2788: /** Attach a static function with a bound pointer - -: 2789: * @param obj Pointer to object to bind to function - -: 2790: * @param func Static function to attach - -: 2791: * @deprecated - -: 2792: * Arguments to callback have been reordered to attach(func, arg) - -: 2793: */ - -: 2794: template - -: 2795: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2796: "Arguments to callback have been reordered to attach(func, arg)") - -: 2797: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 2798: this->~Callback(); - -: 2799: new (this) Callback(func, obj); - -: 2800: } - -: 2801: - -: 2802: /** Attach a static function with a bound pointer - -: 2803: * @param obj Pointer to object to bind to function - -: 2804: * @param func Static function to attach - -: 2805: * @deprecated - -: 2806: * Arguments to callback have been reordered to attach(func, arg) - -: 2807: */ - -: 2808: template - -: 2809: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2810: "Arguments to callback have been reordered to attach(func, arg)") - -: 2811: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 2812: this->~Callback(); - -: 2813: new (this) Callback(func, obj); - -: 2814: } - -: 2815: - -: 2816: /** Assign a callback - -: 2817: */ - -: 2818: Callback &operator=(const Callback &that) { - -: 2819: if (this != &that) { - -: 2820: this->~Callback(); - -: 2821: new (this) Callback(that); - -: 2822: } - -: 2823: - -: 2824: return *this; - -: 2825: } - -: 2826: - -: 2827: /** Call the attached function - -: 2828: */ - -: 2829: R call(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2830: MBED_ASSERT(_ops); - -: 2831: return _ops->call(this, a0, a1, a2, a3); - -: 2832: } - -: 2833: - -: 2834: /** Call the attached function - -: 2835: */ - -: 2836: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2837: return call(a0, a1, a2, a3); - -: 2838: } - -: 2839: - -: 2840: /** Test if function has been attached - -: 2841: */ - -: 2842: operator bool() const { - -: 2843: return _ops; - -: 2844: } - -: 2845: - -: 2846: /** Test for equality - -: 2847: */ - -: 2848: friend bool operator==(const Callback &l, const Callback &r) { - -: 2849: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 2850: } - -: 2851: - -: 2852: /** Test for inequality - -: 2853: */ - -: 2854: friend bool operator!=(const Callback &l, const Callback &r) { - -: 2855: return !(l == r); - -: 2856: } - -: 2857: - -: 2858: /** Static thunk for passing as C-style function - -: 2859: * @param func Callback to call passed as void pointer - -: 2860: * @param a0 An argument to be called with function func - -: 2861: * @param a1 An argument to be called with function func - -: 2862: * @param a2 An argument to be called with function func - -: 2863: * @param a3 An argument to be called with function func - -: 2864: * @return the value as determined by func which is of - -: 2865: * type and determined by the signiture of func - -: 2866: */ - -: 2867: static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2868: return static_cast(func)->call(a0, a1, a2, a3); - -: 2869: } - -: 2870: - -: 2871:private: - -: 2872: // Stored as pointer to function and pointer to optional object - -: 2873: // Function pointer is stored as union of possible function types - -: 2874: // to garuntee proper size and alignment - -: 2875: struct _class; - -: 2876: union { - -: 2877: void (*_staticfunc)(A0, A1, A2, A3); - -: 2878: void (*_boundfunc)(_class*, A0, A1, A2, A3); - -: 2879: void (_class::*_methodfunc)(A0, A1, A2, A3); - -: 2880: } _func; - -: 2881: void *_obj; - -: 2882: - -: 2883: // Dynamically dispatched operations - -: 2884: const struct ops { - -: 2885: R (*call)(const void*, A0, A1, A2, A3); - -: 2886: void (*move)(void*, const void*); - -: 2887: void (*dtor)(void*); - -: 2888: } *_ops; - -: 2889: - -: 2890: // Generate operations for function object - -: 2891: template - -: 2892: void generate(const F &f) { - -: 2893: static const ops ops = { - -: 2894: &Callback::function_call, - -: 2895: &Callback::function_move, - -: 2896: &Callback::function_dtor, - -: 2897: }; - -: 2898: - -: 2899: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 2900: "Type F must not exceed the size of the Callback class"); - -: 2901: memset(this, 0, sizeof(Callback)); - -: 2902: new (this) F(f); - -: 2903: _ops = &ops; - -: 2904: } - -: 2905: - -: 2906: // Function attributes - -: 2907: template - -: 2908: static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2909: return (*(F*)p)(a0, a1, a2, a3); - -: 2910: } - -: 2911: - -: 2912: template - -: 2913: static void function_move(void *d, const void *p) { - -: 2914: new (d) F(*(F*)p); - -: 2915: } - -: 2916: - -: 2917: template - -: 2918: static void function_dtor(void *p) { - -: 2919: ((F*)p)->~F(); - -: 2920: } - -: 2921: - -: 2922: // Wrappers for functions with context - -: 2923: template - -: 2924: struct method_context { - -: 2925: M method; - -: 2926: O *obj; - -: 2927: - -: 2928: method_context(O *obj, M method) - -: 2929: : method(method), obj(obj) {} - -: 2930: - -: 2931: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2932: return (obj->*method)(a0, a1, a2, a3); - -: 2933: } - -: 2934: }; - -: 2935: - -: 2936: template - -: 2937: struct function_context { - -: 2938: F func; - -: 2939: A *arg; - -: 2940: - -: 2941: function_context(F func, A *arg) - -: 2942: : func(func), arg(arg) {} - -: 2943: - -: 2944: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2945: return func(arg, a0, a1, a2, a3); - -: 2946: } - -: 2947: }; - -: 2948:}; - -: 2949: - -: 2950:/** Callback class based on template specialization - -: 2951: * - -: 2952: * @note Synchronization level: Not protected - -: 2953: */ - -: 2954:template - -: 2955:class Callback { - -: 2956:public: - -: 2957: /** Create a Callback with a static function - -: 2958: * @param func Static function to attach - -: 2959: */ - -: 2960: Callback(R (*func)(A0, A1, A2, A3, A4) = 0) { - -: 2961: if (!func) { - -: 2962: memset(this, 0, sizeof(Callback)); - -: 2963: } else { - -: 2964: generate(func); - -: 2965: } - -: 2966: } - -: 2967: - -: 2968: /** Attach a Callback - -: 2969: * @param func The Callback to attach - -: 2970: */ - -: 2971: Callback(const Callback &func) { - -: 2972: if (func._ops) { - -: 2973: func._ops->move(this, &func); - -: 2974: } - -: 2975: _ops = func._ops; - -: 2976: } - -: 2977: - -: 2978: /** Create a Callback with a member function - -: 2979: * @param obj Pointer to object to invoke member function on - -: 2980: * @param method Member function to attach - -: 2981: */ - -: 2982: template - -: 2983: Callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 2984: generate(method_context(obj, method)); - -: 2985: } - -: 2986: - -: 2987: /** Create a Callback with a member function - -: 2988: * @param obj Pointer to object to invoke member function on - -: 2989: * @param method Member function to attach - -: 2990: */ - -: 2991: template - -: 2992: Callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 2993: generate(method_context(obj, method)); - -: 2994: } - -: 2995: - -: 2996: /** Create a Callback with a member function - -: 2997: * @param obj Pointer to object to invoke member function on - -: 2998: * @param method Member function to attach - -: 2999: */ - -: 3000: template - -: 3001: Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 3002: generate(method_context(obj, method)); - -: 3003: } - -: 3004: - -: 3005: /** Create a Callback with a member function - -: 3006: * @param obj Pointer to object to invoke member function on - -: 3007: * @param method Member function to attach - -: 3008: */ - -: 3009: template - -: 3010: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 3011: generate(method_context(obj, method)); - -: 3012: } - -: 3013: - -: 3014: /** Create a Callback with a static function and bound pointer - -: 3015: * @param func Static function to attach - -: 3016: * @param arg Pointer argument to function - -: 3017: */ - -: 3018: template - -: 3019: Callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 3020: generate(function_context(func, arg)); - -: 3021: } - -: 3022: - -: 3023: /** Create a Callback with a static function and bound pointer - -: 3024: * @param func Static function to attach - -: 3025: * @param arg Pointer argument to function - -: 3026: */ - -: 3027: template - -: 3028: Callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 3029: generate(function_context(func, arg)); - -: 3030: } - -: 3031: - -: 3032: /** Create a Callback with a static function and bound pointer - -: 3033: * @param func Static function to attach - -: 3034: * @param arg Pointer argument to function - -: 3035: */ - -: 3036: template - -: 3037: Callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 3038: generate(function_context(func, arg)); - -: 3039: } - -: 3040: - -: 3041: /** Create a Callback with a static function and bound pointer - -: 3042: * @param func Static function to attach - -: 3043: * @param arg Pointer argument to function - -: 3044: */ - -: 3045: template - -: 3046: Callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 3047: generate(function_context(func, arg)); - -: 3048: } - -: 3049: - -: 3050: /** Create a Callback with a function object - -: 3051: * @param f Function object to attach - -: 3052: * @note The function object is limited to a single word of storage - -: 3053: */ - -: 3054: template - -: 3055: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { - -: 3056: generate(f); - -: 3057: } - -: 3058: - -: 3059: /** Create a Callback with a function object - -: 3060: * @param f Function object to attach - -: 3061: * @note The function object is limited to a single word of storage - -: 3062: */ - -: 3063: template - -: 3064: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { - -: 3065: generate(f); - -: 3066: } - -: 3067: - -: 3068: /** Create a Callback with a function object - -: 3069: * @param f Function object to attach - -: 3070: * @note The function object is limited to a single word of storage - -: 3071: */ - -: 3072: template - -: 3073: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { - -: 3074: generate(f); - -: 3075: } - -: 3076: - -: 3077: /** Create a Callback with a function object - -: 3078: * @param f Function object to attach - -: 3079: * @note The function object is limited to a single word of storage - -: 3080: */ - -: 3081: template - -: 3082: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { - -: 3083: generate(f); - -: 3084: } - -: 3085: - -: 3086: /** Create a Callback with a static function and bound pointer - -: 3087: * @param obj Pointer to object to bind to function - -: 3088: * @param func Static function to attach - -: 3089: * @deprecated - -: 3090: * Arguments to callback have been reordered to Callback(func, arg) - -: 3091: */ - -: 3092: template - -: 3093: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3094: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3095: Callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 3096: new (this) Callback(func, obj); - -: 3097: } - -: 3098: - -: 3099: /** Create a Callback with a static function and bound pointer - -: 3100: * @param obj Pointer to object to bind to function - -: 3101: * @param func Static function to attach - -: 3102: * @deprecated - -: 3103: * Arguments to callback have been reordered to Callback(func, arg) - -: 3104: */ - -: 3105: template - -: 3106: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3107: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3108: Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 3109: new (this) Callback(func, obj); - -: 3110: } - -: 3111: - -: 3112: /** Create a Callback with a static function and bound pointer - -: 3113: * @param obj Pointer to object to bind to function - -: 3114: * @param func Static function to attach - -: 3115: * @deprecated - -: 3116: * Arguments to callback have been reordered to Callback(func, arg) - -: 3117: */ - -: 3118: template - -: 3119: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3120: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3121: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 3122: new (this) Callback(func, obj); - -: 3123: } - -: 3124: - -: 3125: /** Create a Callback with a static function and bound pointer - -: 3126: * @param obj Pointer to object to bind to function - -: 3127: * @param func Static function to attach - -: 3128: * @deprecated - -: 3129: * Arguments to callback have been reordered to Callback(func, arg) - -: 3130: */ - -: 3131: template - -: 3132: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3133: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3134: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 3135: new (this) Callback(func, obj); - -: 3136: } - -: 3137: - -: 3138: /** Destroy a callback - -: 3139: */ - -: 3140: ~Callback() { - -: 3141: if (_ops) { - -: 3142: _ops->dtor(this); - -: 3143: } - -: 3144: } - -: 3145: - -: 3146: /** Attach a static function - -: 3147: * @param func Static function to attach - -: 3148: * @deprecated - -: 3149: * Replaced by simple assignment 'Callback cb = func' - -: 3150: */ - -: 3151: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3152: "Replaced by simple assignment 'Callback cb = func") - -: 3153: void attach(R (*func)(A0, A1, A2, A3, A4)) { - -: 3154: this->~Callback(); - -: 3155: new (this) Callback(func); - -: 3156: } - -: 3157: - -: 3158: /** Attach a Callback - -: 3159: * @param func The Callback to attach - -: 3160: * @deprecated - -: 3161: * Replaced by simple assignment 'Callback cb = func' - -: 3162: */ - -: 3163: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3164: "Replaced by simple assignment 'Callback cb = func") - -: 3165: void attach(const Callback &func) { - -: 3166: this->~Callback(); - -: 3167: new (this) Callback(func); - -: 3168: } - -: 3169: - -: 3170: /** Attach a member function - -: 3171: * @param obj Pointer to object to invoke member function on - -: 3172: * @param method Member function to attach - -: 3173: * @deprecated - -: 3174: * Replaced by simple assignment 'Callback cb = func' - -: 3175: */ - -: 3176: template - -: 3177: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3178: "Replaced by simple assignment 'Callback cb = func") - -: 3179: void attach(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 3180: this->~Callback(); - -: 3181: new (this) Callback(obj, method); - -: 3182: } - -: 3183: - -: 3184: /** Attach a member function - -: 3185: * @param obj Pointer to object to invoke member function on - -: 3186: * @param method Member function to attach - -: 3187: * @deprecated - -: 3188: * Replaced by simple assignment 'Callback cb = func' - -: 3189: */ - -: 3190: template - -: 3191: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3192: "Replaced by simple assignment 'Callback cb = func") - -: 3193: void attach(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 3194: this->~Callback(); - -: 3195: new (this) Callback(obj, method); - -: 3196: } - -: 3197: - -: 3198: /** Attach a member function - -: 3199: * @param obj Pointer to object to invoke member function on - -: 3200: * @param method Member function to attach - -: 3201: * @deprecated - -: 3202: * Replaced by simple assignment 'Callback cb = func' - -: 3203: */ - -: 3204: template - -: 3205: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3206: "Replaced by simple assignment 'Callback cb = func") - -: 3207: void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 3208: this->~Callback(); - -: 3209: new (this) Callback(obj, method); - -: 3210: } - -: 3211: - -: 3212: /** Attach a member function - -: 3213: * @param obj Pointer to object to invoke member function on - -: 3214: * @param method Member function to attach - -: 3215: * @deprecated - -: 3216: * Replaced by simple assignment 'Callback cb = func' - -: 3217: */ - -: 3218: template - -: 3219: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3220: "Replaced by simple assignment 'Callback cb = func") - -: 3221: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 3222: this->~Callback(); - -: 3223: new (this) Callback(obj, method); - -: 3224: } - -: 3225: - -: 3226: /** Attach a static function with a bound pointer - -: 3227: * @param func Static function to attach - -: 3228: * @param arg Pointer argument to function - -: 3229: * @deprecated - -: 3230: * Replaced by simple assignment 'Callback cb = func' - -: 3231: */ - -: 3232: template - -: 3233: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3234: "Replaced by simple assignment 'Callback cb = func") - -: 3235: void attach(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 3236: this->~Callback(); - -: 3237: new (this) Callback(func, arg); - -: 3238: } - -: 3239: - -: 3240: /** Attach a static function with a bound pointer - -: 3241: * @param func Static function to attach - -: 3242: * @param arg Pointer argument to function - -: 3243: * @deprecated - -: 3244: * Replaced by simple assignment 'Callback cb = func' - -: 3245: */ - -: 3246: template - -: 3247: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3248: "Replaced by simple assignment 'Callback cb = func") - -: 3249: void attach(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 3250: this->~Callback(); - -: 3251: new (this) Callback(func, arg); - -: 3252: } - -: 3253: - -: 3254: /** Attach a static function with a bound pointer - -: 3255: * @param func Static function to attach - -: 3256: * @param arg Pointer argument to function - -: 3257: * @deprecated - -: 3258: * Replaced by simple assignment 'Callback cb = func' - -: 3259: */ - -: 3260: template - -: 3261: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3262: "Replaced by simple assignment 'Callback cb = func") - -: 3263: void attach(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 3264: this->~Callback(); - -: 3265: new (this) Callback(func, arg); - -: 3266: } - -: 3267: - -: 3268: /** Attach a static function with a bound pointer - -: 3269: * @param func Static function to attach - -: 3270: * @param arg Pointer argument to function - -: 3271: * @deprecated - -: 3272: * Replaced by simple assignment 'Callback cb = func' - -: 3273: */ - -: 3274: template - -: 3275: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3276: "Replaced by simple assignment 'Callback cb = func") - -: 3277: void attach(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 3278: this->~Callback(); - -: 3279: new (this) Callback(func, arg); - -: 3280: } - -: 3281: - -: 3282: /** Attach a function object - -: 3283: * @param f Function object to attach - -: 3284: * @note The function object is limited to a single word of storage - -: 3285: * @deprecated - -: 3286: * Replaced by simple assignment 'Callback cb = func' - -: 3287: */ - -: 3288: template - -: 3289: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3290: "Replaced by simple assignment 'Callback cb = func") - -: 3291: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { - -: 3292: this->~Callback(); - -: 3293: new (this) Callback(f); - -: 3294: } - -: 3295: - -: 3296: /** Attach a function object - -: 3297: * @param f Function object to attach - -: 3298: * @note The function object is limited to a single word of storage - -: 3299: * @deprecated - -: 3300: * Replaced by simple assignment 'Callback cb = func' - -: 3301: */ - -: 3302: template - -: 3303: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3304: "Replaced by simple assignment 'Callback cb = func") - -: 3305: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { - -: 3306: this->~Callback(); - -: 3307: new (this) Callback(f); - -: 3308: } - -: 3309: - -: 3310: /** Attach a function object - -: 3311: * @param f Function object to attach - -: 3312: * @note The function object is limited to a single word of storage - -: 3313: * @deprecated - -: 3314: * Replaced by simple assignment 'Callback cb = func' - -: 3315: */ - -: 3316: template - -: 3317: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3318: "Replaced by simple assignment 'Callback cb = func") - -: 3319: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { - -: 3320: this->~Callback(); - -: 3321: new (this) Callback(f); - -: 3322: } - -: 3323: - -: 3324: /** Attach a function object - -: 3325: * @param f Function object to attach - -: 3326: * @note The function object is limited to a single word of storage - -: 3327: * @deprecated - -: 3328: * Replaced by simple assignment 'Callback cb = func' - -: 3329: */ - -: 3330: template - -: 3331: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3332: "Replaced by simple assignment 'Callback cb = func") - -: 3333: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { - -: 3334: this->~Callback(); - -: 3335: new (this) Callback(f); - -: 3336: } - -: 3337: - -: 3338: /** Attach a static function with a bound pointer - -: 3339: * @param obj Pointer to object to bind to function - -: 3340: * @param func Static function to attach - -: 3341: * @deprecated - -: 3342: * Arguments to callback have been reordered to attach(func, arg) - -: 3343: */ - -: 3344: template - -: 3345: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3346: "Arguments to callback have been reordered to attach(func, arg)") - -: 3347: void attach(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 3348: this->~Callback(); - -: 3349: new (this) Callback(func, obj); - -: 3350: } - -: 3351: - -: 3352: /** Attach a static function with a bound pointer - -: 3353: * @param obj Pointer to object to bind to function - -: 3354: * @param func Static function to attach - -: 3355: * @deprecated - -: 3356: * Arguments to callback have been reordered to attach(func, arg) - -: 3357: */ - -: 3358: template - -: 3359: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3360: "Arguments to callback have been reordered to attach(func, arg)") - -: 3361: void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 3362: this->~Callback(); - -: 3363: new (this) Callback(func, obj); - -: 3364: } - -: 3365: - -: 3366: /** Attach a static function with a bound pointer - -: 3367: * @param obj Pointer to object to bind to function - -: 3368: * @param func Static function to attach - -: 3369: * @deprecated - -: 3370: * Arguments to callback have been reordered to attach(func, arg) - -: 3371: */ - -: 3372: template - -: 3373: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3374: "Arguments to callback have been reordered to attach(func, arg)") - -: 3375: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 3376: this->~Callback(); - -: 3377: new (this) Callback(func, obj); - -: 3378: } - -: 3379: - -: 3380: /** Attach a static function with a bound pointer - -: 3381: * @param obj Pointer to object to bind to function - -: 3382: * @param func Static function to attach - -: 3383: * @deprecated - -: 3384: * Arguments to callback have been reordered to attach(func, arg) - -: 3385: */ - -: 3386: template - -: 3387: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3388: "Arguments to callback have been reordered to attach(func, arg)") - -: 3389: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 3390: this->~Callback(); - -: 3391: new (this) Callback(func, obj); - -: 3392: } - -: 3393: - -: 3394: /** Assign a callback - -: 3395: */ - -: 3396: Callback &operator=(const Callback &that) { - -: 3397: if (this != &that) { - -: 3398: this->~Callback(); - -: 3399: new (this) Callback(that); - -: 3400: } - -: 3401: - -: 3402: return *this; - -: 3403: } - -: 3404: - -: 3405: /** Call the attached function - -: 3406: */ - -: 3407: R call(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3408: MBED_ASSERT(_ops); - -: 3409: return _ops->call(this, a0, a1, a2, a3, a4); - -: 3410: } - -: 3411: - -: 3412: /** Call the attached function - -: 3413: */ - -: 3414: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3415: return call(a0, a1, a2, a3, a4); - -: 3416: } - -: 3417: - -: 3418: /** Test if function has been attached - -: 3419: */ - -: 3420: operator bool() const { - -: 3421: return _ops; - -: 3422: } - -: 3423: - -: 3424: /** Test for equality - -: 3425: */ - -: 3426: friend bool operator==(const Callback &l, const Callback &r) { - -: 3427: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 3428: } - -: 3429: - -: 3430: /** Test for inequality - -: 3431: */ - -: 3432: friend bool operator!=(const Callback &l, const Callback &r) { - -: 3433: return !(l == r); - -: 3434: } - -: 3435: - -: 3436: /** Static thunk for passing as C-style function - -: 3437: * @param func Callback to call passed as void pointer - -: 3438: * @param a0 An argument to be called with function func - -: 3439: * @param a1 An argument to be called with function func - -: 3440: * @param a2 An argument to be called with function func - -: 3441: * @param a3 An argument to be called with function func - -: 3442: * @param a4 An argument to be called with function func - -: 3443: * @return the value as determined by func which is of - -: 3444: * type and determined by the signiture of func - -: 3445: */ - -: 3446: static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 3447: return static_cast(func)->call(a0, a1, a2, a3, a4); - -: 3448: } - -: 3449: - -: 3450:private: - -: 3451: // Stored as pointer to function and pointer to optional object - -: 3452: // Function pointer is stored as union of possible function types - -: 3453: // to garuntee proper size and alignment - -: 3454: struct _class; - -: 3455: union { - -: 3456: void (*_staticfunc)(A0, A1, A2, A3, A4); - -: 3457: void (*_boundfunc)(_class*, A0, A1, A2, A3, A4); - -: 3458: void (_class::*_methodfunc)(A0, A1, A2, A3, A4); - -: 3459: } _func; - -: 3460: void *_obj; - -: 3461: - -: 3462: // Dynamically dispatched operations - -: 3463: const struct ops { - -: 3464: R (*call)(const void*, A0, A1, A2, A3, A4); - -: 3465: void (*move)(void*, const void*); - -: 3466: void (*dtor)(void*); - -: 3467: } *_ops; - -: 3468: - -: 3469: // Generate operations for function object - -: 3470: template - -: 3471: void generate(const F &f) { - -: 3472: static const ops ops = { - -: 3473: &Callback::function_call, - -: 3474: &Callback::function_move, - -: 3475: &Callback::function_dtor, - -: 3476: }; - -: 3477: - -: 3478: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 3479: "Type F must not exceed the size of the Callback class"); - -: 3480: memset(this, 0, sizeof(Callback)); - -: 3481: new (this) F(f); - -: 3482: _ops = &ops; - -: 3483: } - -: 3484: - -: 3485: // Function attributes - -: 3486: template - -: 3487: static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 3488: return (*(F*)p)(a0, a1, a2, a3, a4); - -: 3489: } - -: 3490: - -: 3491: template - -: 3492: static void function_move(void *d, const void *p) { - -: 3493: new (d) F(*(F*)p); - -: 3494: } - -: 3495: - -: 3496: template - -: 3497: static void function_dtor(void *p) { - -: 3498: ((F*)p)->~F(); - -: 3499: } - -: 3500: - -: 3501: // Wrappers for functions with context - -: 3502: template - -: 3503: struct method_context { - -: 3504: M method; - -: 3505: O *obj; - -: 3506: - -: 3507: method_context(O *obj, M method) - -: 3508: : method(method), obj(obj) {} - -: 3509: - -: 3510: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3511: return (obj->*method)(a0, a1, a2, a3, a4); - -: 3512: } - -: 3513: }; - -: 3514: - -: 3515: template - -: 3516: struct function_context { - -: 3517: F func; - -: 3518: A *arg; - -: 3519: - -: 3520: function_context(F func, A *arg) - -: 3521: : func(func), arg(arg) {} - -: 3522: - -: 3523: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3524: return func(arg, a0, a1, a2, a3, a4); - -: 3525: } - -: 3526: }; - -: 3527:}; - -: 3528: - -: 3529:// Internally used event type - -: 3530:typedef Callback event_callback_t; - -: 3531: - -: 3532: - -: 3533:/** Create a callback class with type infered from the arguments - -: 3534: * - -: 3535: * @param func Static function to attach - -: 3536: * @return Callback with infered type - -: 3537: */ - -: 3538:template - -: 3539:Callback callback(R (*func)() = 0) { - -: 3540: return Callback(func); - -: 3541:} - -: 3542: - -: 3543:/** Create a callback class with type infered from the arguments - -: 3544: * - -: 3545: * @param func Static function to attach - -: 3546: * @return Callback with infered type - -: 3547: */ - -: 3548:template - -: 3549:Callback callback(const Callback &func) { - -: 3550: return Callback(func); - -: 3551:} - -: 3552: - -: 3553:/** Create a callback class with type infered from the arguments - -: 3554: * - -: 3555: * @param obj Optional pointer to object to bind to function - -: 3556: * @param method Member function to attach - -: 3557: * @return Callback with infered type - -: 3558: */ - -: 3559:template - 2: 3560:Callback callback(U *obj, R (T::*method)()) { - 2: 3561: return Callback(obj, method); - -: 3562:} - -: 3563: - -: 3564:/** Create a callback class with type infered from the arguments - -: 3565: * - -: 3566: * @param obj Optional pointer to object to bind to function - -: 3567: * @param method Member function to attach - -: 3568: * @return Callback with infered type - -: 3569: */ - -: 3570:template - -: 3571:Callback callback(const U *obj, R (T::*method)() const) { - -: 3572: return Callback(obj, method); - -: 3573:} - -: 3574: - -: 3575:/** Create a callback class with type infered from the arguments - -: 3576: * - -: 3577: * @param obj Optional pointer to object to bind to function - -: 3578: * @param method Member function to attach - -: 3579: * @return Callback with infered type - -: 3580: */ - -: 3581:template - -: 3582:Callback callback(volatile U *obj, R (T::*method)() volatile) { - -: 3583: return Callback(obj, method); - -: 3584:} - -: 3585: - -: 3586:/** Create a callback class with type infered from the arguments - -: 3587: * - -: 3588: * @param obj Optional pointer to object to bind to function - -: 3589: * @param method Member function to attach - -: 3590: * @return Callback with infered type - -: 3591: */ - -: 3592:template - -: 3593:Callback callback(const volatile U *obj, R (T::*method)() const volatile) { - -: 3594: return Callback(obj, method); - -: 3595:} - -: 3596: - -: 3597:/** Create a callback class with type infered from the arguments - -: 3598: * - -: 3599: * @param func Static function to attach - -: 3600: * @param arg Pointer argument to function - -: 3601: * @return Callback with infered type - -: 3602: */ - -: 3603:template - -: 3604:Callback callback(R (*func)(T*), U *arg) { - -: 3605: return Callback(func, arg); - -: 3606:} - -: 3607: - -: 3608:/** Create a callback class with type infered from the arguments - -: 3609: * - -: 3610: * @param func Static function to attach - -: 3611: * @param arg Pointer argument to function - -: 3612: * @return Callback with infered type - -: 3613: */ - -: 3614:template - -: 3615:Callback callback(R (*func)(const T*), const U *arg) { - -: 3616: return Callback(func, arg); - -: 3617:} - -: 3618: - -: 3619:/** Create a callback class with type infered from the arguments - -: 3620: * - -: 3621: * @param func Static function to attach - -: 3622: * @param arg Pointer argument to function - -: 3623: * @return Callback with infered type - -: 3624: */ - -: 3625:template - -: 3626:Callback callback(R (*func)(volatile T*), volatile U *arg) { - -: 3627: return Callback(func, arg); - -: 3628:} - -: 3629: - -: 3630:/** Create a callback class with type infered from the arguments - -: 3631: * - -: 3632: * @param func Static function to attach - -: 3633: * @param arg Pointer argument to function - -: 3634: * @return Callback with infered type - -: 3635: */ - -: 3636:template - -: 3637:Callback callback(R (*func)(const volatile T*), const volatile U *arg) { - -: 3638: return Callback(func, arg); - -: 3639:} - -: 3640: - -: 3641:/** Create a callback class with type infered from the arguments - -: 3642: * - -: 3643: * @param obj Optional pointer to object to bind to function - -: 3644: * @param func Static function to attach - -: 3645: * @return Callback with infered type - -: 3646: * @deprecated - -: 3647: * Arguments to callback have been reordered to callback(func, arg) - -: 3648: */ - -: 3649:template - -: 3650:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3651: "Arguments to callback have been reordered to callback(func, arg)") - -: 3652:Callback callback(U *obj, R (*func)(T*)) { - -: 3653: return Callback(func, obj); - -: 3654:} - -: 3655: - -: 3656:/** Create a callback class with type infered from the arguments - -: 3657: * - -: 3658: * @param obj Optional pointer to object to bind to function - -: 3659: * @param func Static function to attach - -: 3660: * @return Callback with infered type - -: 3661: * @deprecated - -: 3662: * Arguments to callback have been reordered to callback(func, arg) - -: 3663: */ - -: 3664:template - -: 3665:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3666: "Arguments to callback have been reordered to callback(func, arg)") - -: 3667:Callback callback(const U *obj, R (*func)(const T*)) { - -: 3668: return Callback(func, obj); - -: 3669:} - -: 3670: - -: 3671:/** Create a callback class with type infered from the arguments - -: 3672: * - -: 3673: * @param obj Optional pointer to object to bind to function - -: 3674: * @param func Static function to attach - -: 3675: * @return Callback with infered type - -: 3676: * @deprecated - -: 3677: * Arguments to callback have been reordered to callback(func, arg) - -: 3678: */ - -: 3679:template - -: 3680:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3681: "Arguments to callback have been reordered to callback(func, arg)") - -: 3682:Callback callback(volatile U *obj, R (*func)(volatile T*)) { - -: 3683: return Callback(func, obj); - -: 3684:} - -: 3685: - -: 3686:/** Create a callback class with type infered from the arguments - -: 3687: * - -: 3688: * @param obj Optional pointer to object to bind to function - -: 3689: * @param func Static function to attach - -: 3690: * @return Callback with infered type - -: 3691: * @deprecated - -: 3692: * Arguments to callback have been reordered to callback(func, arg) - -: 3693: */ - -: 3694:template - -: 3695:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3696: "Arguments to callback have been reordered to callback(func, arg)") - -: 3697:Callback callback(const volatile U *obj, R (*func)(const volatile T*)) { - -: 3698: return Callback(func, obj); - -: 3699:} - -: 3700: - -: 3701: - -: 3702:/** Create a callback class with type infered from the arguments - -: 3703: * - -: 3704: * @param func Static function to attach - -: 3705: * @return Callback with infered type - -: 3706: */ - -: 3707:template - -: 3708:Callback callback(R (*func)(A0) = 0) { - -: 3709: return Callback(func); - -: 3710:} - -: 3711: - -: 3712:/** Create a callback class with type infered from the arguments - -: 3713: * - -: 3714: * @param func Static function to attach - -: 3715: * @return Callback with infered type - -: 3716: */ - -: 3717:template - -: 3718:Callback callback(const Callback &func) { - -: 3719: return Callback(func); - -: 3720:} - -: 3721: - -: 3722:/** Create a callback class with type infered from the arguments - -: 3723: * - -: 3724: * @param obj Optional pointer to object to bind to function - -: 3725: * @param method Member function to attach - -: 3726: * @return Callback with infered type - -: 3727: */ - -: 3728:template - -: 3729:Callback callback(U *obj, R (T::*method)(A0)) { - -: 3730: return Callback(obj, method); - -: 3731:} - -: 3732: - -: 3733:/** Create a callback class with type infered from the arguments - -: 3734: * - -: 3735: * @param obj Optional pointer to object to bind to function - -: 3736: * @param method Member function to attach - -: 3737: * @return Callback with infered type - -: 3738: */ - -: 3739:template - -: 3740:Callback callback(const U *obj, R (T::*method)(A0) const) { - -: 3741: return Callback(obj, method); - -: 3742:} - -: 3743: - -: 3744:/** Create a callback class with type infered from the arguments - -: 3745: * - -: 3746: * @param obj Optional pointer to object to bind to function - -: 3747: * @param method Member function to attach - -: 3748: * @return Callback with infered type - -: 3749: */ - -: 3750:template - -: 3751:Callback callback(volatile U *obj, R (T::*method)(A0) volatile) { - -: 3752: return Callback(obj, method); - -: 3753:} - -: 3754: - -: 3755:/** Create a callback class with type infered from the arguments - -: 3756: * - -: 3757: * @param obj Optional pointer to object to bind to function - -: 3758: * @param method Member function to attach - -: 3759: * @return Callback with infered type - -: 3760: */ - -: 3761:template - -: 3762:Callback callback(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 3763: return Callback(obj, method); - -: 3764:} - -: 3765: - -: 3766:/** Create a callback class with type infered from the arguments - -: 3767: * - -: 3768: * @param func Static function to attach - -: 3769: * @param arg Pointer argument to function - -: 3770: * @return Callback with infered type - -: 3771: */ - -: 3772:template - -: 3773:Callback callback(R (*func)(T*, A0), U *arg) { - -: 3774: return Callback(func, arg); - -: 3775:} - -: 3776: - -: 3777:/** Create a callback class with type infered from the arguments - -: 3778: * - -: 3779: * @param func Static function to attach - -: 3780: * @param arg Pointer argument to function - -: 3781: * @return Callback with infered type - -: 3782: */ - -: 3783:template - -: 3784:Callback callback(R (*func)(const T*, A0), const U *arg) { - -: 3785: return Callback(func, arg); - -: 3786:} - -: 3787: - -: 3788:/** Create a callback class with type infered from the arguments - -: 3789: * - -: 3790: * @param func Static function to attach - -: 3791: * @param arg Pointer argument to function - -: 3792: * @return Callback with infered type - -: 3793: */ - -: 3794:template - -: 3795:Callback callback(R (*func)(volatile T*, A0), volatile U *arg) { - -: 3796: return Callback(func, arg); - -: 3797:} - -: 3798: - -: 3799:/** Create a callback class with type infered from the arguments - -: 3800: * - -: 3801: * @param func Static function to attach - -: 3802: * @param arg Pointer argument to function - -: 3803: * @return Callback with infered type - -: 3804: */ - -: 3805:template - -: 3806:Callback callback(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 3807: return Callback(func, arg); - -: 3808:} - -: 3809: - -: 3810:/** Create a callback class with type infered from the arguments - -: 3811: * - -: 3812: * @param obj Optional pointer to object to bind to function - -: 3813: * @param func Static function to attach - -: 3814: * @return Callback with infered type - -: 3815: * @deprecated - -: 3816: * Arguments to callback have been reordered to callback(func, arg) - -: 3817: */ - -: 3818:template - -: 3819:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3820: "Arguments to callback have been reordered to callback(func, arg)") - -: 3821:Callback callback(U *obj, R (*func)(T*, A0)) { - -: 3822: return Callback(func, obj); - -: 3823:} - -: 3824: - -: 3825:/** Create a callback class with type infered from the arguments - -: 3826: * - -: 3827: * @param obj Optional pointer to object to bind to function - -: 3828: * @param func Static function to attach - -: 3829: * @return Callback with infered type - -: 3830: * @deprecated - -: 3831: * Arguments to callback have been reordered to callback(func, arg) - -: 3832: */ - -: 3833:template - -: 3834:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3835: "Arguments to callback have been reordered to callback(func, arg)") - -: 3836:Callback callback(const U *obj, R (*func)(const T*, A0)) { - -: 3837: return Callback(func, obj); - -: 3838:} - -: 3839: - -: 3840:/** Create a callback class with type infered from the arguments - -: 3841: * - -: 3842: * @param obj Optional pointer to object to bind to function - -: 3843: * @param func Static function to attach - -: 3844: * @return Callback with infered type - -: 3845: * @deprecated - -: 3846: * Arguments to callback have been reordered to callback(func, arg) - -: 3847: */ - -: 3848:template - -: 3849:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3850: "Arguments to callback have been reordered to callback(func, arg)") - -: 3851:Callback callback(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 3852: return Callback(func, obj); - -: 3853:} - -: 3854: - -: 3855:/** Create a callback class with type infered from the arguments - -: 3856: * - -: 3857: * @param obj Optional pointer to object to bind to function - -: 3858: * @param func Static function to attach - -: 3859: * @return Callback with infered type - -: 3860: * @deprecated - -: 3861: * Arguments to callback have been reordered to callback(func, arg) - -: 3862: */ - -: 3863:template - -: 3864:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3865: "Arguments to callback have been reordered to callback(func, arg)") - -: 3866:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 3867: return Callback(func, obj); - -: 3868:} - -: 3869: - -: 3870: - -: 3871:/** Create a callback class with type infered from the arguments - -: 3872: * - -: 3873: * @param func Static function to attach - -: 3874: * @return Callback with infered type - -: 3875: */ - -: 3876:template - -: 3877:Callback callback(R (*func)(A0, A1) = 0) { - -: 3878: return Callback(func); - -: 3879:} - -: 3880: - -: 3881:/** Create a callback class with type infered from the arguments - -: 3882: * - -: 3883: * @param func Static function to attach - -: 3884: * @return Callback with infered type - -: 3885: */ - -: 3886:template - -: 3887:Callback callback(const Callback &func) { - -: 3888: return Callback(func); - -: 3889:} - -: 3890: - -: 3891:/** Create a callback class with type infered from the arguments - -: 3892: * - -: 3893: * @param obj Optional pointer to object to bind to function - -: 3894: * @param method Member function to attach - -: 3895: * @return Callback with infered type - -: 3896: */ - -: 3897:template - -: 3898:Callback callback(U *obj, R (T::*method)(A0, A1)) { - -: 3899: return Callback(obj, method); - -: 3900:} - -: 3901: - -: 3902:/** Create a callback class with type infered from the arguments - -: 3903: * - -: 3904: * @param obj Optional pointer to object to bind to function - -: 3905: * @param method Member function to attach - -: 3906: * @return Callback with infered type - -: 3907: */ - -: 3908:template - -: 3909:Callback callback(const U *obj, R (T::*method)(A0, A1) const) { - -: 3910: return Callback(obj, method); - -: 3911:} - -: 3912: - -: 3913:/** Create a callback class with type infered from the arguments - -: 3914: * - -: 3915: * @param obj Optional pointer to object to bind to function - -: 3916: * @param method Member function to attach - -: 3917: * @return Callback with infered type - -: 3918: */ - -: 3919:template - -: 3920:Callback callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 3921: return Callback(obj, method); - -: 3922:} - -: 3923: - -: 3924:/** Create a callback class with type infered from the arguments - -: 3925: * - -: 3926: * @param obj Optional pointer to object to bind to function - -: 3927: * @param method Member function to attach - -: 3928: * @return Callback with infered type - -: 3929: */ - -: 3930:template - -: 3931:Callback callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 3932: return Callback(obj, method); - -: 3933:} - -: 3934: - -: 3935:/** Create a callback class with type infered from the arguments - -: 3936: * - -: 3937: * @param func Static function to attach - -: 3938: * @param arg Pointer argument to function - -: 3939: * @return Callback with infered type - -: 3940: */ - -: 3941:template - -: 3942:Callback callback(R (*func)(T*, A0, A1), U *arg) { - -: 3943: return Callback(func, arg); - -: 3944:} - -: 3945: - -: 3946:/** Create a callback class with type infered from the arguments - -: 3947: * - -: 3948: * @param func Static function to attach - -: 3949: * @param arg Pointer argument to function - -: 3950: * @return Callback with infered type - -: 3951: */ - -: 3952:template - -: 3953:Callback callback(R (*func)(const T*, A0, A1), const U *arg) { - -: 3954: return Callback(func, arg); - -: 3955:} - -: 3956: - -: 3957:/** Create a callback class with type infered from the arguments - -: 3958: * - -: 3959: * @param func Static function to attach - -: 3960: * @param arg Pointer argument to function - -: 3961: * @return Callback with infered type - -: 3962: */ - -: 3963:template - -: 3964:Callback callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 3965: return Callback(func, arg); - -: 3966:} - -: 3967: - -: 3968:/** Create a callback class with type infered from the arguments - -: 3969: * - -: 3970: * @param func Static function to attach - -: 3971: * @param arg Pointer argument to function - -: 3972: * @return Callback with infered type - -: 3973: */ - -: 3974:template - -: 3975:Callback callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 3976: return Callback(func, arg); - -: 3977:} - -: 3978: - -: 3979:/** Create a callback class with type infered from the arguments - -: 3980: * - -: 3981: * @param obj Optional pointer to object to bind to function - -: 3982: * @param func Static function to attach - -: 3983: * @return Callback with infered type - -: 3984: * @deprecated - -: 3985: * Arguments to callback have been reordered to callback(func, arg) - -: 3986: */ - -: 3987:template - -: 3988:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3989: "Arguments to callback have been reordered to callback(func, arg)") - -: 3990:Callback callback(U *obj, R (*func)(T*, A0, A1)) { - -: 3991: return Callback(func, obj); - -: 3992:} - -: 3993: - -: 3994:/** Create a callback class with type infered from the arguments - -: 3995: * - -: 3996: * @param obj Optional pointer to object to bind to function - -: 3997: * @param func Static function to attach - -: 3998: * @return Callback with infered type - -: 3999: * @deprecated - -: 4000: * Arguments to callback have been reordered to callback(func, arg) - -: 4001: */ - -: 4002:template - -: 4003:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4004: "Arguments to callback have been reordered to callback(func, arg)") - -: 4005:Callback callback(const U *obj, R (*func)(const T*, A0, A1)) { - -: 4006: return Callback(func, obj); - -: 4007:} - -: 4008: - -: 4009:/** Create a callback class with type infered from the arguments - -: 4010: * - -: 4011: * @param obj Optional pointer to object to bind to function - -: 4012: * @param func Static function to attach - -: 4013: * @return Callback with infered type - -: 4014: * @deprecated - -: 4015: * Arguments to callback have been reordered to callback(func, arg) - -: 4016: */ - -: 4017:template - -: 4018:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4019: "Arguments to callback have been reordered to callback(func, arg)") - -: 4020:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 4021: return Callback(func, obj); - -: 4022:} - -: 4023: - -: 4024:/** Create a callback class with type infered from the arguments - -: 4025: * - -: 4026: * @param obj Optional pointer to object to bind to function - -: 4027: * @param func Static function to attach - -: 4028: * @return Callback with infered type - -: 4029: * @deprecated - -: 4030: * Arguments to callback have been reordered to callback(func, arg) - -: 4031: */ - -: 4032:template - -: 4033:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4034: "Arguments to callback have been reordered to callback(func, arg)") - -: 4035:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 4036: return Callback(func, obj); - -: 4037:} - -: 4038: - -: 4039: - -: 4040:/** Create a callback class with type infered from the arguments - -: 4041: * - -: 4042: * @param func Static function to attach - -: 4043: * @return Callback with infered type - -: 4044: */ - -: 4045:template - -: 4046:Callback callback(R (*func)(A0, A1, A2) = 0) { - -: 4047: return Callback(func); - -: 4048:} - -: 4049: - -: 4050:/** Create a callback class with type infered from the arguments - -: 4051: * - -: 4052: * @param func Static function to attach - -: 4053: * @return Callback with infered type - -: 4054: */ - -: 4055:template - -: 4056:Callback callback(const Callback &func) { - -: 4057: return Callback(func); - -: 4058:} - -: 4059: - -: 4060:/** Create a callback class with type infered from the arguments - -: 4061: * - -: 4062: * @param obj Optional pointer to object to bind to function - -: 4063: * @param method Member function to attach - -: 4064: * @return Callback with infered type - -: 4065: */ - -: 4066:template - -: 4067:Callback callback(U *obj, R (T::*method)(A0, A1, A2)) { - -: 4068: return Callback(obj, method); - -: 4069:} - -: 4070: - -: 4071:/** Create a callback class with type infered from the arguments - -: 4072: * - -: 4073: * @param obj Optional pointer to object to bind to function - -: 4074: * @param method Member function to attach - -: 4075: * @return Callback with infered type - -: 4076: */ - -: 4077:template - -: 4078:Callback callback(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 4079: return Callback(obj, method); - -: 4080:} - -: 4081: - -: 4082:/** Create a callback class with type infered from the arguments - -: 4083: * - -: 4084: * @param obj Optional pointer to object to bind to function - -: 4085: * @param method Member function to attach - -: 4086: * @return Callback with infered type - -: 4087: */ - -: 4088:template - -: 4089:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 4090: return Callback(obj, method); - -: 4091:} - -: 4092: - -: 4093:/** Create a callback class with type infered from the arguments - -: 4094: * - -: 4095: * @param obj Optional pointer to object to bind to function - -: 4096: * @param method Member function to attach - -: 4097: * @return Callback with infered type - -: 4098: */ - -: 4099:template - -: 4100:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 4101: return Callback(obj, method); - -: 4102:} - -: 4103: - -: 4104:/** Create a callback class with type infered from the arguments - -: 4105: * - -: 4106: * @param func Static function to attach - -: 4107: * @param arg Pointer argument to function - -: 4108: * @return Callback with infered type - -: 4109: */ - -: 4110:template - -: 4111:Callback callback(R (*func)(T*, A0, A1, A2), U *arg) { - -: 4112: return Callback(func, arg); - -: 4113:} - -: 4114: - -: 4115:/** Create a callback class with type infered from the arguments - -: 4116: * - -: 4117: * @param func Static function to attach - -: 4118: * @param arg Pointer argument to function - -: 4119: * @return Callback with infered type - -: 4120: */ - -: 4121:template - -: 4122:Callback callback(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 4123: return Callback(func, arg); - -: 4124:} - -: 4125: - -: 4126:/** Create a callback class with type infered from the arguments - -: 4127: * - -: 4128: * @param func Static function to attach - -: 4129: * @param arg Pointer argument to function - -: 4130: * @return Callback with infered type - -: 4131: */ - -: 4132:template - -: 4133:Callback callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 4134: return Callback(func, arg); - -: 4135:} - -: 4136: - -: 4137:/** Create a callback class with type infered from the arguments - -: 4138: * - -: 4139: * @param func Static function to attach - -: 4140: * @param arg Pointer argument to function - -: 4141: * @return Callback with infered type - -: 4142: */ - -: 4143:template - -: 4144:Callback callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 4145: return Callback(func, arg); - -: 4146:} - -: 4147: - -: 4148:/** Create a callback class with type infered from the arguments - -: 4149: * - -: 4150: * @param obj Optional pointer to object to bind to function - -: 4151: * @param func Static function to attach - -: 4152: * @return Callback with infered type - -: 4153: * @deprecated - -: 4154: * Arguments to callback have been reordered to callback(func, arg) - -: 4155: */ - -: 4156:template - -: 4157:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4158: "Arguments to callback have been reordered to callback(func, arg)") - -: 4159:Callback callback(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 4160: return Callback(func, obj); - -: 4161:} - -: 4162: - -: 4163:/** Create a callback class with type infered from the arguments - -: 4164: * - -: 4165: * @param obj Optional pointer to object to bind to function - -: 4166: * @param func Static function to attach - -: 4167: * @return Callback with infered type - -: 4168: * @deprecated - -: 4169: * Arguments to callback have been reordered to callback(func, arg) - -: 4170: */ - -: 4171:template - -: 4172:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4173: "Arguments to callback have been reordered to callback(func, arg)") - -: 4174:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 4175: return Callback(func, obj); - -: 4176:} - -: 4177: - -: 4178:/** Create a callback class with type infered from the arguments - -: 4179: * - -: 4180: * @param obj Optional pointer to object to bind to function - -: 4181: * @param func Static function to attach - -: 4182: * @return Callback with infered type - -: 4183: * @deprecated - -: 4184: * Arguments to callback have been reordered to callback(func, arg) - -: 4185: */ - -: 4186:template - -: 4187:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4188: "Arguments to callback have been reordered to callback(func, arg)") - -: 4189:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 4190: return Callback(func, obj); - -: 4191:} - -: 4192: - -: 4193:/** Create a callback class with type infered from the arguments - -: 4194: * - -: 4195: * @param obj Optional pointer to object to bind to function - -: 4196: * @param func Static function to attach - -: 4197: * @return Callback with infered type - -: 4198: * @deprecated - -: 4199: * Arguments to callback have been reordered to callback(func, arg) - -: 4200: */ - -: 4201:template - -: 4202:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4203: "Arguments to callback have been reordered to callback(func, arg)") - -: 4204:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 4205: return Callback(func, obj); - -: 4206:} - -: 4207: - -: 4208: - -: 4209:/** Create a callback class with type infered from the arguments - -: 4210: * - -: 4211: * @param func Static function to attach - -: 4212: * @return Callback with infered type - -: 4213: */ - -: 4214:template - -: 4215:Callback callback(R (*func)(A0, A1, A2, A3) = 0) { - -: 4216: return Callback(func); - -: 4217:} - -: 4218: - -: 4219:/** Create a callback class with type infered from the arguments - -: 4220: * - -: 4221: * @param func Static function to attach - -: 4222: * @return Callback with infered type - -: 4223: */ - -: 4224:template - -: 4225:Callback callback(const Callback &func) { - -: 4226: return Callback(func); - -: 4227:} - -: 4228: - -: 4229:/** Create a callback class with type infered from the arguments - -: 4230: * - -: 4231: * @param obj Optional pointer to object to bind to function - -: 4232: * @param method Member function to attach - -: 4233: * @return Callback with infered type - -: 4234: */ - -: 4235:template - -: 4236:Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 4237: return Callback(obj, method); - -: 4238:} - -: 4239: - -: 4240:/** Create a callback class with type infered from the arguments - -: 4241: * - -: 4242: * @param obj Optional pointer to object to bind to function - -: 4243: * @param method Member function to attach - -: 4244: * @return Callback with infered type - -: 4245: */ - -: 4246:template - -: 4247:Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 4248: return Callback(obj, method); - -: 4249:} - -: 4250: - -: 4251:/** Create a callback class with type infered from the arguments - -: 4252: * - -: 4253: * @param obj Optional pointer to object to bind to function - -: 4254: * @param method Member function to attach - -: 4255: * @return Callback with infered type - -: 4256: */ - -: 4257:template - -: 4258:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 4259: return Callback(obj, method); - -: 4260:} - -: 4261: - -: 4262:/** Create a callback class with type infered from the arguments - -: 4263: * - -: 4264: * @param obj Optional pointer to object to bind to function - -: 4265: * @param method Member function to attach - -: 4266: * @return Callback with infered type - -: 4267: */ - -: 4268:template - -: 4269:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 4270: return Callback(obj, method); - -: 4271:} - -: 4272: - -: 4273:/** Create a callback class with type infered from the arguments - -: 4274: * - -: 4275: * @param func Static function to attach - -: 4276: * @param arg Pointer argument to function - -: 4277: * @return Callback with infered type - -: 4278: */ - -: 4279:template - -: 4280:Callback callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 4281: return Callback(func, arg); - -: 4282:} - -: 4283: - -: 4284:/** Create a callback class with type infered from the arguments - -: 4285: * - -: 4286: * @param func Static function to attach - -: 4287: * @param arg Pointer argument to function - -: 4288: * @return Callback with infered type - -: 4289: */ - -: 4290:template - -: 4291:Callback callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 4292: return Callback(func, arg); - -: 4293:} - -: 4294: - -: 4295:/** Create a callback class with type infered from the arguments - -: 4296: * - -: 4297: * @param func Static function to attach - -: 4298: * @param arg Pointer argument to function - -: 4299: * @return Callback with infered type - -: 4300: */ - -: 4301:template - -: 4302:Callback callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 4303: return Callback(func, arg); - -: 4304:} - -: 4305: - -: 4306:/** Create a callback class with type infered from the arguments - -: 4307: * - -: 4308: * @param func Static function to attach - -: 4309: * @param arg Pointer argument to function - -: 4310: * @return Callback with infered type - -: 4311: */ - -: 4312:template - -: 4313:Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 4314: return Callback(func, arg); - -: 4315:} - -: 4316: - -: 4317:/** Create a callback class with type infered from the arguments - -: 4318: * - -: 4319: * @param obj Optional pointer to object to bind to function - -: 4320: * @param func Static function to attach - -: 4321: * @return Callback with infered type - -: 4322: * @deprecated - -: 4323: * Arguments to callback have been reordered to callback(func, arg) - -: 4324: */ - -: 4325:template - -: 4326:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4327: "Arguments to callback have been reordered to callback(func, arg)") - -: 4328:Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 4329: return Callback(func, obj); - -: 4330:} - -: 4331: - -: 4332:/** Create a callback class with type infered from the arguments - -: 4333: * - -: 4334: * @param obj Optional pointer to object to bind to function - -: 4335: * @param func Static function to attach - -: 4336: * @return Callback with infered type - -: 4337: * @deprecated - -: 4338: * Arguments to callback have been reordered to callback(func, arg) - -: 4339: */ - -: 4340:template - -: 4341:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4342: "Arguments to callback have been reordered to callback(func, arg)") - -: 4343:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 4344: return Callback(func, obj); - -: 4345:} - -: 4346: - -: 4347:/** Create a callback class with type infered from the arguments - -: 4348: * - -: 4349: * @param obj Optional pointer to object to bind to function - -: 4350: * @param func Static function to attach - -: 4351: * @return Callback with infered type - -: 4352: * @deprecated - -: 4353: * Arguments to callback have been reordered to callback(func, arg) - -: 4354: */ - -: 4355:template - -: 4356:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4357: "Arguments to callback have been reordered to callback(func, arg)") - -: 4358:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 4359: return Callback(func, obj); - -: 4360:} - -: 4361: - -: 4362:/** Create a callback class with type infered from the arguments - -: 4363: * - -: 4364: * @param obj Optional pointer to object to bind to function - -: 4365: * @param func Static function to attach - -: 4366: * @return Callback with infered type - -: 4367: * @deprecated - -: 4368: * Arguments to callback have been reordered to callback(func, arg) - -: 4369: */ - -: 4370:template - -: 4371:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4372: "Arguments to callback have been reordered to callback(func, arg)") - -: 4373:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 4374: return Callback(func, obj); - -: 4375:} - -: 4376: - -: 4377: - -: 4378:/** Create a callback class with type infered from the arguments - -: 4379: * - -: 4380: * @param func Static function to attach - -: 4381: * @return Callback with infered type - -: 4382: */ - -: 4383:template - -: 4384:Callback callback(R (*func)(A0, A1, A2, A3, A4) = 0) { - -: 4385: return Callback(func); - -: 4386:} - -: 4387: - -: 4388:/** Create a callback class with type infered from the arguments - -: 4389: * - -: 4390: * @param func Static function to attach - -: 4391: * @return Callback with infered type - -: 4392: */ - -: 4393:template - -: 4394:Callback callback(const Callback &func) { - -: 4395: return Callback(func); - -: 4396:} - -: 4397: - -: 4398:/** Create a callback class with type infered from the arguments - -: 4399: * - -: 4400: * @param obj Optional pointer to object to bind to function - -: 4401: * @param method Member function to attach - -: 4402: * @return Callback with infered type - -: 4403: */ - -: 4404:template - -: 4405:Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 4406: return Callback(obj, method); - -: 4407:} - -: 4408: - -: 4409:/** Create a callback class with type infered from the arguments - -: 4410: * - -: 4411: * @param obj Optional pointer to object to bind to function - -: 4412: * @param method Member function to attach - -: 4413: * @return Callback with infered type - -: 4414: */ - -: 4415:template - -: 4416:Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 4417: return Callback(obj, method); - -: 4418:} - -: 4419: - -: 4420:/** Create a callback class with type infered from the arguments - -: 4421: * - -: 4422: * @param obj Optional pointer to object to bind to function - -: 4423: * @param method Member function to attach - -: 4424: * @return Callback with infered type - -: 4425: */ - -: 4426:template - -: 4427:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 4428: return Callback(obj, method); - -: 4429:} - -: 4430: - -: 4431:/** Create a callback class with type infered from the arguments - -: 4432: * - -: 4433: * @param obj Optional pointer to object to bind to function - -: 4434: * @param method Member function to attach - -: 4435: * @return Callback with infered type - -: 4436: */ - -: 4437:template - -: 4438:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 4439: return Callback(obj, method); - -: 4440:} - -: 4441: - -: 4442:/** Create a callback class with type infered from the arguments - -: 4443: * - -: 4444: * @param func Static function to attach - -: 4445: * @param arg Pointer argument to function - -: 4446: * @return Callback with infered type - -: 4447: */ - -: 4448:template - -: 4449:Callback callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 4450: return Callback(func, arg); - -: 4451:} - -: 4452: - -: 4453:/** Create a callback class with type infered from the arguments - -: 4454: * - -: 4455: * @param func Static function to attach - -: 4456: * @param arg Pointer argument to function - -: 4457: * @return Callback with infered type - -: 4458: */ - -: 4459:template - -: 4460:Callback callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 4461: return Callback(func, arg); - -: 4462:} - -: 4463: - -: 4464:/** Create a callback class with type infered from the arguments - -: 4465: * - -: 4466: * @param func Static function to attach - -: 4467: * @param arg Pointer argument to function - -: 4468: * @return Callback with infered type - -: 4469: */ - -: 4470:template - -: 4471:Callback callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 4472: return Callback(func, arg); - -: 4473:} - -: 4474: - -: 4475:/** Create a callback class with type infered from the arguments - -: 4476: * - -: 4477: * @param func Static function to attach - -: 4478: * @param arg Pointer argument to function - -: 4479: * @return Callback with infered type - -: 4480: */ - -: 4481:template - -: 4482:Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 4483: return Callback(func, arg); - -: 4484:} - -: 4485: - -: 4486:/** Create a callback class with type infered from the arguments - -: 4487: * - -: 4488: * @param obj Optional pointer to object to bind to function - -: 4489: * @param func Static function to attach - -: 4490: * @return Callback with infered type - -: 4491: * @deprecated - -: 4492: * Arguments to callback have been reordered to callback(func, arg) - -: 4493: */ - -: 4494:template - -: 4495:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4496: "Arguments to callback have been reordered to callback(func, arg)") - -: 4497:Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 4498: return Callback(func, obj); - -: 4499:} - -: 4500: - -: 4501:/** Create a callback class with type infered from the arguments - -: 4502: * - -: 4503: * @param obj Optional pointer to object to bind to function - -: 4504: * @param func Static function to attach - -: 4505: * @return Callback with infered type - -: 4506: * @deprecated - -: 4507: * Arguments to callback have been reordered to callback(func, arg) - -: 4508: */ - -: 4509:template - -: 4510:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4511: "Arguments to callback have been reordered to callback(func, arg)") - -: 4512:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 4513: return Callback(func, obj); - -: 4514:} - -: 4515: - -: 4516:/** Create a callback class with type infered from the arguments - -: 4517: * - -: 4518: * @param obj Optional pointer to object to bind to function - -: 4519: * @param func Static function to attach - -: 4520: * @return Callback with infered type - -: 4521: * @deprecated - -: 4522: * Arguments to callback have been reordered to callback(func, arg) - -: 4523: */ - -: 4524:template - -: 4525:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4526: "Arguments to callback have been reordered to callback(func, arg)") - -: 4527:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 4528: return Callback(func, obj); - -: 4529:} - -: 4530: - -: 4531:/** Create a callback class with type infered from the arguments - -: 4532: * - -: 4533: * @param obj Optional pointer to object to bind to function - -: 4534: * @param func Static function to attach - -: 4535: * @return Callback with infered type - -: 4536: * @deprecated - -: 4537: * Arguments to callback have been reordered to callback(func, arg) - -: 4538: */ - -: 4539:template - -: 4540:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4541: "Arguments to callback have been reordered to callback(func, arg)") - -: 4542:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 4543: return Callback(func, obj); - -: 4544:} - -: 4545: - -: 4546:/**@}*/ - -: 4547: - -: 4548:/**@}*/ - -: 4549: - -: 4550:} // namespace mbed - -: 4551: - -: 4552:#endif diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/CellularSMS.h.gcov b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/CellularSMS.h.gcov deleted file mode 100644 index 2f1ccf15a2..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/CellularSMS.h.gcov +++ /dev/null @@ -1,160 +0,0 @@ - -: 0:Source:../../../framework/API/CellularSMS.h - -: 0:Graph:objs/AT_CellularSMS_unit/AT_CellularSMS.gcno - -: 0:Data:objs/AT_CellularSMS_unit/AT_CellularSMS.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef CELLULAR_SMS_H_ - -: 19:#define CELLULAR_SMS_H_ - -: 20: - -: 21:#include "Callback.h" - -: 22:#include "nsapi_types.h" - -: 23: - -: 24:namespace mbed { - -: 25: - -: 26:// including trailing '\0' - -: 27:const uint16_t SMS_MAX_SIZE_WITH_CONCATENATION = 4096 + 1; - -: 28:const uint16_t SMS_MAX_PHONE_NUMBER_SIZE = 20 + 1; - -: 29:const uint16_t SMS_MAX_TIME_STAMP_SIZE = 20 + 1; - -: 30: - -: 31:const uint16_t SMS_MAX_SIZE_8BIT_SINGLE_SMS_SIZE = 140; - -: 32:const uint16_t SMS_MAX_SIZE_GSM7_SINGLE_SMS_SIZE = 160; - -: 33: - -: 34:const uint16_t SMS_SIM_WAIT_TIME_MILLISECONDS = 200; - -: 35: - -: 36:const int SMS_ERROR_MULTIPART_ALL_PARTS_NOT_READ = -5001; - -: 37: - -: 38:/** - -: 39: * Class CellularSMS - -: 40: * - -: 41: * An abstract interface for SMS sending and reading. - -: 42: */ - 1: 43:class CellularSMS - -: 44:{ - -: 45:protected: - -: 46: // friend of CellularDevice so that it's the only way to close/delete this class. - -: 47: friend class CellularDevice; - -: 48: - -: 49: /** - -: 50: * virtual Destructor - -: 51: */ - 1: 52: virtual ~CellularSMS() {}; - -: 53:public: - -: 54: - -: 55: /* Enumeration for possible SMS modes, PDU and Text */ - -: 56: enum CellularSMSMmode { - -: 57: CellularSMSMmodePDU = 0, - -: 58: CellularSMSMmodeText - -: 59: }; - -: 60: - -: 61: /** Does all the necessary initializations needed for receiving and sending sms. - -: 62: * - -: 63: * @param mode enumeration for choosing the correct mode: text/pdu - -: 64: * @return zero on success - -: 65: */ - -: 66: virtual nsapi_error_t initialize(CellularSMSMmode mode) = 0; - -: 67: - -: 68: /** Send the SMS with the given parameters - -: 69: * - -: 70: * @param phone_number Phone number where to send sms - -: 71: * @param message SMS message content - -: 72: * @param msg_len Length of the message - -: 73: * @return possible error code or length of the sent sms - -: 74: */ - -: 75: virtual nsapi_size_or_error_t send_sms(const char* phone_number, const char* message, int msg_len) = 0; - -: 76: - -: 77: /** Gets the oldest received sms. - -: 78: * - -: 79: * @param buf preallocated buffer for sms message content - -: 80: * @param buf_len length of allocated buf - -: 81: * @param phone_num preallocated buffer for phone number where sms was sent - -: 82: * @param phone_len length of allocated phone_num buffer - -: 83: * @param time_stamp preallocated buffer for TP-Service Centre Time Stamp (format: yy/MM/dd,hh:mm:ss-+zz). +-zz is timezone. - -: 84: * The unit of time zone is a quarter of an hour relative to GMT. For example +32 would be GMT+8. - -: 85: * @param time_len length of allocated time_stamp buffer - -: 86: * @param buf_size if method return error NSAPI_ERROR_NO_MEMORY because the given buf was not big enough this will - -: 87: * hold the size which is enough. Otherwise zero. - -: 88: * @return possible error code or size of buf. Will return SMS_ERROR_MULTIPART_ALL_PARTS_NOT_READ - -: 89: * if sms was multipart but not all parts are present/failed to read. - -: 90: */ - -: 91: virtual nsapi_size_or_error_t get_sms(char* buf, uint16_t buf_len, char* phone_num, uint16_t phone_len, - -: 92: char* time_stamp, uint16_t time_len, int *buf_size) = 0; - -: 93: - -: 94: /** Callback which is called when new sms is received. SMS can be fetched via method get_sms(). - -: 95: * - -: 96: * @remark In PDU mode there can be multipart sms and callback is called for every received part. - -: 97: * - -: 98: * @param func Callback function which is called when new sms is received. - -: 99: */ - -: 100: virtual void set_sms_callback(Callback func) = 0; - -: 101: - -: 102: /** CPMS preferred message storage - -: 103: * - -: 104: * @param memr memory from which messages are read and deleted - -: 105: * "SM" - SIM SMS memory storage (default) - -: 106: * "ME" - NVM SMS storage - -: 107: * @param memw memory to which writing and sending operations are made - -: 108: * "SM" - SIM SMS memory storage (default) - -: 109: * "ME" - NVM SMS storage - -: 110: * @param mems memory to which received SMs are preferred to be stored - -: 111: * "SM" - SIM SMS memory storage (default) - -: 112: * "ME" - NVM SMS storage - -: 113: * - -: 114: * @return 1 for success, 0 for failure - -: 115: */ - -: 116: virtual nsapi_error_t set_cpms(const char *memr, const char *memw, const char *mems) = 0; - -: 117: - -: 118: /** CSCA - set Service Center Address - -: 119: * - -: 120: * @param sca Service Center Address to be used for mobile originated SMS transmissions. - -: 121: * @param type 129 - national numbering scheme, 145 - international numbering scheme (contains the character "+") - -: 122: * - -: 123: * @return 1 for success, 0 for failure - -: 124: */ - -: 125: virtual nsapi_error_t set_csca(const char *sca, int type) = 0; - -: 126: - -: 127: /** Set command sets the current character set used by the device. "GSM", "IRA",.... - -: 128: * - -: 129: * @remark Current implementation support only ASCII so choose the correct character set. - -: 130: * - -: 131: * @param chr_set preferred character set list (comma separated). Modem might not support the wanted character set - -: 132: * so chr_set list is looped from start until supported set is found. Used character set index is returned. - -: 133: * See more from 3GPP TS 27.005. - -: 134: * @return Used character set index from the given list in case of success. Otherwise negative errorcode. - -: 135: */ - -: 136: virtual nsapi_size_or_error_t set_cscs(const char *chr_set) = 0; - -: 137: - -: 138: /** Deletes all messages from the currently set memory/SIM - -: 139: * - -: 140: * @return possible error code - -: 141: */ - -: 142: virtual nsapi_error_t delete_all_messages() = 0; - -: 143: - -: 144: /** Some modems need extra time between AT commands and responses or there will be error -314, SIM busy. - -: 145: * If SIM busy errors are an issue this time should be increased. It can also be set to zero to make - -: 146: * operations faster and more energy efficient if no errors will follow. By default wait time is zero. - -: 147: * - -: 148: * @param sim_wait_time - -: 149: */ - -: 150: virtual void set_extra_sim_wait_time(int sim_wait_time) = 0; - -: 151:}; - -: 152: - -: 153:} // namespace mbed - -: 154: - -: 155:#endif // CELLULAR_SMS_H_ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_output.txt deleted file mode 100644 index 8018042367..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_output.txt +++ /dev/null @@ -1,24 +0,0 @@ -File '../../../../../platform/Callback.h' -Lines executed:36.17% of 47 -Creating 'Callback.h.gcov' - -File '../../../framework/AT/AT_CellularSMS.cpp' -Lines executed:1.10% of 637 -Creating 'AT_CellularSMS.cpp.gcov' - -File '../../../framework/API/CellularSMS.h' -Lines executed:100.00% of 2 -Creating 'CellularSMS.h.gcov' - -File '../../../framework/AT/AT_CellularSMS.h' -Lines executed:0.00% of 1 -Creating 'AT_CellularSMS.h.gcov' - -File '../../../../../platform/mbed_debug.h' -Lines executed:0.00% of 2 -Creating 'mbed_debug.h.gcov' - -File '/usr/include/c++/5/new' -Lines executed:0.00% of 3 -Creating 'new.gcov' - diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_report.txt deleted file mode 100644 index fc83b4c094..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_report.txt +++ /dev/null @@ -1,6 +0,0 @@ - - 0.00% ../framework/AT/AT_CellularSMS.h - 0.00% ../platform/mbed_debug.h -100.00% ../framework/API/CellularSMS.h - 1.10% ../framework/AT/AT_CellularSMS.cpp - 36.17% ../platform/Callback.h diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_report.txt.html deleted file mode 100644 index b451102e87..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/gcov_report.txt.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - -
CoverageFile
0.00% ../framework/AT/AT_CellularSMS.h
0.00% ../platform/mbed_debug.h
100.00% ../framework/API/CellularSMS.h
1.10% ../framework/AT/AT_CellularSMS.cpp
36.17% ../platform/Callback.h
diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/mbed_debug.h.gcov b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/mbed_debug.h.gcov deleted file mode 100644 index 51786b2957..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/mbed_debug.h.gcov +++ /dev/null @@ -1,84 +0,0 @@ - -: 0:Source:../../../../../platform/mbed_debug.h - -: 0:Graph:objs/AT_CellularSMS_unit/AT_CellularSMS.gcno - -: 0:Data:objs/AT_CellularSMS_unit/AT_CellularSMS.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1: - -: 2:/** \addtogroup platform */ - -: 3:/** @{*/ - -: 4:/** - -: 5: * \defgroup platform_debug Debug functions - -: 6: * @{ - -: 7: */ - -: 8: - -: 9:/* mbed Microcontroller Library - -: 10: * Copyright (c) 2006-2013 ARM Limited - -: 11: * - -: 12: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 13: * you may not use this file except in compliance with the License. - -: 14: * You may obtain a copy of the License at - -: 15: * - -: 16: * http://www.apache.org/licenses/LICENSE-2.0 - -: 17: * - -: 18: * Unless required by applicable law or agreed to in writing, software - -: 19: * distributed under the License is distributed on an "AS IS" BASIS, - -: 20: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 21: * See the License for the specific language governing permissions and - -: 22: * limitations under the License. - -: 23: */ - -: 24:#ifndef MBED_DEBUG_H - -: 25:#define MBED_DEBUG_H - -: 26:#if DEVICE_STDIO_MESSAGES - -: 27:#include - -: 28:#include - -: 29:#endif - -: 30: - -: 31:#ifdef __cplusplus - -: 32:extern "C" { - -: 33:#endif - -: 34: - -: 35: - -: 36:/** Output a debug message - -: 37: * - -: 38: * @param format printf-style format string, followed by variables - -: 39: */ - #####: 40:static inline void debug(const char *format, ...) { - -: 41:#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) - -: 42: va_list args; - -: 43: va_start(args, format); - -: 44: vfprintf(stderr, format, args); - -: 45: va_end(args); - -: 46:#endif - #####: 47:} - -: 48: - -: 49: - -: 50:/** Conditionally output a debug message - -: 51: * - -: 52: * NOTE: If the condition is constant false (== 0) and the compiler optimization - -: 53: * level is greater than 0, then the whole function will be compiled away. - -: 54: * - -: 55: * @param condition output only if condition is true (!= 0) - -: 56: * @param format printf-style format string, followed by variables - -: 57: */ - -: 58:static inline void debug_if(int condition, const char *format, ...) { - -: 59:#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) - -: 60: if (condition) { - -: 61: va_list args; - -: 62: va_start(args, format); - -: 63: vfprintf(stderr, format, args); - -: 64: va_end(args); - -: 65: } - -: 66:#endif - -: 67:} - -: 68: - -: 69: - -: 70:#ifdef __cplusplus - -: 71:} - -: 72:#endif - -: 73: - -: 74:#endif - -: 75: - -: 76:/**@}*/ - -: 77: - -: 78:/**@}*/ - -: 79: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/new.gcov b/features/cellular/UNITTESTS/at/at_cellularsms/gcov/new.gcov deleted file mode 100644 index 48ec10f274..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/gcov/new.gcov +++ /dev/null @@ -1,147 +0,0 @@ - -: 0:Source:/usr/include/c++/5/new - -: 0:Graph:objs/AT_CellularSMS_unit/AT_CellularSMS.gcno - -: 0:Data:objs/AT_CellularSMS_unit/AT_CellularSMS.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:// The -*- C++ -*- dynamic memory management header. - -: 2: - -: 3:// Copyright (C) 1994-2015 Free Software Foundation, Inc. - -: 4: - -: 5:// This file is part of GCC. - -: 6:// - -: 7:// GCC is free software; you can redistribute it and/or modify - -: 8:// it under the terms of the GNU General Public License as published by - -: 9:// the Free Software Foundation; either version 3, or (at your option) - -: 10:// any later version. - -: 11:// - -: 12:// GCC is distributed in the hope that it will be useful, - -: 13:// but WITHOUT ANY WARRANTY; without even the implied warranty of - -: 14:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - -: 15:// GNU General Public License for more details. - -: 16:// - -: 17:// Under Section 7 of GPL version 3, you are granted additional - -: 18:// permissions described in the GCC Runtime Library Exception, version - -: 19:// 3.1, as published by the Free Software Foundation. - -: 20: - -: 21:// You should have received a copy of the GNU General Public License and - -: 22:// a copy of the GCC Runtime Library Exception along with this program; - -: 23:// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - -: 24:// . - -: 25: - -: 26:/** @file new - -: 27: * This is a Standard C++ Library header. - -: 28: * - -: 29: * The header @c new defines several functions to manage dynamic memory and - -: 30: * handling memory allocation errors; see - -: 31: * http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more. - -: 32: */ - -: 33: - -: 34:#ifndef _NEW - -: 35:#define _NEW - -: 36: - -: 37:#pragma GCC system_header - -: 38: - -: 39:#include - -: 40:#include - -: 41: - -: 42:#pragma GCC visibility push(default) - -: 43: - -: 44:extern "C++" { - -: 45: - -: 46:namespace std - -: 47:{ - -: 48: /** - -: 49: * @brief Exception possibly thrown by @c new. - -: 50: * @ingroup exceptions - -: 51: * - -: 52: * @c bad_alloc (or classes derived from it) is used to report allocation - -: 53: * errors from the throwing forms of @c new. */ - -: 54: class bad_alloc : public exception - -: 55: { - -: 56: public: - -: 57: bad_alloc() throw() { } - -: 58: - -: 59: // This declaration is not useless: - -: 60: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - -: 61: virtual ~bad_alloc() throw(); - -: 62: - -: 63: // See comment in eh_exception.cc. - -: 64: virtual const char* what() const throw(); - -: 65: }; - -: 66: - -: 67:#if __cplusplus >= 201103L - -: 68: class bad_array_new_length : public bad_alloc - -: 69: { - -: 70: public: - -: 71: bad_array_new_length() throw() { }; - -: 72: - -: 73: // This declaration is not useless: - -: 74: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - -: 75: virtual ~bad_array_new_length() throw(); - -: 76: - -: 77: // See comment in eh_exception.cc. - -: 78: virtual const char* what() const throw(); - -: 79: }; - -: 80:#endif - -: 81: - -: 82: struct nothrow_t { }; - -: 83: - -: 84: extern const nothrow_t nothrow; - -: 85: - -: 86: /** If you write your own error handler to be called by @c new, it must - -: 87: * be of this type. */ - -: 88: typedef void (*new_handler)(); - -: 89: - -: 90: /// Takes a replacement handler as the argument, returns the - -: 91: /// previous handler. - -: 92: new_handler set_new_handler(new_handler) throw(); - -: 93: - -: 94:#if __cplusplus >= 201103L - -: 95: /// Return the current new handler. - -: 96: new_handler get_new_handler() noexcept; - -: 97:#endif - -: 98:} // namespace std - -: 99: - -: 100://@{ - -: 101:/** These are replaceable signatures: - -: 102: * - normal single new and delete (no arguments, throw @c bad_alloc on error) - -: 103: * - normal array new and delete (same) - -: 104: * - @c nothrow single new and delete (take a @c nothrow argument, return - -: 105: * @c NULL on error) - -: 106: * - @c nothrow array new and delete (same) - -: 107: * - -: 108: * Placement new and delete signatures (take a memory address argument, - -: 109: * does nothing) may not be replaced by a user's program. - -: 110:*/ - -: 111:void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) - -: 112: __attribute__((__externally_visible__)); - -: 113:void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) - -: 114: __attribute__((__externally_visible__)); - -: 115:void operator delete(void*) _GLIBCXX_USE_NOEXCEPT - -: 116: __attribute__((__externally_visible__)); - -: 117:void operator delete[](void*) _GLIBCXX_USE_NOEXCEPT - -: 118: __attribute__((__externally_visible__)); - -: 119:void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 120: __attribute__((__externally_visible__)); - -: 121:void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 122: __attribute__((__externally_visible__)); - -: 123:void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 124: __attribute__((__externally_visible__)); - -: 125:void operator delete[](void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 126: __attribute__((__externally_visible__)); - -: 127: - -: 128:// Default placement versions of operator new. - #####: 129:inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT - #####: 130:{ return __p; } - -: 131:inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT - -: 132:{ return __p; } - -: 133: - -: 134:// Default placement versions of operator delete. - #####: 135:inline void operator delete (void*, void*) _GLIBCXX_USE_NOEXCEPT { } - -: 136:inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { } - -: 137://@} - -: 138:} // extern "C++" - -: 139: - -: 140:#pragma GCC visibility pop - -: 141: - -: 142:#endif diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/lib/libAT_CellularSMS_unit.a b/features/cellular/UNITTESTS/at/at_cellularsms/lib/libAT_CellularSMS_unit.a deleted file mode 100644 index d5782afff1..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/lib/libAT_CellularSMS_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.d deleted file mode 100644 index e67b57c679..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.d +++ /dev/null @@ -1,77 +0,0 @@ -objs/AT_CellularSMS_unit/ATHandler_stub.o: ../../stubs/ATHandler_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/platform.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.gcda deleted file mode 100644 index bd550b5584..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.gcno deleted file mode 100644 index 8d2e2db7b9..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.o deleted file mode 100644 index 4718475cbb..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/ATHandler_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.d deleted file mode 100644 index 3821a9f02d..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.d +++ /dev/null @@ -1,53 +0,0 @@ -objs/AT_CellularSMS_unit/AT_CellularBase_stub.o: \ - ../../stubs/AT_CellularBase_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/AT_CellularBase_stub.h \ - ../../../framework/AT/ATHandler.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/AT_CellularBase_stub.h: - -../../../framework/AT/ATHandler.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.gcda deleted file mode 100644 index f3576040ac..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.gcno deleted file mode 100644 index bf37b2c197..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.o deleted file mode 100644 index 7c1659c0fd..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularBase_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.d deleted file mode 100644 index 3af9634028..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.d +++ /dev/null @@ -1,74 +0,0 @@ -objs/AT_CellularSMS_unit/AT_CellularSMS.o: \ - ../../../framework/AT/AT_CellularSMS.cpp \ - ../../../../../platform/mbed_wait_api.h \ - ../../../framework/AT/AT_CellularSMS.h \ - ../../../framework/API/CellularSMS.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../framework/common/CellularUtil.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../../../platform/mbed_wait_api.h: - -../../../framework/AT/AT_CellularSMS.h: - -../../../framework/API/CellularSMS.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../framework/common/CellularUtil.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.gcda deleted file mode 100644 index 9fd86c11aa..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.gcno deleted file mode 100644 index 2f6f3d9b75..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.o deleted file mode 100644 index 4ac3b01f2d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/AT_CellularSMS.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.d deleted file mode 100644 index 649d89d3ab..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.d +++ /dev/null @@ -1,5 +0,0 @@ -objs/AT_CellularSMS_unit/CellularUtil_stub.o: \ - ../../stubs/CellularUtil_stub.cpp \ - ../../../framework/common/CellularUtil.h - -../../../framework/common/CellularUtil.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.gcda deleted file mode 100644 index ab40952586..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.gcno deleted file mode 100644 index 4072494b3d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.o deleted file mode 100644 index e25b97accd..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/CellularUtil_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.d deleted file mode 100644 index 1dbbaa6d02..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularSMS_unit/EventQueue_stub.o: \ - ../../stubs/EventQueue_stub.cpp ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.gcda deleted file mode 100644 index 4410cd4bdd..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.gcno deleted file mode 100644 index 9e0af2ca70..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.o deleted file mode 100644 index bb27387d10..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.d deleted file mode 100644 index f26e8fe19a..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/AT_CellularSMS_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.gcda deleted file mode 100644 index ccf0fdae29..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.gcno deleted file mode 100644 index 66e32bc500..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.o deleted file mode 100644 index 858dc4498f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.d deleted file mode 100644 index 2c8396526c..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/AT_CellularSMS_unit/at_cellularsmstest.o: at_cellularsmstest.cpp \ - test_at_cellularsms.h - -test_at_cellularsms.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.gcda deleted file mode 100644 index 9fd2d7c22f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.gcno deleted file mode 100644 index ed79477a08..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.o deleted file mode 100644 index 24c84c0a00..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/at_cellularsmstest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.d deleted file mode 100644 index d5d3bbdf18..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/AT_CellularSMS_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.gcda deleted file mode 100644 index e6df492633..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.gcno deleted file mode 100644 index dd61504e9f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.o deleted file mode 100644 index 3d31b9ef9f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.d deleted file mode 100644 index 0dd3988c7f..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/AT_CellularSMS_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.gcda deleted file mode 100644 index b4a0085adf..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.gcno deleted file mode 100644 index dd5f9ebe3c..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.o deleted file mode 100644 index 5b85e2be50..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.d deleted file mode 100644 index 41664876a3..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.d +++ /dev/null @@ -1,5 +0,0 @@ -objs/AT_CellularSMS_unit/mbed_wait_api_stub.o: \ - ../../stubs/mbed_wait_api_stub.cpp \ - ../../../../../platform/mbed_wait_api.h - -../../../../../platform/mbed_wait_api.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.gcda deleted file mode 100644 index 3b6e4df09a..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.gcno deleted file mode 100644 index 1b2c83f49d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.o deleted file mode 100644 index bb14cc1def..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/mbed_wait_api_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.d deleted file mode 100644 index 3a247841aa..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.d +++ /dev/null @@ -1,120 +0,0 @@ -objs/AT_CellularSMS_unit/test_at_cellularsms.o: test_at_cellularsms.cpp \ - test_at_cellularsms.h ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/AT/ATHandler.h ../../../framework/AT/AT_CellularSMS.h \ - ../../../framework/API/CellularSMS.h ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -test_at_cellularsms.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/AT/ATHandler.h: - -../../../framework/AT/AT_CellularSMS.h: - -../../../framework/API/CellularSMS.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.gcda deleted file mode 100644 index fd282f4617..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.gcno deleted file mode 100644 index 3554913e19..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.o deleted file mode 100644 index c9ff526140..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/test_at_cellularsms.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.d b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.d deleted file mode 100644 index d6ca48b626..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.d +++ /dev/null @@ -1,9 +0,0 @@ -objs/AT_CellularSMS_unit/us_ticker_stub.o: ../../stubs/us_ticker_stub.cpp \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.gcda deleted file mode 100644 index fcbaab1948..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.gcno deleted file mode 100644 index f2c2d7de62..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.o b/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.o deleted file mode 100644 index 945c684f5f..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularsms/objs/AT_CellularSMS_unit/us_ticker_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/AT_CellularStack_unit_tests b/features/cellular/UNITTESTS/at/at_cellularstack/AT_CellularStack_unit_tests deleted file mode 100755 index b91e558808..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/AT_CellularStack_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/AT_CellularStack_unit_tests.txt b/features/cellular/UNITTESTS/at/at_cellularstack/AT_CellularStack_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/cpputest_AT_CellularStack.xml b/features/cellular/UNITTESTS/at/at_cellularstack/cpputest_AT_CellularStack.xml deleted file mode 100644 index e14429ab9f..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/cpputest_AT_CellularStack.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/AT_CellularStack.cpp.gcov b/features/cellular/UNITTESTS/at/at_cellularstack/gcov/AT_CellularStack.cpp.gcov deleted file mode 100644 index 1fec76e00b..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/AT_CellularStack.cpp.gcov +++ /dev/null @@ -1,283 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularStack.cpp - -: 0:Graph:objs/AT_CellularStack_unit/AT_CellularStack.gcno - -: 0:Data:objs/AT_CellularStack_unit/AT_CellularStack.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include "AT_CellularStack.h" - -: 19:#include "CellularUtil.h" - -: 20:#include "CellularLog.h" - -: 21: - -: 22:using namespace mbed_cellular_util; - -: 23:using namespace mbed; - -: 24: - 1: 25:AT_CellularStack::AT_CellularStack(ATHandler &at, int cid, nsapi_ip_stack_t stack_type) : AT_CellularBase(at), _socket(NULL),_socket_count(0),_cid(cid), _stack_type(stack_type) - -: 26:{ - 1: 27:} - -: 28: - 2: 29:AT_CellularStack::~AT_CellularStack() - -: 30:{ - 1: 31: for (int i = 0; i < _socket_count; i++) { - #####: 32: if (_socket[i]) { - #####: 33: delete _socket[i]; - -: 34: } - -: 35: } - -: 36: - 1: 37: delete [] _socket; - 1: 38:} - -: 39: - -: 40:/** NetworkStack - -: 41: */ - -: 42: - #####: 43:const char * AT_CellularStack::get_ip_address() - -: 44:{ - #####: 45: _at.lock(); - -: 46: - #####: 47: _at.cmd_start("AT+CGPADDR="); - #####: 48: _at.write_int(_cid); - #####: 49: _at.cmd_stop(); - -: 50: - #####: 51: _at.resp_start("+CGPADDR:"); - -: 52: - #####: 53: if (_at.info_resp()) { - -: 54: - #####: 55: _at.skip_param(); - -: 56: - #####: 57: int len = _at.read_string(_ip, NSAPI_IPv4_SIZE-1); - #####: 58: if (len == -1) { - #####: 59: _ip[0] = '\0'; - #####: 60: _at.unlock(); - -: 61: // no IPV4 address, return - #####: 62: return NULL; - -: 63: } - -: 64: - -: 65: // in case stack type is not IPV4 only, try to look also for IPV6 address - #####: 66: if (_stack_type != IPV4_STACK) { - #####: 67: len = _at.read_string(_ip, PDP_IPV6_SIZE-1); - -: 68: } - -: 69: } - -: 70: - #####: 71: _at.resp_stop(); - #####: 72: _at.unlock(); - -: 73: - -: 74: // we have at least IPV4 address - #####: 75: convert_ipv6(_ip); - -: 76: - #####: 77: return _ip; - -: 78:} - -: 79: - #####: 80:nsapi_error_t AT_CellularStack::socket_open(nsapi_socket_t *handle, nsapi_protocol_t proto) - -: 81:{ - #####: 82: if (!is_protocol_supported(proto)) { - #####: 83: return NSAPI_ERROR_UNSUPPORTED; - -: 84: } - -: 85: - #####: 86: int max_socket_count = get_max_socket_count(); - -: 87: - #####: 88: if (!_socket) { - #####: 89: _socket = new CellularSocket*[max_socket_count]; - #####: 90: if (!_socket) { - #####: 91: return NSAPI_ERROR_NO_SOCKET; - -: 92: } - #####: 93: _socket_count = max_socket_count; - #####: 94: for (int i = 0; i < max_socket_count; i++) { - #####: 95: _socket[i] = 0; - -: 96: } - -: 97: } - -: 98: - #####: 99: int index = -1; - #####: 100: for (int i = 0; i < max_socket_count; i++) { - #####: 101: if (!_socket[i]) { - #####: 102: index = i; - #####: 103: break; - -: 104: } - -: 105: } - -: 106: - #####: 107: if (index == -1) { - #####: 108: return NSAPI_ERROR_NO_SOCKET; - -: 109: } - -: 110: - -: 111: // create local socket structure, socket on modem is created when app calls sendto/recvfrom - #####: 112: _socket[index] = new CellularSocket; - -: 113: CellularSocket *psock; - #####: 114: psock = _socket[index]; - #####: 115: memset(psock, 0, sizeof(CellularSocket)); - #####: 116: SocketAddress addr(0, get_dynamic_ip_port()); - #####: 117: psock->id = index; - #####: 118: psock->localAddress = addr; - #####: 119: psock->proto = proto; - #####: 120: *handle = psock; - -: 121: - #####: 122: return NSAPI_ERROR_OK; - -: 123:} - -: 124: - #####: 125:nsapi_error_t AT_CellularStack::socket_close(nsapi_socket_t handle) - -: 126:{ - #####: 127: int err = NSAPI_ERROR_DEVICE_ERROR; - -: 128: - #####: 129: struct CellularSocket *socket = (struct CellularSocket *)handle; - #####: 130: int sock_id = socket->id; - #####: 131: int max_socket_count = get_max_socket_count(); - -: 132: - #####: 133: int index = -1; - #####: 134: for (int i = 0; i < max_socket_count; i++) { - #####: 135: if (_socket[i] && _socket[i]->id == sock_id) { - #####: 136: index = i; - #####: 137: break; - -: 138: } - -: 139: } - -: 140: - #####: 141: if (index != -1) { - #####: 142: _socket[index] = NULL; - #####: 143: err = NSAPI_ERROR_OK; - -: 144: } - -: 145: - #####: 146: _at.lock(); - -: 147: - -: 148: //_atHandler.setTimeout(...) - -: 149: - #####: 150: err = socket_close_impl(sock_id); - -: 151: - #####: 152: _at.unlock(); - -: 153: - #####: 154: delete socket; - -: 155: - #####: 156: return err; - -: 157:} - -: 158: - #####: 159:nsapi_error_t AT_CellularStack::socket_bind(nsapi_socket_t handle, const SocketAddress &addr) - -: 160:{ - #####: 161: struct CellularSocket *socket = (CellularSocket *)handle; - #####: 162: socket->localAddress = addr; - -: 163: - #####: 164: _at.lock(); - -: 165: - #####: 166: if (!socket->created) { - #####: 167: create_socket_impl(socket); - -: 168: } - -: 169: - #####: 170: return _at.unlock_return_error(); - -: 171:} - -: 172: - #####: 173:nsapi_error_t AT_CellularStack::socket_listen(nsapi_socket_t handle, int backlog) - -: 174:{ - #####: 175: return 0; - -: 176:} - -: 177: - #####: 178:nsapi_error_t AT_CellularStack::socket_connect(nsapi_socket_t handle, const SocketAddress &addr) - -: 179:{ - #####: 180: CellularSocket *socket = (CellularSocket *)handle; - #####: 181: socket->remoteAddress = addr; - #####: 182: socket->connected = true; - -: 183: - #####: 184: return NSAPI_ERROR_OK; - -: 185:} - -: 186: - #####: 187:nsapi_error_t AT_CellularStack::socket_accept(void *server, void **socket, SocketAddress *addr) - -: 188:{ - #####: 189: return 0; - -: 190:} - -: 191: - #####: 192:nsapi_size_or_error_t AT_CellularStack::socket_send(nsapi_socket_t handle, const void *data, unsigned size) - -: 193:{ - #####: 194: CellularSocket *socket = (CellularSocket *)handle; - #####: 195: if (!socket->connected) { - #####: 196: return NSAPI_ERROR_DEVICE_ERROR; - -: 197: } - #####: 198: return socket_sendto(handle, socket->remoteAddress, data, size); - -: 199:} - -: 200: - #####: 201:nsapi_size_or_error_t AT_CellularStack::socket_sendto(nsapi_socket_t handle, const SocketAddress &addr, const void *data, unsigned size) - -: 202:{ - #####: 203: CellularSocket *socket = (CellularSocket *)handle; - -: 204: - #####: 205: nsapi_size_or_error_t ret_val = NSAPI_ERROR_OK; - -: 206: - #####: 207: if (!socket->created) { - #####: 208: _at.lock(); - -: 209: - #####: 210: ret_val = create_socket_impl(socket); - -: 211: - #####: 212: _at.unlock(); - #####: 213: if (ret_val != NSAPI_ERROR_OK) { - #####: 214: return ret_val; - -: 215: } - -: 216: } - -: 217: - #####: 218: unsigned max_packet_size = get_max_packet_size(); - -: 219: - -: 220: /* Check parameters */ - #####: 221: if (addr.get_ip_version() == NSAPI_UNSPEC || - -: 222: size > max_packet_size) { - #####: 223: return NSAPI_ERROR_DEVICE_ERROR; - -: 224: } - -: 225: - #####: 226: _at.lock(); - -: 227: - #####: 228: ret_val = socket_sendto_impl(socket, addr, data, size); - -: 229: - #####: 230: _at.unlock(); - -: 231: - #####: 232: return ret_val; - -: 233:} - -: 234: - #####: 235:nsapi_size_or_error_t AT_CellularStack::socket_recv(nsapi_socket_t handle, void *data, unsigned size) - -: 236:{ - #####: 237: return socket_recvfrom(handle, NULL, data, size); - -: 238:} - -: 239: - #####: 240:nsapi_size_or_error_t AT_CellularStack::socket_recvfrom(nsapi_socket_t handle, SocketAddress *addr, void *buffer, unsigned size) - -: 241:{ - #####: 242: CellularSocket *socket = (CellularSocket *)handle; - -: 243: - #####: 244: nsapi_size_or_error_t ret_val = NSAPI_ERROR_OK; - -: 245: - #####: 246: if (!socket->created) { - #####: 247: _at.lock(); - -: 248: - #####: 249: ret_val = create_socket_impl(socket); - -: 250: - #####: 251: _at.unlock(); - #####: 252: if (ret_val != NSAPI_ERROR_OK) { - #####: 253: return ret_val; - -: 254: } - -: 255: } - -: 256: - #####: 257: unsigned max_packet_size = get_max_packet_size(); - -: 258: - -: 259: /* Check parameters */ - -: 260: if (size < max_packet_size) { - -: 261: //log_warn("Socket receive buffer smaller than max packet size! size:%d max_packet_size:%d", size, max_packet_size); - -: 262: } - -: 263: - #####: 264: _at.lock(); - -: 265: - #####: 266: ret_val = socket_recvfrom_impl(socket, addr, buffer, size); - -: 267: - #####: 268: _at.unlock(); - -: 269: - #####: 270: return ret_val; - -: 271:} - -: 272: - #####: 273:void AT_CellularStack::socket_attach(nsapi_socket_t handle, void (*callback)(void *), void *data) - -: 274:{ - #####: 275: CellularSocket *socket = (CellularSocket *)handle; - #####: 276: socket->_cb = callback; - #####: 277: socket->_data = data; - #####: 278:} diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/AT_CellularStack.h.gcov b/features/cellular/UNITTESTS/at/at_cellularstack/gcov/AT_CellularStack.h.gcov deleted file mode 100644 index 1201175f05..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/AT_CellularStack.h.gcov +++ /dev/null @@ -1,315 +0,0 @@ - -: 0:Source:../../../framework/AT/AT_CellularStack.h - -: 0:Graph:objs/AT_CellularStack_unit/AT_CellularStack.gcno - -: 0:Data:objs/AT_CellularStack_unit/AT_CellularStack.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef AT_CELLULAR_STACK_H_ - -: 19:#define AT_CELLULAR_STACK_H_ - -: 20: - -: 21:#include "AT_CellularBase.h" - -: 22:#include "NetworkStack.h" - -: 23: - -: 24:namespace mbed { - -: 25: - -: 26:// and : each is a string type that identifies the MT in the address space applicable to the PDP. - -: 27:// The string is given as dot-separated numeric (0-255) parameter of the form: - -: 28:// a1.a2.a3.a4 for IPv4 and - -: 29:// a1.a2.a3.a4.a5.a6.a7.a8.a9.a10.a11.a12.a13.a14.a15.a16 for IPv6. - -: 30:#define PDP_IPV6_SIZE 63+1 - -: 31: - -: 32:/** - -: 33: * Class AT_CellularStack. - -: 34: * - -: 35: * Implements NetworkStack and introduces interface for modem specific stack implementations. - -: 36: */ - -: 37:class AT_CellularStack : public NetworkStack, public AT_CellularBase - -: 38:{ - -: 39: - -: 40:public: - -: 41: AT_CellularStack(ATHandler &at, int cid, nsapi_ip_stack_t stack_type); - -: 42: virtual ~AT_CellularStack(); - -: 43: - -: 44:public: // NetworkStack - -: 45: - -: 46: /** Get the local IP address - -: 47: * - -: 48: * @return Null-terminated representation of the local IP address - -: 49: * or null if not yet connected - -: 50: */ - -: 51: virtual const char *get_ip_address(); - -: 52: - -: 53: /** Opens a socket - -: 54: * - -: 55: * Creates a network socket and stores it in the specified handle. - -: 56: * The handle must be passed to following calls on the socket. - -: 57: * - -: 58: * A stack may have a finite number of sockets, in this case - -: 59: * NSAPI_ERROR_NO_SOCKET is returned if no socket is available. - -: 60: * - -: 61: * @param handle Destination for the handle to a newly created socket - -: 62: * @param proto Protocol of socket to open, NSAPI_TCP or NSAPI_UDP - -: 63: * @return 0 on success, negative error code on failure - -: 64: */ - -: 65: virtual nsapi_error_t socket_open(nsapi_socket_t *handle, nsapi_protocol_t proto); - -: 66: - -: 67: /** Close the socket - -: 68: * - -: 69: * Closes any open connection and deallocates any memory associated - -: 70: * with the socket. - -: 71: * - -: 72: * @param handle Socket handle - -: 73: * @return 0 on success, negative error code on failure - -: 74: */ - -: 75: virtual nsapi_error_t socket_close(nsapi_socket_t handle); - -: 76: - -: 77: /** Bind a specific address to a socket - -: 78: * - -: 79: * Binding a socket specifies the address and port on which to recieve - -: 80: * data. If the IP address is zeroed, only the port is bound. - -: 81: * - -: 82: * @param handle Socket handle - -: 83: * @param address Local address to bind - -: 84: * @return 0 on success, negative error code on failure. - -: 85: */ - -: 86: virtual nsapi_error_t socket_bind(nsapi_socket_t handle, const SocketAddress &address); - -: 87: - -: 88: /** Listen for connections on a TCP socket - -: 89: * - -: 90: * Marks the socket as a passive socket that can be used to accept - -: 91: * incoming connections. - -: 92: * - -: 93: * @param handle Socket handle - -: 94: * @param backlog Number of pending connections that can be queued - -: 95: * simultaneously - -: 96: * @return 0 on success, negative error code on failure - -: 97: */ - -: 98: virtual nsapi_error_t socket_listen(nsapi_socket_t handle, int backlog); - -: 99: - -: 100: /** Connects TCP socket to a remote host - -: 101: * - -: 102: * Initiates a connection to a remote server specified by the - -: 103: * indicated address. - -: 104: * - -: 105: * @param handle Socket handle - -: 106: * @param address The SocketAddress of the remote host - -: 107: * @return 0 on success, negative error code on failure - -: 108: */ - -: 109: virtual nsapi_error_t socket_connect(nsapi_socket_t handle, const SocketAddress &address); - -: 110: - -: 111: /** Accepts a connection on a TCP socket - -: 112: * - -: 113: * The server socket must be bound and set to listen for connections. - -: 114: * On a new connection, creates a network socket and stores it in the - -: 115: * specified handle. The handle must be passed to following calls on - -: 116: * the socket. - -: 117: * - -: 118: * A stack may have a finite number of sockets, in this case - -: 119: * NSAPI_ERROR_NO_SOCKET is returned if no socket is available. - -: 120: * - -: 121: * This call is non-blocking. If accept would block, - -: 122: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 123: * - -: 124: * @param server Socket handle to server to accept from - -: 125: * @param handle Destination for a handle to the newly created socket - -: 126: * @param address Destination for the remote address or NULL - -: 127: * @return 0 on success, negative error code on failure - -: 128: */ - -: 129: virtual nsapi_error_t socket_accept(nsapi_socket_t server, - -: 130: nsapi_socket_t *handle, SocketAddress *address=0); - -: 131: - -: 132: /** Send data over a TCP socket - -: 133: * - -: 134: * The socket must be connected to a remote host. Returns the number of - -: 135: * bytes sent from the buffer. - -: 136: * - -: 137: * This call is non-blocking. If send would block, - -: 138: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 139: * - -: 140: * @param handle Socket handle - -: 141: * @param data Buffer of data to send to the host - -: 142: * @param size Size of the buffer in bytes - -: 143: * @return Number of sent bytes on success, negative error - -: 144: * code on failure - -: 145: */ - -: 146: virtual nsapi_size_or_error_t socket_send(nsapi_socket_t handle, - -: 147: const void *data, nsapi_size_t size); - -: 148: - -: 149: /** Receive data over a TCP socket - -: 150: * - -: 151: * The socket must be connected to a remote host. Returns the number of - -: 152: * bytes received into the buffer. - -: 153: * - -: 154: * This call is non-blocking. If recv would block, - -: 155: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 156: * - -: 157: * @param handle Socket handle - -: 158: * @param data Destination buffer for data received from the host - -: 159: * @param size Size of the buffer in bytes - -: 160: * @return Number of received bytes on success, negative error - -: 161: * code on failure - -: 162: */ - -: 163: virtual nsapi_size_or_error_t socket_recv(nsapi_socket_t handle, - -: 164: void *data, nsapi_size_t size); - -: 165: - -: 166: /** Send a packet over a UDP socket - -: 167: * - -: 168: * Sends data to the specified address. Returns the number of bytes - -: 169: * sent from the buffer. - -: 170: * - -: 171: * This call is non-blocking. If sendto would block, - -: 172: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 173: * - -: 174: * @param handle Socket handle - -: 175: * @param address The SocketAddress of the remote host - -: 176: * @param data Buffer of data to send to the host - -: 177: * @param size Size of the buffer in bytes - -: 178: * @return Number of sent bytes on success, negative error - -: 179: * code on failure - -: 180: */ - -: 181: virtual nsapi_size_or_error_t socket_sendto(nsapi_socket_t handle, const SocketAddress &address, - -: 182: const void *data, nsapi_size_t size); - -: 183: - -: 184: /** Receive a packet over a UDP socket - -: 185: * - -: 186: * Receives data and stores the source address in address if address - -: 187: * is not NULL. Returns the number of bytes received into the buffer. - -: 188: * - -: 189: * This call is non-blocking. If recvfrom would block, - -: 190: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 191: * - -: 192: * @param handle Socket handle - -: 193: * @param address Destination for the source address or NULL - -: 194: * @param buffer Destination buffer for data received from the host - -: 195: * @param size Size of the buffer in bytes - -: 196: * @return Number of received bytes on success, negative error - -: 197: * code on failure - -: 198: */ - -: 199: virtual nsapi_size_or_error_t socket_recvfrom(nsapi_socket_t handle, SocketAddress *address, - -: 200: void *buffer, nsapi_size_t size); - -: 201: - -: 202: /** Register a callback on state change of the socket - -: 203: * - -: 204: * The specified callback will be called on state changes such as when - -: 205: * the socket can recv/send/accept successfully and on when an error - -: 206: * occurs. The callback may also be called spuriously without reason. - -: 207: * - -: 208: * The callback may be called in an interrupt context and should not - -: 209: * perform expensive operations such as recv/send calls. - -: 210: * - -: 211: * @param handle Socket handle - -: 212: * @param callback Function to call on state change - -: 213: * @param data Argument to pass to callback - -: 214: */ - -: 215: virtual void socket_attach(nsapi_socket_t handle, void (*callback)(void *), void *data); - -: 216: - -: 217:protected: - -: 218: - #####: 219: class CellularSocket - -: 220: { - -: 221: public: - -: 222: // Socket id from cellular device - -: 223: int id; - -: 224: // Being connected means remote ip address and port are set - -: 225: bool connected; - -: 226: nsapi_protocol_t proto; - -: 227: SocketAddress remoteAddress; - -: 228: SocketAddress localAddress; - -: 229: void (*_cb)(void *); - -: 230: void *_data; - -: 231: bool created; - -: 232: bool rx_avail; // used to synchronise reading from modem - -: 233: }; - -: 234: - -: 235: /** - -: 236: * Gets maximum number of sockets modem supports - -: 237: */ - -: 238: virtual int get_max_socket_count() = 0; - -: 239: - -: 240: /** - -: 241: * Gets maximum packet size - -: 242: */ - -: 243: virtual int get_max_packet_size() = 0; - -: 244: - -: 245: /** - -: 246: * Checks if modem supports the given protocol - -: 247: * - -: 248: * @param protocol Protocol type - -: 249: */ - -: 250: virtual bool is_protocol_supported(nsapi_protocol_t protocol) = 0; - -: 251: - -: 252: /** - -: 253: * Implements modem specific AT command set for socket closing - -: 254: * - -: 255: * @param sock_id Socket id - -: 256: */ - -: 257: virtual nsapi_error_t socket_close_impl(int sock_id) = 0; - -: 258: - -: 259: /** - -: 260: * Implements modem specific AT command set for creating socket - -: 261: * - -: 262: * @param socket Cellular socket handle - -: 263: */ - -: 264: virtual nsapi_error_t create_socket_impl(CellularSocket *socket) = 0; - -: 265: - -: 266: /** - -: 267: * Implements modem specific AT command set for sending data - -: 268: * - -: 269: * @param socket Cellular socket handle - -: 270: * @param address The SocketAddress of the remote host - -: 271: * @param data Buffer of data to send to the host - -: 272: * @param size Size of the buffer in bytes - -: 273: * @return Number of sent bytes on success, negative error - -: 274: * code on failure - -: 275: */ - -: 276: virtual nsapi_size_or_error_t socket_sendto_impl(CellularSocket *socket, const SocketAddress &address, - -: 277: const void *data, nsapi_size_t size) = 0; - -: 278: - -: 279: /** - -: 280: * Implements modem specific AT command set for receiving data - -: 281: * - -: 282: * @param socket Socket handle - -: 283: * @param address Destination for the source address or NULL - -: 284: * @param buffer Destination buffer for data received from the host - -: 285: * @param size Size of the buffer in bytes - -: 286: * @return Number of received bytes on success, negative error - -: 287: * code on failure - -: 288: */ - -: 289: virtual nsapi_size_or_error_t socket_recvfrom_impl(CellularSocket *socket, SocketAddress *address, - -: 290: void *buffer, nsapi_size_t size) = 0; - -: 291: - -: 292: // socket container - -: 293: CellularSocket **_socket; - -: 294: - -: 295: // number of socket slots allocated in socket container - -: 296: int _socket_count; - -: 297: - -: 298: // IP address - -: 299: char _ip[PDP_IPV6_SIZE]; - -: 300: - -: 301: // PDP context id - -: 302: int _cid; - -: 303: - -: 304: // stack type from PDP context - -: 305: nsapi_ip_stack_t _stack_type; - -: 306:}; - -: 307: - -: 308:} // namespace mbed - -: 309: - -: 310:#endif // AT_CELLULAR_STACK_H_ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/NetworkStack.h.gcov b/features/cellular/UNITTESTS/at/at_cellularstack/gcov/NetworkStack.h.gcov deleted file mode 100644 index e82a649b52..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/NetworkStack.h.gcov +++ /dev/null @@ -1,328 +0,0 @@ - -: 0:Source:../../../../../features/netsocket/NetworkStack.h - -: 0:Graph:objs/AT_CellularStack_unit/AT_CellularStack.gcno - -: 0:Data:objs/AT_CellularStack_unit/AT_CellularStack.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1: - -: 2:/* NetworkStack - -: 3: * Copyright (c) 2015 ARM Limited - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef NETWORK_STACK_H - -: 19:#define NETWORK_STACK_H - -: 20: - -: 21:#include "nsapi_types.h" - -: 22:#include "netsocket/SocketAddress.h" - -: 23:#include "netsocket/NetworkInterface.h" - -: 24: - -: 25: - -: 26:/** NetworkStack class - -: 27: * - -: 28: * Common interface that is shared between hardware that - -: 29: * can connect to a network over IP. By implementing the - -: 30: * NetworkStack, a network stack can be used as a target - -: 31: * for instantiating network sockets. - -: 32: * @addtogroup netsocket - -: 33: */ - 1: 34:class NetworkStack - -: 35:{ - -: 36:public: - 1: 37: virtual ~NetworkStack() {}; - -: 38: - -: 39: /** Get the local IP address - -: 40: * - -: 41: * @return Null-terminated representation of the local IP address - -: 42: * or null if not yet connected - -: 43: */ - -: 44: virtual const char *get_ip_address() = 0; - -: 45: - -: 46: /** Translates a hostname to an IP address with specific version - -: 47: * - -: 48: * The hostname may be either a domain name or an IP address. If the - -: 49: * hostname is an IP address, no network transactions will be performed. - -: 50: * - -: 51: * If no stack-specific DNS resolution is provided, the hostname - -: 52: * will be resolve using a UDP socket on the stack. - -: 53: * - -: 54: * @param host Hostname to resolve - -: 55: * @param address Destination for the host SocketAddress - -: 56: * @param version IP version of address to resolve, NSAPI_UNSPEC indicates - -: 57: * version is chosen by the stack (defaults to NSAPI_UNSPEC) - -: 58: * @return 0 on success, negative error code on failure - -: 59: */ - -: 60: virtual nsapi_error_t gethostbyname(const char *host, - -: 61: SocketAddress *address, nsapi_version_t version = NSAPI_UNSPEC); - -: 62: - -: 63: /** Add a domain name server to list of servers to query - -: 64: * - -: 65: * @param address Destination for the host address - -: 66: * @return 0 on success, negative error code on failure - -: 67: */ - -: 68: virtual nsapi_error_t add_dns_server(const SocketAddress &address); - -: 69: - -: 70: /* Set stack options - -: 71: * - -: 72: * setstackopt allows an application to pass stack-specific options - -: 73: * to the underlying stack using stack-specific level and option names, - -: 74: * or to request generic options using levels from nsapi_stack_level_t. - -: 75: * - -: 76: * For unsupported options, NSAPI_ERROR_UNSUPPORTED is returned - -: 77: * and the stack is unmodified. - -: 78: * - -: 79: * @param level Stack-specific protocol level or nsapi_stack_level_t - -: 80: * @param optname Level-specific option name - -: 81: * @param optval Option value - -: 82: * @param optlen Length of the option value - -: 83: * @return 0 on success, negative error code on failure - -: 84: */ - -: 85: virtual nsapi_error_t setstackopt(int level, int optname, const void *optval, unsigned optlen); - -: 86: - -: 87: /* Get stack options - -: 88: * - -: 89: * getstackopt allows an application to retrieve stack-specific options - -: 90: * to the underlying stack using stack-specific level and option names, - -: 91: * or to request generic options using levels from nsapi_stack_level_t. - -: 92: * - -: 93: * @param level Stack-specific protocol level or nsapi_stack_level_t - -: 94: * @param optname Level-specific option name - -: 95: * @param optval Destination for option value - -: 96: * @param optlen Length of the option value - -: 97: * @return 0 on success, negative error code on failure - -: 98: */ - -: 99: virtual nsapi_error_t getstackopt(int level, int optname, void *optval, unsigned *optlen); - -: 100: - -: 101:protected: - -: 102: friend class Socket; - -: 103: friend class UDPSocket; - -: 104: friend class TCPSocket; - -: 105: friend class TCPServer; - -: 106: - -: 107: /** Opens a socket - -: 108: * - -: 109: * Creates a network socket and stores it in the specified handle. - -: 110: * The handle must be passed to following calls on the socket. - -: 111: * - -: 112: * A stack may have a finite number of sockets, in this case - -: 113: * NSAPI_ERROR_NO_SOCKET is returned if no socket is available. - -: 114: * - -: 115: * @param handle Destination for the handle to a newly created socket - -: 116: * @param proto Protocol of socket to open, NSAPI_TCP or NSAPI_UDP - -: 117: * @return 0 on success, negative error code on failure - -: 118: */ - -: 119: virtual nsapi_error_t socket_open(nsapi_socket_t *handle, nsapi_protocol_t proto) = 0; - -: 120: - -: 121: /** Close the socket - -: 122: * - -: 123: * Closes any open connection and deallocates any memory associated - -: 124: * with the socket. - -: 125: * - -: 126: * @param handle Socket handle - -: 127: * @return 0 on success, negative error code on failure - -: 128: */ - -: 129: virtual nsapi_error_t socket_close(nsapi_socket_t handle) = 0; - -: 130: - -: 131: /** Bind a specific address to a socket - -: 132: * - -: 133: * Binding a socket specifies the address and port on which to recieve - -: 134: * data. If the IP address is zeroed, only the port is bound. - -: 135: * - -: 136: * @param handle Socket handle - -: 137: * @param address Local address to bind - -: 138: * @return 0 on success, negative error code on failure. - -: 139: */ - -: 140: virtual nsapi_error_t socket_bind(nsapi_socket_t handle, const SocketAddress &address) = 0; - -: 141: - -: 142: /** Listen for connections on a TCP socket - -: 143: * - -: 144: * Marks the socket as a passive socket that can be used to accept - -: 145: * incoming connections. - -: 146: * - -: 147: * @param handle Socket handle - -: 148: * @param backlog Number of pending connections that can be queued - -: 149: * simultaneously - -: 150: * @return 0 on success, negative error code on failure - -: 151: */ - -: 152: virtual nsapi_error_t socket_listen(nsapi_socket_t handle, int backlog) = 0; - -: 153: - -: 154: /** Connects TCP socket to a remote host - -: 155: * - -: 156: * Initiates a connection to a remote server specified by the - -: 157: * indicated address. - -: 158: * - -: 159: * @param handle Socket handle - -: 160: * @param address The SocketAddress of the remote host - -: 161: * @return 0 on success, negative error code on failure - -: 162: */ - -: 163: virtual nsapi_error_t socket_connect(nsapi_socket_t handle, const SocketAddress &address) = 0; - -: 164: - -: 165: /** Accepts a connection on a TCP socket - -: 166: * - -: 167: * The server socket must be bound and set to listen for connections. - -: 168: * On a new connection, creates a network socket and stores it in the - -: 169: * specified handle. The handle must be passed to following calls on - -: 170: * the socket. - -: 171: * - -: 172: * A stack may have a finite number of sockets, in this case - -: 173: * NSAPI_ERROR_NO_SOCKET is returned if no socket is available. - -: 174: * - -: 175: * This call is non-blocking. If accept would block, - -: 176: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 177: * - -: 178: * @param server Socket handle to server to accept from - -: 179: * @param handle Destination for a handle to the newly created socket - -: 180: * @param address Destination for the remote address or NULL - -: 181: * @return 0 on success, negative error code on failure - -: 182: */ - -: 183: virtual nsapi_error_t socket_accept(nsapi_socket_t server, - -: 184: nsapi_socket_t *handle, SocketAddress *address=0) = 0; - -: 185: - -: 186: /** Send data over a TCP socket - -: 187: * - -: 188: * The socket must be connected to a remote host. Returns the number of - -: 189: * bytes sent from the buffer. - -: 190: * - -: 191: * This call is non-blocking. If send would block, - -: 192: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 193: * - -: 194: * @param handle Socket handle - -: 195: * @param data Buffer of data to send to the host - -: 196: * @param size Size of the buffer in bytes - -: 197: * @return Number of sent bytes on success, negative error - -: 198: * code on failure - -: 199: */ - -: 200: virtual nsapi_size_or_error_t socket_send(nsapi_socket_t handle, - -: 201: const void *data, nsapi_size_t size) = 0; - -: 202: - -: 203: /** Receive data over a TCP socket - -: 204: * - -: 205: * The socket must be connected to a remote host. Returns the number of - -: 206: * bytes received into the buffer. - -: 207: * - -: 208: * This call is non-blocking. If recv would block, - -: 209: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 210: * - -: 211: * @param handle Socket handle - -: 212: * @param data Destination buffer for data received from the host - -: 213: * @param size Size of the buffer in bytes - -: 214: * @return Number of received bytes on success, negative error - -: 215: * code on failure - -: 216: */ - -: 217: virtual nsapi_size_or_error_t socket_recv(nsapi_socket_t handle, - -: 218: void *data, nsapi_size_t size) = 0; - -: 219: - -: 220: /** Send a packet over a UDP socket - -: 221: * - -: 222: * Sends data to the specified address. Returns the number of bytes - -: 223: * sent from the buffer. - -: 224: * - -: 225: * This call is non-blocking. If sendto would block, - -: 226: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 227: * - -: 228: * @param handle Socket handle - -: 229: * @param address The SocketAddress of the remote host - -: 230: * @param data Buffer of data to send to the host - -: 231: * @param size Size of the buffer in bytes - -: 232: * @return Number of sent bytes on success, negative error - -: 233: * code on failure - -: 234: */ - -: 235: virtual nsapi_size_or_error_t socket_sendto(nsapi_socket_t handle, const SocketAddress &address, - -: 236: const void *data, nsapi_size_t size) = 0; - -: 237: - -: 238: /** Receive a packet over a UDP socket - -: 239: * - -: 240: * Receives data and stores the source address in address if address - -: 241: * is not NULL. Returns the number of bytes received into the buffer. - -: 242: * - -: 243: * This call is non-blocking. If recvfrom would block, - -: 244: * NSAPI_ERROR_WOULD_BLOCK is returned immediately. - -: 245: * - -: 246: * @param handle Socket handle - -: 247: * @param address Destination for the source address or NULL - -: 248: * @param buffer Destination buffer for data received from the host - -: 249: * @param size Size of the buffer in bytes - -: 250: * @return Number of received bytes on success, negative error - -: 251: * code on failure - -: 252: */ - -: 253: virtual nsapi_size_or_error_t socket_recvfrom(nsapi_socket_t handle, SocketAddress *address, - -: 254: void *buffer, nsapi_size_t size) = 0; - -: 255: - -: 256: /** Register a callback on state change of the socket - -: 257: * - -: 258: * The specified callback will be called on state changes such as when - -: 259: * the socket can recv/send/accept successfully and on when an error - -: 260: * occurs. The callback may also be called spuriously without reason. - -: 261: * - -: 262: * The callback may be called in an interrupt context and should not - -: 263: * perform expensive operations such as recv/send calls. - -: 264: * - -: 265: * @param handle Socket handle - -: 266: * @param callback Function to call on state change - -: 267: * @param data Argument to pass to callback - -: 268: */ - -: 269: virtual void socket_attach(nsapi_socket_t handle, void (*callback)(void *), void *data) = 0; - -: 270: - -: 271: /* Set stack-specific socket options - -: 272: * - -: 273: * The setsockopt allow an application to pass stack-specific hints - -: 274: * to the underlying stack. For unsupported options, - -: 275: * NSAPI_ERROR_UNSUPPORTED is returned and the socket is unmodified. - -: 276: * - -: 277: * @param handle Socket handle - -: 278: * @param level Stack-specific protocol level - -: 279: * @param optname Stack-specific option identifier - -: 280: * @param optval Option value - -: 281: * @param optlen Length of the option value - -: 282: * @return 0 on success, negative error code on failure - -: 283: */ - -: 284: virtual nsapi_error_t setsockopt(nsapi_socket_t handle, int level, - -: 285: int optname, const void *optval, unsigned optlen); - -: 286: - -: 287: /* Get stack-specific socket options - -: 288: * - -: 289: * The getstackopt allow an application to retrieve stack-specific hints - -: 290: * from the underlying stack. For unsupported options, - -: 291: * NSAPI_ERROR_UNSUPPORTED is returned and optval is unmodified. - -: 292: * - -: 293: * @param handle Socket handle - -: 294: * @param level Stack-specific protocol level - -: 295: * @param optname Stack-specific option identifier - -: 296: * @param optval Destination for option value - -: 297: * @param optlen Length of the option value - -: 298: * @return 0 on success, negative error code on failure - -: 299: */ - -: 300: virtual nsapi_error_t getsockopt(nsapi_socket_t handle, int level, - -: 301: int optname, void *optval, unsigned *optlen); - -: 302:}; - -: 303: - -: 304: - -: 305:/** Convert a raw nsapi_stack_t object into a C++ NetworkStack object - -: 306: * - -: 307: * @param stack Reference to an object that can be converted to a stack - -: 308: * - A raw nsapi_stack_t object - -: 309: * - A reference to a network stack - -: 310: * - A reference to a network interface - -: 311: * @return Reference to the underlying network stack - -: 312: */ - -: 313:NetworkStack *nsapi_create_stack(nsapi_stack_t *stack); - -: 314:NetworkStack *nsapi_create_stack(NetworkStack *stack); - -: 315: - -: 316:template - -: 317:NetworkStack *nsapi_create_stack(IF *iface) - -: 318:{ - -: 319: return nsapi_create_stack(static_cast(iface)->get_stack()); - -: 320:} - -: 321: - -: 322: - -: 323:#endif diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_output.txt deleted file mode 100644 index 8d24c510a1..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_output.txt +++ /dev/null @@ -1,12 +0,0 @@ -File '../../../framework/AT/AT_CellularStack.cpp' -Lines executed:4.62% of 130 -Creating 'AT_CellularStack.cpp.gcov' - -File '../../../framework/AT/AT_CellularStack.h' -Lines executed:0.00% of 1 -Creating 'AT_CellularStack.h.gcov' - -File '../../../../../features/netsocket/NetworkStack.h' -Lines executed:100.00% of 2 -Creating 'NetworkStack.h.gcov' - diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_report.txt deleted file mode 100644 index 70a7c46470..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_report.txt +++ /dev/null @@ -1,3 +0,0 @@ - 0.00% ../framework/AT/AT_CellularStack.h -100.00% ../features/netsocket/NetworkStack.h - 4.62% ../framework/AT/AT_CellularStack.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_report.txt.html deleted file mode 100644 index e0def3ce19..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/gcov/gcov_report.txt.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - -
CoverageFile
0.00% ../framework/AT/AT_CellularStack.h
100.00% ../features/netsocket/NetworkStack.h
4.62% ../framework/AT/AT_CellularStack.cpp
diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/lib/libAT_CellularStack_unit.a b/features/cellular/UNITTESTS/at/at_cellularstack/lib/libAT_CellularStack_unit.a deleted file mode 100644 index d9389dc8aa..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/lib/libAT_CellularStack_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.d deleted file mode 100644 index cc6948eb81..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.d +++ /dev/null @@ -1,78 +0,0 @@ -objs/AT_CellularStack_unit/ATHandler_stub.o: \ - ../../stubs/ATHandler_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/ATHandler_stub.h \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/platform.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/ATHandler_stub.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.gcda deleted file mode 100644 index ff41b97e99..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.gcno deleted file mode 100644 index 70e8e9cf35..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.o deleted file mode 100644 index 4b8233b4be..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/ATHandler_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.d deleted file mode 100644 index 35171b7858..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.d +++ /dev/null @@ -1,53 +0,0 @@ -objs/AT_CellularStack_unit/AT_CellularBase_stub.o: \ - ../../stubs/AT_CellularBase_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/AT_CellularBase_stub.h \ - ../../../framework/AT/ATHandler.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/AT_CellularBase_stub.h: - -../../../framework/AT/ATHandler.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.gcda deleted file mode 100644 index af51275f65..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.gcno deleted file mode 100644 index 2dea15cebe..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.o deleted file mode 100644 index 576a93484e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularBase_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.d deleted file mode 100644 index 9878cebbfa..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.d +++ /dev/null @@ -1,87 +0,0 @@ -objs/AT_CellularStack_unit/AT_CellularStack.o: \ - ../../../framework/AT/AT_CellularStack.cpp \ - ../../../framework/AT/AT_CellularStack.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/common/CellularUtil.h \ - ../../../framework/common/CellularLog.h ../../target_h/PinNames.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h ../../../../../platform/mbed_debug.h - -../../../framework/AT/AT_CellularStack.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/common/CellularUtil.h: - -../../../framework/common/CellularLog.h: - -../../target_h/PinNames.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.gcda deleted file mode 100644 index 5ccaab1a06..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.gcno deleted file mode 100644 index 04e7fcafd6..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.o deleted file mode 100644 index 86efa56183..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/AT_CellularStack.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.d deleted file mode 100644 index 661b029181..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.d +++ /dev/null @@ -1,5 +0,0 @@ -objs/AT_CellularStack_unit/CellularUtil_stub.o: \ - ../../stubs/CellularUtil_stub.cpp \ - ../../../framework/common/CellularUtil.h - -../../../framework/common/CellularUtil.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.gcda deleted file mode 100644 index e208fc9d0e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.gcno deleted file mode 100644 index 502cead029..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.o deleted file mode 100644 index 41c398f14b..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/CellularUtil_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.d deleted file mode 100644 index 1fe4e253e1..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularStack_unit/EventQueue_stub.o: \ - ../../stubs/EventQueue_stub.cpp ../../../../../events/EventQueue.h \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.gcda deleted file mode 100644 index 7688490360..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.gcno deleted file mode 100644 index ae1638afc5..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.o deleted file mode 100644 index d32e315c05..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.d deleted file mode 100644 index 3a798d6388..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/AT_CellularStack_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.gcda deleted file mode 100644 index ceaf9bd583..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.gcno deleted file mode 100644 index 04142ab695..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.o deleted file mode 100644 index 90492f40d4..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.d deleted file mode 100644 index dc915698da..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.d +++ /dev/null @@ -1,31 +0,0 @@ -objs/AT_CellularStack_unit/NetworkStack_stub.o: \ - ../../stubs/NetworkStack_stub.cpp \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/nsapi_dns.h \ - ../../../../../features/netsocket/NetworkStack.h ../../target_h/mbed.h - -../../../../../features/netsocket/NetworkStack.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/nsapi_dns.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../target_h/mbed.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.gcda deleted file mode 100644 index 3e50e7f707..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.gcno deleted file mode 100644 index 2931d7ca8d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.o deleted file mode 100644 index c390fe8432..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/NetworkStack_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.d deleted file mode 100644 index 9ef74dfd6f..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.d +++ /dev/null @@ -1,32 +0,0 @@ -objs/AT_CellularStack_unit/SocketAddress_stub.o: \ - ../../stubs/SocketAddress_stub.cpp \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../target_h/mbed.h - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../target_h/mbed.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.gcda deleted file mode 100644 index 5563355add..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.gcno deleted file mode 100644 index dafe22e19a..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.o deleted file mode 100644 index 3b5ed81988..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/SocketAddress_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.d deleted file mode 100644 index ad5b92e26d..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/AT_CellularStack_unit/at_cellularstacktest.o: \ - at_cellularstacktest.cpp test_at_cellularstack.h - -test_at_cellularstack.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.gcda deleted file mode 100644 index db2d95cf3e..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.gcno deleted file mode 100644 index 67fc6e7ad7..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.o deleted file mode 100644 index 2ca071b842..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/at_cellularstacktest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.d deleted file mode 100644 index 0ad7c2f10f..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/AT_CellularStack_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.gcda deleted file mode 100644 index 2c9a431886..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.gcno deleted file mode 100644 index 32982f4651..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.o deleted file mode 100644 index 9e5a51b8a3..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.d deleted file mode 100644 index da247971c9..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/AT_CellularStack_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.gcda deleted file mode 100644 index 0fd269d5a1..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.gcno deleted file mode 100644 index ca7c95eee1..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.o deleted file mode 100644 index 6a2dff057d..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.d deleted file mode 100644 index 614e6afac8..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.d +++ /dev/null @@ -1,119 +0,0 @@ -objs/AT_CellularStack_unit/test_at_cellularstack.o: \ - test_at_cellularstack.cpp test_at_cellularstack.h \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/AT/ATHandler.h \ - ../../../framework/AT/AT_CellularStack.h ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h - -test_at_cellularstack.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/AT/ATHandler.h: - -../../../framework/AT/AT_CellularStack.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.gcda deleted file mode 100644 index 59976d7e0a..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.gcno deleted file mode 100644 index 42b8792875..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.o deleted file mode 100644 index 72165fd962..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/test_at_cellularstack.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.d b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.d deleted file mode 100644 index f936f57eda..0000000000 --- a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.d +++ /dev/null @@ -1,9 +0,0 @@ -objs/AT_CellularStack_unit/us_ticker_stub.o: \ - ../../stubs/us_ticker_stub.cpp ../../../../../hal/us_ticker_api.h \ - ../../../../../hal/ticker_api.h ../../target_h/device.h - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.gcda b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.gcda deleted file mode 100644 index 51c635c333..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.gcno b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.gcno deleted file mode 100644 index 5a57c4efbb..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.o b/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.o deleted file mode 100644 index 7de9095e04..0000000000 Binary files a/features/cellular/UNITTESTS/at/at_cellularstack/objs/AT_CellularStack_unit/us_ticker_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/ATHandler_unit_tests b/features/cellular/UNITTESTS/at/athandler/ATHandler_unit_tests deleted file mode 100755 index 867975ad55..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/ATHandler_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/ATHandler_unit_tests.txt b/features/cellular/UNITTESTS/at/athandler/ATHandler_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/athandler/cpputest_ATHandler.xml b/features/cellular/UNITTESTS/at/athandler/cpputest_ATHandler.xml deleted file mode 100644 index 3af9cf4ab5..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/cpputest_ATHandler.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/ATHandler.cpp.gcov b/features/cellular/UNITTESTS/at/athandler/gcov/ATHandler.cpp.gcov deleted file mode 100644 index d05f41becd..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/ATHandler.cpp.gcov +++ /dev/null @@ -1,1104 +0,0 @@ - -: 0:Source:../../../framework/AT/ATHandler.cpp - -: 0:Graph:objs/ATHandler_unit/ATHandler.gcno - -: 0:Data:objs/ATHandler_unit/ATHandler.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#include "ATHandler.h" - -: 19:#include "mbed_poll.h" - -: 20:#include "FileHandle.h" - -: 21:#include "Timer.h" - -: 22:#include "mbed_wait_api.h" - -: 23:#include "mbed_debug.h" - -: 24:#ifdef MBED_CONF_RTOS_PRESENT - -: 25:#include "rtos/Thread.h" - -: 26:#endif - -: 27: - -: 28:using namespace mbed; - -: 29:using namespace events; - -: 30: - -: 31://#define MBED_TRACE_MAX_LEVEL TRACE_LEVEL_DEBUG - -: 32:#include "CellularLog.h" - -: 33: - -: 34:// this is intentionally TRACE_LEVEL_INFO - -: 35:#if MBED_TRACE_MAX_LEVEL <= TRACE_LEVEL_INFO - -: 36:#define at_debug(format, ...) do { if (_debug_on) debug(format, ## __VA_ARGS__); } while (0) - -: 37:#else - -: 38:#define at_debug(...) - -: 39:#endif - -: 40: - -: 41:const char *mbed::OK = "OK\r\n"; - -: 42:const uint8_t OK_LENGTH = 4; - -: 43:const char *mbed::CRLF = "\r\n"; - -: 44:const uint8_t CRLF_LENGTH = 2; - -: 45:const char *CME_ERROR = "+CME ERROR:"; - -: 46:const uint8_t CME_ERROR_LENGTH = 11; - -: 47:const char *CMS_ERROR = "+CMS ERROR:"; - -: 48:const uint8_t CMS_ERROR_LENGTH = 11; - -: 49:const char *ERROR_ = "ERROR\r\n"; - -: 50:const uint8_t ERROR_LENGTH = 7; - -: 51:const uint8_t MAX_RESP_LENGTH = CMS_ERROR_LENGTH; - -: 52: - -: 53:static const uint8_t map_3gpp_errors[][2] = { - -: 54: { 103, 3 }, { 106, 6 }, { 107, 7 }, { 108, 8 }, { 111, 11 }, { 112, 12 }, { 113, 13 }, { 114, 14 }, - -: 55: { 115, 15 }, { 122, 22 }, { 125, 25 }, { 172, 95 }, { 173, 96 }, { 174, 97 }, { 175, 99 }, { 176, 111 }, - -: 56: { 177, 8 }, { 126, 26 }, { 127, 27 }, { 128, 28 }, { 129, 29 }, { 130, 30 }, { 131, 31 }, { 132, 32 }, - -: 57: { 133, 33 }, { 134, 34 }, { 140, 40 }, { 141, 41 }, { 142, 42 }, { 143, 43 }, { 144, 44 }, { 145, 45 }, - -: 58: { 146, 46 }, { 178, 65 }, { 179, 66 }, { 180, 48 }, { 181, 83 }, { 171, 49 }, - -: 59:}; - -: 60: - 38: 61:ATHandler::ATHandler(FileHandle *fh, EventQueue &queue, int timeout, const char *output_delimiter) : - -: 62: _nextATHandler(0), - -: 63: _fileHandle(fh), - -: 64: _queue(queue), - -: 65: _last_err(NSAPI_ERROR_OK), - -: 66: _last_3gpp_error(0), - -: 67: _oob_string_max_length(0), - -: 68: _oobs(NULL), - -: 69: _at_timeout(timeout), - -: 70: _previous_at_timeout(timeout), - -: 71: _fh_sigio_set(false), - -: 72: _processing(false), - -: 73: _ref_count(1), - -: 74: _stop_tag(NULL), - -: 75: _delimiter(','), - -: 76: _prefix_matched(false), - -: 77: _urc_matched(false), - -: 78: _error_found(false), - -: 79: _max_resp_length(MAX_RESP_LENGTH), - -: 80:#if MBED_TRACE_MAX_LEVEL == TRACE_LEVEL_DEBUG - -: 81: _debug_on(true), - -: 82:#else - -: 83: _debug_on(false), - -: 84:#endif - 38: 85: _cmd_start(false) - -: 86:{ - -: 87: //enable_debug(true); - -: 88: - 38: 89: clear_error(); - -: 90: - 38: 91: if (output_delimiter) { - 37: 92: _output_delimiter_length = strlen(output_delimiter); - 37: 93: _output_delimiter = new char[_output_delimiter_length]; - 74: 94: for (unsigned i=0; i<_output_delimiter_length; i++) { - 37: 95: _output_delimiter[i] = output_delimiter[i]; - -: 96: } - -: 97: } else { - 1: 98: _output_delimiter_length = 0; - 1: 99: _output_delimiter = NULL; - -: 100: } - -: 101: - 38: 102: reset_buffer(); - 38: 103: memset(_info_resp_prefix, 0, sizeof(_info_resp_prefix)); - -: 104: - 38: 105: _current_scope = NotSet; - 38: 106: set_tag(&_resp_stop, OK); - 38: 107: set_tag(&_info_stop, CRLF); - 38: 108: set_tag(&_elem_stop, ")"); - -: 109: - 38: 110: _fileHandle->set_blocking(false); - -: 111: - 38: 112: set_filehandle_sigio(); - 38: 113:} - -: 114: - 2: 115:void ATHandler::enable_debug(bool enable) - -: 116:{ - 2: 117: _debug_on = enable; - 2: 118:} - -: 119: - 79: 120:ATHandler::~ATHandler() - -: 121:{ - 44: 122: while (_oobs) { - 3: 123: struct oob_t *oob = _oobs; - 3: 124: _oobs = oob->next; - 3: 125: delete oob; - -: 126: } - 38: 127: if (_output_delimiter) { - 37: 128: delete [] _output_delimiter; - -: 129: } - 38: 130:} - -: 131: - 3: 132:void ATHandler::inc_ref_count() - -: 133:{ - 3: 134: _ref_count++; - 3: 135:} - -: 136: - 3: 137:void ATHandler::dec_ref_count() - -: 138:{ - 3: 139: _ref_count--; - 3: 140:} - -: 141: - 4: 142:int ATHandler::get_ref_count() - -: 143:{ - 4: 144: return _ref_count; - -: 145:} - -: 146: - 1: 147:FileHandle *ATHandler::get_file_handle() - -: 148:{ - 1: 149: return _fileHandle; - -: 150:} - -: 151: - 1: 152:void ATHandler::set_file_handle(FileHandle *fh) - -: 153:{ - 1: 154: _fileHandle = fh; - 1: 155:} - -: 156: - 3: 157:void ATHandler::set_urc_handler(const char *prefix, mbed::Callback callback) - -: 158:{ - 3: 159: struct oob_t *oob = new struct oob_t; - 3: 160: oob->matching_to_received = true; - 3: 161: size_t prefix_len = strlen(prefix); - 3: 162: if (prefix_len > _oob_string_max_length) { - 3: 163: _oob_string_max_length = prefix_len; - 3: 164: if (_oob_string_max_length > _max_resp_length) { - 1: 165: _max_resp_length = _oob_string_max_length; - -: 166: } - -: 167: } - 3: 168: oob->prefix = prefix; - 3: 169: oob->cb = callback; - 3: 170: oob->next = _oobs; - 3: 171: _oobs = oob; - 3: 172:} - -: 173: - 38: 174:void ATHandler::event() - -: 175:{ - -: 176: // _processing must be set before filehandle write/read to avoid repetitive sigio events - 38: 177: if (!_processing) { - 38: 178: _processing = true; - 38: 179: (void) _queue.call(Callback(this, &ATHandler::process_oob)); - -: 180: } - 38: 181:} - -: 182: - 6: 183:void ATHandler::lock() - -: 184:{ - -: 185:#ifdef AT_HANDLER_MUTEX - 6: 186: _fileHandleMutex.lock(); - -: 187:#endif - 6: 188: _processing = true; - 6: 189: clear_error(); - 6: 190:} - -: 191: - 7: 192:void ATHandler::unlock() - -: 193:{ - 7: 194: _processing = false; - -: 195:#ifdef AT_HANDLER_MUTEX - 7: 196: _fileHandleMutex.unlock(); - -: 197:#endif - 7: 198: if (_fileHandle->readable() || (_recv_pos < _recv_len)) { - 1: 199: (void) _queue.call(Callback(this, &ATHandler::process_oob)); - -: 200: } - 7: 201:} - -: 202: - 1: 203:nsapi_error_t ATHandler::unlock_return_error() - -: 204:{ - 1: 205: nsapi_error_t err = _last_err; - 1: 206: unlock(); - 1: 207: return err; - -: 208:} - -: 209: - 4: 210:void ATHandler::set_at_timeout(uint32_t timeout_milliseconds, bool default_timeout) - -: 211:{ - 4: 212: if (default_timeout) { - 2: 213: _previous_at_timeout = timeout_milliseconds; - 2: 214: _at_timeout = timeout_milliseconds; - 2: 215: } else if (timeout_milliseconds != _at_timeout) { - 2: 216: _previous_at_timeout = _at_timeout; - 2: 217: _at_timeout = timeout_milliseconds; - -: 218: } - 4: 219:} - -: 220: - 1: 221:void ATHandler::restore_at_timeout() - -: 222:{ - 1: 223: if (_previous_at_timeout != _at_timeout) { - 1: 224: _at_timeout =_previous_at_timeout; - -: 225: } - 1: 226:} - -: 227: - 5: 228:void ATHandler::process_oob() - -: 229:{ - 5: 230: lock(); - -: 231: log_debug("process_oob %d", (_fileHandle->readable() || (_recv_pos < _recv_len))); - 5: 232: if (_fileHandle->readable() || (_recv_pos < _recv_len)) { - 5: 233: _current_scope = NotSet; - 10: 234: Timer timer; - 5: 235: timer.start(); - 4: 236: do { - 5: 237: if (match_urc()) { - 2: 238: if (_fileHandle->readable() || (_recv_pos < _recv_len)) { - 1: 239: continue; - -: 240: } - 1: 241: break; - -: 242: } - -: 243: // If no match found, look for CRLF and consume everything up to CRLF - 3: 244: if (mem_str(_recv_buff, sizeof(_recv_buff), CRLF, CRLF_LENGTH)) { - 1: 245: consume_to_tag(CRLF, true); - -: 246: } else { - 2: 247: if (_fileHandle->readable()) { - 1: 248: fill_buffer(); - -: 249: } else { - -: 250:#ifdef MBED_CONF_RTOS_PRESENT - -: 251: rtos::Thread::yield(); - -: 252:#endif - -: 253: } - -: 254: - -: 255: } - 4: 256: } while (timer.read_ms() < 100); - -: 257: } - -: 258: log_debug("process_oob exit"); - -: 259: - 5: 260: flush(); // consume anything that could not be handled - -: 261: - 5: 262: unlock(); - 5: 263:} - -: 264: - -: 265:// oob match settings - -: 266://DEAD CODE? - #####: 267:void ATHandler::set_oobs_matching_param(bool is_it_a_match_or_not) - -: 268:{ - #####: 269: for (struct oob_t *oob = _oobs; oob; oob = oob->next) { - #####: 270: oob->matching_to_received = is_it_a_match_or_not; - -: 271: } - #####: 272:} - -: 273: - 39: 274:void ATHandler::set_filehandle_sigio() - -: 275:{ - 39: 276: if (_fh_sigio_set) { - 1: 277: return; - -: 278: } - 38: 279: _fileHandle->sigio(mbed::Callback(this, &ATHandler::event)); - 38: 280: _fh_sigio_set = true; - -: 281:} - -: 282: - 101: 283:void ATHandler::reset_buffer() - -: 284:{ - -: 285: log_debug("%s", __func__); - 101: 286: memset(_recv_buff, 0, sizeof(_recv_buff)); - 101: 287: _recv_pos = 0; _recv_len = 0; - 101: 288:} - -: 289: - 196: 290:void ATHandler::rewind_buffer() - -: 291:{ - -: 292: log_debug("%s", __func__); - 196: 293: if (_recv_pos > 0 && _recv_len >= _recv_pos) { - 5: 294: _recv_len -= _recv_pos; - -: 295: // move what is not read to beginning of buffer - 5: 296: memmove(_recv_buff, _recv_buff + _recv_pos, _recv_len); - 5: 297: _recv_pos = 0; - -: 298: // reset rest of buffer - 5: 299: memset(_recv_buff + _recv_len, 0, sizeof(_recv_buff) - _recv_len); - -: 300: } - 196: 301:} - -: 302: - -: 303:// we are always expecting to receive something so there is wait timeout - 63: 304:void ATHandler::fill_buffer() - -: 305:{ - -: 306: log_debug("%s", __func__); - -: 307: // Reset buffer when full - 63: 308: if (sizeof(_recv_buff) == _recv_len) { - #####: 309: reset_buffer(); - -: 310: } - -: 311: - 90: 312: Timer timer; - 63: 313: timer.start(); - 27: 314: do { - 63: 315: ssize_t len = _fileHandle->read(_recv_buff + _recv_len, sizeof(_recv_buff) - _recv_len); - 63: 316: if (len > 0) { - 36: 317: _recv_len += len; - 36: 318: at_debug("\n----------readable----------: %d\n", _recv_len); - 420: 319: for (size_t i = _recv_pos; i < _recv_len; i++) { - 384: 320: at_debug("%c", _recv_buff[i]); - -: 321: } - 36: 322: at_debug("\n----------readable----------\n"); - 36: 323: return; - -: 324: } - -: 325:#ifdef MBED_CONF_RTOS_PRESENT - -: 326: rtos::Thread::yield(); - -: 327:#endif - 27: 328: } while (timer.read_ms() < _at_timeout); - -: 329: - 27: 330: set_error(NSAPI_ERROR_DEVICE_ERROR); - 27: 331: log_error("AT TIMEOUT, scope: %d timeout: %d", _current_scope, _at_timeout); - -: 332:} - -: 333: - 267: 334:int16_t ATHandler::get_char() - -: 335:{ - 267: 336: if (_recv_pos == _recv_len) { - -: 337: log_debug("%s", __func__); - 30: 338: reset_buffer(); // try to read as much as possible - 30: 339: fill_buffer(); - 30: 340: if (get_last_error()) { - -: 341: log_debug("%s: -1", __func__); - 21: 342: return -1; // timeout to read - -: 343: } - -: 344: } - -: 345: - -: 346: log_debug("%s: %c", __func__, _recv_buff[_recv_pos]); - -: 347: - 246: 348: return _recv_buff[_recv_pos++]; - -: 349:} - -: 350: - 5: 351:void ATHandler::skip_param(uint32_t count) - -: 352:{ - -: 353: log_debug("%s", __func__); - 5: 354: if (_last_err || !_stop_tag || _stop_tag->found) { - 1: 355: return; - -: 356: } - -: 357: - 6: 358: for (uint32_t i=0; (i < count && !_stop_tag->found); i++) { - 4: 359: size_t match_pos = 0; - 54: 360: while (true) { - 58: 361: int16_t c = get_char(); - 58: 362: if (c == -1) { - 2: 363: set_error(NSAPI_ERROR_DEVICE_ERROR); - 2: 364: return; - 56: 365: } else if (c == _delimiter) { - 1: 366: break; - 55: 367: } else if (_stop_tag->len && c == _stop_tag->tag[match_pos]) { - 6: 368: match_pos++; - 11: 369: if (match_pos == _stop_tag->len) { - 1: 370: _stop_tag->found = true; - 1: 371: break; - -: 372: } - 49: 373: } else if (match_pos) { - 1: 374: match_pos = 0; - -: 375: } - -: 376: } - -: 377: } - 2: 378: return; - -: 379:} - -: 380: - 3: 381:void ATHandler::skip_param(ssize_t len, uint32_t count) - -: 382:{ - -: 383: log_debug("%s", __func__); - 3: 384: if (_last_err || !_stop_tag || _stop_tag->found) { - 1: 385: return; - -: 386: } - -: 387: - 5: 388: for (uint32_t i=0; i < count; i++) { - 4: 389: ssize_t read_len = 0; - 56: 390: while (read_len < len) { - 27: 391: int16_t c = get_char(); - 27: 392: if (c == -1) { - 1: 393: set_error(NSAPI_ERROR_DEVICE_ERROR); - 1: 394: return; - -: 395: } - 26: 396: read_len++; - -: 397: } - -: 398: } - 1: 399: return; - -: 400:} - -: 401: - 9: 402:ssize_t ATHandler::read_bytes(uint8_t *buf, size_t len) - -: 403:{ - -: 404: log_debug("%s", __func__); - 9: 405: if (_last_err) { - 1: 406: return -1; - -: 407: } - -: 408: - 8: 409: size_t read_len = 0; - 54: 410: for (; read_lenfound && read_even_stop_tag == false)) { - 1: 431: return -1; - -: 432: } - -: 433: - 10: 434: uint8_t *pbuf = (uint8_t*)buf; - -: 435: - 10: 436: size_t len = 0; - 10: 437: size_t match_pos = 0; - -: 438: - 10: 439: consume_char('\"'); - -: 440: - 60: 441: for (; len<(size + match_pos); len++) { - 34: 442: int16_t c = get_char(); - 34: 443: if (c == -1) { - 5: 444: pbuf[len] = '\0'; - 5: 445: set_error(NSAPI_ERROR_DEVICE_ERROR); - 5: 446: return -1; - 29: 447: } else if (c == _delimiter) { - 3: 448: pbuf[len] = '\0'; - 3: 449: break; - 26: 450: } else if (c == '\"') { - 1: 451: match_pos = 0; - 1: 452: len--; - 1: 453: continue; - 25: 454: } else if (_stop_tag->len && c == _stop_tag->tag[match_pos]) { - 5: 455: match_pos++; - 9: 456: if (match_pos == _stop_tag->len) { - 1: 457: _stop_tag->found = true; - -: 458: // remove tag from string if it was matched - 1: 459: len -= (_stop_tag->len - 1); - 1: 460: pbuf[len] = '\0'; - 1: 461: break; - -: 462: } - 20: 463: } else if (match_pos) { - 1: 464: match_pos = 0; - -: 465: } - -: 466: - 24: 467: pbuf[len] = c; - -: 468: } - -: 469: - -: 470: // Do we need _stop_found set after reading by size -> is _stop_tag_by_len needed or not? - 5: 471: return len; - -: 472:} - -: 473: - 7: 474:int32_t ATHandler::read_int() - -: 475:{ - -: 476: log_debug("%s", __func__); - -: 477: - 7: 478: if (_last_err || !_stop_tag || _stop_tag->found) { - 1: 479: return -1; - -: 480: } - -: 481: - 6: 482: char buff[BUFF_SIZE] = {0}; - -: 483: char *first_no_digit; - -: 484: - 6: 485: if (read_string(buff, (size_t)sizeof(buff)) == 0) { - 1: 486: return -1; - -: 487: } - -: 488: - 5: 489: return std::strtol(buff, &first_no_digit, 10); - -: 490:} - -: 491: - 1: 492:void ATHandler::set_delimiter(char delimiter) - -: 493:{ - 1: 494: _delimiter = delimiter; - 1: 495:} - -: 496: - 118: 497:void ATHandler::set_tag(tag_t* tag_dst, const char *tag_seq) - -: 498:{ - 118: 499: if (tag_seq) { - 118: 500: size_t tag_len = strlen(tag_seq); - 118: 501: set_string(tag_dst->tag, tag_seq, tag_len); - 118: 502: tag_dst->len = tag_len; - 118: 503: tag_dst->found = false; - -: 504: } else { - #####: 505: _stop_tag = NULL; - -: 506: } - 118: 507:} - -: 508: - 2: 509:void ATHandler::set_stop_tag(const char *stop_tag_seq) - -: 510:{ - 2: 511: if (_last_err || !_stop_tag) { - 1: 512: return; - -: 513: } - -: 514: - 1: 515: set_tag(_stop_tag, stop_tag_seq); - -: 516:} - -: 517: - 50: 518:void ATHandler::set_scope(ScopeType scope_type, const char* stop_tag) - -: 519:{ - -: 520: log_debug("%s: %d", __func__, scope_type); - 50: 521: if (_current_scope != scope_type) { - 34: 522: _current_scope = scope_type; - 34: 523: switch (_current_scope) { - -: 524: case RespType: - 16: 525: _stop_tag = &_resp_stop; - 16: 526: _stop_tag->found = false; - 16: 527: break; - -: 528: case InfoType: - 15: 529: _stop_tag = &_info_stop; - 15: 530: _stop_tag->found = false; - 15: 531: consume_char(' '); - 15: 532: break; - -: 533: case ElemType: - 2: 534: _stop_tag = &_elem_stop; - 2: 535: _stop_tag->found = false; - 2: 536: break; - -: 537: case NotSet: - 1: 538: _stop_tag = NULL; - 1: 539: return; - -: 540: default: - #####: 541: break; - -: 542: } - -: 543: } - -: 544: - -: 545: //CURRENTLY DEAD CODE - 49: 546: if (stop_tag) { - #####: 547: set_stop_tag(stop_tag); - -: 548: } - -: 549:} - -: 550: - -: 551:// should match from recv_pos? - 150: 552:bool ATHandler::match(const char* str, size_t size) - -: 553:{ - -: 554: log_debug("%s: %s", __func__, str); - 150: 555: rewind_buffer(); - -: 556: - 150: 557: if ((_recv_len - _recv_pos) < size) { - 58: 558: return false; - -: 559: } - -: 560: - 92: 561: if (str && memcmp(_recv_buff + _recv_pos, str, size) == 0) { - -: 562: // consume matching part - 15: 563: _recv_pos += size; - 15: 564: return true; - -: 565: } - 77: 566: return false; - -: 567:} - -: 568: - 20: 569:bool ATHandler::match_urc() - -: 570:{ - -: 571: log_debug("%s", __func__); - 20: 572: rewind_buffer(); - 20: 573: size_t prefix_len = 0; - 23: 574: for (struct oob_t *oob = _oobs; oob; oob = oob->next) { - 6: 575: prefix_len = strlen(oob->prefix); - 6: 576: if (_recv_len >= prefix_len) { - 4: 577: if (match(oob->prefix, prefix_len)) { - -: 578: log_debug("URC!"); - 3: 579: set_scope(InfoType); - 3: 580: if(oob->cb){ - 2: 581: oob->cb(); - -: 582: } - 3: 583: information_response_stop(); - 3: 584: return true; - -: 585: } - -: 586: } - -: 587: } - 17: 588: return false; - -: 589:} - -: 590: - 28: 591:bool ATHandler::match_error() - -: 592:{ - -: 593: log_debug("%s", __func__); - -: 594: - 28: 595: if (match(CME_ERROR, CME_ERROR_LENGTH)) { - 3: 596: at_error(true, DeviceErrorTypeErrorCME); - 3: 597: return true; - 25: 598: } else if (match(CMS_ERROR, CMS_ERROR_LENGTH)) { - 1: 599: at_error(true, DeviceErrorTypeErrorCMS); - 1: 600: return true; - 24: 601: } else if (match(ERROR_, ERROR_LENGTH)) { - 1: 602: at_error(false, DeviceErrorTypeNoError); - 1: 603: return true; - -: 604: } - -: 605: - 23: 606: return false; - -: 607:} - -: 608: - 79: 609:void ATHandler::clear_error() - -: 610:{ - 79: 611: _last_err = NSAPI_ERROR_OK; - 79: 612: _last_at_err.errCode = 0; - 79: 613: _last_at_err.errType = DeviceErrorTypeNoError; - 79: 614: _last_3gpp_error = 0; - 79: 615:} - -: 616: - 73: 617:nsapi_error_t ATHandler::get_last_error() const - -: 618:{ - 73: 619: return _last_err; - -: 620:} - -: 621: - 1: 622:device_err_t ATHandler::get_last_device_error() const - -: 623:{ - 1: 624: return _last_at_err; - -: 625:} - -: 626: - 53: 627:void ATHandler::set_error(nsapi_error_t err) - -: 628:{ - 53: 629: if (_last_err == NSAPI_ERROR_OK) { - 29: 630: _last_err = err; - -: 631: } - -: 632: - 53: 633: if (_last_err != err) { - -: 634: log_warn("AT error code changed from %d to %d!", _last_err, err); - -: 635: } - 53: 636:} - -: 637: - 1: 638:uint8_t ATHandler::get_3gpp_error() - -: 639:{ - 1: 640: return _last_3gpp_error; - -: 641:} - -: 642: - 4: 643:void ATHandler::set_3gpp_error(uint8_t err, DeviceErrorType error_type) - -: 644:{ - 4: 645: if (_last_3gpp_error) { // don't overwrite likely root cause error - #####: 646: return; - -: 647: } - -: 648: - 4: 649: if (error_type == DeviceErrorTypeErrorCMS && err < 128) { - -: 650: // CMS errors 0-127 maps straight to 3GPP errors - 1: 651: _last_3gpp_error = err; - -: 652: } else { - 12: 653: for (size_t i=0; ifound = true; - 1: 705: return; - -: 706: } - -: 707: - 28: 708: if(match_error()) { - 5: 709: _error_found = true; - 5: 710: return; - -: 711: } - -: 712: - 23: 713: if (prefix && match(prefix, strlen(prefix))) { - 6: 714: _prefix_matched = true; - 6: 715: return; - -: 716: } - -: 717: - 17: 718: if (check_urc && match_urc()) { - 1: 719: _urc_matched = true; - -: 720: } - -: 721: - -: 722: // If no match found, look for CRLF and consume everything up to and including CRLF - 17: 723: if (mem_str(_recv_buff, sizeof(_recv_buff), CRLF, CRLF_LENGTH)) { - -: 724: // If no prefix, return on CRLF - means data to read - 7: 725: if (!prefix) { - 6: 726: return; - -: 727: } - 1: 728: consume_to_tag(CRLF, true); - -: 729: } else { - -: 730: // If no prefix, no CRLF and no more chance to match for OK, ERROR or URC(since max resp length is already in buffer) - -: 731: // return so data could be read - 10: 732: if (!prefix && ((_recv_len-_recv_pos) >= _max_resp_length)) { - 5: 733: return; - -: 734: } - 5: 735: fill_buffer(); - -: 736: } - -: 737: } - -: 738: - 6: 739: return; - -: 740: // something went wrong so application need to recover and retry - -: 741:} - -: 742: - 28: 743:void ATHandler::resp_start(const char *prefix, bool stop) - -: 744:{ - -: 745: log_debug("%s: %s", __func__, prefix); - -: 746: - 28: 747: if (_last_err) { - 2: 748: return; - -: 749: } - -: 750: - -: 751: // Try get as much data as possible - 26: 752: rewind_buffer(); - 26: 753: fill_buffer(); - -: 754: - 26: 755: if (prefix) { - 7: 756: if ((strlen(prefix) < sizeof(_info_resp_prefix))) { - 6: 757: strcpy(_info_resp_prefix, prefix); - -: 758: } else { - 1: 759: MBED_ASSERT(0); - -: 760: } - -: 761: } - -: 762: - 26: 763: set_scope(RespType); - -: 764: - 26: 765: resp(prefix, true); - -: 766: - 26: 767: if (!stop && prefix && _prefix_matched) { - 4: 768: set_scope(InfoType); - -: 769: } - -: 770:} - -: 771: - -: 772:// check urc because of error as urc - 5: 773:bool ATHandler::info_resp() - -: 774:{ - -: 775: log_debug("%s", __func__); - 5: 776: if (_last_err || _resp_stop.found) { - 1: 777: return false; - -: 778: } - -: 779: - 4: 780: if (_prefix_matched) { - 1: 781: _prefix_matched = false; - 1: 782: return true; - -: 783: } - -: 784: - -: 785: // If coming here after another info response was started(looping), stop the previous one. - -: 786: // Trying to handle stopping in this level instead of doing it in upper level. - 3: 787: if (get_scope() == InfoType) { - 1: 788: information_response_stop(); - -: 789: } - -: 790: - 3: 791: resp(_info_resp_prefix, false); - -: 792: - 3: 793: if (_prefix_matched) { - 2: 794: set_scope(InfoType); - 2: 795: _prefix_matched = false; - 2: 796: return true; - -: 797: } - -: 798: - -: 799: // On mismatch go to response scope - 1: 800: set_scope(RespType); - 1: 801: return false; - -: 802:} - -: 803: - 5: 804:bool ATHandler::info_elem(char start_tag) - -: 805:{ - -: 806: log_debug("%s: %c", __func__, start_tag); - 5: 807: if (_last_err) { - 1: 808: return false; - -: 809: } - -: 810: - -: 811: // If coming here after another info response element was started(looping), stop the previous one. - -: 812: // Trying to handle stopping in this level instead of doing it in upper level. - 4: 813: if (get_scope() == ElemType) { - 1: 814: information_response_element_stop(); - -: 815: } - -: 816: - 4: 817: consume_char(_delimiter); - -: 818: - 4: 819: if (consume_char(start_tag)) { - 3: 820: _prefix_matched = true; - 3: 821: set_scope(ElemType); - 3: 822: return true; - -: 823: } - -: 824: - -: 825: // On mismatch go to information response scope - 1: 826: set_scope(InfoType); - 1: 827: return false; - -: 828:} - -: 829: - 33: 830:bool ATHandler::consume_char(char ch) - -: 831:{ - -: 832: log_debug("%s: %c", __func__, ch); - 33: 833: int16_t read_char = get_char(); - -: 834: // If we read something else than ch, recover it - 33: 835: if (read_char != ch && read_char != -1) { - 18: 836: _recv_pos--; - 18: 837: return false; - -: 838: } - 15: 839: return true; - -: 840:} - -: 841: - 12: 842:bool ATHandler::consume_to_tag(const char *tag, bool consume_tag) - -: 843:{ - -: 844: log_debug("%s: %s", __func__, tag); - 12: 845: size_t match_pos = 0; - -: 846: - 79: 847: while (true) { - 91: 848: int16_t c = get_char(); - 91: 849: if (c == -1) { - 8: 850: break; - 83: 851: } else if (c == tag[match_pos]) { - 10: 852: match_pos++; - 10: 853: if (match_pos == strlen(tag)) { - 4: 854: if (!consume_tag) { - #####: 855: _recv_pos -= strlen(tag); - -: 856: } - 4: 857: return true; - -: 858: } - 73: 859: } else if (match_pos) { - #####: 860: match_pos = 0; - -: 861: } - -: 862: } - 8: 863: log_error("consume_to_tag not found"); - 8: 864: return false; - -: 865:} - -: 866: - 13: 867:bool ATHandler::consume_to_stop_tag() - -: 868:{ - -: 869: log_debug("%s", __func__); - -: 870: - 13: 871: if (!_stop_tag || (_stop_tag && _stop_tag->found) || _error_found) { - 3: 872: return true; - -: 873: } - -: 874: - 10: 875: if (consume_to_tag((const char*)_stop_tag->tag, true)) { - 2: 876: return true; - -: 877: } - -: 878: - 8: 879: log_error("consume_to_stop_tag not found"); - 8: 880: set_error(NSAPI_ERROR_DEVICE_ERROR); - 8: 881: return false; - -: 882:} - -: 883: - -: 884:// consume by size needed? - -: 885: - 3: 886:void ATHandler::resp_stop() - -: 887:{ - -: 888: // Do not return on error so that we can consume whatever there is in the buffer - -: 889: /*if (_last_err) { - -: 890: return; - -: 891: }*/ - -: 892: - -: 893: log_debug("%s", __func__); - -: 894: - 3: 895: if (_current_scope == ElemType) { - 1: 896: information_response_element_stop(); - 1: 897: set_scope(InfoType); - -: 898: } - -: 899: - 3: 900: if (_current_scope == InfoType) { - 3: 901: information_response_stop(); - -: 902: } - -: 903: - -: 904: // Go for response stop_tag - 3: 905: if (consume_to_stop_tag()) { - 1: 906: set_scope(NotSet); - -: 907: } - -: 908: - -: 909: // Restore stop tag to OK - 3: 910: set_tag(&_resp_stop, OK); - -: 911: // Reset info resp prefix - 3: 912: memset(_info_resp_prefix, 0, sizeof(_info_resp_prefix)); - 3: 913:} - -: 914: - 7: 915:void ATHandler::information_response_stop() - -: 916:{ - -: 917: log_debug("%s", __func__); - 7: 918: if (consume_to_stop_tag()) { - 2: 919: set_scope(RespType); - -: 920: } - 7: 921:} - -: 922: - 2: 923:void ATHandler::information_response_element_stop() - -: 924:{ - -: 925: log_debug("%s", __func__); - 2: 926: if (consume_to_stop_tag()) { - 1: 927: set_scope(InfoType); - -: 928: } - 2: 929:} - -: 930: - 7: 931:ATHandler::ScopeType ATHandler::get_scope() - -: 932:{ - 7: 933: return _current_scope; - -: 934:} - -: 935: - 118: 936:void ATHandler::set_string(char *dest, const char *src, size_t src_len) - -: 937:{ - 118: 938: memcpy(dest, src, src_len); - 118: 939: dest[src_len] = '\0'; - 118: 940:} - -: 941: - 20: 942:const char* ATHandler::mem_str(const char* dest, size_t dest_len, const char* src, size_t src_len) - -: 943:{ - 227: 944: for(size_t i = 0; i < dest_len-src_len; ++i) { - 215: 945: if(memcmp(dest+i, src, src_len) == 0) { - 8: 946: return dest+i; - -: 947: } - -: 948: } - 12: 949: return NULL; - -: 950:} - -: 951: - 4: 952:void ATHandler::cmd_start(const char* cmd) - -: 953:{ - -: 954: log_debug("AT> %s", cmd); - -: 955: - 4: 956: if (_last_err != NSAPI_ERROR_OK) { - 1: 957: return; - -: 958: } - -: 959: - -: 960: // write command - 5: 961: for (size_t i = 0; i < strlen(cmd); i++) { - 3: 962: if (write_char(cmd[i]) == false) { - -: 963: // writing failed ---> write_char have set the last error, return... - 1: 964: return; - -: 965: } - -: 966: } - -: 967: - 2: 968: _cmd_start = true; - -: 969:} - -: 970: - 4: 971:void ATHandler::write_int(int32_t param) - -: 972:{ - -: 973: // do common checks before sending subparameter - 4: 974: if (check_cmd_send() == false) { - 3: 975: return; - -: 976: } - -: 977: - -: 978: // write the integer subparameter - 1: 979: const uint8_t str_len = 12; - -: 980: char number_string[str_len]; - 1: 981: int32_t result = std::snprintf(number_string, str_len, "%ld", param); - 1: 982: if (result > 0 && result < str_len) { - 1: 983: for (size_t i = 0; number_string[i]; i++) { - 1: 984: if (write_char(number_string[i]) == false) { - -: 985: // writing failed ---> write_char have set the last error, break out - 1: 986: break; - -: 987: } - 1: 988: } - -: 989: } else { - -: 990: //This is DEAD CODE: longest value is "-2147483648" which is 11 characters long and passing int64 is not possible! - -: 991: // must have been 64-bit integer, not supported - #####: 992: set_error(NSAPI_ERROR_PARAMETER); - -: 993: } - -: 994:} - -: 995: - 5: 996:void ATHandler::write_string(const char* param, bool useQuotations) - -: 997:{ - -: 998: // do common checks before sending subparameter - 5: 999: if (check_cmd_send() == false) { - 2: 1000: return; - -: 1001: } - -: 1002: - -: 1003: // we are writing string, surround it with quotes - 3: 1004: if (useQuotations && write_char('\"') == false) { - 1: 1005: return; - -: 1006: } - -: 1007: - 7: 1008: for (size_t i = 0; i < strlen(param); i++) { - 6: 1009: if (write_char(param[i]) == false) { - -: 1010: // writing failed ---> write_char have set the last error, return - 1: 1011: break; - -: 1012: } - -: 1013: } - -: 1014: - 2: 1015: if (useQuotations) { - -: 1016: // we are writing string, surround it with quotes - 2: 1017: write_char('\"'); - -: 1018: } - -: 1019:} - -: 1020: - 2: 1021:void ATHandler::cmd_stop() - -: 1022:{ - 2: 1023: if (_last_err != NSAPI_ERROR_OK) { - 1: 1024: return; - -: 1025: } - -: 1026: // Finish with CR - 1: 1027: for (size_t i = 0; i < _output_delimiter_length; i++) { - 1: 1028: if (write_char(_output_delimiter[i]) == false) { - 1: 1029: break; - -: 1030: } - -: 1031: } - -: 1032:} - -: 1033: - 2: 1034:size_t ATHandler::write_bytes(uint8_t *data, size_t len) - -: 1035:{ - 2: 1036: if (_last_err != NSAPI_ERROR_OK) { - 1: 1037: return 0; - -: 1038: } - -: 1039: - 1: 1040: size_t i = 0; - 1: 1041: for (; i < len; i++) { - 1: 1042: if (write_char(data[i]) == false) { - -: 1043: // writing failed ---> write_char have set the last error, return - 1: 1044: break; - -: 1045: } - -: 1046: } - -: 1047: - 1: 1048: return i; - -: 1049:} - -: 1050: - 22: 1051:bool ATHandler::write_char(char c) - -: 1052:{ - -: 1053: pollfh fhs; - 22: 1054: fhs.fh = _fileHandle; - 22: 1055: fhs.events = POLLOUT; - 22: 1056: bool retVal = true; - -: 1057: - 22: 1058: int count = poll(&fhs, 1, _at_timeout); - 22: 1059: if (count > 0 && (fhs.revents & POLLOUT)) { - 18: 1060: retVal = _fileHandle->write(&c, 1) == 1 ? true : false; - -: 1061: } else { - 4: 1062: retVal = false; - -: 1063: } - -: 1064: - 22: 1065: if (retVal == false) { - 9: 1066: set_error(NSAPI_ERROR_DEVICE_ERROR); - -: 1067: } - -: 1068: - 22: 1069: return retVal; - -: 1070:} - -: 1071: - -: 1072:// do common checks before sending subparameters - 9: 1073:bool ATHandler::check_cmd_send() - -: 1074:{ - 9: 1075: if (_last_err != NSAPI_ERROR_OK) { - 3: 1076: return false; - -: 1077: } - -: 1078: - -: 1079: // Don't write delimiter if this is the first subparameter - 6: 1080: if (_cmd_start) { - 1: 1081: _cmd_start = false; - -: 1082: } else { - 5: 1083: if (write_char(_delimiter) == false) { - -: 1084: // writing of delimiter failed, return. write_char already have set the _last_err - 2: 1085: return false; - -: 1086: } - -: 1087: } - -: 1088: - 4: 1089: return true; - -: 1090:} - -: 1091: - 33: 1092:void ATHandler::flush() - -: 1093:{ - 34: 1094: while (_fileHandle->readable()) { - 1: 1095: reset_buffer(); - 1: 1096: fill_buffer(); - -: 1097: } - 32: 1098: reset_buffer(); - 32: 1099:} diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/ATHandler.h.gcov b/features/cellular/UNITTESTS/at/athandler/gcov/ATHandler.h.gcov deleted file mode 100644 index 1f13fd23e1..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/ATHandler.h.gcov +++ /dev/null @@ -1,476 +0,0 @@ - -: 0:Source:../../../framework/AT/ATHandler.h - -: 0:Graph:objs/ATHandler_unit/ATHandler.gcno - -: 0:Data:objs/ATHandler_unit/ATHandler.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef AT_HANDLER_H_ - -: 19:#define AT_HANDLER_H_ - -: 20: - -: 21:#include "platform/mbed_retarget.h" - -: 22:#include "stdio.h" - -: 23: - -: 24:#include "EventQueue.h" - -: 25:#include "PlatformMutex.h" - -: 26:#include "nsapi_types.h" - -: 27: - -: 28:#include "PlatformMutex.h" - -: 29:#include "Callback.h" - -: 30:#include "EventQueue.h" - -: 31: - -: 32:namespace mbed { - -: 33: - -: 34:class FileHandle; - -: 35: - -: 36:/** - -: 37: * If application calls associated FileHandle only from single thread context - -: 38: * then locking between AT command and response is not needed. However, - -: 39: * note that many cellular functions are called indirectly e.g. via socket API. - -: 40: * If you are unsure then AT_HANDLER_MUTEX must be defined. - -: 41: */ - -: 42:#define AT_HANDLER_MUTEX - -: 43: - -: 44:extern const char *OK; - -: 45:extern const char *CRLF; - -: 46: - -: 47:#define BUFF_SIZE 16 - -: 48: - -: 49:/* AT Error types enumeration */ - -: 50:enum DeviceErrorType { - -: 51: DeviceErrorTypeNoError = 0, - -: 52: DeviceErrorTypeError, // AT ERROR - -: 53: DeviceErrorTypeErrorCMS, // AT ERROR CMS - -: 54: DeviceErrorTypeErrorCME // AT ERROR CME - -: 55:}; - -: 56: - -: 57:/* struct used when getting at response error. Defines error code and type */ - -: 58:struct device_err_t { - -: 59: DeviceErrorType errType; - -: 60: int errCode; - -: 61:}; - -: 62: - -: 63:/** Class ATHandler - -: 64: * - -: 65: * Class for sending AT commands and parsing AT responses. - -: 66: */ - -: 67:class ATHandler - -: 68:{ - -: 69: - -: 70:public: - -: 71: /** Constructor - -: 72: * - -: 73: * @param fh file handle used for reading AT responses and writing AT commands - -: 74: * @param queue Event queue used to transfer sigio events to this thread - -: 75: * @param timeout Timeout when reading for AT response - -: 76: * @param output_delimiter Default delimiter used when parsing at responses - -: 77: */ - -: 78: ATHandler(FileHandle *fh, events::EventQueue &queue, int timeout, const char *output_delimiter = "\r"); - -: 79: ~ATHandler(); - -: 80: - -: 81: /** Return used file handle. - -: 82: * - -: 83: * @return used file handle - -: 84: */ - -: 85: FileHandle *get_file_handle(); - -: 86: - -: 87: /** Set file handle which is used for reading AT responses and writing AT commands - -: 88: * - -: 89: * @param fh file handle used for reading AT responses and writing AT commands - -: 90: */ - -: 91: void set_file_handle(FileHandle *fh); - -: 92: - -: 93: /** Locks the mutex for file handle if AT_HANDLER_MUTEX is defined. - -: 94: */ - -: 95: void lock(); - -: 96: - -: 97: /** Unlocks the mutex for file handle if AT_HANDLER_MUTEX is defined. - -: 98: */ - -: 99: void unlock(); - -: 100: - -: 101: /** Locks the mutex for file handle if AT_HANDLER_MUTEX is defined and returns the last error. - -: 102: * - -: 103: * @return last error which happened when parsing AT responses - -: 104: */ - -: 105: nsapi_error_t unlock_return_error(); - -: 106: - -: 107: /** Set the urc callback for urc. If urc is found when parsing AT responses then call if called. - -: 108: * - -: 109: * @param prefix Register urc prefix for callback. Urc could be for example "+CMTI: " - -: 110: * @param callback Callback which is called if urc is found in AT response - -: 111: */ - -: 112: void set_urc_handler(const char *prefix, mbed::Callback callback); - -: 113: - -: 114: ATHandler *_nextATHandler; // linked list - -: 115: - -: 116: /** returns the last error while parsing AT responses. - -: 117: * - -: 118: * @return last error - -: 119: */ - -: 120: nsapi_error_t get_last_error() const; - -: 121: - -: 122: /** returns the last device error while parsing AT responses. Actually AT error (CME/CMS). - -: 123: * - -: 124: * @return last error struct device_err_t - -: 125: */ - -: 126: device_err_t get_last_device_error() const; - -: 127: - -: 128: /** Increase reference count. Used for counting references to this instance. - -: 129: */ - -: 130: void inc_ref_count(); - -: 131: - -: 132: /** Decrease reference count. Used for counting references to this instance. - -: 133: */ - -: 134: void dec_ref_count(); - -: 135: - -: 136: /** Get the current reference count. Used for counting references to this instance. - -: 137: * - -: 138: * @return current reference count - -: 139: */ - -: 140: int get_ref_count(); - -: 141: - -: 142: /** Set timeout in milliseconds for AT commands - -: 143: * - -: 144: * @param timeout_milliseconds Timeout in milliseconds - -: 145: * @param default_timeout Store as default timeout - -: 146: */ - -: 147: void set_at_timeout(uint32_t timeout_milliseconds, bool default_timeout = false); - -: 148: - -: 149: /** Restore timeout to previous timeout. Handy if there is a need to change timeout temporarily. - -: 150: */ - -: 151: void restore_at_timeout(); - -: 152: - -: 153: /** Clear pending error flag. By default error is cleared only in lock(). - -: 154: */ - -: 155: void clear_error(); - -: 156: - -: 157: /** Tries to find oob's from the AT response. Call the urc callback if one is found. - -: 158: */ - -: 159: void process_oob(); - -: 160: - -: 161: /** Set sigio for the current file handle. Sigio event goes through eventqueue so that it's handled in current thread. - -: 162: */ - -: 163: void set_filehandle_sigio(); - -: 164: - -: 165: /** - -: 166: * Flushes the underlying stream - -: 167: */ - -: 168: void flush(); - -: 169: - -: 170:protected: - -: 171: void event(); - -: 172:#ifdef AT_HANDLER_MUTEX - -: 173: PlatformMutex _fileHandleMutex; - -: 174:#endif - -: 175: FileHandle *_fileHandle; - -: 176:private: - -: 177: - -: 178: void set_error(nsapi_error_t err); - -: 179: void set_oobs_matching_param(bool); - -: 180: - -: 181: events::EventQueue &_queue; - -: 182: nsapi_error_t _last_err; - -: 183: nsapi_error_t _last_3gpp_error; - -: 184: device_err_t _last_at_err; - -: 185: uint16_t _oob_string_max_length; - -: 186: char *_output_delimiter; - -: 187: uint8_t _output_delimiter_length; - -: 188: - 6: 189: struct oob_t { - -: 190: bool matching_to_received; - -: 191: const char *prefix; - -: 192: mbed::Callback cb; - -: 193: oob_t *next; - -: 194: }; - -: 195: oob_t *_oobs; - -: 196: bool _response_terminated; - -: 197: uint32_t _at_timeout; - -: 198: uint32_t _previous_at_timeout; - -: 199: - -: 200: bool _fh_sigio_set; - -: 201: - -: 202: bool _processing; - -: 203: int32_t _ref_count; - -: 204: - -: 205: //************************************* - -: 206:public: - -: 207: - -: 208: /** Starts the command writing by clearing the last error and writing the given command. - -: 209: * In case of failure when writing the last error is set to NSAPI_ERROR_DEVICE_ERROR. - -: 210: * - -: 211: * @param cmd AT command to be written to modem - -: 212: */ - -: 213: void cmd_start(const char* cmd); - -: 214: - -: 215: /** Writes integer type AT command subparameter. Starts with the delimiter if not the first param after cmd_start. - -: 216: * In case of failure when writing the last error is set to NSAPI_ERROR_DEVICE_ERROR. - -: 217: * - -: 218: * @param param int to be written to modem as AT command subparameter - -: 219: */ - -: 220: void write_int(int32_t param); - -: 221: - -: 222: /** Writes string type AT command subparamater. Quotes are added to surround the given string. - -: 223: * Starts with the delimiter if not the first param after cmd_start. - -: 224: * In case of failure when writing the last error is set to NSAPI_ERROR_DEVICE_ERROR. - -: 225: * - -: 226: * @param param string to be written to modem as AT command subparameter - -: 227: * @param useQuotations flag indicating if the string should be or not included in quotation marks - -: 228: */ - -: 229: void write_string(const char* param, bool useQuotations = true); - -: 230: - -: 231: /** Stops the AT command by writing command line terminator CR to mark command as finished. - -: 232: */ - -: 233: void cmd_stop(); - -: 234: - -: 235: /** Write bytes without any subparameter delimiters, such as comma. - -: 236: * In case of failure when writing the last error is set to NSAPI_ERROR_DEVICE_ERROR. - -: 237: * - -: 238: * @param data bytes to be written to modem - -: 239: * @param len length of data string - -: 240: * - -: 241: * @return number of characters successfully written - -: 242: */ - -: 243: size_t write_bytes(uint8_t *data, size_t len); - -: 244: - -: 245: /** Sets the stop tag for the current scope(response/information response/element) - -: 246: * Parameter's reading routines will stop the reading when such tag is found and will set the found flag. - -: 247: * Consume routines will read everything until such tag is found. - -: 248: * - -: 249: * @param stop_tag_seq string to be set as stop tag - -: 250: */ - -: 251: void set_stop_tag(const char *stop_tag_seq); - -: 252: - -: 253: /** Sets the delimiter between parameters or between elements of the information response. - -: 254: * Parameter's reading routines will stop when such char is read. - -: 255: * - -: 256: * @param delimiter char to be set as _delimiter - -: 257: */ - -: 258: void set_delimiter(char delimiter); - -: 259: - -: 260: /** Consumes the reading buffer up to the delimiter or stop_tag - -: 261: * - -: 262: * @param count number of parameters to be skipped - -: 263: */ - -: 264: void skip_param(uint32_t count = 1); - -: 265: - -: 266: /** Consumes the given length from the reading buffer - -: 267: * - -: 268: * @param len length to be consumed from reading buffer - -: 269: * @param count number of parameters to be skipped - -: 270: */ - -: 271: void skip_param(ssize_t len, uint32_t count); - -: 272: - -: 273: /** Reads given number of bytes from receiving buffer without checking any subparameter delimiters, such as comma. - -: 274: * - -: 275: * @param buf output buffer for the read - -: 276: * @param len maximum number of bytes to read - -: 277: * @return number of successfully read bytes or -1 in case of error - -: 278: */ - -: 279: ssize_t read_bytes(uint8_t *buf, size_t len); - -: 280: - -: 281: /** Reads chars from reading buffer. Terminates with null. Skips the quotation marks. - -: 282: * Stops on delimiter or stop tag. - -: 283: * - -: 284: * @param str output buffer for the read - -: 285: * @param size maximum number of chars to output - -: 286: * @param read_even_stop_tag if true then try to read even the stop tag was found previously - -: 287: * @return length of output string or -1 in case of read timeout before delimiter or stop tag is found - -: 288: */ - -: 289: ssize_t read_string(char *str, size_t size, bool read_even_stop_tag = false); - -: 290: - -: 291: /** Reads as string and converts result to integer. Supports only positive integers. - -: 292: * - -: 293: * @return the positive integer or -1 in case of error. - -: 294: */ - -: 295: int32_t read_int(); - -: 296: - -: 297: /** This looks for necessary matches: prefix, OK, ERROR, URCs and sets the correct scope. - -: 298: * - -: 299: * @param prefix string to be matched from receiving buffer. If not NULL and match succeeds, then scope - -: 300: * will be set as information response(info_type) - -: 301: * @param stop flag to indicate if we go to information response scope or not. - -: 302: * (needed when nothing is expected to be received anymore after the prefix match: - -: 303: * sms case: "> ", bc95 reboot case) - -: 304: */ - -: 305: void resp_start(const char *prefix = NULL, bool stop = false); - -: 306: - -: 307: /** Ends all scopes starting from current scope. - -: 308: * Consumes everything until the scope's stop tag is found, then - -: 309: * goes to next scope, until response scope is ending. - -: 310: * Possible sequence: - -: 311: * element scope -> information response scope -> response scope - -: 312: */ - -: 313: void resp_stop(); - -: 314: - -: 315: /** Looks for matching the prefix given to resp_start() call. - -: 316: * If needed it ends the scope of a previous information response. - -: 317: * Sets the information response scope if new prefix is found and response scope if prefix is not found. - -: 318: * - -: 319: * @return true if new information response is found, false otherwise - -: 320: */ - -: 321: bool info_resp(); - -: 322: - -: 323: /** Looks for matching the start tag. - -: 324: * If needed it ends the scope of a previous element. - -: 325: * Sets the element scope if start tag is found and information response scope if start tag is not found. - -: 326: * - -: 327: * @param start_tag tag to be matched to begin parsing an element of an information response - -: 328: * @return true if new element is found, false otherwise - -: 329: */ - -: 330: bool info_elem(char start_tag); - -: 331: - -: 332: /** Consumes the received content until current stop tag is found. - -: 333: * - -: 334: * @return true if stop tag is found, false otherwise - -: 335: */ - -: 336: bool consume_to_stop_tag(); - -: 337: - -: 338: /** Sets _debug_on flag. - -: 339: * - -: 340: * @param enable value to be set for _debug_on flag - -: 341: */ - -: 342: void enable_debug(bool enable); - -: 343: - -: 344: /** Return the last 3GPP error code. - -: 345: * @return last 3GPP error code - -: 346: */ - -: 347: uint8_t get_3gpp_error(); - -: 348: - -: 349:private: - -: 350: - -: 351: // should fit any prefix and int - -: 352: char _recv_buff[BUFF_SIZE]; - -: 353: // reading position - -: 354: size_t _recv_len; - -: 355: // reading length - -: 356: size_t _recv_pos; - -: 357: - -: 358: // resp_type: the part of the response that doesn't include the information response(+CMD1,+CMD2..) - -: 359: // ends with OK or (CME)(CMS)ERROR - -: 360: // info_type: the information response part of the response: starts with +CMD1 and ends with CRLF - -: 361: // information response contains parameters or subsets of parameters(elements), both separated by comma - -: 362: // elem_type: subsets of parameters that are part of information response, its parameters are separated by comma - -: 363: enum ScopeType {RespType, InfoType, ElemType, NotSet}; - -: 364: void set_scope(ScopeType scope_type, const char* stop_tag = NULL); - -: 365: ScopeType _current_scope; - -: 366: - -: 367: struct tag_t { - -: 368: char tag[7]; - -: 369: size_t len; - -: 370: bool found; - -: 371: }; - -: 372: - -: 373: // tag to stop response scope - -: 374: tag_t _resp_stop; - -: 375: // tag to stop information response scope - -: 376: tag_t _info_stop; - -: 377: // tag to stop element scope - -: 378: tag_t _elem_stop; - -: 379: // reference to the stop tag of current scope(resp/info/elem) - -: 380: tag_t *_stop_tag; - -: 381: - -: 382: // delimiter between parameters and also used for delimiting elements of information response - -: 383: char _delimiter; - -: 384: // set true on prefix match -> indicates start of an information response or of an element - -: 385: bool _prefix_matched; - -: 386: // set true on urc match - -: 387: bool _urc_matched; - -: 388: // set true on (CME)(CMS)ERROR - -: 389: bool _error_found; - -: 390: // Max length of OK,(CME)(CMS)ERROR and URCs - -: 391: size_t _max_resp_length; - -: 392: - -: 393: // prefix set during resp_start and used to try matching possible information responses - -: 394: char _info_resp_prefix[BUFF_SIZE]; - -: 395: bool _debug_on; - -: 396: bool _cmd_start; - -: 397: - -: 398: // Gets char from receiving buffer. - -: 399: // Resets and fills the buffer if all are already read (receiving position equals receiving length). - -: 400: int16_t get_char(); - -: 401: // Sets to 0 the reading position, reading length and the whole buffer content. - -: 402: void reset_buffer(); - -: 403: // Reading position set to 0 and buffer's unread content moved to beginning - -: 404: void rewind_buffer(); - -: 405: // Reads from serial to receiving buffer. - -: 406: // Returns on first successful read OR on timeout. - -: 407: void fill_buffer(); - -: 408: - -: 409: void set_tag(tag_t* tag_dest, const char *tag_seq); - -: 410: - -: 411: // Rewinds the receiving buffer and compares it against given str. - -: 412: bool match(const char* str, size_t size); - -: 413: // Iterates URCs and check if they match the receiving buffer content. - -: 414: // If URC match sets the scope to information response and after urc's cb returns - -: 415: // finishes the information response scope(consumes to CRLF). - -: 416: bool match_urc(); - -: 417: // Checks if any of the error strings are matching the receiving buffer content. - -: 418: bool match_error(); - -: 419: // Checks is current char in buffer matches ch and consumes it, - -: 420: // if no match lets the buffer unchanged. - -: 421: bool consume_char(char ch); - -: 422: // Consumes the received content until tag is found. - -: 423: // Consumes the tag only if consume_tag flag is true. - -: 424: bool consume_to_tag(const char *tag, bool consume_tag); - -: 425: // Checks if receiving buffer contains OK, ERROR, URC or given prefix. - -: 426: void resp(const char *prefix, bool check_urc); - -: 427: - -: 428: - -: 429: ScopeType get_scope(); - -: 430: - -: 431: // Consumes to information response stop tag which is CRLF. Sets scope to response. - -: 432: void information_response_stop(); - -: 433: // Consumes to element stop tag. Sets scope to information response - -: 434: void information_response_element_stop(); - -: 435: - -: 436: // Reads the error code if expected and sets it as last error. - -: 437: void at_error(bool error_code, DeviceErrorType error_type); - -: 438: - -: 439: /** Convert AT error code to 3GPP error codes - -: 440: * @param err AT error code read from CME/CMS ERROR responses - -: 441: * @param error_type error type (CMS/CME/ERROR) - -: 442: */ - -: 443: void set_3gpp_error(uint8_t err, DeviceErrorType error_type); - -: 444: - -: 445: bool check_cmd_send(); - -: 446: bool write_char(char c); - -: 447: - -: 448: /** Copy content of one char buffer to another buffer and sets NULL terminator - -: 449: * - -: 450: * @param dest destination char buffer - -: 451: * @param src source char buffer - -: 452: * @param src_len number of bytes to copy - -: 453: * - -: 454: */ - -: 455: void set_string(char *dest, const char *src, size_t src_len); - -: 456: - -: 457: /** Finds occurence of one char buffer inside another char buffer. - -: 458: * - -: 459: * @param dest destination char buffer - -: 460: * @param dest_len length of dest - -: 461: * @param src string to be searched for - -: 462: * @param src_len length of string to be searched for - -: 463: * - -: 464: * @return pointer to first occurrence of src in dest - -: 465: */ - -: 466: const char* mem_str(const char* dest, size_t dest_len, const char* src, size_t src_len); - -: 467:}; - -: 468: - -: 469:} // namespace mbed - -: 470: - -: 471:#endif //AT_HANDLER_H_ diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/Callback.h.gcov b/features/cellular/UNITTESTS/at/athandler/gcov/Callback.h.gcov deleted file mode 100644 index 9e74d82f2a..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/Callback.h.gcov +++ /dev/null @@ -1,4557 +0,0 @@ - -: 0:Source:../../../../../platform/Callback.h - -: 0:Graph:objs/ATHandler_unit/ATHandler.gcno - -: 0:Data:objs/ATHandler_unit/ATHandler.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* mbed Microcontroller Library - -: 2: * Copyright (c) 2006-2015 ARM Limited - -: 3: * - -: 4: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 5: * you may not use this file except in compliance with the License. - -: 6: * You may obtain a copy of the License at - -: 7: * - -: 8: * http://www.apache.org/licenses/LICENSE-2.0 - -: 9: * - -: 10: * Unless required by applicable law or agreed to in writing, software - -: 11: * distributed under the License is distributed on an "AS IS" BASIS, - -: 12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 13: * See the License for the specific language governing permissions and - -: 14: * limitations under the License. - -: 15: */ - -: 16:#ifndef MBED_CALLBACK_H - -: 17:#define MBED_CALLBACK_H - -: 18: - -: 19:#include - -: 20:#include - -: 21:#include - -: 22:#include "platform/mbed_assert.h" - -: 23:#include "platform/mbed_toolchain.h" - -: 24: - -: 25:namespace mbed { - -: 26:/** \addtogroup platform */ - -: 27:/** @{*/ - -: 28:/** - -: 29: * \defgroup platform_Callback Callback class - -: 30: * @{ - -: 31: */ - -: 32: - -: 33:/** Callback class based on template specialization - -: 34: * - -: 35: * @note Synchronization level: Not protected - -: 36: */ - -: 37:template - -: 38:class Callback; - -: 39: - -: 40:// Internal sfinae declarations - -: 41:// - -: 42:// These are used to eliminate overloads based on type attributes - -: 43:// 1. Does a function object have a call operator - -: 44:// 2. Does a function object fit in the available storage - -: 45:// - -: 46:// These eliminations are handled cleanly by the compiler and avoid - -: 47:// massive and misleading error messages when confronted with an - -: 48:// invalid type (or worse, runtime failures) - -: 49:namespace detail { - -: 50: struct nil {}; - -: 51: - -: 52: template - -: 53: struct enable_if { typedef R type; }; - -: 54: - -: 55: template - -: 56: struct enable_if {}; - -: 57: - -: 58: template - -: 59: struct is_type { - -: 60: static const bool value = true; - -: 61: }; - -: 62:} - -: 63: - -: 64:#define MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M) \ - -: 65: typename detail::enable_if< \ - -: 66: detail::is_type::value && \ - -: 67: sizeof(F) <= sizeof(uintptr_t) \ - -: 68: >::type = detail::nil() - -: 69: - -: 70:/** Callback class based on template specialization - -: 71: * - -: 72: * @note Synchronization level: Not protected - -: 73: */ - -: 74:template - -: 75:class Callback { - -: 76:public: - -: 77: /** Create a Callback with a static function - -: 78: * @param func Static function to attach - -: 79: */ - #####: 80: Callback(R (*func)() = 0) { - #####: 81: if (!func) { - #####: 82: memset(this, 0, sizeof(Callback)); - -: 83: } else { - #####: 84: generate(func); - -: 85: } - #####: 86: } - -: 87: - -: 88: /** Attach a Callback - -: 89: * @param func The Callback to attach - -: 90: */ - 3: 91: Callback(const Callback &func) { - 3: 92: if (func._ops) { - 2: 93: func._ops->move(this, &func); - -: 94: } - 3: 95: _ops = func._ops; - 3: 96: } - -: 97: - -: 98: /** Create a Callback with a member function - -: 99: * @param obj Pointer to object to invoke member function on - -: 100: * @param method Member function to attach - -: 101: */ - -: 102: template - 77: 103: Callback(U *obj, R (T::*method)()) { - 77: 104: generate(method_context(obj, method)); - 77: 105: } - -: 106: - -: 107: /** Create a Callback with a member function - -: 108: * @param obj Pointer to object to invoke member function on - -: 109: * @param method Member function to attach - -: 110: */ - -: 111: template - -: 112: Callback(const U *obj, R (T::*method)() const) { - -: 113: generate(method_context(obj, method)); - -: 114: } - -: 115: - -: 116: /** Create a Callback with a member function - -: 117: * @param obj Pointer to object to invoke member function on - -: 118: * @param method Member function to attach - -: 119: */ - -: 120: template - -: 121: Callback(volatile U *obj, R (T::*method)() volatile) { - -: 122: generate(method_context(obj, method)); - -: 123: } - -: 124: - -: 125: /** Create a Callback with a member function - -: 126: * @param obj Pointer to object to invoke member function on - -: 127: * @param method Member function to attach - -: 128: */ - -: 129: template - -: 130: Callback(const volatile U *obj, R (T::*method)() const volatile) { - -: 131: generate(method_context(obj, method)); - -: 132: } - -: 133: - -: 134: /** Create a Callback with a static function and bound pointer - -: 135: * @param func Static function to attach - -: 136: * @param arg Pointer argument to function - -: 137: */ - -: 138: template - -: 139: Callback(R (*func)(T*), U *arg) { - -: 140: generate(function_context(func, arg)); - -: 141: } - -: 142: - -: 143: /** Create a Callback with a static function and bound pointer - -: 144: * @param func Static function to attach - -: 145: * @param arg Pointer argument to function - -: 146: */ - -: 147: template - -: 148: Callback(R (*func)(const T*), const U *arg) { - -: 149: generate(function_context(func, arg)); - -: 150: } - -: 151: - -: 152: /** Create a Callback with a static function and bound pointer - -: 153: * @param func Static function to attach - -: 154: * @param arg Pointer argument to function - -: 155: */ - -: 156: template - -: 157: Callback(R (*func)(volatile T*), volatile U *arg) { - -: 158: generate(function_context(func, arg)); - -: 159: } - -: 160: - -: 161: /** Create a Callback with a static function and bound pointer - -: 162: * @param func Static function to attach - -: 163: * @param arg Pointer argument to function - -: 164: */ - -: 165: template - -: 166: Callback(R (*func)(const volatile T*), const volatile U *arg) { - -: 167: generate(function_context(func, arg)); - -: 168: } - -: 169: - -: 170: /** Create a Callback with a function object - -: 171: * @param f Function object to attach - -: 172: * @note The function object is limited to a single word of storage - -: 173: */ - -: 174: template - -: 175: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { - -: 176: generate(f); - -: 177: } - -: 178: - -: 179: /** Create a Callback with a function object - -: 180: * @param f Function object to attach - -: 181: * @note The function object is limited to a single word of storage - -: 182: */ - -: 183: template - -: 184: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { - -: 185: generate(f); - -: 186: } - -: 187: - -: 188: /** Create a Callback with a function object - -: 189: * @param f Function object to attach - -: 190: * @note The function object is limited to a single word of storage - -: 191: */ - -: 192: template - -: 193: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { - -: 194: generate(f); - -: 195: } - -: 196: - -: 197: /** Create a Callback with a function object - -: 198: * @param f Function object to attach - -: 199: * @note The function object is limited to a single word of storage - -: 200: */ - -: 201: template - -: 202: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { - -: 203: generate(f); - -: 204: } - -: 205: - -: 206: /** Create a Callback with a static function and bound pointer - -: 207: * @param obj Pointer to object to bind to function - -: 208: * @param func Static function to attach - -: 209: * @deprecated - -: 210: * Arguments to callback have been reordered to Callback(func, arg) - -: 211: */ - -: 212: template - -: 213: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 214: "Arguments to callback have been reordered to Callback(func, arg)") - -: 215: Callback(U *obj, R (*func)(T*)) { - -: 216: new (this) Callback(func, obj); - -: 217: } - -: 218: - -: 219: /** Create a Callback with a static function and bound pointer - -: 220: * @param obj Pointer to object to bind to function - -: 221: * @param func Static function to attach - -: 222: * @deprecated - -: 223: * Arguments to callback have been reordered to Callback(func, arg) - -: 224: */ - -: 225: template - -: 226: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 227: "Arguments to callback have been reordered to Callback(func, arg)") - -: 228: Callback(const U *obj, R (*func)(const T*)) { - -: 229: new (this) Callback(func, obj); - -: 230: } - -: 231: - -: 232: /** Create a Callback with a static function and bound pointer - -: 233: * @param obj Pointer to object to bind to function - -: 234: * @param func Static function to attach - -: 235: * @deprecated - -: 236: * Arguments to callback have been reordered to Callback(func, arg) - -: 237: */ - -: 238: template - -: 239: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 240: "Arguments to callback have been reordered to Callback(func, arg)") - -: 241: Callback(volatile U *obj, R (*func)(volatile T*)) { - -: 242: new (this) Callback(func, obj); - -: 243: } - -: 244: - -: 245: /** Create a Callback with a static function and bound pointer - -: 246: * @param obj Pointer to object to bind to function - -: 247: * @param func Static function to attach - -: 248: * @deprecated - -: 249: * Arguments to callback have been reordered to Callback(func, arg) - -: 250: */ - -: 251: template - -: 252: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 253: "Arguments to callback have been reordered to Callback(func, arg)") - -: 254: Callback(const volatile U *obj, R (*func)(const volatile T*)) { - -: 255: new (this) Callback(func, obj); - -: 256: } - -: 257: - -: 258: /** Destroy a callback - -: 259: */ - #####: 260: ~Callback() { - #####: 261: if (_ops) { - #####: 262: _ops->dtor(this); - -: 263: } - #####: 264: } - -: 265: - -: 266: /** Attach a static function - -: 267: * @param func Static function to attach - -: 268: * @deprecated - -: 269: * Replaced by simple assignment 'Callback cb = func' - -: 270: */ - -: 271: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 272: "Replaced by simple assignment 'Callback cb = func") - -: 273: void attach(R (*func)()) { - -: 274: this->~Callback(); - -: 275: new (this) Callback(func); - -: 276: } - -: 277: - -: 278: /** Attach a Callback - -: 279: * @param func The Callback to attach - -: 280: * @deprecated - -: 281: * Replaced by simple assignment 'Callback cb = func' - -: 282: */ - -: 283: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 284: "Replaced by simple assignment 'Callback cb = func") - -: 285: void attach(const Callback &func) { - -: 286: this->~Callback(); - -: 287: new (this) Callback(func); - -: 288: } - -: 289: - -: 290: /** Attach a member function - -: 291: * @param obj Pointer to object to invoke member function on - -: 292: * @param method Member function to attach - -: 293: * @deprecated - -: 294: * Replaced by simple assignment 'Callback cb = func' - -: 295: */ - -: 296: template - -: 297: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 298: "Replaced by simple assignment 'Callback cb = func") - -: 299: void attach(U *obj, R (T::*method)()) { - -: 300: this->~Callback(); - -: 301: new (this) Callback(obj, method); - -: 302: } - -: 303: - -: 304: /** Attach a member function - -: 305: * @param obj Pointer to object to invoke member function on - -: 306: * @param method Member function to attach - -: 307: * @deprecated - -: 308: * Replaced by simple assignment 'Callback cb = func' - -: 309: */ - -: 310: template - -: 311: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 312: "Replaced by simple assignment 'Callback cb = func") - -: 313: void attach(const U *obj, R (T::*method)() const) { - -: 314: this->~Callback(); - -: 315: new (this) Callback(obj, method); - -: 316: } - -: 317: - -: 318: /** Attach a member function - -: 319: * @param obj Pointer to object to invoke member function on - -: 320: * @param method Member function to attach - -: 321: * @deprecated - -: 322: * Replaced by simple assignment 'Callback cb = func' - -: 323: */ - -: 324: template - -: 325: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 326: "Replaced by simple assignment 'Callback cb = func") - -: 327: void attach(volatile U *obj, R (T::*method)() volatile) { - -: 328: this->~Callback(); - -: 329: new (this) Callback(obj, method); - -: 330: } - -: 331: - -: 332: /** Attach a member function - -: 333: * @param obj Pointer to object to invoke member function on - -: 334: * @param method Member function to attach - -: 335: * @deprecated - -: 336: * Replaced by simple assignment 'Callback cb = func' - -: 337: */ - -: 338: template - -: 339: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 340: "Replaced by simple assignment 'Callback cb = func") - -: 341: void attach(const volatile U *obj, R (T::*method)() const volatile) { - -: 342: this->~Callback(); - -: 343: new (this) Callback(obj, method); - -: 344: } - -: 345: - -: 346: /** Attach a static function with a bound pointer - -: 347: * @param func Static function to attach - -: 348: * @param arg Pointer argument to function - -: 349: * @deprecated - -: 350: * Replaced by simple assignment 'Callback cb = func' - -: 351: */ - -: 352: template - -: 353: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 354: "Replaced by simple assignment 'Callback cb = func") - -: 355: void attach(R (*func)(T*), U *arg) { - -: 356: this->~Callback(); - -: 357: new (this) Callback(func, arg); - -: 358: } - -: 359: - -: 360: /** Attach a static function with a bound pointer - -: 361: * @param func Static function to attach - -: 362: * @param arg Pointer argument to function - -: 363: * @deprecated - -: 364: * Replaced by simple assignment 'Callback cb = func' - -: 365: */ - -: 366: template - -: 367: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 368: "Replaced by simple assignment 'Callback cb = func") - -: 369: void attach(R (*func)(const T*), const U *arg) { - -: 370: this->~Callback(); - -: 371: new (this) Callback(func, arg); - -: 372: } - -: 373: - -: 374: /** Attach a static function with a bound pointer - -: 375: * @param func Static function to attach - -: 376: * @param arg Pointer argument to function - -: 377: * @deprecated - -: 378: * Replaced by simple assignment 'Callback cb = func' - -: 379: */ - -: 380: template - -: 381: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 382: "Replaced by simple assignment 'Callback cb = func") - -: 383: void attach(R (*func)(volatile T*), volatile U *arg) { - -: 384: this->~Callback(); - -: 385: new (this) Callback(func, arg); - -: 386: } - -: 387: - -: 388: /** Attach a static function with a bound pointer - -: 389: * @param func Static function to attach - -: 390: * @param arg Pointer argument to function - -: 391: * @deprecated - -: 392: * Replaced by simple assignment 'Callback cb = func' - -: 393: */ - -: 394: template - -: 395: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 396: "Replaced by simple assignment 'Callback cb = func") - -: 397: void attach(R (*func)(const volatile T*), const volatile U *arg) { - -: 398: this->~Callback(); - -: 399: new (this) Callback(func, arg); - -: 400: } - -: 401: - -: 402: /** Attach a function object - -: 403: * @param f Function object to attach - -: 404: * @note The function object is limited to a single word of storage - -: 405: * @deprecated - -: 406: * Replaced by simple assignment 'Callback cb = func' - -: 407: */ - -: 408: template - -: 409: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 410: "Replaced by simple assignment 'Callback cb = func") - -: 411: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { - -: 412: this->~Callback(); - -: 413: new (this) Callback(f); - -: 414: } - -: 415: - -: 416: /** Attach a function object - -: 417: * @param f Function object to attach - -: 418: * @note The function object is limited to a single word of storage - -: 419: * @deprecated - -: 420: * Replaced by simple assignment 'Callback cb = func' - -: 421: */ - -: 422: template - -: 423: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 424: "Replaced by simple assignment 'Callback cb = func") - -: 425: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { - -: 426: this->~Callback(); - -: 427: new (this) Callback(f); - -: 428: } - -: 429: - -: 430: /** Attach a function object - -: 431: * @param f Function object to attach - -: 432: * @note The function object is limited to a single word of storage - -: 433: * @deprecated - -: 434: * Replaced by simple assignment 'Callback cb = func' - -: 435: */ - -: 436: template - -: 437: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 438: "Replaced by simple assignment 'Callback cb = func") - -: 439: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { - -: 440: this->~Callback(); - -: 441: new (this) Callback(f); - -: 442: } - -: 443: - -: 444: /** Attach a function object - -: 445: * @param f Function object to attach - -: 446: * @note The function object is limited to a single word of storage - -: 447: * @deprecated - -: 448: * Replaced by simple assignment 'Callback cb = func' - -: 449: */ - -: 450: template - -: 451: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 452: "Replaced by simple assignment 'Callback cb = func") - -: 453: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { - -: 454: this->~Callback(); - -: 455: new (this) Callback(f); - -: 456: } - -: 457: - -: 458: /** Attach a static function with a bound pointer - -: 459: * @param obj Pointer to object to bind to function - -: 460: * @param func Static function to attach - -: 461: * @deprecated - -: 462: * Arguments to callback have been reordered to attach(func, arg) - -: 463: */ - -: 464: template - -: 465: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 466: "Arguments to callback have been reordered to attach(func, arg)") - -: 467: void attach(U *obj, R (*func)(T*)) { - -: 468: this->~Callback(); - -: 469: new (this) Callback(func, obj); - -: 470: } - -: 471: - -: 472: /** Attach a static function with a bound pointer - -: 473: * @param obj Pointer to object to bind to function - -: 474: * @param func Static function to attach - -: 475: * @deprecated - -: 476: * Arguments to callback have been reordered to attach(func, arg) - -: 477: */ - -: 478: template - -: 479: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 480: "Arguments to callback have been reordered to attach(func, arg)") - -: 481: void attach(const U *obj, R (*func)(const T*)) { - -: 482: this->~Callback(); - -: 483: new (this) Callback(func, obj); - -: 484: } - -: 485: - -: 486: /** Attach a static function with a bound pointer - -: 487: * @param obj Pointer to object to bind to function - -: 488: * @param func Static function to attach - -: 489: * @deprecated - -: 490: * Arguments to callback have been reordered to attach(func, arg) - -: 491: */ - -: 492: template - -: 493: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 494: "Arguments to callback have been reordered to attach(func, arg)") - -: 495: void attach(volatile U *obj, R (*func)(volatile T*)) { - -: 496: this->~Callback(); - -: 497: new (this) Callback(func, obj); - -: 498: } - -: 499: - -: 500: /** Attach a static function with a bound pointer - -: 501: * @param obj Pointer to object to bind to function - -: 502: * @param func Static function to attach - -: 503: * @deprecated - -: 504: * Arguments to callback have been reordered to attach(func, arg) - -: 505: */ - -: 506: template - -: 507: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 508: "Arguments to callback have been reordered to attach(func, arg)") - -: 509: void attach(const volatile U *obj, R (*func)(const volatile T*)) { - -: 510: this->~Callback(); - -: 511: new (this) Callback(func, obj); - -: 512: } - -: 513: - -: 514: /** Assign a callback - -: 515: */ - 3: 516: Callback &operator=(const Callback &that) { - 3: 517: if (this != &that) { - 3: 518: this->~Callback(); - 3: 519: new (this) Callback(that); - -: 520: } - -: 521: - 3: 522: return *this; - -: 523: } - -: 524: - -: 525: /** Call the attached function - -: 526: */ - #####: 527: R call() const { - #####: 528: MBED_ASSERT(_ops); - #####: 529: return _ops->call(this); - -: 530: } - -: 531: - -: 532: /** Call the attached function - -: 533: */ - #####: 534: R operator()() const { - #####: 535: return call(); - -: 536: } - -: 537: - -: 538: /** Test if function has been attached - -: 539: */ - 3: 540: operator bool() const { - 3: 541: return _ops; - -: 542: } - -: 543: - -: 544: /** Test for equality - -: 545: */ - -: 546: friend bool operator==(const Callback &l, const Callback &r) { - -: 547: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 548: } - -: 549: - -: 550: /** Test for inequality - -: 551: */ - -: 552: friend bool operator!=(const Callback &l, const Callback &r) { - -: 553: return !(l == r); - -: 554: } - -: 555: - -: 556: /** Static thunk for passing as C-style function - -: 557: * @param func Callback to call passed as void pointer - -: 558: * @return the value as determined by func which is of - -: 559: * type and determined by the signiture of func - -: 560: */ - -: 561: static R thunk(void *func) { - -: 562: return static_cast(func)->call(); - -: 563: } - -: 564: - -: 565:private: - -: 566: // Stored as pointer to function and pointer to optional object - -: 567: // Function pointer is stored as union of possible function types - -: 568: // to garuntee proper size and alignment - -: 569: struct _class; - -: 570: union { - -: 571: void (*_staticfunc)(); - -: 572: void (*_boundfunc)(_class*); - -: 573: void (_class::*_methodfunc)(); - -: 574: } _func; - -: 575: void *_obj; - -: 576: - -: 577: // Dynamically dispatched operations - -: 578: const struct ops { - -: 579: R (*call)(const void*); - -: 580: void (*move)(void*, const void*); - -: 581: void (*dtor)(void*); - -: 582: } *_ops; - -: 583: - -: 584: // Generate operations for function object - -: 585: template - 77: 586: void generate(const F &f) { - -: 587: static const ops ops = { - -: 588: &Callback::function_call, - -: 589: &Callback::function_move, - -: 590: &Callback::function_dtor, - -: 591: }; - -: 592: - -: 593: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 594: "Type F must not exceed the size of the Callback class"); - 77: 595: memset(this, 0, sizeof(Callback)); - 77: 596: new (this) F(f); - 77: 597: _ops = &ops; - 77: 598: } - -: 599: - -: 600: // Function attributes - -: 601: template - 38: 602: static R function_call(const void *p) { - 38: 603: return (*(F*)p)(); - -: 604: } - -: 605: - -: 606: template - #####: 607: static void function_move(void *d, const void *p) { - #####: 608: new (d) F(*(F*)p); - #####: 609: } - -: 610: - -: 611: template - 77: 612: static void function_dtor(void *p) { - -: 613: ((F*)p)->~F(); - 77: 614: } - -: 615: - -: 616: // Wrappers for functions with context - -: 617: template - -: 618: struct method_context { - -: 619: M method; - -: 620: O *obj; - -: 621: - 77: 622: method_context(O *obj, M method) - 77: 623: : method(method), obj(obj) {} - -: 624: - 38: 625: R operator()() const { - 38: 626: return (obj->*method)(); - -: 627: } - -: 628: }; - -: 629: - -: 630: template - -: 631: struct function_context { - -: 632: F func; - -: 633: A *arg; - -: 634: - -: 635: function_context(F func, A *arg) - -: 636: : func(func), arg(arg) {} - -: 637: - -: 638: R operator()() const { - -: 639: return func(arg); - -: 640: } - -: 641: }; - -: 642:}; - -: 643: - -: 644:/** Callback class based on template specialization - -: 645: * - -: 646: * @note Synchronization level: Not protected - -: 647: */ - -: 648:template - -: 649:class Callback { - -: 650:public: - -: 651: /** Create a Callback with a static function - -: 652: * @param func Static function to attach - -: 653: */ - -: 654: Callback(R (*func)(A0) = 0) { - -: 655: if (!func) { - -: 656: memset(this, 0, sizeof(Callback)); - -: 657: } else { - -: 658: generate(func); - -: 659: } - -: 660: } - -: 661: - -: 662: /** Attach a Callback - -: 663: * @param func The Callback to attach - -: 664: */ - -: 665: Callback(const Callback &func) { - -: 666: if (func._ops) { - -: 667: func._ops->move(this, &func); - -: 668: } - -: 669: _ops = func._ops; - -: 670: } - -: 671: - -: 672: /** Create a Callback with a member function - -: 673: * @param obj Pointer to object to invoke member function on - -: 674: * @param method Member function to attach - -: 675: */ - -: 676: template - -: 677: Callback(U *obj, R (T::*method)(A0)) { - -: 678: generate(method_context(obj, method)); - -: 679: } - -: 680: - -: 681: /** Create a Callback with a member function - -: 682: * @param obj Pointer to object to invoke member function on - -: 683: * @param method Member function to attach - -: 684: */ - -: 685: template - -: 686: Callback(const U *obj, R (T::*method)(A0) const) { - -: 687: generate(method_context(obj, method)); - -: 688: } - -: 689: - -: 690: /** Create a Callback with a member function - -: 691: * @param obj Pointer to object to invoke member function on - -: 692: * @param method Member function to attach - -: 693: */ - -: 694: template - -: 695: Callback(volatile U *obj, R (T::*method)(A0) volatile) { - -: 696: generate(method_context(obj, method)); - -: 697: } - -: 698: - -: 699: /** Create a Callback with a member function - -: 700: * @param obj Pointer to object to invoke member function on - -: 701: * @param method Member function to attach - -: 702: */ - -: 703: template - -: 704: Callback(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 705: generate(method_context(obj, method)); - -: 706: } - -: 707: - -: 708: /** Create a Callback with a static function and bound pointer - -: 709: * @param func Static function to attach - -: 710: * @param arg Pointer argument to function - -: 711: */ - -: 712: template - -: 713: Callback(R (*func)(T*, A0), U *arg) { - -: 714: generate(function_context(func, arg)); - -: 715: } - -: 716: - -: 717: /** Create a Callback with a static function and bound pointer - -: 718: * @param func Static function to attach - -: 719: * @param arg Pointer argument to function - -: 720: */ - -: 721: template - -: 722: Callback(R (*func)(const T*, A0), const U *arg) { - -: 723: generate(function_context(func, arg)); - -: 724: } - -: 725: - -: 726: /** Create a Callback with a static function and bound pointer - -: 727: * @param func Static function to attach - -: 728: * @param arg Pointer argument to function - -: 729: */ - -: 730: template - -: 731: Callback(R (*func)(volatile T*, A0), volatile U *arg) { - -: 732: generate(function_context(func, arg)); - -: 733: } - -: 734: - -: 735: /** Create a Callback with a static function and bound pointer - -: 736: * @param func Static function to attach - -: 737: * @param arg Pointer argument to function - -: 738: */ - -: 739: template - -: 740: Callback(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 741: generate(function_context(func, arg)); - -: 742: } - -: 743: - -: 744: /** Create a Callback with a function object - -: 745: * @param f Function object to attach - -: 746: * @note The function object is limited to a single word of storage - -: 747: */ - -: 748: template - -: 749: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { - -: 750: generate(f); - -: 751: } - -: 752: - -: 753: /** Create a Callback with a function object - -: 754: * @param f Function object to attach - -: 755: * @note The function object is limited to a single word of storage - -: 756: */ - -: 757: template - -: 758: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { - -: 759: generate(f); - -: 760: } - -: 761: - -: 762: /** Create a Callback with a function object - -: 763: * @param f Function object to attach - -: 764: * @note The function object is limited to a single word of storage - -: 765: */ - -: 766: template - -: 767: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { - -: 768: generate(f); - -: 769: } - -: 770: - -: 771: /** Create a Callback with a function object - -: 772: * @param f Function object to attach - -: 773: * @note The function object is limited to a single word of storage - -: 774: */ - -: 775: template - -: 776: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { - -: 777: generate(f); - -: 778: } - -: 779: - -: 780: /** Create a Callback with a static function and bound pointer - -: 781: * @param obj Pointer to object to bind to function - -: 782: * @param func Static function to attach - -: 783: * @deprecated - -: 784: * Arguments to callback have been reordered to Callback(func, arg) - -: 785: */ - -: 786: template - -: 787: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 788: "Arguments to callback have been reordered to Callback(func, arg)") - -: 789: Callback(U *obj, R (*func)(T*, A0)) { - -: 790: new (this) Callback(func, obj); - -: 791: } - -: 792: - -: 793: /** Create a Callback with a static function and bound pointer - -: 794: * @param obj Pointer to object to bind to function - -: 795: * @param func Static function to attach - -: 796: * @deprecated - -: 797: * Arguments to callback have been reordered to Callback(func, arg) - -: 798: */ - -: 799: template - -: 800: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 801: "Arguments to callback have been reordered to Callback(func, arg)") - -: 802: Callback(const U *obj, R (*func)(const T*, A0)) { - -: 803: new (this) Callback(func, obj); - -: 804: } - -: 805: - -: 806: /** Create a Callback with a static function and bound pointer - -: 807: * @param obj Pointer to object to bind to function - -: 808: * @param func Static function to attach - -: 809: * @deprecated - -: 810: * Arguments to callback have been reordered to Callback(func, arg) - -: 811: */ - -: 812: template - -: 813: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 814: "Arguments to callback have been reordered to Callback(func, arg)") - -: 815: Callback(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 816: new (this) Callback(func, obj); - -: 817: } - -: 818: - -: 819: /** Create a Callback with a static function and bound pointer - -: 820: * @param obj Pointer to object to bind to function - -: 821: * @param func Static function to attach - -: 822: * @deprecated - -: 823: * Arguments to callback have been reordered to Callback(func, arg) - -: 824: */ - -: 825: template - -: 826: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 827: "Arguments to callback have been reordered to Callback(func, arg)") - -: 828: Callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 829: new (this) Callback(func, obj); - -: 830: } - -: 831: - -: 832: /** Destroy a callback - -: 833: */ - -: 834: ~Callback() { - -: 835: if (_ops) { - -: 836: _ops->dtor(this); - -: 837: } - -: 838: } - -: 839: - -: 840: /** Attach a static function - -: 841: * @param func Static function to attach - -: 842: * @deprecated - -: 843: * Replaced by simple assignment 'Callback cb = func' - -: 844: */ - -: 845: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 846: "Replaced by simple assignment 'Callback cb = func") - -: 847: void attach(R (*func)(A0)) { - -: 848: this->~Callback(); - -: 849: new (this) Callback(func); - -: 850: } - -: 851: - -: 852: /** Attach a Callback - -: 853: * @param func The Callback to attach - -: 854: * @deprecated - -: 855: * Replaced by simple assignment 'Callback cb = func' - -: 856: */ - -: 857: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 858: "Replaced by simple assignment 'Callback cb = func") - -: 859: void attach(const Callback &func) { - -: 860: this->~Callback(); - -: 861: new (this) Callback(func); - -: 862: } - -: 863: - -: 864: /** Attach a member function - -: 865: * @param obj Pointer to object to invoke member function on - -: 866: * @param method Member function to attach - -: 867: * @deprecated - -: 868: * Replaced by simple assignment 'Callback cb = func' - -: 869: */ - -: 870: template - -: 871: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 872: "Replaced by simple assignment 'Callback cb = func") - -: 873: void attach(U *obj, R (T::*method)(A0)) { - -: 874: this->~Callback(); - -: 875: new (this) Callback(obj, method); - -: 876: } - -: 877: - -: 878: /** Attach a member function - -: 879: * @param obj Pointer to object to invoke member function on - -: 880: * @param method Member function to attach - -: 881: * @deprecated - -: 882: * Replaced by simple assignment 'Callback cb = func' - -: 883: */ - -: 884: template - -: 885: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 886: "Replaced by simple assignment 'Callback cb = func") - -: 887: void attach(const U *obj, R (T::*method)(A0) const) { - -: 888: this->~Callback(); - -: 889: new (this) Callback(obj, method); - -: 890: } - -: 891: - -: 892: /** Attach a member function - -: 893: * @param obj Pointer to object to invoke member function on - -: 894: * @param method Member function to attach - -: 895: * @deprecated - -: 896: * Replaced by simple assignment 'Callback cb = func' - -: 897: */ - -: 898: template - -: 899: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 900: "Replaced by simple assignment 'Callback cb = func") - -: 901: void attach(volatile U *obj, R (T::*method)(A0) volatile) { - -: 902: this->~Callback(); - -: 903: new (this) Callback(obj, method); - -: 904: } - -: 905: - -: 906: /** Attach a member function - -: 907: * @param obj Pointer to object to invoke member function on - -: 908: * @param method Member function to attach - -: 909: * @deprecated - -: 910: * Replaced by simple assignment 'Callback cb = func' - -: 911: */ - -: 912: template - -: 913: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 914: "Replaced by simple assignment 'Callback cb = func") - -: 915: void attach(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 916: this->~Callback(); - -: 917: new (this) Callback(obj, method); - -: 918: } - -: 919: - -: 920: /** Attach a static function with a bound pointer - -: 921: * @param func Static function to attach - -: 922: * @param arg Pointer argument to function - -: 923: * @deprecated - -: 924: * Replaced by simple assignment 'Callback cb = func' - -: 925: */ - -: 926: template - -: 927: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 928: "Replaced by simple assignment 'Callback cb = func") - -: 929: void attach(R (*func)(T*, A0), U *arg) { - -: 930: this->~Callback(); - -: 931: new (this) Callback(func, arg); - -: 932: } - -: 933: - -: 934: /** Attach a static function with a bound pointer - -: 935: * @param func Static function to attach - -: 936: * @param arg Pointer argument to function - -: 937: * @deprecated - -: 938: * Replaced by simple assignment 'Callback cb = func' - -: 939: */ - -: 940: template - -: 941: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 942: "Replaced by simple assignment 'Callback cb = func") - -: 943: void attach(R (*func)(const T*, A0), const U *arg) { - -: 944: this->~Callback(); - -: 945: new (this) Callback(func, arg); - -: 946: } - -: 947: - -: 948: /** Attach a static function with a bound pointer - -: 949: * @param func Static function to attach - -: 950: * @param arg Pointer argument to function - -: 951: * @deprecated - -: 952: * Replaced by simple assignment 'Callback cb = func' - -: 953: */ - -: 954: template - -: 955: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 956: "Replaced by simple assignment 'Callback cb = func") - -: 957: void attach(R (*func)(volatile T*, A0), volatile U *arg) { - -: 958: this->~Callback(); - -: 959: new (this) Callback(func, arg); - -: 960: } - -: 961: - -: 962: /** Attach a static function with a bound pointer - -: 963: * @param func Static function to attach - -: 964: * @param arg Pointer argument to function - -: 965: * @deprecated - -: 966: * Replaced by simple assignment 'Callback cb = func' - -: 967: */ - -: 968: template - -: 969: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 970: "Replaced by simple assignment 'Callback cb = func") - -: 971: void attach(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 972: this->~Callback(); - -: 973: new (this) Callback(func, arg); - -: 974: } - -: 975: - -: 976: /** Attach a function object - -: 977: * @param f Function object to attach - -: 978: * @note The function object is limited to a single word of storage - -: 979: * @deprecated - -: 980: * Replaced by simple assignment 'Callback cb = func' - -: 981: */ - -: 982: template - -: 983: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 984: "Replaced by simple assignment 'Callback cb = func") - -: 985: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { - -: 986: this->~Callback(); - -: 987: new (this) Callback(f); - -: 988: } - -: 989: - -: 990: /** Attach a function object - -: 991: * @param f Function object to attach - -: 992: * @note The function object is limited to a single word of storage - -: 993: * @deprecated - -: 994: * Replaced by simple assignment 'Callback cb = func' - -: 995: */ - -: 996: template - -: 997: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 998: "Replaced by simple assignment 'Callback cb = func") - -: 999: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { - -: 1000: this->~Callback(); - -: 1001: new (this) Callback(f); - -: 1002: } - -: 1003: - -: 1004: /** Attach a function object - -: 1005: * @param f Function object to attach - -: 1006: * @note The function object is limited to a single word of storage - -: 1007: * @deprecated - -: 1008: * Replaced by simple assignment 'Callback cb = func' - -: 1009: */ - -: 1010: template - -: 1011: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1012: "Replaced by simple assignment 'Callback cb = func") - -: 1013: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { - -: 1014: this->~Callback(); - -: 1015: new (this) Callback(f); - -: 1016: } - -: 1017: - -: 1018: /** Attach a function object - -: 1019: * @param f Function object to attach - -: 1020: * @note The function object is limited to a single word of storage - -: 1021: * @deprecated - -: 1022: * Replaced by simple assignment 'Callback cb = func' - -: 1023: */ - -: 1024: template - -: 1025: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1026: "Replaced by simple assignment 'Callback cb = func") - -: 1027: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { - -: 1028: this->~Callback(); - -: 1029: new (this) Callback(f); - -: 1030: } - -: 1031: - -: 1032: /** Attach a static function with a bound pointer - -: 1033: * @param obj Pointer to object to bind to function - -: 1034: * @param func Static function to attach - -: 1035: * @deprecated - -: 1036: * Arguments to callback have been reordered to attach(func, arg) - -: 1037: */ - -: 1038: template - -: 1039: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1040: "Arguments to callback have been reordered to attach(func, arg)") - -: 1041: void attach(U *obj, R (*func)(T*, A0)) { - -: 1042: this->~Callback(); - -: 1043: new (this) Callback(func, obj); - -: 1044: } - -: 1045: - -: 1046: /** Attach a static function with a bound pointer - -: 1047: * @param obj Pointer to object to bind to function - -: 1048: * @param func Static function to attach - -: 1049: * @deprecated - -: 1050: * Arguments to callback have been reordered to attach(func, arg) - -: 1051: */ - -: 1052: template - -: 1053: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1054: "Arguments to callback have been reordered to attach(func, arg)") - -: 1055: void attach(const U *obj, R (*func)(const T*, A0)) { - -: 1056: this->~Callback(); - -: 1057: new (this) Callback(func, obj); - -: 1058: } - -: 1059: - -: 1060: /** Attach a static function with a bound pointer - -: 1061: * @param obj Pointer to object to bind to function - -: 1062: * @param func Static function to attach - -: 1063: * @deprecated - -: 1064: * Arguments to callback have been reordered to attach(func, arg) - -: 1065: */ - -: 1066: template - -: 1067: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1068: "Arguments to callback have been reordered to attach(func, arg)") - -: 1069: void attach(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 1070: this->~Callback(); - -: 1071: new (this) Callback(func, obj); - -: 1072: } - -: 1073: - -: 1074: /** Attach a static function with a bound pointer - -: 1075: * @param obj Pointer to object to bind to function - -: 1076: * @param func Static function to attach - -: 1077: * @deprecated - -: 1078: * Arguments to callback have been reordered to attach(func, arg) - -: 1079: */ - -: 1080: template - -: 1081: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1082: "Arguments to callback have been reordered to attach(func, arg)") - -: 1083: void attach(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 1084: this->~Callback(); - -: 1085: new (this) Callback(func, obj); - -: 1086: } - -: 1087: - -: 1088: /** Assign a callback - -: 1089: */ - -: 1090: Callback &operator=(const Callback &that) { - -: 1091: if (this != &that) { - -: 1092: this->~Callback(); - -: 1093: new (this) Callback(that); - -: 1094: } - -: 1095: - -: 1096: return *this; - -: 1097: } - -: 1098: - -: 1099: /** Call the attached function - -: 1100: */ - -: 1101: R call(A0 a0) const { - -: 1102: MBED_ASSERT(_ops); - -: 1103: return _ops->call(this, a0); - -: 1104: } - -: 1105: - -: 1106: /** Call the attached function - -: 1107: */ - -: 1108: R operator()(A0 a0) const { - -: 1109: return call(a0); - -: 1110: } - -: 1111: - -: 1112: /** Test if function has been attached - -: 1113: */ - -: 1114: operator bool() const { - -: 1115: return _ops; - -: 1116: } - -: 1117: - -: 1118: /** Test for equality - -: 1119: */ - -: 1120: friend bool operator==(const Callback &l, const Callback &r) { - -: 1121: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 1122: } - -: 1123: - -: 1124: /** Test for inequality - -: 1125: */ - -: 1126: friend bool operator!=(const Callback &l, const Callback &r) { - -: 1127: return !(l == r); - -: 1128: } - -: 1129: - -: 1130: /** Static thunk for passing as C-style function - -: 1131: * @param func Callback to call passed as void pointer - -: 1132: * @param a0 An argument to be called with function func - -: 1133: * @return the value as determined by func which is of - -: 1134: * type and determined by the signiture of func - -: 1135: */ - -: 1136: static R thunk(void *func, A0 a0) { - -: 1137: return static_cast(func)->call(a0); - -: 1138: } - -: 1139: - -: 1140:private: - -: 1141: // Stored as pointer to function and pointer to optional object - -: 1142: // Function pointer is stored as union of possible function types - -: 1143: // to garuntee proper size and alignment - -: 1144: struct _class; - -: 1145: union { - -: 1146: void (*_staticfunc)(A0); - -: 1147: void (*_boundfunc)(_class*, A0); - -: 1148: void (_class::*_methodfunc)(A0); - -: 1149: } _func; - -: 1150: void *_obj; - -: 1151: - -: 1152: // Dynamically dispatched operations - -: 1153: const struct ops { - -: 1154: R (*call)(const void*, A0); - -: 1155: void (*move)(void*, const void*); - -: 1156: void (*dtor)(void*); - -: 1157: } *_ops; - -: 1158: - -: 1159: // Generate operations for function object - -: 1160: template - -: 1161: void generate(const F &f) { - -: 1162: static const ops ops = { - -: 1163: &Callback::function_call, - -: 1164: &Callback::function_move, - -: 1165: &Callback::function_dtor, - -: 1166: }; - -: 1167: - -: 1168: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 1169: "Type F must not exceed the size of the Callback class"); - -: 1170: memset(this, 0, sizeof(Callback)); - -: 1171: new (this) F(f); - -: 1172: _ops = &ops; - -: 1173: } - -: 1174: - -: 1175: // Function attributes - -: 1176: template - -: 1177: static R function_call(const void *p, A0 a0) { - -: 1178: return (*(F*)p)(a0); - -: 1179: } - -: 1180: - -: 1181: template - -: 1182: static void function_move(void *d, const void *p) { - -: 1183: new (d) F(*(F*)p); - -: 1184: } - -: 1185: - -: 1186: template - -: 1187: static void function_dtor(void *p) { - -: 1188: ((F*)p)->~F(); - -: 1189: } - -: 1190: - -: 1191: // Wrappers for functions with context - -: 1192: template - -: 1193: struct method_context { - -: 1194: M method; - -: 1195: O *obj; - -: 1196: - -: 1197: method_context(O *obj, M method) - -: 1198: : method(method), obj(obj) {} - -: 1199: - -: 1200: R operator()(A0 a0) const { - -: 1201: return (obj->*method)(a0); - -: 1202: } - -: 1203: }; - -: 1204: - -: 1205: template - -: 1206: struct function_context { - -: 1207: F func; - -: 1208: A *arg; - -: 1209: - -: 1210: function_context(F func, A *arg) - -: 1211: : func(func), arg(arg) {} - -: 1212: - -: 1213: R operator()(A0 a0) const { - -: 1214: return func(arg, a0); - -: 1215: } - -: 1216: }; - -: 1217:}; - -: 1218: - -: 1219:/** Callback class based on template specialization - -: 1220: * - -: 1221: * @note Synchronization level: Not protected - -: 1222: */ - -: 1223:template - -: 1224:class Callback { - -: 1225:public: - -: 1226: /** Create a Callback with a static function - -: 1227: * @param func Static function to attach - -: 1228: */ - -: 1229: Callback(R (*func)(A0, A1) = 0) { - -: 1230: if (!func) { - -: 1231: memset(this, 0, sizeof(Callback)); - -: 1232: } else { - -: 1233: generate(func); - -: 1234: } - -: 1235: } - -: 1236: - -: 1237: /** Attach a Callback - -: 1238: * @param func The Callback to attach - -: 1239: */ - -: 1240: Callback(const Callback &func) { - -: 1241: if (func._ops) { - -: 1242: func._ops->move(this, &func); - -: 1243: } - -: 1244: _ops = func._ops; - -: 1245: } - -: 1246: - -: 1247: /** Create a Callback with a member function - -: 1248: * @param obj Pointer to object to invoke member function on - -: 1249: * @param method Member function to attach - -: 1250: */ - -: 1251: template - -: 1252: Callback(U *obj, R (T::*method)(A0, A1)) { - -: 1253: generate(method_context(obj, method)); - -: 1254: } - -: 1255: - -: 1256: /** Create a Callback with a member function - -: 1257: * @param obj Pointer to object to invoke member function on - -: 1258: * @param method Member function to attach - -: 1259: */ - -: 1260: template - -: 1261: Callback(const U *obj, R (T::*method)(A0, A1) const) { - -: 1262: generate(method_context(obj, method)); - -: 1263: } - -: 1264: - -: 1265: /** Create a Callback with a member function - -: 1266: * @param obj Pointer to object to invoke member function on - -: 1267: * @param method Member function to attach - -: 1268: */ - -: 1269: template - -: 1270: Callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 1271: generate(method_context(obj, method)); - -: 1272: } - -: 1273: - -: 1274: /** Create a Callback with a member function - -: 1275: * @param obj Pointer to object to invoke member function on - -: 1276: * @param method Member function to attach - -: 1277: */ - -: 1278: template - -: 1279: Callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 1280: generate(method_context(obj, method)); - -: 1281: } - -: 1282: - -: 1283: /** Create a Callback with a static function and bound pointer - -: 1284: * @param func Static function to attach - -: 1285: * @param arg Pointer argument to function - -: 1286: */ - -: 1287: template - -: 1288: Callback(R (*func)(T*, A0, A1), U *arg) { - -: 1289: generate(function_context(func, arg)); - -: 1290: } - -: 1291: - -: 1292: /** Create a Callback with a static function and bound pointer - -: 1293: * @param func Static function to attach - -: 1294: * @param arg Pointer argument to function - -: 1295: */ - -: 1296: template - -: 1297: Callback(R (*func)(const T*, A0, A1), const U *arg) { - -: 1298: generate(function_context(func, arg)); - -: 1299: } - -: 1300: - -: 1301: /** Create a Callback with a static function and bound pointer - -: 1302: * @param func Static function to attach - -: 1303: * @param arg Pointer argument to function - -: 1304: */ - -: 1305: template - -: 1306: Callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 1307: generate(function_context(func, arg)); - -: 1308: } - -: 1309: - -: 1310: /** Create a Callback with a static function and bound pointer - -: 1311: * @param func Static function to attach - -: 1312: * @param arg Pointer argument to function - -: 1313: */ - -: 1314: template - -: 1315: Callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 1316: generate(function_context(func, arg)); - -: 1317: } - -: 1318: - -: 1319: /** Create a Callback with a function object - -: 1320: * @param f Function object to attach - -: 1321: * @note The function object is limited to a single word of storage - -: 1322: */ - -: 1323: template - -: 1324: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { - -: 1325: generate(f); - -: 1326: } - -: 1327: - -: 1328: /** Create a Callback with a function object - -: 1329: * @param f Function object to attach - -: 1330: * @note The function object is limited to a single word of storage - -: 1331: */ - -: 1332: template - -: 1333: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { - -: 1334: generate(f); - -: 1335: } - -: 1336: - -: 1337: /** Create a Callback with a function object - -: 1338: * @param f Function object to attach - -: 1339: * @note The function object is limited to a single word of storage - -: 1340: */ - -: 1341: template - -: 1342: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { - -: 1343: generate(f); - -: 1344: } - -: 1345: - -: 1346: /** Create a Callback with a function object - -: 1347: * @param f Function object to attach - -: 1348: * @note The function object is limited to a single word of storage - -: 1349: */ - -: 1350: template - -: 1351: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { - -: 1352: generate(f); - -: 1353: } - -: 1354: - -: 1355: /** Create a Callback with a static function and bound pointer - -: 1356: * @param obj Pointer to object to bind to function - -: 1357: * @param func Static function to attach - -: 1358: * @deprecated - -: 1359: * Arguments to callback have been reordered to Callback(func, arg) - -: 1360: */ - -: 1361: template - -: 1362: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1363: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1364: Callback(U *obj, R (*func)(T*, A0, A1)) { - -: 1365: new (this) Callback(func, obj); - -: 1366: } - -: 1367: - -: 1368: /** Create a Callback with a static function and bound pointer - -: 1369: * @param obj Pointer to object to bind to function - -: 1370: * @param func Static function to attach - -: 1371: * @deprecated - -: 1372: * Arguments to callback have been reordered to Callback(func, arg) - -: 1373: */ - -: 1374: template - -: 1375: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1376: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1377: Callback(const U *obj, R (*func)(const T*, A0, A1)) { - -: 1378: new (this) Callback(func, obj); - -: 1379: } - -: 1380: - -: 1381: /** Create a Callback with a static function and bound pointer - -: 1382: * @param obj Pointer to object to bind to function - -: 1383: * @param func Static function to attach - -: 1384: * @deprecated - -: 1385: * Arguments to callback have been reordered to Callback(func, arg) - -: 1386: */ - -: 1387: template - -: 1388: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1389: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1390: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 1391: new (this) Callback(func, obj); - -: 1392: } - -: 1393: - -: 1394: /** Create a Callback with a static function and bound pointer - -: 1395: * @param obj Pointer to object to bind to function - -: 1396: * @param func Static function to attach - -: 1397: * @deprecated - -: 1398: * Arguments to callback have been reordered to Callback(func, arg) - -: 1399: */ - -: 1400: template - -: 1401: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1402: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1403: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 1404: new (this) Callback(func, obj); - -: 1405: } - -: 1406: - -: 1407: /** Destroy a callback - -: 1408: */ - -: 1409: ~Callback() { - -: 1410: if (_ops) { - -: 1411: _ops->dtor(this); - -: 1412: } - -: 1413: } - -: 1414: - -: 1415: /** Attach a static function - -: 1416: * @param func Static function to attach - -: 1417: * @deprecated - -: 1418: * Replaced by simple assignment 'Callback cb = func' - -: 1419: */ - -: 1420: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1421: "Replaced by simple assignment 'Callback cb = func") - -: 1422: void attach(R (*func)(A0, A1)) { - -: 1423: this->~Callback(); - -: 1424: new (this) Callback(func); - -: 1425: } - -: 1426: - -: 1427: /** Attach a Callback - -: 1428: * @param func The Callback to attach - -: 1429: * @deprecated - -: 1430: * Replaced by simple assignment 'Callback cb = func' - -: 1431: */ - -: 1432: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1433: "Replaced by simple assignment 'Callback cb = func") - -: 1434: void attach(const Callback &func) { - -: 1435: this->~Callback(); - -: 1436: new (this) Callback(func); - -: 1437: } - -: 1438: - -: 1439: /** Attach a member function - -: 1440: * @param obj Pointer to object to invoke member function on - -: 1441: * @param method Member function to attach - -: 1442: * @deprecated - -: 1443: * Replaced by simple assignment 'Callback cb = func' - -: 1444: */ - -: 1445: template - -: 1446: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1447: "Replaced by simple assignment 'Callback cb = func") - -: 1448: void attach(U *obj, R (T::*method)(A0, A1)) { - -: 1449: this->~Callback(); - -: 1450: new (this) Callback(obj, method); - -: 1451: } - -: 1452: - -: 1453: /** Attach a member function - -: 1454: * @param obj Pointer to object to invoke member function on - -: 1455: * @param method Member function to attach - -: 1456: * @deprecated - -: 1457: * Replaced by simple assignment 'Callback cb = func' - -: 1458: */ - -: 1459: template - -: 1460: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1461: "Replaced by simple assignment 'Callback cb = func") - -: 1462: void attach(const U *obj, R (T::*method)(A0, A1) const) { - -: 1463: this->~Callback(); - -: 1464: new (this) Callback(obj, method); - -: 1465: } - -: 1466: - -: 1467: /** Attach a member function - -: 1468: * @param obj Pointer to object to invoke member function on - -: 1469: * @param method Member function to attach - -: 1470: * @deprecated - -: 1471: * Replaced by simple assignment 'Callback cb = func' - -: 1472: */ - -: 1473: template - -: 1474: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1475: "Replaced by simple assignment 'Callback cb = func") - -: 1476: void attach(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 1477: this->~Callback(); - -: 1478: new (this) Callback(obj, method); - -: 1479: } - -: 1480: - -: 1481: /** Attach a member function - -: 1482: * @param obj Pointer to object to invoke member function on - -: 1483: * @param method Member function to attach - -: 1484: * @deprecated - -: 1485: * Replaced by simple assignment 'Callback cb = func' - -: 1486: */ - -: 1487: template - -: 1488: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1489: "Replaced by simple assignment 'Callback cb = func") - -: 1490: void attach(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 1491: this->~Callback(); - -: 1492: new (this) Callback(obj, method); - -: 1493: } - -: 1494: - -: 1495: /** Attach a static function with a bound pointer - -: 1496: * @param func Static function to attach - -: 1497: * @param arg Pointer argument to function - -: 1498: * @deprecated - -: 1499: * Replaced by simple assignment 'Callback cb = func' - -: 1500: */ - -: 1501: template - -: 1502: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1503: "Replaced by simple assignment 'Callback cb = func") - -: 1504: void attach(R (*func)(T*, A0, A1), U *arg) { - -: 1505: this->~Callback(); - -: 1506: new (this) Callback(func, arg); - -: 1507: } - -: 1508: - -: 1509: /** Attach a static function with a bound pointer - -: 1510: * @param func Static function to attach - -: 1511: * @param arg Pointer argument to function - -: 1512: * @deprecated - -: 1513: * Replaced by simple assignment 'Callback cb = func' - -: 1514: */ - -: 1515: template - -: 1516: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1517: "Replaced by simple assignment 'Callback cb = func") - -: 1518: void attach(R (*func)(const T*, A0, A1), const U *arg) { - -: 1519: this->~Callback(); - -: 1520: new (this) Callback(func, arg); - -: 1521: } - -: 1522: - -: 1523: /** Attach a static function with a bound pointer - -: 1524: * @param func Static function to attach - -: 1525: * @param arg Pointer argument to function - -: 1526: * @deprecated - -: 1527: * Replaced by simple assignment 'Callback cb = func' - -: 1528: */ - -: 1529: template - -: 1530: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1531: "Replaced by simple assignment 'Callback cb = func") - -: 1532: void attach(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 1533: this->~Callback(); - -: 1534: new (this) Callback(func, arg); - -: 1535: } - -: 1536: - -: 1537: /** Attach a static function with a bound pointer - -: 1538: * @param func Static function to attach - -: 1539: * @param arg Pointer argument to function - -: 1540: * @deprecated - -: 1541: * Replaced by simple assignment 'Callback cb = func' - -: 1542: */ - -: 1543: template - -: 1544: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1545: "Replaced by simple assignment 'Callback cb = func") - -: 1546: void attach(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 1547: this->~Callback(); - -: 1548: new (this) Callback(func, arg); - -: 1549: } - -: 1550: - -: 1551: /** Attach a function object - -: 1552: * @param f Function object to attach - -: 1553: * @note The function object is limited to a single word of storage - -: 1554: * @deprecated - -: 1555: * Replaced by simple assignment 'Callback cb = func' - -: 1556: */ - -: 1557: template - -: 1558: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1559: "Replaced by simple assignment 'Callback cb = func") - -: 1560: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { - -: 1561: this->~Callback(); - -: 1562: new (this) Callback(f); - -: 1563: } - -: 1564: - -: 1565: /** Attach a function object - -: 1566: * @param f Function object to attach - -: 1567: * @note The function object is limited to a single word of storage - -: 1568: * @deprecated - -: 1569: * Replaced by simple assignment 'Callback cb = func' - -: 1570: */ - -: 1571: template - -: 1572: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1573: "Replaced by simple assignment 'Callback cb = func") - -: 1574: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { - -: 1575: this->~Callback(); - -: 1576: new (this) Callback(f); - -: 1577: } - -: 1578: - -: 1579: /** Attach a function object - -: 1580: * @param f Function object to attach - -: 1581: * @note The function object is limited to a single word of storage - -: 1582: * @deprecated - -: 1583: * Replaced by simple assignment 'Callback cb = func' - -: 1584: */ - -: 1585: template - -: 1586: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1587: "Replaced by simple assignment 'Callback cb = func") - -: 1588: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { - -: 1589: this->~Callback(); - -: 1590: new (this) Callback(f); - -: 1591: } - -: 1592: - -: 1593: /** Attach a function object - -: 1594: * @param f Function object to attach - -: 1595: * @note The function object is limited to a single word of storage - -: 1596: * @deprecated - -: 1597: * Replaced by simple assignment 'Callback cb = func' - -: 1598: */ - -: 1599: template - -: 1600: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1601: "Replaced by simple assignment 'Callback cb = func") - -: 1602: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { - -: 1603: this->~Callback(); - -: 1604: new (this) Callback(f); - -: 1605: } - -: 1606: - -: 1607: /** Attach a static function with a bound pointer - -: 1608: * @param obj Pointer to object to bind to function - -: 1609: * @param func Static function to attach - -: 1610: * @deprecated - -: 1611: * Arguments to callback have been reordered to attach(func, arg) - -: 1612: */ - -: 1613: template - -: 1614: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1615: "Arguments to callback have been reordered to attach(func, arg)") - -: 1616: void attach(U *obj, R (*func)(T*, A0, A1)) { - -: 1617: this->~Callback(); - -: 1618: new (this) Callback(func, obj); - -: 1619: } - -: 1620: - -: 1621: /** Attach a static function with a bound pointer - -: 1622: * @param obj Pointer to object to bind to function - -: 1623: * @param func Static function to attach - -: 1624: * @deprecated - -: 1625: * Arguments to callback have been reordered to attach(func, arg) - -: 1626: */ - -: 1627: template - -: 1628: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1629: "Arguments to callback have been reordered to attach(func, arg)") - -: 1630: void attach(const U *obj, R (*func)(const T*, A0, A1)) { - -: 1631: this->~Callback(); - -: 1632: new (this) Callback(func, obj); - -: 1633: } - -: 1634: - -: 1635: /** Attach a static function with a bound pointer - -: 1636: * @param obj Pointer to object to bind to function - -: 1637: * @param func Static function to attach - -: 1638: * @deprecated - -: 1639: * Arguments to callback have been reordered to attach(func, arg) - -: 1640: */ - -: 1641: template - -: 1642: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1643: "Arguments to callback have been reordered to attach(func, arg)") - -: 1644: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 1645: this->~Callback(); - -: 1646: new (this) Callback(func, obj); - -: 1647: } - -: 1648: - -: 1649: /** Attach a static function with a bound pointer - -: 1650: * @param obj Pointer to object to bind to function - -: 1651: * @param func Static function to attach - -: 1652: * @deprecated - -: 1653: * Arguments to callback have been reordered to attach(func, arg) - -: 1654: */ - -: 1655: template - -: 1656: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1657: "Arguments to callback have been reordered to attach(func, arg)") - -: 1658: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 1659: this->~Callback(); - -: 1660: new (this) Callback(func, obj); - -: 1661: } - -: 1662: - -: 1663: /** Assign a callback - -: 1664: */ - -: 1665: Callback &operator=(const Callback &that) { - -: 1666: if (this != &that) { - -: 1667: this->~Callback(); - -: 1668: new (this) Callback(that); - -: 1669: } - -: 1670: - -: 1671: return *this; - -: 1672: } - -: 1673: - -: 1674: /** Call the attached function - -: 1675: */ - -: 1676: R call(A0 a0, A1 a1) const { - -: 1677: MBED_ASSERT(_ops); - -: 1678: return _ops->call(this, a0, a1); - -: 1679: } - -: 1680: - -: 1681: /** Call the attached function - -: 1682: */ - -: 1683: R operator()(A0 a0, A1 a1) const { - -: 1684: return call(a0, a1); - -: 1685: } - -: 1686: - -: 1687: /** Test if function has been attached - -: 1688: */ - -: 1689: operator bool() const { - -: 1690: return _ops; - -: 1691: } - -: 1692: - -: 1693: /** Test for equality - -: 1694: */ - -: 1695: friend bool operator==(const Callback &l, const Callback &r) { - -: 1696: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 1697: } - -: 1698: - -: 1699: /** Test for inequality - -: 1700: */ - -: 1701: friend bool operator!=(const Callback &l, const Callback &r) { - -: 1702: return !(l == r); - -: 1703: } - -: 1704: - -: 1705: /** Static thunk for passing as C-style function - -: 1706: * @param func Callback to call passed as void pointer - -: 1707: * @param a0 An argument to be called with function func - -: 1708: * @param a1 An argument to be called with function func - -: 1709: * @return the value as determined by func which is of - -: 1710: * type and determined by the signiture of func - -: 1711: */ - -: 1712: static R thunk(void *func, A0 a0, A1 a1) { - -: 1713: return static_cast(func)->call(a0, a1); - -: 1714: } - -: 1715: - -: 1716:private: - -: 1717: // Stored as pointer to function and pointer to optional object - -: 1718: // Function pointer is stored as union of possible function types - -: 1719: // to garuntee proper size and alignment - -: 1720: struct _class; - -: 1721: union { - -: 1722: void (*_staticfunc)(A0, A1); - -: 1723: void (*_boundfunc)(_class*, A0, A1); - -: 1724: void (_class::*_methodfunc)(A0, A1); - -: 1725: } _func; - -: 1726: void *_obj; - -: 1727: - -: 1728: // Dynamically dispatched operations - -: 1729: const struct ops { - -: 1730: R (*call)(const void*, A0, A1); - -: 1731: void (*move)(void*, const void*); - -: 1732: void (*dtor)(void*); - -: 1733: } *_ops; - -: 1734: - -: 1735: // Generate operations for function object - -: 1736: template - -: 1737: void generate(const F &f) { - -: 1738: static const ops ops = { - -: 1739: &Callback::function_call, - -: 1740: &Callback::function_move, - -: 1741: &Callback::function_dtor, - -: 1742: }; - -: 1743: - -: 1744: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 1745: "Type F must not exceed the size of the Callback class"); - -: 1746: memset(this, 0, sizeof(Callback)); - -: 1747: new (this) F(f); - -: 1748: _ops = &ops; - -: 1749: } - -: 1750: - -: 1751: // Function attributes - -: 1752: template - -: 1753: static R function_call(const void *p, A0 a0, A1 a1) { - -: 1754: return (*(F*)p)(a0, a1); - -: 1755: } - -: 1756: - -: 1757: template - -: 1758: static void function_move(void *d, const void *p) { - -: 1759: new (d) F(*(F*)p); - -: 1760: } - -: 1761: - -: 1762: template - -: 1763: static void function_dtor(void *p) { - -: 1764: ((F*)p)->~F(); - -: 1765: } - -: 1766: - -: 1767: // Wrappers for functions with context - -: 1768: template - -: 1769: struct method_context { - -: 1770: M method; - -: 1771: O *obj; - -: 1772: - -: 1773: method_context(O *obj, M method) - -: 1774: : method(method), obj(obj) {} - -: 1775: - -: 1776: R operator()(A0 a0, A1 a1) const { - -: 1777: return (obj->*method)(a0, a1); - -: 1778: } - -: 1779: }; - -: 1780: - -: 1781: template - -: 1782: struct function_context { - -: 1783: F func; - -: 1784: A *arg; - -: 1785: - -: 1786: function_context(F func, A *arg) - -: 1787: : func(func), arg(arg) {} - -: 1788: - -: 1789: R operator()(A0 a0, A1 a1) const { - -: 1790: return func(arg, a0, a1); - -: 1791: } - -: 1792: }; - -: 1793:}; - -: 1794: - -: 1795:/** Callback class based on template specialization - -: 1796: * - -: 1797: * @note Synchronization level: Not protected - -: 1798: */ - -: 1799:template - -: 1800:class Callback { - -: 1801:public: - -: 1802: /** Create a Callback with a static function - -: 1803: * @param func Static function to attach - -: 1804: */ - -: 1805: Callback(R (*func)(A0, A1, A2) = 0) { - -: 1806: if (!func) { - -: 1807: memset(this, 0, sizeof(Callback)); - -: 1808: } else { - -: 1809: generate(func); - -: 1810: } - -: 1811: } - -: 1812: - -: 1813: /** Attach a Callback - -: 1814: * @param func The Callback to attach - -: 1815: */ - -: 1816: Callback(const Callback &func) { - -: 1817: if (func._ops) { - -: 1818: func._ops->move(this, &func); - -: 1819: } - -: 1820: _ops = func._ops; - -: 1821: } - -: 1822: - -: 1823: /** Create a Callback with a member function - -: 1824: * @param obj Pointer to object to invoke member function on - -: 1825: * @param method Member function to attach - -: 1826: */ - -: 1827: template - -: 1828: Callback(U *obj, R (T::*method)(A0, A1, A2)) { - -: 1829: generate(method_context(obj, method)); - -: 1830: } - -: 1831: - -: 1832: /** Create a Callback with a member function - -: 1833: * @param obj Pointer to object to invoke member function on - -: 1834: * @param method Member function to attach - -: 1835: */ - -: 1836: template - -: 1837: Callback(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 1838: generate(method_context(obj, method)); - -: 1839: } - -: 1840: - -: 1841: /** Create a Callback with a member function - -: 1842: * @param obj Pointer to object to invoke member function on - -: 1843: * @param method Member function to attach - -: 1844: */ - -: 1845: template - -: 1846: Callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 1847: generate(method_context(obj, method)); - -: 1848: } - -: 1849: - -: 1850: /** Create a Callback with a member function - -: 1851: * @param obj Pointer to object to invoke member function on - -: 1852: * @param method Member function to attach - -: 1853: */ - -: 1854: template - -: 1855: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 1856: generate(method_context(obj, method)); - -: 1857: } - -: 1858: - -: 1859: /** Create a Callback with a static function and bound pointer - -: 1860: * @param func Static function to attach - -: 1861: * @param arg Pointer argument to function - -: 1862: */ - -: 1863: template - -: 1864: Callback(R (*func)(T*, A0, A1, A2), U *arg) { - -: 1865: generate(function_context(func, arg)); - -: 1866: } - -: 1867: - -: 1868: /** Create a Callback with a static function and bound pointer - -: 1869: * @param func Static function to attach - -: 1870: * @param arg Pointer argument to function - -: 1871: */ - -: 1872: template - -: 1873: Callback(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 1874: generate(function_context(func, arg)); - -: 1875: } - -: 1876: - -: 1877: /** Create a Callback with a static function and bound pointer - -: 1878: * @param func Static function to attach - -: 1879: * @param arg Pointer argument to function - -: 1880: */ - -: 1881: template - -: 1882: Callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 1883: generate(function_context(func, arg)); - -: 1884: } - -: 1885: - -: 1886: /** Create a Callback with a static function and bound pointer - -: 1887: * @param func Static function to attach - -: 1888: * @param arg Pointer argument to function - -: 1889: */ - -: 1890: template - -: 1891: Callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 1892: generate(function_context(func, arg)); - -: 1893: } - -: 1894: - -: 1895: /** Create a Callback with a function object - -: 1896: * @param f Function object to attach - -: 1897: * @note The function object is limited to a single word of storage - -: 1898: */ - -: 1899: template - -: 1900: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { - -: 1901: generate(f); - -: 1902: } - -: 1903: - -: 1904: /** Create a Callback with a function object - -: 1905: * @param f Function object to attach - -: 1906: * @note The function object is limited to a single word of storage - -: 1907: */ - -: 1908: template - -: 1909: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { - -: 1910: generate(f); - -: 1911: } - -: 1912: - -: 1913: /** Create a Callback with a function object - -: 1914: * @param f Function object to attach - -: 1915: * @note The function object is limited to a single word of storage - -: 1916: */ - -: 1917: template - -: 1918: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { - -: 1919: generate(f); - -: 1920: } - -: 1921: - -: 1922: /** Create a Callback with a function object - -: 1923: * @param f Function object to attach - -: 1924: * @note The function object is limited to a single word of storage - -: 1925: */ - -: 1926: template - -: 1927: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { - -: 1928: generate(f); - -: 1929: } - -: 1930: - -: 1931: /** Create a Callback with a static function and bound pointer - -: 1932: * @param obj Pointer to object to bind to function - -: 1933: * @param func Static function to attach - -: 1934: * @deprecated - -: 1935: * Arguments to callback have been reordered to Callback(func, arg) - -: 1936: */ - -: 1937: template - -: 1938: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1939: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1940: Callback(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 1941: new (this) Callback(func, obj); - -: 1942: } - -: 1943: - -: 1944: /** Create a Callback with a static function and bound pointer - -: 1945: * @param obj Pointer to object to bind to function - -: 1946: * @param func Static function to attach - -: 1947: * @deprecated - -: 1948: * Arguments to callback have been reordered to Callback(func, arg) - -: 1949: */ - -: 1950: template - -: 1951: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1952: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1953: Callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 1954: new (this) Callback(func, obj); - -: 1955: } - -: 1956: - -: 1957: /** Create a Callback with a static function and bound pointer - -: 1958: * @param obj Pointer to object to bind to function - -: 1959: * @param func Static function to attach - -: 1960: * @deprecated - -: 1961: * Arguments to callback have been reordered to Callback(func, arg) - -: 1962: */ - -: 1963: template - -: 1964: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1965: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1966: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 1967: new (this) Callback(func, obj); - -: 1968: } - -: 1969: - -: 1970: /** Create a Callback with a static function and bound pointer - -: 1971: * @param obj Pointer to object to bind to function - -: 1972: * @param func Static function to attach - -: 1973: * @deprecated - -: 1974: * Arguments to callback have been reordered to Callback(func, arg) - -: 1975: */ - -: 1976: template - -: 1977: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1978: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1979: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 1980: new (this) Callback(func, obj); - -: 1981: } - -: 1982: - -: 1983: /** Destroy a callback - -: 1984: */ - -: 1985: ~Callback() { - -: 1986: if (_ops) { - -: 1987: _ops->dtor(this); - -: 1988: } - -: 1989: } - -: 1990: - -: 1991: /** Attach a static function - -: 1992: * @param func Static function to attach - -: 1993: * @deprecated - -: 1994: * Replaced by simple assignment 'Callback cb = func' - -: 1995: */ - -: 1996: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1997: "Replaced by simple assignment 'Callback cb = func") - -: 1998: void attach(R (*func)(A0, A1, A2)) { - -: 1999: this->~Callback(); - -: 2000: new (this) Callback(func); - -: 2001: } - -: 2002: - -: 2003: /** Attach a Callback - -: 2004: * @param func The Callback to attach - -: 2005: * @deprecated - -: 2006: * Replaced by simple assignment 'Callback cb = func' - -: 2007: */ - -: 2008: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2009: "Replaced by simple assignment 'Callback cb = func") - -: 2010: void attach(const Callback &func) { - -: 2011: this->~Callback(); - -: 2012: new (this) Callback(func); - -: 2013: } - -: 2014: - -: 2015: /** Attach a member function - -: 2016: * @param obj Pointer to object to invoke member function on - -: 2017: * @param method Member function to attach - -: 2018: * @deprecated - -: 2019: * Replaced by simple assignment 'Callback cb = func' - -: 2020: */ - -: 2021: template - -: 2022: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2023: "Replaced by simple assignment 'Callback cb = func") - -: 2024: void attach(U *obj, R (T::*method)(A0, A1, A2)) { - -: 2025: this->~Callback(); - -: 2026: new (this) Callback(obj, method); - -: 2027: } - -: 2028: - -: 2029: /** Attach a member function - -: 2030: * @param obj Pointer to object to invoke member function on - -: 2031: * @param method Member function to attach - -: 2032: * @deprecated - -: 2033: * Replaced by simple assignment 'Callback cb = func' - -: 2034: */ - -: 2035: template - -: 2036: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2037: "Replaced by simple assignment 'Callback cb = func") - -: 2038: void attach(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 2039: this->~Callback(); - -: 2040: new (this) Callback(obj, method); - -: 2041: } - -: 2042: - -: 2043: /** Attach a member function - -: 2044: * @param obj Pointer to object to invoke member function on - -: 2045: * @param method Member function to attach - -: 2046: * @deprecated - -: 2047: * Replaced by simple assignment 'Callback cb = func' - -: 2048: */ - -: 2049: template - -: 2050: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2051: "Replaced by simple assignment 'Callback cb = func") - -: 2052: void attach(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 2053: this->~Callback(); - -: 2054: new (this) Callback(obj, method); - -: 2055: } - -: 2056: - -: 2057: /** Attach a member function - -: 2058: * @param obj Pointer to object to invoke member function on - -: 2059: * @param method Member function to attach - -: 2060: * @deprecated - -: 2061: * Replaced by simple assignment 'Callback cb = func' - -: 2062: */ - -: 2063: template - -: 2064: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2065: "Replaced by simple assignment 'Callback cb = func") - -: 2066: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 2067: this->~Callback(); - -: 2068: new (this) Callback(obj, method); - -: 2069: } - -: 2070: - -: 2071: /** Attach a static function with a bound pointer - -: 2072: * @param func Static function to attach - -: 2073: * @param arg Pointer argument to function - -: 2074: * @deprecated - -: 2075: * Replaced by simple assignment 'Callback cb = func' - -: 2076: */ - -: 2077: template - -: 2078: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2079: "Replaced by simple assignment 'Callback cb = func") - -: 2080: void attach(R (*func)(T*, A0, A1, A2), U *arg) { - -: 2081: this->~Callback(); - -: 2082: new (this) Callback(func, arg); - -: 2083: } - -: 2084: - -: 2085: /** Attach a static function with a bound pointer - -: 2086: * @param func Static function to attach - -: 2087: * @param arg Pointer argument to function - -: 2088: * @deprecated - -: 2089: * Replaced by simple assignment 'Callback cb = func' - -: 2090: */ - -: 2091: template - -: 2092: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2093: "Replaced by simple assignment 'Callback cb = func") - -: 2094: void attach(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 2095: this->~Callback(); - -: 2096: new (this) Callback(func, arg); - -: 2097: } - -: 2098: - -: 2099: /** Attach a static function with a bound pointer - -: 2100: * @param func Static function to attach - -: 2101: * @param arg Pointer argument to function - -: 2102: * @deprecated - -: 2103: * Replaced by simple assignment 'Callback cb = func' - -: 2104: */ - -: 2105: template - -: 2106: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2107: "Replaced by simple assignment 'Callback cb = func") - -: 2108: void attach(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 2109: this->~Callback(); - -: 2110: new (this) Callback(func, arg); - -: 2111: } - -: 2112: - -: 2113: /** Attach a static function with a bound pointer - -: 2114: * @param func Static function to attach - -: 2115: * @param arg Pointer argument to function - -: 2116: * @deprecated - -: 2117: * Replaced by simple assignment 'Callback cb = func' - -: 2118: */ - -: 2119: template - -: 2120: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2121: "Replaced by simple assignment 'Callback cb = func") - -: 2122: void attach(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 2123: this->~Callback(); - -: 2124: new (this) Callback(func, arg); - -: 2125: } - -: 2126: - -: 2127: /** Attach a function object - -: 2128: * @param f Function object to attach - -: 2129: * @note The function object is limited to a single word of storage - -: 2130: * @deprecated - -: 2131: * Replaced by simple assignment 'Callback cb = func' - -: 2132: */ - -: 2133: template - -: 2134: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2135: "Replaced by simple assignment 'Callback cb = func") - -: 2136: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { - -: 2137: this->~Callback(); - -: 2138: new (this) Callback(f); - -: 2139: } - -: 2140: - -: 2141: /** Attach a function object - -: 2142: * @param f Function object to attach - -: 2143: * @note The function object is limited to a single word of storage - -: 2144: * @deprecated - -: 2145: * Replaced by simple assignment 'Callback cb = func' - -: 2146: */ - -: 2147: template - -: 2148: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2149: "Replaced by simple assignment 'Callback cb = func") - -: 2150: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { - -: 2151: this->~Callback(); - -: 2152: new (this) Callback(f); - -: 2153: } - -: 2154: - -: 2155: /** Attach a function object - -: 2156: * @param f Function object to attach - -: 2157: * @note The function object is limited to a single word of storage - -: 2158: * @deprecated - -: 2159: * Replaced by simple assignment 'Callback cb = func' - -: 2160: */ - -: 2161: template - -: 2162: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2163: "Replaced by simple assignment 'Callback cb = func") - -: 2164: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { - -: 2165: this->~Callback(); - -: 2166: new (this) Callback(f); - -: 2167: } - -: 2168: - -: 2169: /** Attach a function object - -: 2170: * @param f Function object to attach - -: 2171: * @note The function object is limited to a single word of storage - -: 2172: * @deprecated - -: 2173: * Replaced by simple assignment 'Callback cb = func' - -: 2174: */ - -: 2175: template - -: 2176: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2177: "Replaced by simple assignment 'Callback cb = func") - -: 2178: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { - -: 2179: this->~Callback(); - -: 2180: new (this) Callback(f); - -: 2181: } - -: 2182: - -: 2183: /** Attach a static function with a bound pointer - -: 2184: * @param obj Pointer to object to bind to function - -: 2185: * @param func Static function to attach - -: 2186: * @deprecated - -: 2187: * Arguments to callback have been reordered to attach(func, arg) - -: 2188: */ - -: 2189: template - -: 2190: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2191: "Arguments to callback have been reordered to attach(func, arg)") - -: 2192: void attach(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 2193: this->~Callback(); - -: 2194: new (this) Callback(func, obj); - -: 2195: } - -: 2196: - -: 2197: /** Attach a static function with a bound pointer - -: 2198: * @param obj Pointer to object to bind to function - -: 2199: * @param func Static function to attach - -: 2200: * @deprecated - -: 2201: * Arguments to callback have been reordered to attach(func, arg) - -: 2202: */ - -: 2203: template - -: 2204: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2205: "Arguments to callback have been reordered to attach(func, arg)") - -: 2206: void attach(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 2207: this->~Callback(); - -: 2208: new (this) Callback(func, obj); - -: 2209: } - -: 2210: - -: 2211: /** Attach a static function with a bound pointer - -: 2212: * @param obj Pointer to object to bind to function - -: 2213: * @param func Static function to attach - -: 2214: * @deprecated - -: 2215: * Arguments to callback have been reordered to attach(func, arg) - -: 2216: */ - -: 2217: template - -: 2218: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2219: "Arguments to callback have been reordered to attach(func, arg)") - -: 2220: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 2221: this->~Callback(); - -: 2222: new (this) Callback(func, obj); - -: 2223: } - -: 2224: - -: 2225: /** Attach a static function with a bound pointer - -: 2226: * @param obj Pointer to object to bind to function - -: 2227: * @param func Static function to attach - -: 2228: * @deprecated - -: 2229: * Arguments to callback have been reordered to attach(func, arg) - -: 2230: */ - -: 2231: template - -: 2232: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2233: "Arguments to callback have been reordered to attach(func, arg)") - -: 2234: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 2235: this->~Callback(); - -: 2236: new (this) Callback(func, obj); - -: 2237: } - -: 2238: - -: 2239: /** Assign a callback - -: 2240: */ - -: 2241: Callback &operator=(const Callback &that) { - -: 2242: if (this != &that) { - -: 2243: this->~Callback(); - -: 2244: new (this) Callback(that); - -: 2245: } - -: 2246: - -: 2247: return *this; - -: 2248: } - -: 2249: - -: 2250: /** Call the attached function - -: 2251: */ - -: 2252: R call(A0 a0, A1 a1, A2 a2) const { - -: 2253: MBED_ASSERT(_ops); - -: 2254: return _ops->call(this, a0, a1, a2); - -: 2255: } - -: 2256: - -: 2257: /** Call the attached function - -: 2258: */ - -: 2259: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2260: return call(a0, a1, a2); - -: 2261: } - -: 2262: - -: 2263: /** Test if function has been attached - -: 2264: */ - -: 2265: operator bool() const { - -: 2266: return _ops; - -: 2267: } - -: 2268: - -: 2269: /** Test for equality - -: 2270: */ - -: 2271: friend bool operator==(const Callback &l, const Callback &r) { - -: 2272: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 2273: } - -: 2274: - -: 2275: /** Test for inequality - -: 2276: */ - -: 2277: friend bool operator!=(const Callback &l, const Callback &r) { - -: 2278: return !(l == r); - -: 2279: } - -: 2280: - -: 2281: /** Static thunk for passing as C-style function - -: 2282: * @param func Callback to call passed as void pointer - -: 2283: * @param a0 An argument to be called with function func - -: 2284: * @param a1 An argument to be called with function func - -: 2285: * @param a2 An argument to be called with function func - -: 2286: * @return the value as determined by func which is of - -: 2287: * type and determined by the signiture of func - -: 2288: */ - -: 2289: static R thunk(void *func, A0 a0, A1 a1, A2 a2) { - -: 2290: return static_cast(func)->call(a0, a1, a2); - -: 2291: } - -: 2292: - -: 2293:private: - -: 2294: // Stored as pointer to function and pointer to optional object - -: 2295: // Function pointer is stored as union of possible function types - -: 2296: // to garuntee proper size and alignment - -: 2297: struct _class; - -: 2298: union { - -: 2299: void (*_staticfunc)(A0, A1, A2); - -: 2300: void (*_boundfunc)(_class*, A0, A1, A2); - -: 2301: void (_class::*_methodfunc)(A0, A1, A2); - -: 2302: } _func; - -: 2303: void *_obj; - -: 2304: - -: 2305: // Dynamically dispatched operations - -: 2306: const struct ops { - -: 2307: R (*call)(const void*, A0, A1, A2); - -: 2308: void (*move)(void*, const void*); - -: 2309: void (*dtor)(void*); - -: 2310: } *_ops; - -: 2311: - -: 2312: // Generate operations for function object - -: 2313: template - -: 2314: void generate(const F &f) { - -: 2315: static const ops ops = { - -: 2316: &Callback::function_call, - -: 2317: &Callback::function_move, - -: 2318: &Callback::function_dtor, - -: 2319: }; - -: 2320: - -: 2321: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 2322: "Type F must not exceed the size of the Callback class"); - -: 2323: memset(this, 0, sizeof(Callback)); - -: 2324: new (this) F(f); - -: 2325: _ops = &ops; - -: 2326: } - -: 2327: - -: 2328: // Function attributes - -: 2329: template - -: 2330: static R function_call(const void *p, A0 a0, A1 a1, A2 a2) { - -: 2331: return (*(F*)p)(a0, a1, a2); - -: 2332: } - -: 2333: - -: 2334: template - -: 2335: static void function_move(void *d, const void *p) { - -: 2336: new (d) F(*(F*)p); - -: 2337: } - -: 2338: - -: 2339: template - -: 2340: static void function_dtor(void *p) { - -: 2341: ((F*)p)->~F(); - -: 2342: } - -: 2343: - -: 2344: // Wrappers for functions with context - -: 2345: template - -: 2346: struct method_context { - -: 2347: M method; - -: 2348: O *obj; - -: 2349: - -: 2350: method_context(O *obj, M method) - -: 2351: : method(method), obj(obj) {} - -: 2352: - -: 2353: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2354: return (obj->*method)(a0, a1, a2); - -: 2355: } - -: 2356: }; - -: 2357: - -: 2358: template - -: 2359: struct function_context { - -: 2360: F func; - -: 2361: A *arg; - -: 2362: - -: 2363: function_context(F func, A *arg) - -: 2364: : func(func), arg(arg) {} - -: 2365: - -: 2366: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2367: return func(arg, a0, a1, a2); - -: 2368: } - -: 2369: }; - -: 2370:}; - -: 2371: - -: 2372:/** Callback class based on template specialization - -: 2373: * - -: 2374: * @note Synchronization level: Not protected - -: 2375: */ - -: 2376:template - -: 2377:class Callback { - -: 2378:public: - -: 2379: /** Create a Callback with a static function - -: 2380: * @param func Static function to attach - -: 2381: */ - -: 2382: Callback(R (*func)(A0, A1, A2, A3) = 0) { - -: 2383: if (!func) { - -: 2384: memset(this, 0, sizeof(Callback)); - -: 2385: } else { - -: 2386: generate(func); - -: 2387: } - -: 2388: } - -: 2389: - -: 2390: /** Attach a Callback - -: 2391: * @param func The Callback to attach - -: 2392: */ - -: 2393: Callback(const Callback &func) { - -: 2394: if (func._ops) { - -: 2395: func._ops->move(this, &func); - -: 2396: } - -: 2397: _ops = func._ops; - -: 2398: } - -: 2399: - -: 2400: /** Create a Callback with a member function - -: 2401: * @param obj Pointer to object to invoke member function on - -: 2402: * @param method Member function to attach - -: 2403: */ - -: 2404: template - -: 2405: Callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 2406: generate(method_context(obj, method)); - -: 2407: } - -: 2408: - -: 2409: /** Create a Callback with a member function - -: 2410: * @param obj Pointer to object to invoke member function on - -: 2411: * @param method Member function to attach - -: 2412: */ - -: 2413: template - -: 2414: Callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 2415: generate(method_context(obj, method)); - -: 2416: } - -: 2417: - -: 2418: /** Create a Callback with a member function - -: 2419: * @param obj Pointer to object to invoke member function on - -: 2420: * @param method Member function to attach - -: 2421: */ - -: 2422: template - -: 2423: Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 2424: generate(method_context(obj, method)); - -: 2425: } - -: 2426: - -: 2427: /** Create a Callback with a member function - -: 2428: * @param obj Pointer to object to invoke member function on - -: 2429: * @param method Member function to attach - -: 2430: */ - -: 2431: template - -: 2432: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 2433: generate(method_context(obj, method)); - -: 2434: } - -: 2435: - -: 2436: /** Create a Callback with a static function and bound pointer - -: 2437: * @param func Static function to attach - -: 2438: * @param arg Pointer argument to function - -: 2439: */ - -: 2440: template - -: 2441: Callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 2442: generate(function_context(func, arg)); - -: 2443: } - -: 2444: - -: 2445: /** Create a Callback with a static function and bound pointer - -: 2446: * @param func Static function to attach - -: 2447: * @param arg Pointer argument to function - -: 2448: */ - -: 2449: template - -: 2450: Callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 2451: generate(function_context(func, arg)); - -: 2452: } - -: 2453: - -: 2454: /** Create a Callback with a static function and bound pointer - -: 2455: * @param func Static function to attach - -: 2456: * @param arg Pointer argument to function - -: 2457: */ - -: 2458: template - -: 2459: Callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 2460: generate(function_context(func, arg)); - -: 2461: } - -: 2462: - -: 2463: /** Create a Callback with a static function and bound pointer - -: 2464: * @param func Static function to attach - -: 2465: * @param arg Pointer argument to function - -: 2466: */ - -: 2467: template - -: 2468: Callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 2469: generate(function_context(func, arg)); - -: 2470: } - -: 2471: - -: 2472: /** Create a Callback with a function object - -: 2473: * @param f Function object to attach - -: 2474: * @note The function object is limited to a single word of storage - -: 2475: */ - -: 2476: template - -: 2477: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { - -: 2478: generate(f); - -: 2479: } - -: 2480: - -: 2481: /** Create a Callback with a function object - -: 2482: * @param f Function object to attach - -: 2483: * @note The function object is limited to a single word of storage - -: 2484: */ - -: 2485: template - -: 2486: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { - -: 2487: generate(f); - -: 2488: } - -: 2489: - -: 2490: /** Create a Callback with a function object - -: 2491: * @param f Function object to attach - -: 2492: * @note The function object is limited to a single word of storage - -: 2493: */ - -: 2494: template - -: 2495: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { - -: 2496: generate(f); - -: 2497: } - -: 2498: - -: 2499: /** Create a Callback with a function object - -: 2500: * @param f Function object to attach - -: 2501: * @note The function object is limited to a single word of storage - -: 2502: */ - -: 2503: template - -: 2504: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { - -: 2505: generate(f); - -: 2506: } - -: 2507: - -: 2508: /** Create a Callback with a static function and bound pointer - -: 2509: * @param obj Pointer to object to bind to function - -: 2510: * @param func Static function to attach - -: 2511: * @deprecated - -: 2512: * Arguments to callback have been reordered to Callback(func, arg) - -: 2513: */ - -: 2514: template - -: 2515: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2516: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2517: Callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 2518: new (this) Callback(func, obj); - -: 2519: } - -: 2520: - -: 2521: /** Create a Callback with a static function and bound pointer - -: 2522: * @param obj Pointer to object to bind to function - -: 2523: * @param func Static function to attach - -: 2524: * @deprecated - -: 2525: * Arguments to callback have been reordered to Callback(func, arg) - -: 2526: */ - -: 2527: template - -: 2528: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2529: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2530: Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 2531: new (this) Callback(func, obj); - -: 2532: } - -: 2533: - -: 2534: /** Create a Callback with a static function and bound pointer - -: 2535: * @param obj Pointer to object to bind to function - -: 2536: * @param func Static function to attach - -: 2537: * @deprecated - -: 2538: * Arguments to callback have been reordered to Callback(func, arg) - -: 2539: */ - -: 2540: template - -: 2541: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2542: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2543: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 2544: new (this) Callback(func, obj); - -: 2545: } - -: 2546: - -: 2547: /** Create a Callback with a static function and bound pointer - -: 2548: * @param obj Pointer to object to bind to function - -: 2549: * @param func Static function to attach - -: 2550: * @deprecated - -: 2551: * Arguments to callback have been reordered to Callback(func, arg) - -: 2552: */ - -: 2553: template - -: 2554: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2555: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2556: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 2557: new (this) Callback(func, obj); - -: 2558: } - -: 2559: - -: 2560: /** Destroy a callback - -: 2561: */ - -: 2562: ~Callback() { - -: 2563: if (_ops) { - -: 2564: _ops->dtor(this); - -: 2565: } - -: 2566: } - -: 2567: - -: 2568: /** Attach a static function - -: 2569: * @param func Static function to attach - -: 2570: * @deprecated - -: 2571: * Replaced by simple assignment 'Callback cb = func' - -: 2572: */ - -: 2573: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2574: "Replaced by simple assignment 'Callback cb = func") - -: 2575: void attach(R (*func)(A0, A1, A2, A3)) { - -: 2576: this->~Callback(); - -: 2577: new (this) Callback(func); - -: 2578: } - -: 2579: - -: 2580: /** Attach a Callback - -: 2581: * @param func The Callback to attach - -: 2582: * @deprecated - -: 2583: * Replaced by simple assignment 'Callback cb = func' - -: 2584: */ - -: 2585: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2586: "Replaced by simple assignment 'Callback cb = func") - -: 2587: void attach(const Callback &func) { - -: 2588: this->~Callback(); - -: 2589: new (this) Callback(func); - -: 2590: } - -: 2591: - -: 2592: /** Attach a member function - -: 2593: * @param obj Pointer to object to invoke member function on - -: 2594: * @param method Member function to attach - -: 2595: * @deprecated - -: 2596: * Replaced by simple assignment 'Callback cb = func' - -: 2597: */ - -: 2598: template - -: 2599: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2600: "Replaced by simple assignment 'Callback cb = func") - -: 2601: void attach(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 2602: this->~Callback(); - -: 2603: new (this) Callback(obj, method); - -: 2604: } - -: 2605: - -: 2606: /** Attach a member function - -: 2607: * @param obj Pointer to object to invoke member function on - -: 2608: * @param method Member function to attach - -: 2609: * @deprecated - -: 2610: * Replaced by simple assignment 'Callback cb = func' - -: 2611: */ - -: 2612: template - -: 2613: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2614: "Replaced by simple assignment 'Callback cb = func") - -: 2615: void attach(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 2616: this->~Callback(); - -: 2617: new (this) Callback(obj, method); - -: 2618: } - -: 2619: - -: 2620: /** Attach a member function - -: 2621: * @param obj Pointer to object to invoke member function on - -: 2622: * @param method Member function to attach - -: 2623: * @deprecated - -: 2624: * Replaced by simple assignment 'Callback cb = func' - -: 2625: */ - -: 2626: template - -: 2627: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2628: "Replaced by simple assignment 'Callback cb = func") - -: 2629: void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 2630: this->~Callback(); - -: 2631: new (this) Callback(obj, method); - -: 2632: } - -: 2633: - -: 2634: /** Attach a member function - -: 2635: * @param obj Pointer to object to invoke member function on - -: 2636: * @param method Member function to attach - -: 2637: * @deprecated - -: 2638: * Replaced by simple assignment 'Callback cb = func' - -: 2639: */ - -: 2640: template - -: 2641: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2642: "Replaced by simple assignment 'Callback cb = func") - -: 2643: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 2644: this->~Callback(); - -: 2645: new (this) Callback(obj, method); - -: 2646: } - -: 2647: - -: 2648: /** Attach a static function with a bound pointer - -: 2649: * @param func Static function to attach - -: 2650: * @param arg Pointer argument to function - -: 2651: * @deprecated - -: 2652: * Replaced by simple assignment 'Callback cb = func' - -: 2653: */ - -: 2654: template - -: 2655: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2656: "Replaced by simple assignment 'Callback cb = func") - -: 2657: void attach(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 2658: this->~Callback(); - -: 2659: new (this) Callback(func, arg); - -: 2660: } - -: 2661: - -: 2662: /** Attach a static function with a bound pointer - -: 2663: * @param func Static function to attach - -: 2664: * @param arg Pointer argument to function - -: 2665: * @deprecated - -: 2666: * Replaced by simple assignment 'Callback cb = func' - -: 2667: */ - -: 2668: template - -: 2669: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2670: "Replaced by simple assignment 'Callback cb = func") - -: 2671: void attach(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 2672: this->~Callback(); - -: 2673: new (this) Callback(func, arg); - -: 2674: } - -: 2675: - -: 2676: /** Attach a static function with a bound pointer - -: 2677: * @param func Static function to attach - -: 2678: * @param arg Pointer argument to function - -: 2679: * @deprecated - -: 2680: * Replaced by simple assignment 'Callback cb = func' - -: 2681: */ - -: 2682: template - -: 2683: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2684: "Replaced by simple assignment 'Callback cb = func") - -: 2685: void attach(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 2686: this->~Callback(); - -: 2687: new (this) Callback(func, arg); - -: 2688: } - -: 2689: - -: 2690: /** Attach a static function with a bound pointer - -: 2691: * @param func Static function to attach - -: 2692: * @param arg Pointer argument to function - -: 2693: * @deprecated - -: 2694: * Replaced by simple assignment 'Callback cb = func' - -: 2695: */ - -: 2696: template - -: 2697: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2698: "Replaced by simple assignment 'Callback cb = func") - -: 2699: void attach(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 2700: this->~Callback(); - -: 2701: new (this) Callback(func, arg); - -: 2702: } - -: 2703: - -: 2704: /** Attach a function object - -: 2705: * @param f Function object to attach - -: 2706: * @note The function object is limited to a single word of storage - -: 2707: * @deprecated - -: 2708: * Replaced by simple assignment 'Callback cb = func' - -: 2709: */ - -: 2710: template - -: 2711: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2712: "Replaced by simple assignment 'Callback cb = func") - -: 2713: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { - -: 2714: this->~Callback(); - -: 2715: new (this) Callback(f); - -: 2716: } - -: 2717: - -: 2718: /** Attach a function object - -: 2719: * @param f Function object to attach - -: 2720: * @note The function object is limited to a single word of storage - -: 2721: * @deprecated - -: 2722: * Replaced by simple assignment 'Callback cb = func' - -: 2723: */ - -: 2724: template - -: 2725: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2726: "Replaced by simple assignment 'Callback cb = func") - -: 2727: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { - -: 2728: this->~Callback(); - -: 2729: new (this) Callback(f); - -: 2730: } - -: 2731: - -: 2732: /** Attach a function object - -: 2733: * @param f Function object to attach - -: 2734: * @note The function object is limited to a single word of storage - -: 2735: * @deprecated - -: 2736: * Replaced by simple assignment 'Callback cb = func' - -: 2737: */ - -: 2738: template - -: 2739: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2740: "Replaced by simple assignment 'Callback cb = func") - -: 2741: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { - -: 2742: this->~Callback(); - -: 2743: new (this) Callback(f); - -: 2744: } - -: 2745: - -: 2746: /** Attach a function object - -: 2747: * @param f Function object to attach - -: 2748: * @note The function object is limited to a single word of storage - -: 2749: * @deprecated - -: 2750: * Replaced by simple assignment 'Callback cb = func' - -: 2751: */ - -: 2752: template - -: 2753: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2754: "Replaced by simple assignment 'Callback cb = func") - -: 2755: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { - -: 2756: this->~Callback(); - -: 2757: new (this) Callback(f); - -: 2758: } - -: 2759: - -: 2760: /** Attach a static function with a bound pointer - -: 2761: * @param obj Pointer to object to bind to function - -: 2762: * @param func Static function to attach - -: 2763: * @deprecated - -: 2764: * Arguments to callback have been reordered to attach(func, arg) - -: 2765: */ - -: 2766: template - -: 2767: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2768: "Arguments to callback have been reordered to attach(func, arg)") - -: 2769: void attach(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 2770: this->~Callback(); - -: 2771: new (this) Callback(func, obj); - -: 2772: } - -: 2773: - -: 2774: /** Attach a static function with a bound pointer - -: 2775: * @param obj Pointer to object to bind to function - -: 2776: * @param func Static function to attach - -: 2777: * @deprecated - -: 2778: * Arguments to callback have been reordered to attach(func, arg) - -: 2779: */ - -: 2780: template - -: 2781: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2782: "Arguments to callback have been reordered to attach(func, arg)") - -: 2783: void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 2784: this->~Callback(); - -: 2785: new (this) Callback(func, obj); - -: 2786: } - -: 2787: - -: 2788: /** Attach a static function with a bound pointer - -: 2789: * @param obj Pointer to object to bind to function - -: 2790: * @param func Static function to attach - -: 2791: * @deprecated - -: 2792: * Arguments to callback have been reordered to attach(func, arg) - -: 2793: */ - -: 2794: template - -: 2795: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2796: "Arguments to callback have been reordered to attach(func, arg)") - -: 2797: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 2798: this->~Callback(); - -: 2799: new (this) Callback(func, obj); - -: 2800: } - -: 2801: - -: 2802: /** Attach a static function with a bound pointer - -: 2803: * @param obj Pointer to object to bind to function - -: 2804: * @param func Static function to attach - -: 2805: * @deprecated - -: 2806: * Arguments to callback have been reordered to attach(func, arg) - -: 2807: */ - -: 2808: template - -: 2809: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2810: "Arguments to callback have been reordered to attach(func, arg)") - -: 2811: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 2812: this->~Callback(); - -: 2813: new (this) Callback(func, obj); - -: 2814: } - -: 2815: - -: 2816: /** Assign a callback - -: 2817: */ - -: 2818: Callback &operator=(const Callback &that) { - -: 2819: if (this != &that) { - -: 2820: this->~Callback(); - -: 2821: new (this) Callback(that); - -: 2822: } - -: 2823: - -: 2824: return *this; - -: 2825: } - -: 2826: - -: 2827: /** Call the attached function - -: 2828: */ - -: 2829: R call(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2830: MBED_ASSERT(_ops); - -: 2831: return _ops->call(this, a0, a1, a2, a3); - -: 2832: } - -: 2833: - -: 2834: /** Call the attached function - -: 2835: */ - -: 2836: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2837: return call(a0, a1, a2, a3); - -: 2838: } - -: 2839: - -: 2840: /** Test if function has been attached - -: 2841: */ - -: 2842: operator bool() const { - -: 2843: return _ops; - -: 2844: } - -: 2845: - -: 2846: /** Test for equality - -: 2847: */ - -: 2848: friend bool operator==(const Callback &l, const Callback &r) { - -: 2849: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 2850: } - -: 2851: - -: 2852: /** Test for inequality - -: 2853: */ - -: 2854: friend bool operator!=(const Callback &l, const Callback &r) { - -: 2855: return !(l == r); - -: 2856: } - -: 2857: - -: 2858: /** Static thunk for passing as C-style function - -: 2859: * @param func Callback to call passed as void pointer - -: 2860: * @param a0 An argument to be called with function func - -: 2861: * @param a1 An argument to be called with function func - -: 2862: * @param a2 An argument to be called with function func - -: 2863: * @param a3 An argument to be called with function func - -: 2864: * @return the value as determined by func which is of - -: 2865: * type and determined by the signiture of func - -: 2866: */ - -: 2867: static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2868: return static_cast(func)->call(a0, a1, a2, a3); - -: 2869: } - -: 2870: - -: 2871:private: - -: 2872: // Stored as pointer to function and pointer to optional object - -: 2873: // Function pointer is stored as union of possible function types - -: 2874: // to garuntee proper size and alignment - -: 2875: struct _class; - -: 2876: union { - -: 2877: void (*_staticfunc)(A0, A1, A2, A3); - -: 2878: void (*_boundfunc)(_class*, A0, A1, A2, A3); - -: 2879: void (_class::*_methodfunc)(A0, A1, A2, A3); - -: 2880: } _func; - -: 2881: void *_obj; - -: 2882: - -: 2883: // Dynamically dispatched operations - -: 2884: const struct ops { - -: 2885: R (*call)(const void*, A0, A1, A2, A3); - -: 2886: void (*move)(void*, const void*); - -: 2887: void (*dtor)(void*); - -: 2888: } *_ops; - -: 2889: - -: 2890: // Generate operations for function object - -: 2891: template - -: 2892: void generate(const F &f) { - -: 2893: static const ops ops = { - -: 2894: &Callback::function_call, - -: 2895: &Callback::function_move, - -: 2896: &Callback::function_dtor, - -: 2897: }; - -: 2898: - -: 2899: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 2900: "Type F must not exceed the size of the Callback class"); - -: 2901: memset(this, 0, sizeof(Callback)); - -: 2902: new (this) F(f); - -: 2903: _ops = &ops; - -: 2904: } - -: 2905: - -: 2906: // Function attributes - -: 2907: template - -: 2908: static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2909: return (*(F*)p)(a0, a1, a2, a3); - -: 2910: } - -: 2911: - -: 2912: template - -: 2913: static void function_move(void *d, const void *p) { - -: 2914: new (d) F(*(F*)p); - -: 2915: } - -: 2916: - -: 2917: template - -: 2918: static void function_dtor(void *p) { - -: 2919: ((F*)p)->~F(); - -: 2920: } - -: 2921: - -: 2922: // Wrappers for functions with context - -: 2923: template - -: 2924: struct method_context { - -: 2925: M method; - -: 2926: O *obj; - -: 2927: - -: 2928: method_context(O *obj, M method) - -: 2929: : method(method), obj(obj) {} - -: 2930: - -: 2931: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2932: return (obj->*method)(a0, a1, a2, a3); - -: 2933: } - -: 2934: }; - -: 2935: - -: 2936: template - -: 2937: struct function_context { - -: 2938: F func; - -: 2939: A *arg; - -: 2940: - -: 2941: function_context(F func, A *arg) - -: 2942: : func(func), arg(arg) {} - -: 2943: - -: 2944: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2945: return func(arg, a0, a1, a2, a3); - -: 2946: } - -: 2947: }; - -: 2948:}; - -: 2949: - -: 2950:/** Callback class based on template specialization - -: 2951: * - -: 2952: * @note Synchronization level: Not protected - -: 2953: */ - -: 2954:template - -: 2955:class Callback { - -: 2956:public: - -: 2957: /** Create a Callback with a static function - -: 2958: * @param func Static function to attach - -: 2959: */ - -: 2960: Callback(R (*func)(A0, A1, A2, A3, A4) = 0) { - -: 2961: if (!func) { - -: 2962: memset(this, 0, sizeof(Callback)); - -: 2963: } else { - -: 2964: generate(func); - -: 2965: } - -: 2966: } - -: 2967: - -: 2968: /** Attach a Callback - -: 2969: * @param func The Callback to attach - -: 2970: */ - -: 2971: Callback(const Callback &func) { - -: 2972: if (func._ops) { - -: 2973: func._ops->move(this, &func); - -: 2974: } - -: 2975: _ops = func._ops; - -: 2976: } - -: 2977: - -: 2978: /** Create a Callback with a member function - -: 2979: * @param obj Pointer to object to invoke member function on - -: 2980: * @param method Member function to attach - -: 2981: */ - -: 2982: template - -: 2983: Callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 2984: generate(method_context(obj, method)); - -: 2985: } - -: 2986: - -: 2987: /** Create a Callback with a member function - -: 2988: * @param obj Pointer to object to invoke member function on - -: 2989: * @param method Member function to attach - -: 2990: */ - -: 2991: template - -: 2992: Callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 2993: generate(method_context(obj, method)); - -: 2994: } - -: 2995: - -: 2996: /** Create a Callback with a member function - -: 2997: * @param obj Pointer to object to invoke member function on - -: 2998: * @param method Member function to attach - -: 2999: */ - -: 3000: template - -: 3001: Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 3002: generate(method_context(obj, method)); - -: 3003: } - -: 3004: - -: 3005: /** Create a Callback with a member function - -: 3006: * @param obj Pointer to object to invoke member function on - -: 3007: * @param method Member function to attach - -: 3008: */ - -: 3009: template - -: 3010: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 3011: generate(method_context(obj, method)); - -: 3012: } - -: 3013: - -: 3014: /** Create a Callback with a static function and bound pointer - -: 3015: * @param func Static function to attach - -: 3016: * @param arg Pointer argument to function - -: 3017: */ - -: 3018: template - -: 3019: Callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 3020: generate(function_context(func, arg)); - -: 3021: } - -: 3022: - -: 3023: /** Create a Callback with a static function and bound pointer - -: 3024: * @param func Static function to attach - -: 3025: * @param arg Pointer argument to function - -: 3026: */ - -: 3027: template - -: 3028: Callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 3029: generate(function_context(func, arg)); - -: 3030: } - -: 3031: - -: 3032: /** Create a Callback with a static function and bound pointer - -: 3033: * @param func Static function to attach - -: 3034: * @param arg Pointer argument to function - -: 3035: */ - -: 3036: template - -: 3037: Callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 3038: generate(function_context(func, arg)); - -: 3039: } - -: 3040: - -: 3041: /** Create a Callback with a static function and bound pointer - -: 3042: * @param func Static function to attach - -: 3043: * @param arg Pointer argument to function - -: 3044: */ - -: 3045: template - -: 3046: Callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 3047: generate(function_context(func, arg)); - -: 3048: } - -: 3049: - -: 3050: /** Create a Callback with a function object - -: 3051: * @param f Function object to attach - -: 3052: * @note The function object is limited to a single word of storage - -: 3053: */ - -: 3054: template - -: 3055: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { - -: 3056: generate(f); - -: 3057: } - -: 3058: - -: 3059: /** Create a Callback with a function object - -: 3060: * @param f Function object to attach - -: 3061: * @note The function object is limited to a single word of storage - -: 3062: */ - -: 3063: template - -: 3064: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { - -: 3065: generate(f); - -: 3066: } - -: 3067: - -: 3068: /** Create a Callback with a function object - -: 3069: * @param f Function object to attach - -: 3070: * @note The function object is limited to a single word of storage - -: 3071: */ - -: 3072: template - -: 3073: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { - -: 3074: generate(f); - -: 3075: } - -: 3076: - -: 3077: /** Create a Callback with a function object - -: 3078: * @param f Function object to attach - -: 3079: * @note The function object is limited to a single word of storage - -: 3080: */ - -: 3081: template - -: 3082: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { - -: 3083: generate(f); - -: 3084: } - -: 3085: - -: 3086: /** Create a Callback with a static function and bound pointer - -: 3087: * @param obj Pointer to object to bind to function - -: 3088: * @param func Static function to attach - -: 3089: * @deprecated - -: 3090: * Arguments to callback have been reordered to Callback(func, arg) - -: 3091: */ - -: 3092: template - -: 3093: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3094: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3095: Callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 3096: new (this) Callback(func, obj); - -: 3097: } - -: 3098: - -: 3099: /** Create a Callback with a static function and bound pointer - -: 3100: * @param obj Pointer to object to bind to function - -: 3101: * @param func Static function to attach - -: 3102: * @deprecated - -: 3103: * Arguments to callback have been reordered to Callback(func, arg) - -: 3104: */ - -: 3105: template - -: 3106: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3107: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3108: Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 3109: new (this) Callback(func, obj); - -: 3110: } - -: 3111: - -: 3112: /** Create a Callback with a static function and bound pointer - -: 3113: * @param obj Pointer to object to bind to function - -: 3114: * @param func Static function to attach - -: 3115: * @deprecated - -: 3116: * Arguments to callback have been reordered to Callback(func, arg) - -: 3117: */ - -: 3118: template - -: 3119: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3120: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3121: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 3122: new (this) Callback(func, obj); - -: 3123: } - -: 3124: - -: 3125: /** Create a Callback with a static function and bound pointer - -: 3126: * @param obj Pointer to object to bind to function - -: 3127: * @param func Static function to attach - -: 3128: * @deprecated - -: 3129: * Arguments to callback have been reordered to Callback(func, arg) - -: 3130: */ - -: 3131: template - -: 3132: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3133: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3134: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 3135: new (this) Callback(func, obj); - -: 3136: } - -: 3137: - -: 3138: /** Destroy a callback - -: 3139: */ - -: 3140: ~Callback() { - -: 3141: if (_ops) { - -: 3142: _ops->dtor(this); - -: 3143: } - -: 3144: } - -: 3145: - -: 3146: /** Attach a static function - -: 3147: * @param func Static function to attach - -: 3148: * @deprecated - -: 3149: * Replaced by simple assignment 'Callback cb = func' - -: 3150: */ - -: 3151: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3152: "Replaced by simple assignment 'Callback cb = func") - -: 3153: void attach(R (*func)(A0, A1, A2, A3, A4)) { - -: 3154: this->~Callback(); - -: 3155: new (this) Callback(func); - -: 3156: } - -: 3157: - -: 3158: /** Attach a Callback - -: 3159: * @param func The Callback to attach - -: 3160: * @deprecated - -: 3161: * Replaced by simple assignment 'Callback cb = func' - -: 3162: */ - -: 3163: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3164: "Replaced by simple assignment 'Callback cb = func") - -: 3165: void attach(const Callback &func) { - -: 3166: this->~Callback(); - -: 3167: new (this) Callback(func); - -: 3168: } - -: 3169: - -: 3170: /** Attach a member function - -: 3171: * @param obj Pointer to object to invoke member function on - -: 3172: * @param method Member function to attach - -: 3173: * @deprecated - -: 3174: * Replaced by simple assignment 'Callback cb = func' - -: 3175: */ - -: 3176: template - -: 3177: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3178: "Replaced by simple assignment 'Callback cb = func") - -: 3179: void attach(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 3180: this->~Callback(); - -: 3181: new (this) Callback(obj, method); - -: 3182: } - -: 3183: - -: 3184: /** Attach a member function - -: 3185: * @param obj Pointer to object to invoke member function on - -: 3186: * @param method Member function to attach - -: 3187: * @deprecated - -: 3188: * Replaced by simple assignment 'Callback cb = func' - -: 3189: */ - -: 3190: template - -: 3191: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3192: "Replaced by simple assignment 'Callback cb = func") - -: 3193: void attach(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 3194: this->~Callback(); - -: 3195: new (this) Callback(obj, method); - -: 3196: } - -: 3197: - -: 3198: /** Attach a member function - -: 3199: * @param obj Pointer to object to invoke member function on - -: 3200: * @param method Member function to attach - -: 3201: * @deprecated - -: 3202: * Replaced by simple assignment 'Callback cb = func' - -: 3203: */ - -: 3204: template - -: 3205: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3206: "Replaced by simple assignment 'Callback cb = func") - -: 3207: void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 3208: this->~Callback(); - -: 3209: new (this) Callback(obj, method); - -: 3210: } - -: 3211: - -: 3212: /** Attach a member function - -: 3213: * @param obj Pointer to object to invoke member function on - -: 3214: * @param method Member function to attach - -: 3215: * @deprecated - -: 3216: * Replaced by simple assignment 'Callback cb = func' - -: 3217: */ - -: 3218: template - -: 3219: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3220: "Replaced by simple assignment 'Callback cb = func") - -: 3221: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 3222: this->~Callback(); - -: 3223: new (this) Callback(obj, method); - -: 3224: } - -: 3225: - -: 3226: /** Attach a static function with a bound pointer - -: 3227: * @param func Static function to attach - -: 3228: * @param arg Pointer argument to function - -: 3229: * @deprecated - -: 3230: * Replaced by simple assignment 'Callback cb = func' - -: 3231: */ - -: 3232: template - -: 3233: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3234: "Replaced by simple assignment 'Callback cb = func") - -: 3235: void attach(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 3236: this->~Callback(); - -: 3237: new (this) Callback(func, arg); - -: 3238: } - -: 3239: - -: 3240: /** Attach a static function with a bound pointer - -: 3241: * @param func Static function to attach - -: 3242: * @param arg Pointer argument to function - -: 3243: * @deprecated - -: 3244: * Replaced by simple assignment 'Callback cb = func' - -: 3245: */ - -: 3246: template - -: 3247: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3248: "Replaced by simple assignment 'Callback cb = func") - -: 3249: void attach(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 3250: this->~Callback(); - -: 3251: new (this) Callback(func, arg); - -: 3252: } - -: 3253: - -: 3254: /** Attach a static function with a bound pointer - -: 3255: * @param func Static function to attach - -: 3256: * @param arg Pointer argument to function - -: 3257: * @deprecated - -: 3258: * Replaced by simple assignment 'Callback cb = func' - -: 3259: */ - -: 3260: template - -: 3261: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3262: "Replaced by simple assignment 'Callback cb = func") - -: 3263: void attach(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 3264: this->~Callback(); - -: 3265: new (this) Callback(func, arg); - -: 3266: } - -: 3267: - -: 3268: /** Attach a static function with a bound pointer - -: 3269: * @param func Static function to attach - -: 3270: * @param arg Pointer argument to function - -: 3271: * @deprecated - -: 3272: * Replaced by simple assignment 'Callback cb = func' - -: 3273: */ - -: 3274: template - -: 3275: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3276: "Replaced by simple assignment 'Callback cb = func") - -: 3277: void attach(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 3278: this->~Callback(); - -: 3279: new (this) Callback(func, arg); - -: 3280: } - -: 3281: - -: 3282: /** Attach a function object - -: 3283: * @param f Function object to attach - -: 3284: * @note The function object is limited to a single word of storage - -: 3285: * @deprecated - -: 3286: * Replaced by simple assignment 'Callback cb = func' - -: 3287: */ - -: 3288: template - -: 3289: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3290: "Replaced by simple assignment 'Callback cb = func") - -: 3291: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { - -: 3292: this->~Callback(); - -: 3293: new (this) Callback(f); - -: 3294: } - -: 3295: - -: 3296: /** Attach a function object - -: 3297: * @param f Function object to attach - -: 3298: * @note The function object is limited to a single word of storage - -: 3299: * @deprecated - -: 3300: * Replaced by simple assignment 'Callback cb = func' - -: 3301: */ - -: 3302: template - -: 3303: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3304: "Replaced by simple assignment 'Callback cb = func") - -: 3305: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { - -: 3306: this->~Callback(); - -: 3307: new (this) Callback(f); - -: 3308: } - -: 3309: - -: 3310: /** Attach a function object - -: 3311: * @param f Function object to attach - -: 3312: * @note The function object is limited to a single word of storage - -: 3313: * @deprecated - -: 3314: * Replaced by simple assignment 'Callback cb = func' - -: 3315: */ - -: 3316: template - -: 3317: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3318: "Replaced by simple assignment 'Callback cb = func") - -: 3319: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { - -: 3320: this->~Callback(); - -: 3321: new (this) Callback(f); - -: 3322: } - -: 3323: - -: 3324: /** Attach a function object - -: 3325: * @param f Function object to attach - -: 3326: * @note The function object is limited to a single word of storage - -: 3327: * @deprecated - -: 3328: * Replaced by simple assignment 'Callback cb = func' - -: 3329: */ - -: 3330: template - -: 3331: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3332: "Replaced by simple assignment 'Callback cb = func") - -: 3333: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { - -: 3334: this->~Callback(); - -: 3335: new (this) Callback(f); - -: 3336: } - -: 3337: - -: 3338: /** Attach a static function with a bound pointer - -: 3339: * @param obj Pointer to object to bind to function - -: 3340: * @param func Static function to attach - -: 3341: * @deprecated - -: 3342: * Arguments to callback have been reordered to attach(func, arg) - -: 3343: */ - -: 3344: template - -: 3345: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3346: "Arguments to callback have been reordered to attach(func, arg)") - -: 3347: void attach(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 3348: this->~Callback(); - -: 3349: new (this) Callback(func, obj); - -: 3350: } - -: 3351: - -: 3352: /** Attach a static function with a bound pointer - -: 3353: * @param obj Pointer to object to bind to function - -: 3354: * @param func Static function to attach - -: 3355: * @deprecated - -: 3356: * Arguments to callback have been reordered to attach(func, arg) - -: 3357: */ - -: 3358: template - -: 3359: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3360: "Arguments to callback have been reordered to attach(func, arg)") - -: 3361: void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 3362: this->~Callback(); - -: 3363: new (this) Callback(func, obj); - -: 3364: } - -: 3365: - -: 3366: /** Attach a static function with a bound pointer - -: 3367: * @param obj Pointer to object to bind to function - -: 3368: * @param func Static function to attach - -: 3369: * @deprecated - -: 3370: * Arguments to callback have been reordered to attach(func, arg) - -: 3371: */ - -: 3372: template - -: 3373: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3374: "Arguments to callback have been reordered to attach(func, arg)") - -: 3375: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 3376: this->~Callback(); - -: 3377: new (this) Callback(func, obj); - -: 3378: } - -: 3379: - -: 3380: /** Attach a static function with a bound pointer - -: 3381: * @param obj Pointer to object to bind to function - -: 3382: * @param func Static function to attach - -: 3383: * @deprecated - -: 3384: * Arguments to callback have been reordered to attach(func, arg) - -: 3385: */ - -: 3386: template - -: 3387: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3388: "Arguments to callback have been reordered to attach(func, arg)") - -: 3389: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 3390: this->~Callback(); - -: 3391: new (this) Callback(func, obj); - -: 3392: } - -: 3393: - -: 3394: /** Assign a callback - -: 3395: */ - -: 3396: Callback &operator=(const Callback &that) { - -: 3397: if (this != &that) { - -: 3398: this->~Callback(); - -: 3399: new (this) Callback(that); - -: 3400: } - -: 3401: - -: 3402: return *this; - -: 3403: } - -: 3404: - -: 3405: /** Call the attached function - -: 3406: */ - -: 3407: R call(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3408: MBED_ASSERT(_ops); - -: 3409: return _ops->call(this, a0, a1, a2, a3, a4); - -: 3410: } - -: 3411: - -: 3412: /** Call the attached function - -: 3413: */ - -: 3414: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3415: return call(a0, a1, a2, a3, a4); - -: 3416: } - -: 3417: - -: 3418: /** Test if function has been attached - -: 3419: */ - -: 3420: operator bool() const { - -: 3421: return _ops; - -: 3422: } - -: 3423: - -: 3424: /** Test for equality - -: 3425: */ - -: 3426: friend bool operator==(const Callback &l, const Callback &r) { - -: 3427: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 3428: } - -: 3429: - -: 3430: /** Test for inequality - -: 3431: */ - -: 3432: friend bool operator!=(const Callback &l, const Callback &r) { - -: 3433: return !(l == r); - -: 3434: } - -: 3435: - -: 3436: /** Static thunk for passing as C-style function - -: 3437: * @param func Callback to call passed as void pointer - -: 3438: * @param a0 An argument to be called with function func - -: 3439: * @param a1 An argument to be called with function func - -: 3440: * @param a2 An argument to be called with function func - -: 3441: * @param a3 An argument to be called with function func - -: 3442: * @param a4 An argument to be called with function func - -: 3443: * @return the value as determined by func which is of - -: 3444: * type and determined by the signiture of func - -: 3445: */ - -: 3446: static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 3447: return static_cast(func)->call(a0, a1, a2, a3, a4); - -: 3448: } - -: 3449: - -: 3450:private: - -: 3451: // Stored as pointer to function and pointer to optional object - -: 3452: // Function pointer is stored as union of possible function types - -: 3453: // to garuntee proper size and alignment - -: 3454: struct _class; - -: 3455: union { - -: 3456: void (*_staticfunc)(A0, A1, A2, A3, A4); - -: 3457: void (*_boundfunc)(_class*, A0, A1, A2, A3, A4); - -: 3458: void (_class::*_methodfunc)(A0, A1, A2, A3, A4); - -: 3459: } _func; - -: 3460: void *_obj; - -: 3461: - -: 3462: // Dynamically dispatched operations - -: 3463: const struct ops { - -: 3464: R (*call)(const void*, A0, A1, A2, A3, A4); - -: 3465: void (*move)(void*, const void*); - -: 3466: void (*dtor)(void*); - -: 3467: } *_ops; - -: 3468: - -: 3469: // Generate operations for function object - -: 3470: template - -: 3471: void generate(const F &f) { - -: 3472: static const ops ops = { - -: 3473: &Callback::function_call, - -: 3474: &Callback::function_move, - -: 3475: &Callback::function_dtor, - -: 3476: }; - -: 3477: - -: 3478: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 3479: "Type F must not exceed the size of the Callback class"); - -: 3480: memset(this, 0, sizeof(Callback)); - -: 3481: new (this) F(f); - -: 3482: _ops = &ops; - -: 3483: } - -: 3484: - -: 3485: // Function attributes - -: 3486: template - -: 3487: static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 3488: return (*(F*)p)(a0, a1, a2, a3, a4); - -: 3489: } - -: 3490: - -: 3491: template - -: 3492: static void function_move(void *d, const void *p) { - -: 3493: new (d) F(*(F*)p); - -: 3494: } - -: 3495: - -: 3496: template - -: 3497: static void function_dtor(void *p) { - -: 3498: ((F*)p)->~F(); - -: 3499: } - -: 3500: - -: 3501: // Wrappers for functions with context - -: 3502: template - -: 3503: struct method_context { - -: 3504: M method; - -: 3505: O *obj; - -: 3506: - -: 3507: method_context(O *obj, M method) - -: 3508: : method(method), obj(obj) {} - -: 3509: - -: 3510: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3511: return (obj->*method)(a0, a1, a2, a3, a4); - -: 3512: } - -: 3513: }; - -: 3514: - -: 3515: template - -: 3516: struct function_context { - -: 3517: F func; - -: 3518: A *arg; - -: 3519: - -: 3520: function_context(F func, A *arg) - -: 3521: : func(func), arg(arg) {} - -: 3522: - -: 3523: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3524: return func(arg, a0, a1, a2, a3, a4); - -: 3525: } - -: 3526: }; - -: 3527:}; - -: 3528: - -: 3529:// Internally used event type - -: 3530:typedef Callback event_callback_t; - -: 3531: - -: 3532: - -: 3533:/** Create a callback class with type infered from the arguments - -: 3534: * - -: 3535: * @param func Static function to attach - -: 3536: * @return Callback with infered type - -: 3537: */ - -: 3538:template - -: 3539:Callback callback(R (*func)() = 0) { - -: 3540: return Callback(func); - -: 3541:} - -: 3542: - -: 3543:/** Create a callback class with type infered from the arguments - -: 3544: * - -: 3545: * @param func Static function to attach - -: 3546: * @return Callback with infered type - -: 3547: */ - -: 3548:template - -: 3549:Callback callback(const Callback &func) { - -: 3550: return Callback(func); - -: 3551:} - -: 3552: - -: 3553:/** Create a callback class with type infered from the arguments - -: 3554: * - -: 3555: * @param obj Optional pointer to object to bind to function - -: 3556: * @param method Member function to attach - -: 3557: * @return Callback with infered type - -: 3558: */ - -: 3559:template - -: 3560:Callback callback(U *obj, R (T::*method)()) { - -: 3561: return Callback(obj, method); - -: 3562:} - -: 3563: - -: 3564:/** Create a callback class with type infered from the arguments - -: 3565: * - -: 3566: * @param obj Optional pointer to object to bind to function - -: 3567: * @param method Member function to attach - -: 3568: * @return Callback with infered type - -: 3569: */ - -: 3570:template - -: 3571:Callback callback(const U *obj, R (T::*method)() const) { - -: 3572: return Callback(obj, method); - -: 3573:} - -: 3574: - -: 3575:/** Create a callback class with type infered from the arguments - -: 3576: * - -: 3577: * @param obj Optional pointer to object to bind to function - -: 3578: * @param method Member function to attach - -: 3579: * @return Callback with infered type - -: 3580: */ - -: 3581:template - -: 3582:Callback callback(volatile U *obj, R (T::*method)() volatile) { - -: 3583: return Callback(obj, method); - -: 3584:} - -: 3585: - -: 3586:/** Create a callback class with type infered from the arguments - -: 3587: * - -: 3588: * @param obj Optional pointer to object to bind to function - -: 3589: * @param method Member function to attach - -: 3590: * @return Callback with infered type - -: 3591: */ - -: 3592:template - -: 3593:Callback callback(const volatile U *obj, R (T::*method)() const volatile) { - -: 3594: return Callback(obj, method); - -: 3595:} - -: 3596: - -: 3597:/** Create a callback class with type infered from the arguments - -: 3598: * - -: 3599: * @param func Static function to attach - -: 3600: * @param arg Pointer argument to function - -: 3601: * @return Callback with infered type - -: 3602: */ - -: 3603:template - -: 3604:Callback callback(R (*func)(T*), U *arg) { - -: 3605: return Callback(func, arg); - -: 3606:} - -: 3607: - -: 3608:/** Create a callback class with type infered from the arguments - -: 3609: * - -: 3610: * @param func Static function to attach - -: 3611: * @param arg Pointer argument to function - -: 3612: * @return Callback with infered type - -: 3613: */ - -: 3614:template - -: 3615:Callback callback(R (*func)(const T*), const U *arg) { - -: 3616: return Callback(func, arg); - -: 3617:} - -: 3618: - -: 3619:/** Create a callback class with type infered from the arguments - -: 3620: * - -: 3621: * @param func Static function to attach - -: 3622: * @param arg Pointer argument to function - -: 3623: * @return Callback with infered type - -: 3624: */ - -: 3625:template - -: 3626:Callback callback(R (*func)(volatile T*), volatile U *arg) { - -: 3627: return Callback(func, arg); - -: 3628:} - -: 3629: - -: 3630:/** Create a callback class with type infered from the arguments - -: 3631: * - -: 3632: * @param func Static function to attach - -: 3633: * @param arg Pointer argument to function - -: 3634: * @return Callback with infered type - -: 3635: */ - -: 3636:template - -: 3637:Callback callback(R (*func)(const volatile T*), const volatile U *arg) { - -: 3638: return Callback(func, arg); - -: 3639:} - -: 3640: - -: 3641:/** Create a callback class with type infered from the arguments - -: 3642: * - -: 3643: * @param obj Optional pointer to object to bind to function - -: 3644: * @param func Static function to attach - -: 3645: * @return Callback with infered type - -: 3646: * @deprecated - -: 3647: * Arguments to callback have been reordered to callback(func, arg) - -: 3648: */ - -: 3649:template - -: 3650:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3651: "Arguments to callback have been reordered to callback(func, arg)") - -: 3652:Callback callback(U *obj, R (*func)(T*)) { - -: 3653: return Callback(func, obj); - -: 3654:} - -: 3655: - -: 3656:/** Create a callback class with type infered from the arguments - -: 3657: * - -: 3658: * @param obj Optional pointer to object to bind to function - -: 3659: * @param func Static function to attach - -: 3660: * @return Callback with infered type - -: 3661: * @deprecated - -: 3662: * Arguments to callback have been reordered to callback(func, arg) - -: 3663: */ - -: 3664:template - -: 3665:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3666: "Arguments to callback have been reordered to callback(func, arg)") - -: 3667:Callback callback(const U *obj, R (*func)(const T*)) { - -: 3668: return Callback(func, obj); - -: 3669:} - -: 3670: - -: 3671:/** Create a callback class with type infered from the arguments - -: 3672: * - -: 3673: * @param obj Optional pointer to object to bind to function - -: 3674: * @param func Static function to attach - -: 3675: * @return Callback with infered type - -: 3676: * @deprecated - -: 3677: * Arguments to callback have been reordered to callback(func, arg) - -: 3678: */ - -: 3679:template - -: 3680:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3681: "Arguments to callback have been reordered to callback(func, arg)") - -: 3682:Callback callback(volatile U *obj, R (*func)(volatile T*)) { - -: 3683: return Callback(func, obj); - -: 3684:} - -: 3685: - -: 3686:/** Create a callback class with type infered from the arguments - -: 3687: * - -: 3688: * @param obj Optional pointer to object to bind to function - -: 3689: * @param func Static function to attach - -: 3690: * @return Callback with infered type - -: 3691: * @deprecated - -: 3692: * Arguments to callback have been reordered to callback(func, arg) - -: 3693: */ - -: 3694:template - -: 3695:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3696: "Arguments to callback have been reordered to callback(func, arg)") - -: 3697:Callback callback(const volatile U *obj, R (*func)(const volatile T*)) { - -: 3698: return Callback(func, obj); - -: 3699:} - -: 3700: - -: 3701: - -: 3702:/** Create a callback class with type infered from the arguments - -: 3703: * - -: 3704: * @param func Static function to attach - -: 3705: * @return Callback with infered type - -: 3706: */ - -: 3707:template - -: 3708:Callback callback(R (*func)(A0) = 0) { - -: 3709: return Callback(func); - -: 3710:} - -: 3711: - -: 3712:/** Create a callback class with type infered from the arguments - -: 3713: * - -: 3714: * @param func Static function to attach - -: 3715: * @return Callback with infered type - -: 3716: */ - -: 3717:template - -: 3718:Callback callback(const Callback &func) { - -: 3719: return Callback(func); - -: 3720:} - -: 3721: - -: 3722:/** Create a callback class with type infered from the arguments - -: 3723: * - -: 3724: * @param obj Optional pointer to object to bind to function - -: 3725: * @param method Member function to attach - -: 3726: * @return Callback with infered type - -: 3727: */ - -: 3728:template - -: 3729:Callback callback(U *obj, R (T::*method)(A0)) { - -: 3730: return Callback(obj, method); - -: 3731:} - -: 3732: - -: 3733:/** Create a callback class with type infered from the arguments - -: 3734: * - -: 3735: * @param obj Optional pointer to object to bind to function - -: 3736: * @param method Member function to attach - -: 3737: * @return Callback with infered type - -: 3738: */ - -: 3739:template - -: 3740:Callback callback(const U *obj, R (T::*method)(A0) const) { - -: 3741: return Callback(obj, method); - -: 3742:} - -: 3743: - -: 3744:/** Create a callback class with type infered from the arguments - -: 3745: * - -: 3746: * @param obj Optional pointer to object to bind to function - -: 3747: * @param method Member function to attach - -: 3748: * @return Callback with infered type - -: 3749: */ - -: 3750:template - -: 3751:Callback callback(volatile U *obj, R (T::*method)(A0) volatile) { - -: 3752: return Callback(obj, method); - -: 3753:} - -: 3754: - -: 3755:/** Create a callback class with type infered from the arguments - -: 3756: * - -: 3757: * @param obj Optional pointer to object to bind to function - -: 3758: * @param method Member function to attach - -: 3759: * @return Callback with infered type - -: 3760: */ - -: 3761:template - -: 3762:Callback callback(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 3763: return Callback(obj, method); - -: 3764:} - -: 3765: - -: 3766:/** Create a callback class with type infered from the arguments - -: 3767: * - -: 3768: * @param func Static function to attach - -: 3769: * @param arg Pointer argument to function - -: 3770: * @return Callback with infered type - -: 3771: */ - -: 3772:template - -: 3773:Callback callback(R (*func)(T*, A0), U *arg) { - -: 3774: return Callback(func, arg); - -: 3775:} - -: 3776: - -: 3777:/** Create a callback class with type infered from the arguments - -: 3778: * - -: 3779: * @param func Static function to attach - -: 3780: * @param arg Pointer argument to function - -: 3781: * @return Callback with infered type - -: 3782: */ - -: 3783:template - -: 3784:Callback callback(R (*func)(const T*, A0), const U *arg) { - -: 3785: return Callback(func, arg); - -: 3786:} - -: 3787: - -: 3788:/** Create a callback class with type infered from the arguments - -: 3789: * - -: 3790: * @param func Static function to attach - -: 3791: * @param arg Pointer argument to function - -: 3792: * @return Callback with infered type - -: 3793: */ - -: 3794:template - -: 3795:Callback callback(R (*func)(volatile T*, A0), volatile U *arg) { - -: 3796: return Callback(func, arg); - -: 3797:} - -: 3798: - -: 3799:/** Create a callback class with type infered from the arguments - -: 3800: * - -: 3801: * @param func Static function to attach - -: 3802: * @param arg Pointer argument to function - -: 3803: * @return Callback with infered type - -: 3804: */ - -: 3805:template - -: 3806:Callback callback(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 3807: return Callback(func, arg); - -: 3808:} - -: 3809: - -: 3810:/** Create a callback class with type infered from the arguments - -: 3811: * - -: 3812: * @param obj Optional pointer to object to bind to function - -: 3813: * @param func Static function to attach - -: 3814: * @return Callback with infered type - -: 3815: * @deprecated - -: 3816: * Arguments to callback have been reordered to callback(func, arg) - -: 3817: */ - -: 3818:template - -: 3819:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3820: "Arguments to callback have been reordered to callback(func, arg)") - -: 3821:Callback callback(U *obj, R (*func)(T*, A0)) { - -: 3822: return Callback(func, obj); - -: 3823:} - -: 3824: - -: 3825:/** Create a callback class with type infered from the arguments - -: 3826: * - -: 3827: * @param obj Optional pointer to object to bind to function - -: 3828: * @param func Static function to attach - -: 3829: * @return Callback with infered type - -: 3830: * @deprecated - -: 3831: * Arguments to callback have been reordered to callback(func, arg) - -: 3832: */ - -: 3833:template - -: 3834:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3835: "Arguments to callback have been reordered to callback(func, arg)") - -: 3836:Callback callback(const U *obj, R (*func)(const T*, A0)) { - -: 3837: return Callback(func, obj); - -: 3838:} - -: 3839: - -: 3840:/** Create a callback class with type infered from the arguments - -: 3841: * - -: 3842: * @param obj Optional pointer to object to bind to function - -: 3843: * @param func Static function to attach - -: 3844: * @return Callback with infered type - -: 3845: * @deprecated - -: 3846: * Arguments to callback have been reordered to callback(func, arg) - -: 3847: */ - -: 3848:template - -: 3849:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3850: "Arguments to callback have been reordered to callback(func, arg)") - -: 3851:Callback callback(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 3852: return Callback(func, obj); - -: 3853:} - -: 3854: - -: 3855:/** Create a callback class with type infered from the arguments - -: 3856: * - -: 3857: * @param obj Optional pointer to object to bind to function - -: 3858: * @param func Static function to attach - -: 3859: * @return Callback with infered type - -: 3860: * @deprecated - -: 3861: * Arguments to callback have been reordered to callback(func, arg) - -: 3862: */ - -: 3863:template - -: 3864:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3865: "Arguments to callback have been reordered to callback(func, arg)") - -: 3866:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 3867: return Callback(func, obj); - -: 3868:} - -: 3869: - -: 3870: - -: 3871:/** Create a callback class with type infered from the arguments - -: 3872: * - -: 3873: * @param func Static function to attach - -: 3874: * @return Callback with infered type - -: 3875: */ - -: 3876:template - -: 3877:Callback callback(R (*func)(A0, A1) = 0) { - -: 3878: return Callback(func); - -: 3879:} - -: 3880: - -: 3881:/** Create a callback class with type infered from the arguments - -: 3882: * - -: 3883: * @param func Static function to attach - -: 3884: * @return Callback with infered type - -: 3885: */ - -: 3886:template - -: 3887:Callback callback(const Callback &func) { - -: 3888: return Callback(func); - -: 3889:} - -: 3890: - -: 3891:/** Create a callback class with type infered from the arguments - -: 3892: * - -: 3893: * @param obj Optional pointer to object to bind to function - -: 3894: * @param method Member function to attach - -: 3895: * @return Callback with infered type - -: 3896: */ - -: 3897:template - -: 3898:Callback callback(U *obj, R (T::*method)(A0, A1)) { - -: 3899: return Callback(obj, method); - -: 3900:} - -: 3901: - -: 3902:/** Create a callback class with type infered from the arguments - -: 3903: * - -: 3904: * @param obj Optional pointer to object to bind to function - -: 3905: * @param method Member function to attach - -: 3906: * @return Callback with infered type - -: 3907: */ - -: 3908:template - -: 3909:Callback callback(const U *obj, R (T::*method)(A0, A1) const) { - -: 3910: return Callback(obj, method); - -: 3911:} - -: 3912: - -: 3913:/** Create a callback class with type infered from the arguments - -: 3914: * - -: 3915: * @param obj Optional pointer to object to bind to function - -: 3916: * @param method Member function to attach - -: 3917: * @return Callback with infered type - -: 3918: */ - -: 3919:template - -: 3920:Callback callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 3921: return Callback(obj, method); - -: 3922:} - -: 3923: - -: 3924:/** Create a callback class with type infered from the arguments - -: 3925: * - -: 3926: * @param obj Optional pointer to object to bind to function - -: 3927: * @param method Member function to attach - -: 3928: * @return Callback with infered type - -: 3929: */ - -: 3930:template - -: 3931:Callback callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 3932: return Callback(obj, method); - -: 3933:} - -: 3934: - -: 3935:/** Create a callback class with type infered from the arguments - -: 3936: * - -: 3937: * @param func Static function to attach - -: 3938: * @param arg Pointer argument to function - -: 3939: * @return Callback with infered type - -: 3940: */ - -: 3941:template - -: 3942:Callback callback(R (*func)(T*, A0, A1), U *arg) { - -: 3943: return Callback(func, arg); - -: 3944:} - -: 3945: - -: 3946:/** Create a callback class with type infered from the arguments - -: 3947: * - -: 3948: * @param func Static function to attach - -: 3949: * @param arg Pointer argument to function - -: 3950: * @return Callback with infered type - -: 3951: */ - -: 3952:template - -: 3953:Callback callback(R (*func)(const T*, A0, A1), const U *arg) { - -: 3954: return Callback(func, arg); - -: 3955:} - -: 3956: - -: 3957:/** Create a callback class with type infered from the arguments - -: 3958: * - -: 3959: * @param func Static function to attach - -: 3960: * @param arg Pointer argument to function - -: 3961: * @return Callback with infered type - -: 3962: */ - -: 3963:template - -: 3964:Callback callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 3965: return Callback(func, arg); - -: 3966:} - -: 3967: - -: 3968:/** Create a callback class with type infered from the arguments - -: 3969: * - -: 3970: * @param func Static function to attach - -: 3971: * @param arg Pointer argument to function - -: 3972: * @return Callback with infered type - -: 3973: */ - -: 3974:template - -: 3975:Callback callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 3976: return Callback(func, arg); - -: 3977:} - -: 3978: - -: 3979:/** Create a callback class with type infered from the arguments - -: 3980: * - -: 3981: * @param obj Optional pointer to object to bind to function - -: 3982: * @param func Static function to attach - -: 3983: * @return Callback with infered type - -: 3984: * @deprecated - -: 3985: * Arguments to callback have been reordered to callback(func, arg) - -: 3986: */ - -: 3987:template - -: 3988:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3989: "Arguments to callback have been reordered to callback(func, arg)") - -: 3990:Callback callback(U *obj, R (*func)(T*, A0, A1)) { - -: 3991: return Callback(func, obj); - -: 3992:} - -: 3993: - -: 3994:/** Create a callback class with type infered from the arguments - -: 3995: * - -: 3996: * @param obj Optional pointer to object to bind to function - -: 3997: * @param func Static function to attach - -: 3998: * @return Callback with infered type - -: 3999: * @deprecated - -: 4000: * Arguments to callback have been reordered to callback(func, arg) - -: 4001: */ - -: 4002:template - -: 4003:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4004: "Arguments to callback have been reordered to callback(func, arg)") - -: 4005:Callback callback(const U *obj, R (*func)(const T*, A0, A1)) { - -: 4006: return Callback(func, obj); - -: 4007:} - -: 4008: - -: 4009:/** Create a callback class with type infered from the arguments - -: 4010: * - -: 4011: * @param obj Optional pointer to object to bind to function - -: 4012: * @param func Static function to attach - -: 4013: * @return Callback with infered type - -: 4014: * @deprecated - -: 4015: * Arguments to callback have been reordered to callback(func, arg) - -: 4016: */ - -: 4017:template - -: 4018:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4019: "Arguments to callback have been reordered to callback(func, arg)") - -: 4020:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 4021: return Callback(func, obj); - -: 4022:} - -: 4023: - -: 4024:/** Create a callback class with type infered from the arguments - -: 4025: * - -: 4026: * @param obj Optional pointer to object to bind to function - -: 4027: * @param func Static function to attach - -: 4028: * @return Callback with infered type - -: 4029: * @deprecated - -: 4030: * Arguments to callback have been reordered to callback(func, arg) - -: 4031: */ - -: 4032:template - -: 4033:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4034: "Arguments to callback have been reordered to callback(func, arg)") - -: 4035:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 4036: return Callback(func, obj); - -: 4037:} - -: 4038: - -: 4039: - -: 4040:/** Create a callback class with type infered from the arguments - -: 4041: * - -: 4042: * @param func Static function to attach - -: 4043: * @return Callback with infered type - -: 4044: */ - -: 4045:template - -: 4046:Callback callback(R (*func)(A0, A1, A2) = 0) { - -: 4047: return Callback(func); - -: 4048:} - -: 4049: - -: 4050:/** Create a callback class with type infered from the arguments - -: 4051: * - -: 4052: * @param func Static function to attach - -: 4053: * @return Callback with infered type - -: 4054: */ - -: 4055:template - -: 4056:Callback callback(const Callback &func) { - -: 4057: return Callback(func); - -: 4058:} - -: 4059: - -: 4060:/** Create a callback class with type infered from the arguments - -: 4061: * - -: 4062: * @param obj Optional pointer to object to bind to function - -: 4063: * @param method Member function to attach - -: 4064: * @return Callback with infered type - -: 4065: */ - -: 4066:template - -: 4067:Callback callback(U *obj, R (T::*method)(A0, A1, A2)) { - -: 4068: return Callback(obj, method); - -: 4069:} - -: 4070: - -: 4071:/** Create a callback class with type infered from the arguments - -: 4072: * - -: 4073: * @param obj Optional pointer to object to bind to function - -: 4074: * @param method Member function to attach - -: 4075: * @return Callback with infered type - -: 4076: */ - -: 4077:template - -: 4078:Callback callback(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 4079: return Callback(obj, method); - -: 4080:} - -: 4081: - -: 4082:/** Create a callback class with type infered from the arguments - -: 4083: * - -: 4084: * @param obj Optional pointer to object to bind to function - -: 4085: * @param method Member function to attach - -: 4086: * @return Callback with infered type - -: 4087: */ - -: 4088:template - -: 4089:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 4090: return Callback(obj, method); - -: 4091:} - -: 4092: - -: 4093:/** Create a callback class with type infered from the arguments - -: 4094: * - -: 4095: * @param obj Optional pointer to object to bind to function - -: 4096: * @param method Member function to attach - -: 4097: * @return Callback with infered type - -: 4098: */ - -: 4099:template - -: 4100:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 4101: return Callback(obj, method); - -: 4102:} - -: 4103: - -: 4104:/** Create a callback class with type infered from the arguments - -: 4105: * - -: 4106: * @param func Static function to attach - -: 4107: * @param arg Pointer argument to function - -: 4108: * @return Callback with infered type - -: 4109: */ - -: 4110:template - -: 4111:Callback callback(R (*func)(T*, A0, A1, A2), U *arg) { - -: 4112: return Callback(func, arg); - -: 4113:} - -: 4114: - -: 4115:/** Create a callback class with type infered from the arguments - -: 4116: * - -: 4117: * @param func Static function to attach - -: 4118: * @param arg Pointer argument to function - -: 4119: * @return Callback with infered type - -: 4120: */ - -: 4121:template - -: 4122:Callback callback(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 4123: return Callback(func, arg); - -: 4124:} - -: 4125: - -: 4126:/** Create a callback class with type infered from the arguments - -: 4127: * - -: 4128: * @param func Static function to attach - -: 4129: * @param arg Pointer argument to function - -: 4130: * @return Callback with infered type - -: 4131: */ - -: 4132:template - -: 4133:Callback callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 4134: return Callback(func, arg); - -: 4135:} - -: 4136: - -: 4137:/** Create a callback class with type infered from the arguments - -: 4138: * - -: 4139: * @param func Static function to attach - -: 4140: * @param arg Pointer argument to function - -: 4141: * @return Callback with infered type - -: 4142: */ - -: 4143:template - -: 4144:Callback callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 4145: return Callback(func, arg); - -: 4146:} - -: 4147: - -: 4148:/** Create a callback class with type infered from the arguments - -: 4149: * - -: 4150: * @param obj Optional pointer to object to bind to function - -: 4151: * @param func Static function to attach - -: 4152: * @return Callback with infered type - -: 4153: * @deprecated - -: 4154: * Arguments to callback have been reordered to callback(func, arg) - -: 4155: */ - -: 4156:template - -: 4157:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4158: "Arguments to callback have been reordered to callback(func, arg)") - -: 4159:Callback callback(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 4160: return Callback(func, obj); - -: 4161:} - -: 4162: - -: 4163:/** Create a callback class with type infered from the arguments - -: 4164: * - -: 4165: * @param obj Optional pointer to object to bind to function - -: 4166: * @param func Static function to attach - -: 4167: * @return Callback with infered type - -: 4168: * @deprecated - -: 4169: * Arguments to callback have been reordered to callback(func, arg) - -: 4170: */ - -: 4171:template - -: 4172:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4173: "Arguments to callback have been reordered to callback(func, arg)") - -: 4174:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 4175: return Callback(func, obj); - -: 4176:} - -: 4177: - -: 4178:/** Create a callback class with type infered from the arguments - -: 4179: * - -: 4180: * @param obj Optional pointer to object to bind to function - -: 4181: * @param func Static function to attach - -: 4182: * @return Callback with infered type - -: 4183: * @deprecated - -: 4184: * Arguments to callback have been reordered to callback(func, arg) - -: 4185: */ - -: 4186:template - -: 4187:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4188: "Arguments to callback have been reordered to callback(func, arg)") - -: 4189:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 4190: return Callback(func, obj); - -: 4191:} - -: 4192: - -: 4193:/** Create a callback class with type infered from the arguments - -: 4194: * - -: 4195: * @param obj Optional pointer to object to bind to function - -: 4196: * @param func Static function to attach - -: 4197: * @return Callback with infered type - -: 4198: * @deprecated - -: 4199: * Arguments to callback have been reordered to callback(func, arg) - -: 4200: */ - -: 4201:template - -: 4202:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4203: "Arguments to callback have been reordered to callback(func, arg)") - -: 4204:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 4205: return Callback(func, obj); - -: 4206:} - -: 4207: - -: 4208: - -: 4209:/** Create a callback class with type infered from the arguments - -: 4210: * - -: 4211: * @param func Static function to attach - -: 4212: * @return Callback with infered type - -: 4213: */ - -: 4214:template - -: 4215:Callback callback(R (*func)(A0, A1, A2, A3) = 0) { - -: 4216: return Callback(func); - -: 4217:} - -: 4218: - -: 4219:/** Create a callback class with type infered from the arguments - -: 4220: * - -: 4221: * @param func Static function to attach - -: 4222: * @return Callback with infered type - -: 4223: */ - -: 4224:template - -: 4225:Callback callback(const Callback &func) { - -: 4226: return Callback(func); - -: 4227:} - -: 4228: - -: 4229:/** Create a callback class with type infered from the arguments - -: 4230: * - -: 4231: * @param obj Optional pointer to object to bind to function - -: 4232: * @param method Member function to attach - -: 4233: * @return Callback with infered type - -: 4234: */ - -: 4235:template - -: 4236:Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 4237: return Callback(obj, method); - -: 4238:} - -: 4239: - -: 4240:/** Create a callback class with type infered from the arguments - -: 4241: * - -: 4242: * @param obj Optional pointer to object to bind to function - -: 4243: * @param method Member function to attach - -: 4244: * @return Callback with infered type - -: 4245: */ - -: 4246:template - -: 4247:Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 4248: return Callback(obj, method); - -: 4249:} - -: 4250: - -: 4251:/** Create a callback class with type infered from the arguments - -: 4252: * - -: 4253: * @param obj Optional pointer to object to bind to function - -: 4254: * @param method Member function to attach - -: 4255: * @return Callback with infered type - -: 4256: */ - -: 4257:template - -: 4258:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 4259: return Callback(obj, method); - -: 4260:} - -: 4261: - -: 4262:/** Create a callback class with type infered from the arguments - -: 4263: * - -: 4264: * @param obj Optional pointer to object to bind to function - -: 4265: * @param method Member function to attach - -: 4266: * @return Callback with infered type - -: 4267: */ - -: 4268:template - -: 4269:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 4270: return Callback(obj, method); - -: 4271:} - -: 4272: - -: 4273:/** Create a callback class with type infered from the arguments - -: 4274: * - -: 4275: * @param func Static function to attach - -: 4276: * @param arg Pointer argument to function - -: 4277: * @return Callback with infered type - -: 4278: */ - -: 4279:template - -: 4280:Callback callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 4281: return Callback(func, arg); - -: 4282:} - -: 4283: - -: 4284:/** Create a callback class with type infered from the arguments - -: 4285: * - -: 4286: * @param func Static function to attach - -: 4287: * @param arg Pointer argument to function - -: 4288: * @return Callback with infered type - -: 4289: */ - -: 4290:template - -: 4291:Callback callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 4292: return Callback(func, arg); - -: 4293:} - -: 4294: - -: 4295:/** Create a callback class with type infered from the arguments - -: 4296: * - -: 4297: * @param func Static function to attach - -: 4298: * @param arg Pointer argument to function - -: 4299: * @return Callback with infered type - -: 4300: */ - -: 4301:template - -: 4302:Callback callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 4303: return Callback(func, arg); - -: 4304:} - -: 4305: - -: 4306:/** Create a callback class with type infered from the arguments - -: 4307: * - -: 4308: * @param func Static function to attach - -: 4309: * @param arg Pointer argument to function - -: 4310: * @return Callback with infered type - -: 4311: */ - -: 4312:template - -: 4313:Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 4314: return Callback(func, arg); - -: 4315:} - -: 4316: - -: 4317:/** Create a callback class with type infered from the arguments - -: 4318: * - -: 4319: * @param obj Optional pointer to object to bind to function - -: 4320: * @param func Static function to attach - -: 4321: * @return Callback with infered type - -: 4322: * @deprecated - -: 4323: * Arguments to callback have been reordered to callback(func, arg) - -: 4324: */ - -: 4325:template - -: 4326:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4327: "Arguments to callback have been reordered to callback(func, arg)") - -: 4328:Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 4329: return Callback(func, obj); - -: 4330:} - -: 4331: - -: 4332:/** Create a callback class with type infered from the arguments - -: 4333: * - -: 4334: * @param obj Optional pointer to object to bind to function - -: 4335: * @param func Static function to attach - -: 4336: * @return Callback with infered type - -: 4337: * @deprecated - -: 4338: * Arguments to callback have been reordered to callback(func, arg) - -: 4339: */ - -: 4340:template - -: 4341:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4342: "Arguments to callback have been reordered to callback(func, arg)") - -: 4343:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 4344: return Callback(func, obj); - -: 4345:} - -: 4346: - -: 4347:/** Create a callback class with type infered from the arguments - -: 4348: * - -: 4349: * @param obj Optional pointer to object to bind to function - -: 4350: * @param func Static function to attach - -: 4351: * @return Callback with infered type - -: 4352: * @deprecated - -: 4353: * Arguments to callback have been reordered to callback(func, arg) - -: 4354: */ - -: 4355:template - -: 4356:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4357: "Arguments to callback have been reordered to callback(func, arg)") - -: 4358:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 4359: return Callback(func, obj); - -: 4360:} - -: 4361: - -: 4362:/** Create a callback class with type infered from the arguments - -: 4363: * - -: 4364: * @param obj Optional pointer to object to bind to function - -: 4365: * @param func Static function to attach - -: 4366: * @return Callback with infered type - -: 4367: * @deprecated - -: 4368: * Arguments to callback have been reordered to callback(func, arg) - -: 4369: */ - -: 4370:template - -: 4371:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4372: "Arguments to callback have been reordered to callback(func, arg)") - -: 4373:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 4374: return Callback(func, obj); - -: 4375:} - -: 4376: - -: 4377: - -: 4378:/** Create a callback class with type infered from the arguments - -: 4379: * - -: 4380: * @param func Static function to attach - -: 4381: * @return Callback with infered type - -: 4382: */ - -: 4383:template - -: 4384:Callback callback(R (*func)(A0, A1, A2, A3, A4) = 0) { - -: 4385: return Callback(func); - -: 4386:} - -: 4387: - -: 4388:/** Create a callback class with type infered from the arguments - -: 4389: * - -: 4390: * @param func Static function to attach - -: 4391: * @return Callback with infered type - -: 4392: */ - -: 4393:template - -: 4394:Callback callback(const Callback &func) { - -: 4395: return Callback(func); - -: 4396:} - -: 4397: - -: 4398:/** Create a callback class with type infered from the arguments - -: 4399: * - -: 4400: * @param obj Optional pointer to object to bind to function - -: 4401: * @param method Member function to attach - -: 4402: * @return Callback with infered type - -: 4403: */ - -: 4404:template - -: 4405:Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 4406: return Callback(obj, method); - -: 4407:} - -: 4408: - -: 4409:/** Create a callback class with type infered from the arguments - -: 4410: * - -: 4411: * @param obj Optional pointer to object to bind to function - -: 4412: * @param method Member function to attach - -: 4413: * @return Callback with infered type - -: 4414: */ - -: 4415:template - -: 4416:Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 4417: return Callback(obj, method); - -: 4418:} - -: 4419: - -: 4420:/** Create a callback class with type infered from the arguments - -: 4421: * - -: 4422: * @param obj Optional pointer to object to bind to function - -: 4423: * @param method Member function to attach - -: 4424: * @return Callback with infered type - -: 4425: */ - -: 4426:template - -: 4427:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 4428: return Callback(obj, method); - -: 4429:} - -: 4430: - -: 4431:/** Create a callback class with type infered from the arguments - -: 4432: * - -: 4433: * @param obj Optional pointer to object to bind to function - -: 4434: * @param method Member function to attach - -: 4435: * @return Callback with infered type - -: 4436: */ - -: 4437:template - -: 4438:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 4439: return Callback(obj, method); - -: 4440:} - -: 4441: - -: 4442:/** Create a callback class with type infered from the arguments - -: 4443: * - -: 4444: * @param func Static function to attach - -: 4445: * @param arg Pointer argument to function - -: 4446: * @return Callback with infered type - -: 4447: */ - -: 4448:template - -: 4449:Callback callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 4450: return Callback(func, arg); - -: 4451:} - -: 4452: - -: 4453:/** Create a callback class with type infered from the arguments - -: 4454: * - -: 4455: * @param func Static function to attach - -: 4456: * @param arg Pointer argument to function - -: 4457: * @return Callback with infered type - -: 4458: */ - -: 4459:template - -: 4460:Callback callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 4461: return Callback(func, arg); - -: 4462:} - -: 4463: - -: 4464:/** Create a callback class with type infered from the arguments - -: 4465: * - -: 4466: * @param func Static function to attach - -: 4467: * @param arg Pointer argument to function - -: 4468: * @return Callback with infered type - -: 4469: */ - -: 4470:template - -: 4471:Callback callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 4472: return Callback(func, arg); - -: 4473:} - -: 4474: - -: 4475:/** Create a callback class with type infered from the arguments - -: 4476: * - -: 4477: * @param func Static function to attach - -: 4478: * @param arg Pointer argument to function - -: 4479: * @return Callback with infered type - -: 4480: */ - -: 4481:template - -: 4482:Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 4483: return Callback(func, arg); - -: 4484:} - -: 4485: - -: 4486:/** Create a callback class with type infered from the arguments - -: 4487: * - -: 4488: * @param obj Optional pointer to object to bind to function - -: 4489: * @param func Static function to attach - -: 4490: * @return Callback with infered type - -: 4491: * @deprecated - -: 4492: * Arguments to callback have been reordered to callback(func, arg) - -: 4493: */ - -: 4494:template - -: 4495:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4496: "Arguments to callback have been reordered to callback(func, arg)") - -: 4497:Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 4498: return Callback(func, obj); - -: 4499:} - -: 4500: - -: 4501:/** Create a callback class with type infered from the arguments - -: 4502: * - -: 4503: * @param obj Optional pointer to object to bind to function - -: 4504: * @param func Static function to attach - -: 4505: * @return Callback with infered type - -: 4506: * @deprecated - -: 4507: * Arguments to callback have been reordered to callback(func, arg) - -: 4508: */ - -: 4509:template - -: 4510:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4511: "Arguments to callback have been reordered to callback(func, arg)") - -: 4512:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 4513: return Callback(func, obj); - -: 4514:} - -: 4515: - -: 4516:/** Create a callback class with type infered from the arguments - -: 4517: * - -: 4518: * @param obj Optional pointer to object to bind to function - -: 4519: * @param func Static function to attach - -: 4520: * @return Callback with infered type - -: 4521: * @deprecated - -: 4522: * Arguments to callback have been reordered to callback(func, arg) - -: 4523: */ - -: 4524:template - -: 4525:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4526: "Arguments to callback have been reordered to callback(func, arg)") - -: 4527:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 4528: return Callback(func, obj); - -: 4529:} - -: 4530: - -: 4531:/** Create a callback class with type infered from the arguments - -: 4532: * - -: 4533: * @param obj Optional pointer to object to bind to function - -: 4534: * @param func Static function to attach - -: 4535: * @return Callback with infered type - -: 4536: * @deprecated - -: 4537: * Arguments to callback have been reordered to callback(func, arg) - -: 4538: */ - -: 4539:template - -: 4540:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4541: "Arguments to callback have been reordered to callback(func, arg)") - -: 4542:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 4543: return Callback(func, obj); - -: 4544:} - -: 4545: - -: 4546:/**@}*/ - -: 4547: - -: 4548:/**@}*/ - -: 4549: - -: 4550:} // namespace mbed - -: 4551: - -: 4552:#endif diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/EventQueue.h.gcov b/features/cellular/UNITTESTS/at/athandler/gcov/EventQueue.h.gcov deleted file mode 100644 index 450b086497..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/EventQueue.h.gcov +++ /dev/null @@ -1,2739 +0,0 @@ - -: 0:Source:../../../../../events/EventQueue.h - -: 0:Graph:objs/ATHandler_unit/ATHandler.gcno - -: 0:Data:objs/ATHandler_unit/ATHandler.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* events - -: 2: * Copyright (c) 2016 ARM Limited - -: 3: * - -: 4: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 5: * you may not use this file except in compliance with the License. - -: 6: * You may obtain a copy of the License at - -: 7: * - -: 8: * http://www.apache.org/licenses/LICENSE-2.0 - -: 9: * - -: 10: * Unless required by applicable law or agreed to in writing, software - -: 11: * distributed under the License is distributed on an "AS IS" BASIS, - -: 12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 13: * See the License for the specific language governing permissions and - -: 14: * limitations under the License. - -: 15: */ - -: 16: - -: 17:#ifndef EVENT_QUEUE_H - -: 18:#define EVENT_QUEUE_H - -: 19: - -: 20:#include "equeue/equeue.h" - -: 21:#include "platform/Callback.h" - -: 22:#include "platform/NonCopyable.h" - -: 23:#include - -: 24:#include - -: 25: - -: 26:namespace events { - -: 27:/** \addtogroup events */ - -: 28: - -: 29:/** EVENTS_EVENT_SIZE - -: 30: * Minimum size of an event - -: 31: * This size fits a Callback at minimum - -: 32: */ - -: 33:#define EVENTS_EVENT_SIZE \ - -: 34: (EQUEUE_EVENT_SIZE - 2*sizeof(void*) + sizeof(mbed::Callback)) - -: 35: - -: 36:/** EVENTS_QUEUE_SIZE - -: 37: * Default size of buffer for events - -: 38: */ - -: 39:#define EVENTS_QUEUE_SIZE (32*EVENTS_EVENT_SIZE) - -: 40: - -: 41:// Predeclared classes - -: 42:template - -: 43:class Event; - -: 44: - -: 45: - -: 46:/** EventQueue - -: 47: * - -: 48: * Flexible event queue for dispatching events - -: 49: * @ingroup events - -: 50: */ - -: 51:class EventQueue : private mbed::NonCopyable { - -: 52:public: - -: 53: /** Create an EventQueue - -: 54: * - -: 55: * Create an event queue. The event queue either allocates a buffer of - -: 56: * the specified size with malloc or uses the user provided buffer. - -: 57: * - -: 58: * @param size Size of buffer to use for events in bytes - -: 59: * (default to EVENTS_QUEUE_SIZE) - -: 60: * @param buffer Pointer to buffer to use for events - -: 61: * (default to NULL) - -: 62: */ - -: 63: EventQueue(unsigned size=EVENTS_QUEUE_SIZE, unsigned char *buffer=NULL); - -: 64: - -: 65: /** Destroy an EventQueue - -: 66: */ - -: 67: ~EventQueue(); - -: 68: - -: 69: /** Dispatch events - -: 70: * - -: 71: * Executes events until the specified milliseconds have passed. - -: 72: * If ms is negative, the dispatch function will dispatch events - -: 73: * indefinitely or until break_dispatch is called on this queue. - -: 74: * - -: 75: * When called with a finite timeout, the dispatch function is guaranteed - -: 76: * to terminate. When called with a timeout of 0, the dispatch function - -: 77: * does not wait and is irq safe. - -: 78: * - -: 79: * @param ms Time to wait for events in milliseconds, a negative - -: 80: * value will dispatch events indefinitely - -: 81: * (default to -1) - -: 82: */ - -: 83: void dispatch(int ms=-1); - -: 84: - -: 85: /** Dispatch events without a timeout - -: 86: * - -: 87: * This is equivalent to EventQueue::dispatch with no arguments, but - -: 88: * avoids overload ambiguities when passed as a callback. - -: 89: * - -: 90: * @see EventQueue::dispatch - -: 91: */ - -: 92: void dispatch_forever() { dispatch(); } - -: 93: - -: 94: /** Break out of a running event loop - -: 95: * - -: 96: * Forces the specified event queue's dispatch loop to terminate. Pending - -: 97: * events may finish executing, but no new events will be executed. - -: 98: */ - -: 99: void break_dispatch(); - -: 100: - -: 101: /** Millisecond counter - -: 102: * - -: 103: * Returns the underlying tick of the event queue represented as the - -: 104: * number of milliseconds that have passed since an arbitrary point in - -: 105: * time. Intentionally overflows to 0 after 2^32-1. - -: 106: * - -: 107: * @return The underlying tick of the event queue in milliseconds - -: 108: */ - -: 109: unsigned tick(); - -: 110: - -: 111: /** Cancel an in-flight event - -: 112: * - -: 113: * Attempts to cancel an event referenced by the unique id returned from - -: 114: * one of the call functions. It is safe to call cancel after an event - -: 115: * has already been dispatched. - -: 116: * - -: 117: * The cancel function is irq safe. - -: 118: * - -: 119: * If called while the event queue's dispatch loop is active, the cancel - -: 120: * function does not garuntee that the event will not execute after it - -: 121: * returns, as the event may have already begun executing. - -: 122: * - -: 123: * @param id Unique id of the event - -: 124: */ - -: 125: void cancel(int id); - -: 126: - -: 127: /** Background an event queue onto a single-shot timer-interrupt - -: 128: * - -: 129: * When updated, the event queue will call the provided update function - -: 130: * with a timeout indicating when the queue should be dispatched. A - -: 131: * negative timeout will be passed to the update function when the - -: 132: * timer-interrupt is no longer needed. - -: 133: * - -: 134: * Passing a null function disables the existing update function. - -: 135: * - -: 136: * The background function allows an event queue to take advantage of - -: 137: * hardware timers or other event loops, allowing an event queue to be - -: 138: * ran in the background without consuming the foreground thread. - -: 139: * - -: 140: * @param update Function called to indicate when the queue should be - -: 141: * dispatched - -: 142: */ - -: 143: void background(mbed::Callback update); - -: 144: - -: 145: /** Chain an event queue onto another event queue - -: 146: * - -: 147: * After chaining a queue to a target, calling dispatch on the target - -: 148: * queue will also dispatch events from this queue. The queues use - -: 149: * their own buffers and events must be handled independently. - -: 150: * - -: 151: * A null queue as the target will unchain the existing queue. - -: 152: * - -: 153: * The chain function allows multiple event queues to be composed, - -: 154: * sharing the context of a dispatch loop while still being managed - -: 155: * independently - -: 156: * - -: 157: * @param target Queue that will dispatch this queue's events as a - -: 158: * part of its dispatch loop - -: 159: */ - -: 160: void chain(EventQueue *target); - -: 161: - -: 162: /** Calls an event on the queue - -: 163: * - -: 164: * The specified callback will be executed in the context of the event - -: 165: * queue's dispatch loop. - -: 166: * - -: 167: * The call function is irq safe and can act as a mechanism for moving - -: 168: * events out of irq contexts. - -: 169: * - -: 170: * @param f Function to execute in the context of the dispatch loop - -: 171: * @return A unique id that represents the posted event and can - -: 172: * be passed to cancel, or an id of 0 if there is not - -: 173: * enough memory to allocate the event. - -: 174: */ - -: 175: template - 39: 176: int call(F f) { - 39: 177: void *p = equeue_alloc(&_equeue, sizeof(F)); - 39: 178: if (!p) { - 39: 179: return 0; - -: 180: } - -: 181: - #####: 182: F *e = new (p) F(f); - #####: 183: equeue_event_dtor(e, &EventQueue::function_dtor); - #####: 184: return equeue_post(&_equeue, &EventQueue::function_call, e); - -: 185: } - -: 186: - -: 187: /** Calls an event on the queue - -: 188: * @see EventQueue::call - -: 189: * @param f Function to execute in the context of the dispatch loop - -: 190: * @param a0 Argument to pass to the callback - -: 191: */ - -: 192: template - -: 193: int call(F f, A0 a0) { - -: 194: return call(context10(f, a0)); - -: 195: } - -: 196: - -: 197: /** Calls an event on the queue - -: 198: * @see EventQueue::call - -: 199: * @param f Function to execute in the context of the dispatch loop - -: 200: * @param a0,a1 Arguments to pass to the callback - -: 201: */ - -: 202: template - -: 203: int call(F f, A0 a0, A1 a1) { - -: 204: return call(context20(f, a0, a1)); - -: 205: } - -: 206: - -: 207: /** Calls an event on the queue - -: 208: * @see EventQueue::call - -: 209: * @param f Function to execute in the context of the dispatch loop - -: 210: * @param a0,a1,a2 Arguments to pass to the callback - -: 211: */ - -: 212: template - -: 213: int call(F f, A0 a0, A1 a1, A2 a2) { - -: 214: return call(context30(f, a0, a1, a2)); - -: 215: } - -: 216: - -: 217: /** Calls an event on the queue - -: 218: * @see EventQueue::call - -: 219: * @param f Function to execute in the context of the dispatch loop - -: 220: * @param a0,a1,a2,a3 Arguments to pass to the callback - -: 221: */ - -: 222: template - -: 223: int call(F f, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 224: return call(context40(f, a0, a1, a2, a3)); - -: 225: } - -: 226: - -: 227: /** Calls an event on the queue - -: 228: * @see EventQueue::call - -: 229: * @param f Function to execute in the context of the dispatch loop - -: 230: * @param a0,a1,a2,a3,a4 Arguments to pass to the callback - -: 231: */ - -: 232: template - -: 233: int call(F f, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 234: return call(context50(f, a0, a1, a2, a3, a4)); - -: 235: } - -: 236: - -: 237: /** Calls an event on the queue - -: 238: * @see EventQueue::call - -: 239: */ - -: 240: template - -: 241: int call(T *obj, R (T::*method)()) { - -: 242: return call(mbed::callback(obj, method)); - -: 243: } - -: 244: - -: 245: /** Calls an event on the queue - -: 246: * @see EventQueue::call - -: 247: */ - -: 248: template - -: 249: int call(const T *obj, R (T::*method)() const) { - -: 250: return call(mbed::callback(obj, method)); - -: 251: } - -: 252: - -: 253: /** Calls an event on the queue - -: 254: * @see EventQueue::call - -: 255: */ - -: 256: template - -: 257: int call(volatile T *obj, R (T::*method)() volatile) { - -: 258: return call(mbed::callback(obj, method)); - -: 259: } - -: 260: - -: 261: /** Calls an event on the queue - -: 262: * @see EventQueue::call - -: 263: */ - -: 264: template - -: 265: int call(const volatile T *obj, R (T::*method)() const volatile) { - -: 266: return call(mbed::callback(obj, method)); - -: 267: } - -: 268: - -: 269: /** Calls an event on the queue - -: 270: * @see EventQueue::call - -: 271: */ - -: 272: template - -: 273: int call(T *obj, R (T::*method)(A0), A0 a0) { - -: 274: return call(mbed::callback(obj, method), a0); - -: 275: } - -: 276: - -: 277: /** Calls an event on the queue - -: 278: * @see EventQueue::call - -: 279: */ - -: 280: template - -: 281: int call(const T *obj, R (T::*method)(A0) const, A0 a0) { - -: 282: return call(mbed::callback(obj, method), a0); - -: 283: } - -: 284: - -: 285: /** Calls an event on the queue - -: 286: * @see EventQueue::call - -: 287: */ - -: 288: template - -: 289: int call(volatile T *obj, R (T::*method)(A0) volatile, A0 a0) { - -: 290: return call(mbed::callback(obj, method), a0); - -: 291: } - -: 292: - -: 293: /** Calls an event on the queue - -: 294: * @see EventQueue::call - -: 295: */ - -: 296: template - -: 297: int call(const volatile T *obj, R (T::*method)(A0) const volatile, A0 a0) { - -: 298: return call(mbed::callback(obj, method), a0); - -: 299: } - -: 300: - -: 301: /** Calls an event on the queue - -: 302: * @see EventQueue::call - -: 303: */ - -: 304: template - -: 305: int call(T *obj, R (T::*method)(A0, A1), A0 a0, A1 a1) { - -: 306: return call(mbed::callback(obj, method), a0, a1); - -: 307: } - -: 308: - -: 309: /** Calls an event on the queue - -: 310: * @see EventQueue::call - -: 311: */ - -: 312: template - -: 313: int call(const T *obj, R (T::*method)(A0, A1) const, A0 a0, A1 a1) { - -: 314: return call(mbed::callback(obj, method), a0, a1); - -: 315: } - -: 316: - -: 317: /** Calls an event on the queue - -: 318: * @see EventQueue::call - -: 319: */ - -: 320: template - -: 321: int call(volatile T *obj, R (T::*method)(A0, A1) volatile, A0 a0, A1 a1) { - -: 322: return call(mbed::callback(obj, method), a0, a1); - -: 323: } - -: 324: - -: 325: /** Calls an event on the queue - -: 326: * @see EventQueue::call - -: 327: */ - -: 328: template - -: 329: int call(const volatile T *obj, R (T::*method)(A0, A1) const volatile, A0 a0, A1 a1) { - -: 330: return call(mbed::callback(obj, method), a0, a1); - -: 331: } - -: 332: - -: 333: /** Calls an event on the queue - -: 334: * @see EventQueue::call - -: 335: */ - -: 336: template - -: 337: int call(T *obj, R (T::*method)(A0, A1, A2), A0 a0, A1 a1, A2 a2) { - -: 338: return call(mbed::callback(obj, method), a0, a1, a2); - -: 339: } - -: 340: - -: 341: /** Calls an event on the queue - -: 342: * @see EventQueue::call - -: 343: */ - -: 344: template - -: 345: int call(const T *obj, R (T::*method)(A0, A1, A2) const, A0 a0, A1 a1, A2 a2) { - -: 346: return call(mbed::callback(obj, method), a0, a1, a2); - -: 347: } - -: 348: - -: 349: /** Calls an event on the queue - -: 350: * @see EventQueue::call - -: 351: */ - -: 352: template - -: 353: int call(volatile T *obj, R (T::*method)(A0, A1, A2) volatile, A0 a0, A1 a1, A2 a2) { - -: 354: return call(mbed::callback(obj, method), a0, a1, a2); - -: 355: } - -: 356: - -: 357: /** Calls an event on the queue - -: 358: * @see EventQueue::call - -: 359: */ - -: 360: template - -: 361: int call(const volatile T *obj, R (T::*method)(A0, A1, A2) const volatile, A0 a0, A1 a1, A2 a2) { - -: 362: return call(mbed::callback(obj, method), a0, a1, a2); - -: 363: } - -: 364: - -: 365: /** Calls an event on the queue - -: 366: * @see EventQueue::call - -: 367: */ - -: 368: template - -: 369: int call(T *obj, R (T::*method)(A0, A1, A2, A3), A0 a0, A1 a1, A2 a2, A3 a3) { - -: 370: return call(mbed::callback(obj, method), a0, a1, a2, a3); - -: 371: } - -: 372: - -: 373: /** Calls an event on the queue - -: 374: * @see EventQueue::call - -: 375: */ - -: 376: template - -: 377: int call(const T *obj, R (T::*method)(A0, A1, A2, A3) const, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 378: return call(mbed::callback(obj, method), a0, a1, a2, a3); - -: 379: } - -: 380: - -: 381: /** Calls an event on the queue - -: 382: * @see EventQueue::call - -: 383: */ - -: 384: template - -: 385: int call(volatile T *obj, R (T::*method)(A0, A1, A2, A3) volatile, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 386: return call(mbed::callback(obj, method), a0, a1, a2, a3); - -: 387: } - -: 388: - -: 389: /** Calls an event on the queue - -: 390: * @see EventQueue::call - -: 391: */ - -: 392: template - -: 393: int call(const volatile T *obj, R (T::*method)(A0, A1, A2, A3) const volatile, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 394: return call(mbed::callback(obj, method), a0, a1, a2, a3); - -: 395: } - -: 396: - -: 397: /** Calls an event on the queue - -: 398: * @see EventQueue::call - -: 399: */ - -: 400: template - -: 401: int call(T *obj, R (T::*method)(A0, A1, A2, A3, A4), A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 402: return call(mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 403: } - -: 404: - -: 405: /** Calls an event on the queue - -: 406: * @see EventQueue::call - -: 407: */ - -: 408: template - -: 409: int call(const T *obj, R (T::*method)(A0, A1, A2, A3, A4) const, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 410: return call(mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 411: } - -: 412: - -: 413: /** Calls an event on the queue - -: 414: * @see EventQueue::call - -: 415: */ - -: 416: template - -: 417: int call(volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 418: return call(mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 419: } - -: 420: - -: 421: /** Calls an event on the queue - -: 422: * @see EventQueue::call - -: 423: */ - -: 424: template - -: 425: int call(const volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 426: return call(mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 427: } - -: 428: - -: 429: /** Calls an event on the queue after a specified delay - -: 430: * - -: 431: * The specified callback will be executed in the context of the event - -: 432: * queue's dispatch loop. - -: 433: * - -: 434: * The call_in function is irq safe and can act as a mechanism for moving - -: 435: * events out of irq contexts. - -: 436: * - -: 437: * @param f Function to execute in the context of the dispatch loop - -: 438: * @param ms Time to delay in milliseconds - -: 439: * @return A unique id that represents the posted event and can - -: 440: * be passed to cancel, or an id of 0 if there is not - -: 441: * enough memory to allocate the event. - -: 442: */ - -: 443: template - -: 444: int call_in(int ms, F f) { - -: 445: void *p = equeue_alloc(&_equeue, sizeof(F)); - -: 446: if (!p) { - -: 447: return 0; - -: 448: } - -: 449: - -: 450: F *e = new (p) F(f); - -: 451: equeue_event_delay(e, ms); - -: 452: equeue_event_dtor(e, &EventQueue::function_dtor); - -: 453: return equeue_post(&_equeue, &EventQueue::function_call, e); - -: 454: } - -: 455: - -: 456: /** Calls an event on the queue after a specified delay - -: 457: * @see EventQueue::call_in - -: 458: * @param ms Time to delay in milliseconds - -: 459: * @param f Function to execute in the context of the dispatch loop - -: 460: * @param a0 Argument to pass to the callback - -: 461: */ - -: 462: template - -: 463: int call_in(int ms, F f, A0 a0) { - -: 464: return call_in(ms, context10(f, a0)); - -: 465: } - -: 466: - -: 467: /** Calls an event on the queue after a specified delay - -: 468: * @see EventQueue::call_in - -: 469: * @param ms Time to delay in milliseconds - -: 470: * @param f Function to execute in the context of the dispatch loop - -: 471: * @param a0,a1 Arguments to pass to the callback - -: 472: */ - -: 473: template - -: 474: int call_in(int ms, F f, A0 a0, A1 a1) { - -: 475: return call_in(ms, context20(f, a0, a1)); - -: 476: } - -: 477: - -: 478: /** Calls an event on the queue after a specified delay - -: 479: * @see EventQueue::call_in - -: 480: * @param ms Time to delay in milliseconds - -: 481: * @param f Function to execute in the context of the dispatch loop - -: 482: * @param a0,a1,a2 Arguments to pass to the callback - -: 483: */ - -: 484: template - -: 485: int call_in(int ms, F f, A0 a0, A1 a1, A2 a2) { - -: 486: return call_in(ms, context30(f, a0, a1, a2)); - -: 487: } - -: 488: - -: 489: /** Calls an event on the queue after a specified delay - -: 490: * @see EventQueue::call_in - -: 491: * @param ms Time to delay in milliseconds - -: 492: * @param f Function to execute in the context of the dispatch loop - -: 493: * @param a0,a1,a2,a3 Arguments to pass to the callback - -: 494: */ - -: 495: template - -: 496: int call_in(int ms, F f, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 497: return call_in(ms, context40(f, a0, a1, a2, a3)); - -: 498: } - -: 499: - -: 500: /** Calls an event on the queue after a specified delay - -: 501: * @see EventQueue::call_in - -: 502: * @param ms Time to delay in milliseconds - -: 503: * @param f Function to execute in the context of the dispatch loop - -: 504: * @param a0,a1,a2,a3,a4 Arguments to pass to the callback - -: 505: */ - -: 506: template - -: 507: int call_in(int ms, F f, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 508: return call_in(ms, context50(f, a0, a1, a2, a3, a4)); - -: 509: } - -: 510: - -: 511: /** Calls an event on the queue after a specified delay - -: 512: * @see EventQueue::call_in - -: 513: */ - -: 514: template - -: 515: int call_in(int ms, T *obj, R (T::*method)()) { - -: 516: return call_in(ms, mbed::callback(obj, method)); - -: 517: } - -: 518: - -: 519: /** Calls an event on the queue after a specified delay - -: 520: * @see EventQueue::call_in - -: 521: */ - -: 522: template - -: 523: int call_in(int ms, const T *obj, R (T::*method)() const) { - -: 524: return call_in(ms, mbed::callback(obj, method)); - -: 525: } - -: 526: - -: 527: /** Calls an event on the queue after a specified delay - -: 528: * @see EventQueue::call_in - -: 529: */ - -: 530: template - -: 531: int call_in(int ms, volatile T *obj, R (T::*method)() volatile) { - -: 532: return call_in(ms, mbed::callback(obj, method)); - -: 533: } - -: 534: - -: 535: /** Calls an event on the queue after a specified delay - -: 536: * @see EventQueue::call_in - -: 537: */ - -: 538: template - -: 539: int call_in(int ms, const volatile T *obj, R (T::*method)() const volatile) { - -: 540: return call_in(ms, mbed::callback(obj, method)); - -: 541: } - -: 542: - -: 543: /** Calls an event on the queue after a specified delay - -: 544: * @see EventQueue::call_in - -: 545: */ - -: 546: template - -: 547: int call_in(int ms, T *obj, R (T::*method)(A0), A0 a0) { - -: 548: return call_in(ms, mbed::callback(obj, method), a0); - -: 549: } - -: 550: - -: 551: /** Calls an event on the queue after a specified delay - -: 552: * @see EventQueue::call_in - -: 553: */ - -: 554: template - -: 555: int call_in(int ms, const T *obj, R (T::*method)(A0) const, A0 a0) { - -: 556: return call_in(ms, mbed::callback(obj, method), a0); - -: 557: } - -: 558: - -: 559: /** Calls an event on the queue after a specified delay - -: 560: * @see EventQueue::call_in - -: 561: */ - -: 562: template - -: 563: int call_in(int ms, volatile T *obj, R (T::*method)(A0) volatile, A0 a0) { - -: 564: return call_in(ms, mbed::callback(obj, method), a0); - -: 565: } - -: 566: - -: 567: /** Calls an event on the queue after a specified delay - -: 568: * @see EventQueue::call_in - -: 569: */ - -: 570: template - -: 571: int call_in(int ms, const volatile T *obj, R (T::*method)(A0) const volatile, A0 a0) { - -: 572: return call_in(ms, mbed::callback(obj, method), a0); - -: 573: } - -: 574: - -: 575: /** Calls an event on the queue after a specified delay - -: 576: * @see EventQueue::call_in - -: 577: */ - -: 578: template - -: 579: int call_in(int ms, T *obj, R (T::*method)(A0, A1), A0 a0, A1 a1) { - -: 580: return call_in(ms, mbed::callback(obj, method), a0, a1); - -: 581: } - -: 582: - -: 583: /** Calls an event on the queue after a specified delay - -: 584: * @see EventQueue::call_in - -: 585: */ - -: 586: template - -: 587: int call_in(int ms, const T *obj, R (T::*method)(A0, A1) const, A0 a0, A1 a1) { - -: 588: return call_in(ms, mbed::callback(obj, method), a0, a1); - -: 589: } - -: 590: - -: 591: /** Calls an event on the queue after a specified delay - -: 592: * @see EventQueue::call_in - -: 593: */ - -: 594: template - -: 595: int call_in(int ms, volatile T *obj, R (T::*method)(A0, A1) volatile, A0 a0, A1 a1) { - -: 596: return call_in(ms, mbed::callback(obj, method), a0, a1); - -: 597: } - -: 598: - -: 599: /** Calls an event on the queue after a specified delay - -: 600: * @see EventQueue::call_in - -: 601: */ - -: 602: template - -: 603: int call_in(int ms, const volatile T *obj, R (T::*method)(A0, A1) const volatile, A0 a0, A1 a1) { - -: 604: return call_in(ms, mbed::callback(obj, method), a0, a1); - -: 605: } - -: 606: - -: 607: /** Calls an event on the queue after a specified delay - -: 608: * @see EventQueue::call_in - -: 609: */ - -: 610: template - -: 611: int call_in(int ms, T *obj, R (T::*method)(A0, A1, A2), A0 a0, A1 a1, A2 a2) { - -: 612: return call_in(ms, mbed::callback(obj, method), a0, a1, a2); - -: 613: } - -: 614: - -: 615: /** Calls an event on the queue after a specified delay - -: 616: * @see EventQueue::call_in - -: 617: */ - -: 618: template - -: 619: int call_in(int ms, const T *obj, R (T::*method)(A0, A1, A2) const, A0 a0, A1 a1, A2 a2) { - -: 620: return call_in(ms, mbed::callback(obj, method), a0, a1, a2); - -: 621: } - -: 622: - -: 623: /** Calls an event on the queue after a specified delay - -: 624: * @see EventQueue::call_in - -: 625: */ - -: 626: template - -: 627: int call_in(int ms, volatile T *obj, R (T::*method)(A0, A1, A2) volatile, A0 a0, A1 a1, A2 a2) { - -: 628: return call_in(ms, mbed::callback(obj, method), a0, a1, a2); - -: 629: } - -: 630: - -: 631: /** Calls an event on the queue after a specified delay - -: 632: * @see EventQueue::call_in - -: 633: */ - -: 634: template - -: 635: int call_in(int ms, const volatile T *obj, R (T::*method)(A0, A1, A2) const volatile, A0 a0, A1 a1, A2 a2) { - -: 636: return call_in(ms, mbed::callback(obj, method), a0, a1, a2); - -: 637: } - -: 638: - -: 639: /** Calls an event on the queue after a specified delay - -: 640: * @see EventQueue::call_in - -: 641: */ - -: 642: template - -: 643: int call_in(int ms, T *obj, R (T::*method)(A0, A1, A2, A3), A0 a0, A1 a1, A2 a2, A3 a3) { - -: 644: return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3); - -: 645: } - -: 646: - -: 647: /** Calls an event on the queue after a specified delay - -: 648: * @see EventQueue::call_in - -: 649: */ - -: 650: template - -: 651: int call_in(int ms, const T *obj, R (T::*method)(A0, A1, A2, A3) const, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 652: return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3); - -: 653: } - -: 654: - -: 655: /** Calls an event on the queue after a specified delay - -: 656: * @see EventQueue::call_in - -: 657: */ - -: 658: template - -: 659: int call_in(int ms, volatile T *obj, R (T::*method)(A0, A1, A2, A3) volatile, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 660: return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3); - -: 661: } - -: 662: - -: 663: /** Calls an event on the queue after a specified delay - -: 664: * @see EventQueue::call_in - -: 665: */ - -: 666: template - -: 667: int call_in(int ms, const volatile T *obj, R (T::*method)(A0, A1, A2, A3) const volatile, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 668: return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3); - -: 669: } - -: 670: - -: 671: /** Calls an event on the queue after a specified delay - -: 672: * @see EventQueue::call_in - -: 673: */ - -: 674: template - -: 675: int call_in(int ms, T *obj, R (T::*method)(A0, A1, A2, A3, A4), A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 676: return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 677: } - -: 678: - -: 679: /** Calls an event on the queue after a specified delay - -: 680: * @see EventQueue::call_in - -: 681: */ - -: 682: template - -: 683: int call_in(int ms, const T *obj, R (T::*method)(A0, A1, A2, A3, A4) const, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 684: return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 685: } - -: 686: - -: 687: /** Calls an event on the queue after a specified delay - -: 688: * @see EventQueue::call_in - -: 689: */ - -: 690: template - -: 691: int call_in(int ms, volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 692: return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 693: } - -: 694: - -: 695: /** Calls an event on the queue after a specified delay - -: 696: * @see EventQueue::call_in - -: 697: */ - -: 698: template - -: 699: int call_in(int ms, const volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 700: return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 701: } - -: 702: - -: 703: /** Calls an event on the queue periodically - -: 704: * - -: 705: * The specified callback will be executed in the context of the event - -: 706: * queue's dispatch loop. - -: 707: * - -: 708: * The call_every function is irq safe and can act as a mechanism for - -: 709: * moving events out of irq contexts. - -: 710: * - -: 711: * @param f Function to execute in the context of the dispatch loop - -: 712: * @param ms Period of the event in milliseconds - -: 713: * @return A unique id that represents the posted event and can - -: 714: * be passed to cancel, or an id of 0 if there is not - -: 715: * enough memory to allocate the event. - -: 716: */ - -: 717: template - -: 718: int call_every(int ms, F f) { - -: 719: void *p = equeue_alloc(&_equeue, sizeof(F)); - -: 720: if (!p) { - -: 721: return 0; - -: 722: } - -: 723: - -: 724: F *e = new (p) F(f); - -: 725: equeue_event_delay(e, ms); - -: 726: equeue_event_period(e, ms); - -: 727: equeue_event_dtor(e, &EventQueue::function_dtor); - -: 728: return equeue_post(&_equeue, &EventQueue::function_call, e); - -: 729: } - -: 730: - -: 731: /** Calls an event on the queue periodically - -: 732: * @see EventQueue::call_every - -: 733: * @param f Function to execute in the context of the dispatch loop - -: 734: * @param a0 Argument to pass to the callback - -: 735: * @param ms Period of the event in milliseconds - -: 736: */ - -: 737: template - -: 738: int call_every(int ms, F f, A0 a0) { - -: 739: return call_every(ms, context10(f, a0)); - -: 740: } - -: 741: - -: 742: /** Calls an event on the queue periodically - -: 743: * @see EventQueue::call_every - -: 744: * @param f Function to execute in the context of the dispatch loop - -: 745: * @param a0,a1 Arguments to pass to the callback - -: 746: * @param ms Period of the event in milliseconds - -: 747: */ - -: 748: template - -: 749: int call_every(int ms, F f, A0 a0, A1 a1) { - -: 750: return call_every(ms, context20(f, a0, a1)); - -: 751: } - -: 752: - -: 753: /** Calls an event on the queue periodically - -: 754: * @see EventQueue::call_every - -: 755: * @param f Function to execute in the context of the dispatch loop - -: 756: * @param a0,a1,a2 Arguments to pass to the callback - -: 757: * @param ms Period of the event in milliseconds - -: 758: */ - -: 759: template - -: 760: int call_every(int ms, F f, A0 a0, A1 a1, A2 a2) { - -: 761: return call_every(ms, context30(f, a0, a1, a2)); - -: 762: } - -: 763: - -: 764: /** Calls an event on the queue periodically - -: 765: * @see EventQueue::call_every - -: 766: * @param f Function to execute in the context of the dispatch loop - -: 767: * @param a0,a1,a2,a3 Arguments to pass to the callback - -: 768: * @param ms Period of the event in milliseconds - -: 769: */ - -: 770: template - -: 771: int call_every(int ms, F f, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 772: return call_every(ms, context40(f, a0, a1, a2, a3)); - -: 773: } - -: 774: - -: 775: /** Calls an event on the queue periodically - -: 776: * @see EventQueue::call_every - -: 777: * @param f Function to execute in the context of the dispatch loop - -: 778: * @param a0,a1,a2,a3,a4 Arguments to pass to the callback - -: 779: * @param ms Period of the event in milliseconds - -: 780: */ - -: 781: template - -: 782: int call_every(int ms, F f, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 783: return call_every(ms, context50(f, a0, a1, a2, a3, a4)); - -: 784: } - -: 785: - -: 786: /** Calls an event on the queue periodically - -: 787: * @see EventQueue::call_every - -: 788: */ - -: 789: template - -: 790: int call_every(int ms, T *obj, R (T::*method)()) { - -: 791: return call_every(ms, mbed::callback(obj, method)); - -: 792: } - -: 793: - -: 794: /** Calls an event on the queue periodically - -: 795: * @see EventQueue::call_every - -: 796: */ - -: 797: template - -: 798: int call_every(int ms, const T *obj, R (T::*method)() const) { - -: 799: return call_every(ms, mbed::callback(obj, method)); - -: 800: } - -: 801: - -: 802: /** Calls an event on the queue periodically - -: 803: * @see EventQueue::call_every - -: 804: */ - -: 805: template - -: 806: int call_every(int ms, volatile T *obj, R (T::*method)() volatile) { - -: 807: return call_every(ms, mbed::callback(obj, method)); - -: 808: } - -: 809: - -: 810: /** Calls an event on the queue periodically - -: 811: * @see EventQueue::call_every - -: 812: */ - -: 813: template - -: 814: int call_every(int ms, const volatile T *obj, R (T::*method)() const volatile) { - -: 815: return call_every(ms, mbed::callback(obj, method)); - -: 816: } - -: 817: - -: 818: /** Calls an event on the queue periodically - -: 819: * @see EventQueue::call_every - -: 820: */ - -: 821: template - -: 822: int call_every(int ms, T *obj, R (T::*method)(A0), A0 a0) { - -: 823: return call_every(ms, mbed::callback(obj, method), a0); - -: 824: } - -: 825: - -: 826: /** Calls an event on the queue periodically - -: 827: * @see EventQueue::call_every - -: 828: */ - -: 829: template - -: 830: int call_every(int ms, const T *obj, R (T::*method)(A0) const, A0 a0) { - -: 831: return call_every(ms, mbed::callback(obj, method), a0); - -: 832: } - -: 833: - -: 834: /** Calls an event on the queue periodically - -: 835: * @see EventQueue::call_every - -: 836: */ - -: 837: template - -: 838: int call_every(int ms, volatile T *obj, R (T::*method)(A0) volatile, A0 a0) { - -: 839: return call_every(ms, mbed::callback(obj, method), a0); - -: 840: } - -: 841: - -: 842: /** Calls an event on the queue periodically - -: 843: * @see EventQueue::call_every - -: 844: */ - -: 845: template - -: 846: int call_every(int ms, const volatile T *obj, R (T::*method)(A0) const volatile, A0 a0) { - -: 847: return call_every(ms, mbed::callback(obj, method), a0); - -: 848: } - -: 849: - -: 850: /** Calls an event on the queue periodically - -: 851: * @see EventQueue::call_every - -: 852: */ - -: 853: template - -: 854: int call_every(int ms, T *obj, R (T::*method)(A0, A1), A0 a0, A1 a1) { - -: 855: return call_every(ms, mbed::callback(obj, method), a0, a1); - -: 856: } - -: 857: - -: 858: /** Calls an event on the queue periodically - -: 859: * @see EventQueue::call_every - -: 860: */ - -: 861: template - -: 862: int call_every(int ms, const T *obj, R (T::*method)(A0, A1) const, A0 a0, A1 a1) { - -: 863: return call_every(ms, mbed::callback(obj, method), a0, a1); - -: 864: } - -: 865: - -: 866: /** Calls an event on the queue periodically - -: 867: * @see EventQueue::call_every - -: 868: */ - -: 869: template - -: 870: int call_every(int ms, volatile T *obj, R (T::*method)(A0, A1) volatile, A0 a0, A1 a1) { - -: 871: return call_every(ms, mbed::callback(obj, method), a0, a1); - -: 872: } - -: 873: - -: 874: /** Calls an event on the queue periodically - -: 875: * @see EventQueue::call_every - -: 876: */ - -: 877: template - -: 878: int call_every(int ms, const volatile T *obj, R (T::*method)(A0, A1) const volatile, A0 a0, A1 a1) { - -: 879: return call_every(ms, mbed::callback(obj, method), a0, a1); - -: 880: } - -: 881: - -: 882: /** Calls an event on the queue periodically - -: 883: * @see EventQueue::call_every - -: 884: */ - -: 885: template - -: 886: int call_every(int ms, T *obj, R (T::*method)(A0, A1, A2), A0 a0, A1 a1, A2 a2) { - -: 887: return call_every(ms, mbed::callback(obj, method), a0, a1, a2); - -: 888: } - -: 889: - -: 890: /** Calls an event on the queue periodically - -: 891: * @see EventQueue::call_every - -: 892: */ - -: 893: template - -: 894: int call_every(int ms, const T *obj, R (T::*method)(A0, A1, A2) const, A0 a0, A1 a1, A2 a2) { - -: 895: return call_every(ms, mbed::callback(obj, method), a0, a1, a2); - -: 896: } - -: 897: - -: 898: /** Calls an event on the queue periodically - -: 899: * @see EventQueue::call_every - -: 900: */ - -: 901: template - -: 902: int call_every(int ms, volatile T *obj, R (T::*method)(A0, A1, A2) volatile, A0 a0, A1 a1, A2 a2) { - -: 903: return call_every(ms, mbed::callback(obj, method), a0, a1, a2); - -: 904: } - -: 905: - -: 906: /** Calls an event on the queue periodically - -: 907: * @see EventQueue::call_every - -: 908: */ - -: 909: template - -: 910: int call_every(int ms, const volatile T *obj, R (T::*method)(A0, A1, A2) const volatile, A0 a0, A1 a1, A2 a2) { - -: 911: return call_every(ms, mbed::callback(obj, method), a0, a1, a2); - -: 912: } - -: 913: - -: 914: /** Calls an event on the queue periodically - -: 915: * @see EventQueue::call_every - -: 916: */ - -: 917: template - -: 918: int call_every(int ms, T *obj, R (T::*method)(A0, A1, A2, A3), A0 a0, A1 a1, A2 a2, A3 a3) { - -: 919: return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3); - -: 920: } - -: 921: - -: 922: /** Calls an event on the queue periodically - -: 923: * @see EventQueue::call_every - -: 924: */ - -: 925: template - -: 926: int call_every(int ms, const T *obj, R (T::*method)(A0, A1, A2, A3) const, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 927: return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3); - -: 928: } - -: 929: - -: 930: /** Calls an event on the queue periodically - -: 931: * @see EventQueue::call_every - -: 932: */ - -: 933: template - -: 934: int call_every(int ms, volatile T *obj, R (T::*method)(A0, A1, A2, A3) volatile, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 935: return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3); - -: 936: } - -: 937: - -: 938: /** Calls an event on the queue periodically - -: 939: * @see EventQueue::call_every - -: 940: */ - -: 941: template - -: 942: int call_every(int ms, const volatile T *obj, R (T::*method)(A0, A1, A2, A3) const volatile, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 943: return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3); - -: 944: } - -: 945: - -: 946: /** Calls an event on the queue periodically - -: 947: * @see EventQueue::call_every - -: 948: */ - -: 949: template - -: 950: int call_every(int ms, T *obj, R (T::*method)(A0, A1, A2, A3, A4), A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 951: return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 952: } - -: 953: - -: 954: /** Calls an event on the queue periodically - -: 955: * @see EventQueue::call_every - -: 956: */ - -: 957: template - -: 958: int call_every(int ms, const T *obj, R (T::*method)(A0, A1, A2, A3, A4) const, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 959: return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 960: } - -: 961: - -: 962: /** Calls an event on the queue periodically - -: 963: * @see EventQueue::call_every - -: 964: */ - -: 965: template - -: 966: int call_every(int ms, volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 967: return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 968: } - -: 969: - -: 970: /** Calls an event on the queue periodically - -: 971: * @see EventQueue::call_every - -: 972: */ - -: 973: template - -: 974: int call_every(int ms, const volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 975: return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4); - -: 976: } - -: 977: - -: 978: /** Creates an event bound to the event queue - -: 979: * - -: 980: * Constructs an event bound to the specified event queue. The specified - -: 981: * callback acts as the target for the event and is executed in the - -: 982: * context of the event queue's dispatch loop once posted. - -: 983: * - -: 984: * @param func Function to execute when the event is dispatched - -: 985: * @return Event that will dispatch on the specific queue - -: 986: */ - -: 987: template - -: 988: Event event(R (*func)()); - -: 989: - -: 990: /** Creates an event bound to the event queue - -: 991: * @see EventQueue::event - -: 992: */ - -: 993: template - -: 994: Event event(T *obj, R (T::*method)()); - -: 995: - -: 996: /** Creates an event bound to the event queue - -: 997: * @see EventQueue::event - -: 998: */ - -: 999: template - -: 1000: Event event(const T *obj, R (T::*method)() const); - -: 1001: - -: 1002: /** Creates an event bound to the event queue - -: 1003: * @see EventQueue::event - -: 1004: */ - -: 1005: template - -: 1006: Event event(volatile T *obj, R (T::*method)() volatile); - -: 1007: - -: 1008: /** Creates an event bound to the event queue - -: 1009: * @see EventQueue::event - -: 1010: */ - -: 1011: template - -: 1012: Event event(const volatile T *obj, R (T::*method)() const volatile); - -: 1013: - -: 1014: /** Creates an event bound to the event queue - -: 1015: * @see EventQueue::event - -: 1016: */ - -: 1017: template - -: 1018: Event event(mbed::Callback cb); - -: 1019: - -: 1020: /** Creates an event bound to the event queue - -: 1021: * @see EventQueue::event - -: 1022: */ - -: 1023: template - -: 1024: Event event(R (*func)(B0), C0 c0); - -: 1025: - -: 1026: /** Creates an event bound to the event queue - -: 1027: * @see EventQueue::event - -: 1028: */ - -: 1029: template - -: 1030: Event event(T *obj, R (T::*method)(B0), C0 c0); - -: 1031: - -: 1032: /** Creates an event bound to the event queue - -: 1033: * @see EventQueue::event - -: 1034: */ - -: 1035: template - -: 1036: Event event(const T *obj, R (T::*method)(B0) const, C0 c0); - -: 1037: - -: 1038: /** Creates an event bound to the event queue - -: 1039: * @see EventQueue::event - -: 1040: */ - -: 1041: template - -: 1042: Event event(volatile T *obj, R (T::*method)(B0) volatile, C0 c0); - -: 1043: - -: 1044: /** Creates an event bound to the event queue - -: 1045: * @see EventQueue::event - -: 1046: */ - -: 1047: template - -: 1048: Event event(const volatile T *obj, R (T::*method)(B0) const volatile, C0 c0); - -: 1049: - -: 1050: /** Creates an event bound to the event queue - -: 1051: * @see EventQueue::event - -: 1052: */ - -: 1053: template - -: 1054: Event event(mbed::Callback cb, C0 c0); - -: 1055: - -: 1056: /** Creates an event bound to the event queue - -: 1057: * @see EventQueue::event - -: 1058: */ - -: 1059: template - -: 1060: Event event(R (*func)(B0, B1), C0 c0, C1 c1); - -: 1061: - -: 1062: /** Creates an event bound to the event queue - -: 1063: * @see EventQueue::event - -: 1064: */ - -: 1065: template - -: 1066: Event event(T *obj, R (T::*method)(B0, B1), C0 c0, C1 c1); - -: 1067: - -: 1068: /** Creates an event bound to the event queue - -: 1069: * @see EventQueue::event - -: 1070: */ - -: 1071: template - -: 1072: Event event(const T *obj, R (T::*method)(B0, B1) const, C0 c0, C1 c1); - -: 1073: - -: 1074: /** Creates an event bound to the event queue - -: 1075: * @see EventQueue::event - -: 1076: */ - -: 1077: template - -: 1078: Event event(volatile T *obj, R (T::*method)(B0, B1) volatile, C0 c0, C1 c1); - -: 1079: - -: 1080: /** Creates an event bound to the event queue - -: 1081: * @see EventQueue::event - -: 1082: */ - -: 1083: template - -: 1084: Event event(const volatile T *obj, R (T::*method)(B0, B1) const volatile, C0 c0, C1 c1); - -: 1085: - -: 1086: /** Creates an event bound to the event queue - -: 1087: * @see EventQueue::event - -: 1088: */ - -: 1089: template - -: 1090: Event event(mbed::Callback cb, C0 c0, C1 c1); - -: 1091: - -: 1092: /** Creates an event bound to the event queue - -: 1093: * @see EventQueue::event - -: 1094: */ - -: 1095: template - -: 1096: Event event(R (*func)(B0, B1, B2), C0 c0, C1 c1, C2 c2); - -: 1097: - -: 1098: /** Creates an event bound to the event queue - -: 1099: * @see EventQueue::event - -: 1100: */ - -: 1101: template - -: 1102: Event event(T *obj, R (T::*method)(B0, B1, B2), C0 c0, C1 c1, C2 c2); - -: 1103: - -: 1104: /** Creates an event bound to the event queue - -: 1105: * @see EventQueue::event - -: 1106: */ - -: 1107: template - -: 1108: Event event(const T *obj, R (T::*method)(B0, B1, B2) const, C0 c0, C1 c1, C2 c2); - -: 1109: - -: 1110: /** Creates an event bound to the event queue - -: 1111: * @see EventQueue::event - -: 1112: */ - -: 1113: template - -: 1114: Event event(volatile T *obj, R (T::*method)(B0, B1, B2) volatile, C0 c0, C1 c1, C2 c2); - -: 1115: - -: 1116: /** Creates an event bound to the event queue - -: 1117: * @see EventQueue::event - -: 1118: */ - -: 1119: template - -: 1120: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2) const volatile, C0 c0, C1 c1, C2 c2); - -: 1121: - -: 1122: /** Creates an event bound to the event queue - -: 1123: * @see EventQueue::event - -: 1124: */ - -: 1125: template - -: 1126: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2); - -: 1127: - -: 1128: /** Creates an event bound to the event queue - -: 1129: * @see EventQueue::event - -: 1130: */ - -: 1131: template - -: 1132: Event event(R (*func)(B0, B1, B2, B3), C0 c0, C1 c1, C2 c2, C3 c3); - -: 1133: - -: 1134: /** Creates an event bound to the event queue - -: 1135: * @see EventQueue::event - -: 1136: */ - -: 1137: template - -: 1138: Event event(T *obj, R (T::*method)(B0, B1, B2, B3), C0 c0, C1 c1, C2 c2, C3 c3); - -: 1139: - -: 1140: /** Creates an event bound to the event queue - -: 1141: * @see EventQueue::event - -: 1142: */ - -: 1143: template - -: 1144: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3) const, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1145: - -: 1146: /** Creates an event bound to the event queue - -: 1147: * @see EventQueue::event - -: 1148: */ - -: 1149: template - -: 1150: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3) volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1151: - -: 1152: /** Creates an event bound to the event queue - -: 1153: * @see EventQueue::event - -: 1154: */ - -: 1155: template - -: 1156: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3) const volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1157: - -: 1158: /** Creates an event bound to the event queue - -: 1159: * @see EventQueue::event - -: 1160: */ - -: 1161: template - -: 1162: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1163: - -: 1164: /** Creates an event bound to the event queue - -: 1165: * @see EventQueue::event - -: 1166: */ - -: 1167: template - -: 1168: Event event(R (*func)(B0, B1, B2, B3, B4), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1169: - -: 1170: /** Creates an event bound to the event queue - -: 1171: * @see EventQueue::event - -: 1172: */ - -: 1173: template - -: 1174: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, B4), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1175: - -: 1176: /** Creates an event bound to the event queue - -: 1177: * @see EventQueue::event - -: 1178: */ - -: 1179: template - -: 1180: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, B4) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1181: - -: 1182: /** Creates an event bound to the event queue - -: 1183: * @see EventQueue::event - -: 1184: */ - -: 1185: template - -: 1186: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1187: - -: 1188: /** Creates an event bound to the event queue - -: 1189: * @see EventQueue::event - -: 1190: */ - -: 1191: template - -: 1192: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1193: - -: 1194: /** Creates an event bound to the event queue - -: 1195: * @see EventQueue::event - -: 1196: */ - -: 1197: template - -: 1198: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1199: - -: 1200: /** Creates an event bound to the event queue - -: 1201: * @see EventQueue::event - -: 1202: */ - -: 1203: template - -: 1204: Event event(R (*func)(A0)); - -: 1205: - -: 1206: /** Creates an event bound to the event queue - -: 1207: * @see EventQueue::event - -: 1208: */ - -: 1209: template - -: 1210: Event event(T *obj, R (T::*method)(A0)); - -: 1211: - -: 1212: /** Creates an event bound to the event queue - -: 1213: * @see EventQueue::event - -: 1214: */ - -: 1215: template - -: 1216: Event event(const T *obj, R (T::*method)(A0) const); - -: 1217: - -: 1218: /** Creates an event bound to the event queue - -: 1219: * @see EventQueue::event - -: 1220: */ - -: 1221: template - -: 1222: Event event(volatile T *obj, R (T::*method)(A0) volatile); - -: 1223: - -: 1224: /** Creates an event bound to the event queue - -: 1225: * @see EventQueue::event - -: 1226: */ - -: 1227: template - -: 1228: Event event(const volatile T *obj, R (T::*method)(A0) const volatile); - -: 1229: - -: 1230: /** Creates an event bound to the event queue - -: 1231: * @see EventQueue::event - -: 1232: */ - -: 1233: template - -: 1234: Event event(mbed::Callback cb); - -: 1235: - -: 1236: /** Creates an event bound to the event queue - -: 1237: * @see EventQueue::event - -: 1238: */ - -: 1239: template - -: 1240: Event event(R (*func)(B0, A0), C0 c0); - -: 1241: - -: 1242: /** Creates an event bound to the event queue - -: 1243: * @see EventQueue::event - -: 1244: */ - -: 1245: template - -: 1246: Event event(T *obj, R (T::*method)(B0, A0), C0 c0); - -: 1247: - -: 1248: /** Creates an event bound to the event queue - -: 1249: * @see EventQueue::event - -: 1250: */ - -: 1251: template - -: 1252: Event event(const T *obj, R (T::*method)(B0, A0) const, C0 c0); - -: 1253: - -: 1254: /** Creates an event bound to the event queue - -: 1255: * @see EventQueue::event - -: 1256: */ - -: 1257: template - -: 1258: Event event(volatile T *obj, R (T::*method)(B0, A0) volatile, C0 c0); - -: 1259: - -: 1260: /** Creates an event bound to the event queue - -: 1261: * @see EventQueue::event - -: 1262: */ - -: 1263: template - -: 1264: Event event(const volatile T *obj, R (T::*method)(B0, A0) const volatile, C0 c0); - -: 1265: - -: 1266: /** Creates an event bound to the event queue - -: 1267: * @see EventQueue::event - -: 1268: */ - -: 1269: template - -: 1270: Event event(mbed::Callback cb, C0 c0); - -: 1271: - -: 1272: /** Creates an event bound to the event queue - -: 1273: * @see EventQueue::event - -: 1274: */ - -: 1275: template - -: 1276: Event event(R (*func)(B0, B1, A0), C0 c0, C1 c1); - -: 1277: - -: 1278: /** Creates an event bound to the event queue - -: 1279: * @see EventQueue::event - -: 1280: */ - -: 1281: template - -: 1282: Event event(T *obj, R (T::*method)(B0, B1, A0), C0 c0, C1 c1); - -: 1283: - -: 1284: /** Creates an event bound to the event queue - -: 1285: * @see EventQueue::event - -: 1286: */ - -: 1287: template - -: 1288: Event event(const T *obj, R (T::*method)(B0, B1, A0) const, C0 c0, C1 c1); - -: 1289: - -: 1290: /** Creates an event bound to the event queue - -: 1291: * @see EventQueue::event - -: 1292: */ - -: 1293: template - -: 1294: Event event(volatile T *obj, R (T::*method)(B0, B1, A0) volatile, C0 c0, C1 c1); - -: 1295: - -: 1296: /** Creates an event bound to the event queue - -: 1297: * @see EventQueue::event - -: 1298: */ - -: 1299: template - -: 1300: Event event(const volatile T *obj, R (T::*method)(B0, B1, A0) const volatile, C0 c0, C1 c1); - -: 1301: - -: 1302: /** Creates an event bound to the event queue - -: 1303: * @see EventQueue::event - -: 1304: */ - -: 1305: template - -: 1306: Event event(mbed::Callback cb, C0 c0, C1 c1); - -: 1307: - -: 1308: /** Creates an event bound to the event queue - -: 1309: * @see EventQueue::event - -: 1310: */ - -: 1311: template - -: 1312: Event event(R (*func)(B0, B1, B2, A0), C0 c0, C1 c1, C2 c2); - -: 1313: - -: 1314: /** Creates an event bound to the event queue - -: 1315: * @see EventQueue::event - -: 1316: */ - -: 1317: template - -: 1318: Event event(T *obj, R (T::*method)(B0, B1, B2, A0), C0 c0, C1 c1, C2 c2); - -: 1319: - -: 1320: /** Creates an event bound to the event queue - -: 1321: * @see EventQueue::event - -: 1322: */ - -: 1323: template - -: 1324: Event event(const T *obj, R (T::*method)(B0, B1, B2, A0) const, C0 c0, C1 c1, C2 c2); - -: 1325: - -: 1326: /** Creates an event bound to the event queue - -: 1327: * @see EventQueue::event - -: 1328: */ - -: 1329: template - -: 1330: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, A0) volatile, C0 c0, C1 c1, C2 c2); - -: 1331: - -: 1332: /** Creates an event bound to the event queue - -: 1333: * @see EventQueue::event - -: 1334: */ - -: 1335: template - -: 1336: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, A0) const volatile, C0 c0, C1 c1, C2 c2); - -: 1337: - -: 1338: /** Creates an event bound to the event queue - -: 1339: * @see EventQueue::event - -: 1340: */ - -: 1341: template - -: 1342: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2); - -: 1343: - -: 1344: /** Creates an event bound to the event queue - -: 1345: * @see EventQueue::event - -: 1346: */ - -: 1347: template - -: 1348: Event event(R (*func)(B0, B1, B2, B3, A0), C0 c0, C1 c1, C2 c2, C3 c3); - -: 1349: - -: 1350: /** Creates an event bound to the event queue - -: 1351: * @see EventQueue::event - -: 1352: */ - -: 1353: template - -: 1354: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, A0), C0 c0, C1 c1, C2 c2, C3 c3); - -: 1355: - -: 1356: /** Creates an event bound to the event queue - -: 1357: * @see EventQueue::event - -: 1358: */ - -: 1359: template - -: 1360: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, A0) const, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1361: - -: 1362: /** Creates an event bound to the event queue - -: 1363: * @see EventQueue::event - -: 1364: */ - -: 1365: template - -: 1366: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0) volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1367: - -: 1368: /** Creates an event bound to the event queue - -: 1369: * @see EventQueue::event - -: 1370: */ - -: 1371: template - -: 1372: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0) const volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1373: - -: 1374: /** Creates an event bound to the event queue - -: 1375: * @see EventQueue::event - -: 1376: */ - -: 1377: template - -: 1378: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1379: - -: 1380: /** Creates an event bound to the event queue - -: 1381: * @see EventQueue::event - -: 1382: */ - -: 1383: template - -: 1384: Event event(R (*func)(B0, B1, B2, B3, B4, A0), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1385: - -: 1386: /** Creates an event bound to the event queue - -: 1387: * @see EventQueue::event - -: 1388: */ - -: 1389: template - -: 1390: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1391: - -: 1392: /** Creates an event bound to the event queue - -: 1393: * @see EventQueue::event - -: 1394: */ - -: 1395: template - -: 1396: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1397: - -: 1398: /** Creates an event bound to the event queue - -: 1399: * @see EventQueue::event - -: 1400: */ - -: 1401: template - -: 1402: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1403: - -: 1404: /** Creates an event bound to the event queue - -: 1405: * @see EventQueue::event - -: 1406: */ - -: 1407: template - -: 1408: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1409: - -: 1410: /** Creates an event bound to the event queue - -: 1411: * @see EventQueue::event - -: 1412: */ - -: 1413: template - -: 1414: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1415: - -: 1416: /** Creates an event bound to the event queue - -: 1417: * @see EventQueue::event - -: 1418: */ - -: 1419: template - -: 1420: Event event(R (*func)(A0, A1)); - -: 1421: - -: 1422: /** Creates an event bound to the event queue - -: 1423: * @see EventQueue::event - -: 1424: */ - -: 1425: template - -: 1426: Event event(T *obj, R (T::*method)(A0, A1)); - -: 1427: - -: 1428: /** Creates an event bound to the event queue - -: 1429: * @see EventQueue::event - -: 1430: */ - -: 1431: template - -: 1432: Event event(const T *obj, R (T::*method)(A0, A1) const); - -: 1433: - -: 1434: /** Creates an event bound to the event queue - -: 1435: * @see EventQueue::event - -: 1436: */ - -: 1437: template - -: 1438: Event event(volatile T *obj, R (T::*method)(A0, A1) volatile); - -: 1439: - -: 1440: /** Creates an event bound to the event queue - -: 1441: * @see EventQueue::event - -: 1442: */ - -: 1443: template - -: 1444: Event event(const volatile T *obj, R (T::*method)(A0, A1) const volatile); - -: 1445: - -: 1446: /** Creates an event bound to the event queue - -: 1447: * @see EventQueue::event - -: 1448: */ - -: 1449: template - -: 1450: Event event(mbed::Callback cb); - -: 1451: - -: 1452: /** Creates an event bound to the event queue - -: 1453: * @see EventQueue::event - -: 1454: */ - -: 1455: template - -: 1456: Event event(R (*func)(B0, A0, A1), C0 c0); - -: 1457: - -: 1458: /** Creates an event bound to the event queue - -: 1459: * @see EventQueue::event - -: 1460: */ - -: 1461: template - -: 1462: Event event(T *obj, R (T::*method)(B0, A0, A1), C0 c0); - -: 1463: - -: 1464: /** Creates an event bound to the event queue - -: 1465: * @see EventQueue::event - -: 1466: */ - -: 1467: template - -: 1468: Event event(const T *obj, R (T::*method)(B0, A0, A1) const, C0 c0); - -: 1469: - -: 1470: /** Creates an event bound to the event queue - -: 1471: * @see EventQueue::event - -: 1472: */ - -: 1473: template - -: 1474: Event event(volatile T *obj, R (T::*method)(B0, A0, A1) volatile, C0 c0); - -: 1475: - -: 1476: /** Creates an event bound to the event queue - -: 1477: * @see EventQueue::event - -: 1478: */ - -: 1479: template - -: 1480: Event event(const volatile T *obj, R (T::*method)(B0, A0, A1) const volatile, C0 c0); - -: 1481: - -: 1482: /** Creates an event bound to the event queue - -: 1483: * @see EventQueue::event - -: 1484: */ - -: 1485: template - -: 1486: Event event(mbed::Callback cb, C0 c0); - -: 1487: - -: 1488: /** Creates an event bound to the event queue - -: 1489: * @see EventQueue::event - -: 1490: */ - -: 1491: template - -: 1492: Event event(R (*func)(B0, B1, A0, A1), C0 c0, C1 c1); - -: 1493: - -: 1494: /** Creates an event bound to the event queue - -: 1495: * @see EventQueue::event - -: 1496: */ - -: 1497: template - -: 1498: Event event(T *obj, R (T::*method)(B0, B1, A0, A1), C0 c0, C1 c1); - -: 1499: - -: 1500: /** Creates an event bound to the event queue - -: 1501: * @see EventQueue::event - -: 1502: */ - -: 1503: template - -: 1504: Event event(const T *obj, R (T::*method)(B0, B1, A0, A1) const, C0 c0, C1 c1); - -: 1505: - -: 1506: /** Creates an event bound to the event queue - -: 1507: * @see EventQueue::event - -: 1508: */ - -: 1509: template - -: 1510: Event event(volatile T *obj, R (T::*method)(B0, B1, A0, A1) volatile, C0 c0, C1 c1); - -: 1511: - -: 1512: /** Creates an event bound to the event queue - -: 1513: * @see EventQueue::event - -: 1514: */ - -: 1515: template - -: 1516: Event event(const volatile T *obj, R (T::*method)(B0, B1, A0, A1) const volatile, C0 c0, C1 c1); - -: 1517: - -: 1518: /** Creates an event bound to the event queue - -: 1519: * @see EventQueue::event - -: 1520: */ - -: 1521: template - -: 1522: Event event(mbed::Callback cb, C0 c0, C1 c1); - -: 1523: - -: 1524: /** Creates an event bound to the event queue - -: 1525: * @see EventQueue::event - -: 1526: */ - -: 1527: template - -: 1528: Event event(R (*func)(B0, B1, B2, A0, A1), C0 c0, C1 c1, C2 c2); - -: 1529: - -: 1530: /** Creates an event bound to the event queue - -: 1531: * @see EventQueue::event - -: 1532: */ - -: 1533: template - -: 1534: Event event(T *obj, R (T::*method)(B0, B1, B2, A0, A1), C0 c0, C1 c1, C2 c2); - -: 1535: - -: 1536: /** Creates an event bound to the event queue - -: 1537: * @see EventQueue::event - -: 1538: */ - -: 1539: template - -: 1540: Event event(const T *obj, R (T::*method)(B0, B1, B2, A0, A1) const, C0 c0, C1 c1, C2 c2); - -: 1541: - -: 1542: /** Creates an event bound to the event queue - -: 1543: * @see EventQueue::event - -: 1544: */ - -: 1545: template - -: 1546: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, A0, A1) volatile, C0 c0, C1 c1, C2 c2); - -: 1547: - -: 1548: /** Creates an event bound to the event queue - -: 1549: * @see EventQueue::event - -: 1550: */ - -: 1551: template - -: 1552: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, A0, A1) const volatile, C0 c0, C1 c1, C2 c2); - -: 1553: - -: 1554: /** Creates an event bound to the event queue - -: 1555: * @see EventQueue::event - -: 1556: */ - -: 1557: template - -: 1558: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2); - -: 1559: - -: 1560: /** Creates an event bound to the event queue - -: 1561: * @see EventQueue::event - -: 1562: */ - -: 1563: template - -: 1564: Event event(R (*func)(B0, B1, B2, B3, A0, A1), C0 c0, C1 c1, C2 c2, C3 c3); - -: 1565: - -: 1566: /** Creates an event bound to the event queue - -: 1567: * @see EventQueue::event - -: 1568: */ - -: 1569: template - -: 1570: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1), C0 c0, C1 c1, C2 c2, C3 c3); - -: 1571: - -: 1572: /** Creates an event bound to the event queue - -: 1573: * @see EventQueue::event - -: 1574: */ - -: 1575: template - -: 1576: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1) const, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1577: - -: 1578: /** Creates an event bound to the event queue - -: 1579: * @see EventQueue::event - -: 1580: */ - -: 1581: template - -: 1582: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1) volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1583: - -: 1584: /** Creates an event bound to the event queue - -: 1585: * @see EventQueue::event - -: 1586: */ - -: 1587: template - -: 1588: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1) const volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1589: - -: 1590: /** Creates an event bound to the event queue - -: 1591: * @see EventQueue::event - -: 1592: */ - -: 1593: template - -: 1594: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1595: - -: 1596: /** Creates an event bound to the event queue - -: 1597: * @see EventQueue::event - -: 1598: */ - -: 1599: template - -: 1600: Event event(R (*func)(B0, B1, B2, B3, B4, A0, A1), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1601: - -: 1602: /** Creates an event bound to the event queue - -: 1603: * @see EventQueue::event - -: 1604: */ - -: 1605: template - -: 1606: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1607: - -: 1608: /** Creates an event bound to the event queue - -: 1609: * @see EventQueue::event - -: 1610: */ - -: 1611: template - -: 1612: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1613: - -: 1614: /** Creates an event bound to the event queue - -: 1615: * @see EventQueue::event - -: 1616: */ - -: 1617: template - -: 1618: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1619: - -: 1620: /** Creates an event bound to the event queue - -: 1621: * @see EventQueue::event - -: 1622: */ - -: 1623: template - -: 1624: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1625: - -: 1626: /** Creates an event bound to the event queue - -: 1627: * @see EventQueue::event - -: 1628: */ - -: 1629: template - -: 1630: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1631: - -: 1632: /** Creates an event bound to the event queue - -: 1633: * @see EventQueue::event - -: 1634: */ - -: 1635: template - -: 1636: Event event(R (*func)(A0, A1, A2)); - -: 1637: - -: 1638: /** Creates an event bound to the event queue - -: 1639: * @see EventQueue::event - -: 1640: */ - -: 1641: template - -: 1642: Event event(T *obj, R (T::*method)(A0, A1, A2)); - -: 1643: - -: 1644: /** Creates an event bound to the event queue - -: 1645: * @see EventQueue::event - -: 1646: */ - -: 1647: template - -: 1648: Event event(const T *obj, R (T::*method)(A0, A1, A2) const); - -: 1649: - -: 1650: /** Creates an event bound to the event queue - -: 1651: * @see EventQueue::event - -: 1652: */ - -: 1653: template - -: 1654: Event event(volatile T *obj, R (T::*method)(A0, A1, A2) volatile); - -: 1655: - -: 1656: /** Creates an event bound to the event queue - -: 1657: * @see EventQueue::event - -: 1658: */ - -: 1659: template - -: 1660: Event event(const volatile T *obj, R (T::*method)(A0, A1, A2) const volatile); - -: 1661: - -: 1662: /** Creates an event bound to the event queue - -: 1663: * @see EventQueue::event - -: 1664: */ - -: 1665: template - -: 1666: Event event(mbed::Callback cb); - -: 1667: - -: 1668: /** Creates an event bound to the event queue - -: 1669: * @see EventQueue::event - -: 1670: */ - -: 1671: template - -: 1672: Event event(R (*func)(B0, A0, A1, A2), C0 c0); - -: 1673: - -: 1674: /** Creates an event bound to the event queue - -: 1675: * @see EventQueue::event - -: 1676: */ - -: 1677: template - -: 1678: Event event(T *obj, R (T::*method)(B0, A0, A1, A2), C0 c0); - -: 1679: - -: 1680: /** Creates an event bound to the event queue - -: 1681: * @see EventQueue::event - -: 1682: */ - -: 1683: template - -: 1684: Event event(const T *obj, R (T::*method)(B0, A0, A1, A2) const, C0 c0); - -: 1685: - -: 1686: /** Creates an event bound to the event queue - -: 1687: * @see EventQueue::event - -: 1688: */ - -: 1689: template - -: 1690: Event event(volatile T *obj, R (T::*method)(B0, A0, A1, A2) volatile, C0 c0); - -: 1691: - -: 1692: /** Creates an event bound to the event queue - -: 1693: * @see EventQueue::event - -: 1694: */ - -: 1695: template - -: 1696: Event event(const volatile T *obj, R (T::*method)(B0, A0, A1, A2) const volatile, C0 c0); - -: 1697: - -: 1698: /** Creates an event bound to the event queue - -: 1699: * @see EventQueue::event - -: 1700: */ - -: 1701: template - -: 1702: Event event(mbed::Callback cb, C0 c0); - -: 1703: - -: 1704: /** Creates an event bound to the event queue - -: 1705: * @see EventQueue::event - -: 1706: */ - -: 1707: template - -: 1708: Event event(R (*func)(B0, B1, A0, A1, A2), C0 c0, C1 c1); - -: 1709: - -: 1710: /** Creates an event bound to the event queue - -: 1711: * @see EventQueue::event - -: 1712: */ - -: 1713: template - -: 1714: Event event(T *obj, R (T::*method)(B0, B1, A0, A1, A2), C0 c0, C1 c1); - -: 1715: - -: 1716: /** Creates an event bound to the event queue - -: 1717: * @see EventQueue::event - -: 1718: */ - -: 1719: template - -: 1720: Event event(const T *obj, R (T::*method)(B0, B1, A0, A1, A2) const, C0 c0, C1 c1); - -: 1721: - -: 1722: /** Creates an event bound to the event queue - -: 1723: * @see EventQueue::event - -: 1724: */ - -: 1725: template - -: 1726: Event event(volatile T *obj, R (T::*method)(B0, B1, A0, A1, A2) volatile, C0 c0, C1 c1); - -: 1727: - -: 1728: /** Creates an event bound to the event queue - -: 1729: * @see EventQueue::event - -: 1730: */ - -: 1731: template - -: 1732: Event event(const volatile T *obj, R (T::*method)(B0, B1, A0, A1, A2) const volatile, C0 c0, C1 c1); - -: 1733: - -: 1734: /** Creates an event bound to the event queue - -: 1735: * @see EventQueue::event - -: 1736: */ - -: 1737: template - -: 1738: Event event(mbed::Callback cb, C0 c0, C1 c1); - -: 1739: - -: 1740: /** Creates an event bound to the event queue - -: 1741: * @see EventQueue::event - -: 1742: */ - -: 1743: template - -: 1744: Event event(R (*func)(B0, B1, B2, A0, A1, A2), C0 c0, C1 c1, C2 c2); - -: 1745: - -: 1746: /** Creates an event bound to the event queue - -: 1747: * @see EventQueue::event - -: 1748: */ - -: 1749: template - -: 1750: Event event(T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2), C0 c0, C1 c1, C2 c2); - -: 1751: - -: 1752: /** Creates an event bound to the event queue - -: 1753: * @see EventQueue::event - -: 1754: */ - -: 1755: template - -: 1756: Event event(const T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2) const, C0 c0, C1 c1, C2 c2); - -: 1757: - -: 1758: /** Creates an event bound to the event queue - -: 1759: * @see EventQueue::event - -: 1760: */ - -: 1761: template - -: 1762: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2) volatile, C0 c0, C1 c1, C2 c2); - -: 1763: - -: 1764: /** Creates an event bound to the event queue - -: 1765: * @see EventQueue::event - -: 1766: */ - -: 1767: template - -: 1768: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2) const volatile, C0 c0, C1 c1, C2 c2); - -: 1769: - -: 1770: /** Creates an event bound to the event queue - -: 1771: * @see EventQueue::event - -: 1772: */ - -: 1773: template - -: 1774: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2); - -: 1775: - -: 1776: /** Creates an event bound to the event queue - -: 1777: * @see EventQueue::event - -: 1778: */ - -: 1779: template - -: 1780: Event event(R (*func)(B0, B1, B2, B3, A0, A1, A2), C0 c0, C1 c1, C2 c2, C3 c3); - -: 1781: - -: 1782: /** Creates an event bound to the event queue - -: 1783: * @see EventQueue::event - -: 1784: */ - -: 1785: template - -: 1786: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2), C0 c0, C1 c1, C2 c2, C3 c3); - -: 1787: - -: 1788: /** Creates an event bound to the event queue - -: 1789: * @see EventQueue::event - -: 1790: */ - -: 1791: template - -: 1792: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2) const, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1793: - -: 1794: /** Creates an event bound to the event queue - -: 1795: * @see EventQueue::event - -: 1796: */ - -: 1797: template - -: 1798: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2) volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1799: - -: 1800: /** Creates an event bound to the event queue - -: 1801: * @see EventQueue::event - -: 1802: */ - -: 1803: template - -: 1804: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2) const volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1805: - -: 1806: /** Creates an event bound to the event queue - -: 1807: * @see EventQueue::event - -: 1808: */ - -: 1809: template - -: 1810: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3); - -: 1811: - -: 1812: /** Creates an event bound to the event queue - -: 1813: * @see EventQueue::event - -: 1814: */ - -: 1815: template - -: 1816: Event event(R (*func)(B0, B1, B2, B3, B4, A0, A1, A2), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1817: - -: 1818: /** Creates an event bound to the event queue - -: 1819: * @see EventQueue::event - -: 1820: */ - -: 1821: template - -: 1822: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1823: - -: 1824: /** Creates an event bound to the event queue - -: 1825: * @see EventQueue::event - -: 1826: */ - -: 1827: template - -: 1828: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1829: - -: 1830: /** Creates an event bound to the event queue - -: 1831: * @see EventQueue::event - -: 1832: */ - -: 1833: template - -: 1834: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1835: - -: 1836: /** Creates an event bound to the event queue - -: 1837: * @see EventQueue::event - -: 1838: */ - -: 1839: template - -: 1840: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1841: - -: 1842: /** Creates an event bound to the event queue - -: 1843: * @see EventQueue::event - -: 1844: */ - -: 1845: template - -: 1846: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 1847: - -: 1848: /** Creates an event bound to the event queue - -: 1849: * @see EventQueue::event - -: 1850: */ - -: 1851: template - -: 1852: Event event(R (*func)(A0, A1, A2, A3)); - -: 1853: - -: 1854: /** Creates an event bound to the event queue - -: 1855: * @see EventQueue::event - -: 1856: */ - -: 1857: template - -: 1858: Event event(T *obj, R (T::*method)(A0, A1, A2, A3)); - -: 1859: - -: 1860: /** Creates an event bound to the event queue - -: 1861: * @see EventQueue::event - -: 1862: */ - -: 1863: template - -: 1864: Event event(const T *obj, R (T::*method)(A0, A1, A2, A3) const); - -: 1865: - -: 1866: /** Creates an event bound to the event queue - -: 1867: * @see EventQueue::event - -: 1868: */ - -: 1869: template - -: 1870: Event event(volatile T *obj, R (T::*method)(A0, A1, A2, A3) volatile); - -: 1871: - -: 1872: /** Creates an event bound to the event queue - -: 1873: * @see EventQueue::event - -: 1874: */ - -: 1875: template - -: 1876: Event event(const volatile T *obj, R (T::*method)(A0, A1, A2, A3) const volatile); - -: 1877: - -: 1878: /** Creates an event bound to the event queue - -: 1879: * @see EventQueue::event - -: 1880: */ - -: 1881: template - -: 1882: Event event(mbed::Callback cb); - -: 1883: - -: 1884: /** Creates an event bound to the event queue - -: 1885: * @see EventQueue::event - -: 1886: */ - -: 1887: template - -: 1888: Event event(R (*func)(B0, A0, A1, A2, A3), C0 c0); - -: 1889: - -: 1890: /** Creates an event bound to the event queue - -: 1891: * @see EventQueue::event - -: 1892: */ - -: 1893: template - -: 1894: Event event(T *obj, R (T::*method)(B0, A0, A1, A2, A3), C0 c0); - -: 1895: - -: 1896: /** Creates an event bound to the event queue - -: 1897: * @see EventQueue::event - -: 1898: */ - -: 1899: template - -: 1900: Event event(const T *obj, R (T::*method)(B0, A0, A1, A2, A3) const, C0 c0); - -: 1901: - -: 1902: /** Creates an event bound to the event queue - -: 1903: * @see EventQueue::event - -: 1904: */ - -: 1905: template - -: 1906: Event event(volatile T *obj, R (T::*method)(B0, A0, A1, A2, A3) volatile, C0 c0); - -: 1907: - -: 1908: /** Creates an event bound to the event queue - -: 1909: * @see EventQueue::event - -: 1910: */ - -: 1911: template - -: 1912: Event event(const volatile T *obj, R (T::*method)(B0, A0, A1, A2, A3) const volatile, C0 c0); - -: 1913: - -: 1914: /** Creates an event bound to the event queue - -: 1915: * @see EventQueue::event - -: 1916: */ - -: 1917: template - -: 1918: Event event(mbed::Callback cb, C0 c0); - -: 1919: - -: 1920: /** Creates an event bound to the event queue - -: 1921: * @see EventQueue::event - -: 1922: */ - -: 1923: template - -: 1924: Event event(R (*func)(B0, B1, A0, A1, A2, A3), C0 c0, C1 c1); - -: 1925: - -: 1926: /** Creates an event bound to the event queue - -: 1927: * @see EventQueue::event - -: 1928: */ - -: 1929: template - -: 1930: Event event(T *obj, R (T::*method)(B0, B1, A0, A1, A2, A3), C0 c0, C1 c1); - -: 1931: - -: 1932: /** Creates an event bound to the event queue - -: 1933: * @see EventQueue::event - -: 1934: */ - -: 1935: template - -: 1936: Event event(const T *obj, R (T::*method)(B0, B1, A0, A1, A2, A3) const, C0 c0, C1 c1); - -: 1937: - -: 1938: /** Creates an event bound to the event queue - -: 1939: * @see EventQueue::event - -: 1940: */ - -: 1941: template - -: 1942: Event event(volatile T *obj, R (T::*method)(B0, B1, A0, A1, A2, A3) volatile, C0 c0, C1 c1); - -: 1943: - -: 1944: /** Creates an event bound to the event queue - -: 1945: * @see EventQueue::event - -: 1946: */ - -: 1947: template - -: 1948: Event event(const volatile T *obj, R (T::*method)(B0, B1, A0, A1, A2, A3) const volatile, C0 c0, C1 c1); - -: 1949: - -: 1950: /** Creates an event bound to the event queue - -: 1951: * @see EventQueue::event - -: 1952: */ - -: 1953: template - -: 1954: Event event(mbed::Callback cb, C0 c0, C1 c1); - -: 1955: - -: 1956: /** Creates an event bound to the event queue - -: 1957: * @see EventQueue::event - -: 1958: */ - -: 1959: template - -: 1960: Event event(R (*func)(B0, B1, B2, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2); - -: 1961: - -: 1962: /** Creates an event bound to the event queue - -: 1963: * @see EventQueue::event - -: 1964: */ - -: 1965: template - -: 1966: Event event(T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2); - -: 1967: - -: 1968: /** Creates an event bound to the event queue - -: 1969: * @see EventQueue::event - -: 1970: */ - -: 1971: template - -: 1972: Event event(const T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2, A3) const, C0 c0, C1 c1, C2 c2); - -: 1973: - -: 1974: /** Creates an event bound to the event queue - -: 1975: * @see EventQueue::event - -: 1976: */ - -: 1977: template - -: 1978: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2, A3) volatile, C0 c0, C1 c1, C2 c2); - -: 1979: - -: 1980: /** Creates an event bound to the event queue - -: 1981: * @see EventQueue::event - -: 1982: */ - -: 1983: template - -: 1984: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2, A3) const volatile, C0 c0, C1 c1, C2 c2); - -: 1985: - -: 1986: /** Creates an event bound to the event queue - -: 1987: * @see EventQueue::event - -: 1988: */ - -: 1989: template - -: 1990: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2); - -: 1991: - -: 1992: /** Creates an event bound to the event queue - -: 1993: * @see EventQueue::event - -: 1994: */ - -: 1995: template - -: 1996: Event event(R (*func)(B0, B1, B2, B3, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2, C3 c3); - -: 1997: - -: 1998: /** Creates an event bound to the event queue - -: 1999: * @see EventQueue::event - -: 2000: */ - -: 2001: template - -: 2002: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2, C3 c3); - -: 2003: - -: 2004: /** Creates an event bound to the event queue - -: 2005: * @see EventQueue::event - -: 2006: */ - -: 2007: template - -: 2008: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2, A3) const, C0 c0, C1 c1, C2 c2, C3 c3); - -: 2009: - -: 2010: /** Creates an event bound to the event queue - -: 2011: * @see EventQueue::event - -: 2012: */ - -: 2013: template - -: 2014: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2, A3) volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 2015: - -: 2016: /** Creates an event bound to the event queue - -: 2017: * @see EventQueue::event - -: 2018: */ - -: 2019: template - -: 2020: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2, A3) const volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 2021: - -: 2022: /** Creates an event bound to the event queue - -: 2023: * @see EventQueue::event - -: 2024: */ - -: 2025: template - -: 2026: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3); - -: 2027: - -: 2028: /** Creates an event bound to the event queue - -: 2029: * @see EventQueue::event - -: 2030: */ - -: 2031: template - -: 2032: Event event(R (*func)(B0, B1, B2, B3, B4, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2033: - -: 2034: /** Creates an event bound to the event queue - -: 2035: * @see EventQueue::event - -: 2036: */ - -: 2037: template - -: 2038: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2039: - -: 2040: /** Creates an event bound to the event queue - -: 2041: * @see EventQueue::event - -: 2042: */ - -: 2043: template - -: 2044: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2045: - -: 2046: /** Creates an event bound to the event queue - -: 2047: * @see EventQueue::event - -: 2048: */ - -: 2049: template - -: 2050: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2051: - -: 2052: /** Creates an event bound to the event queue - -: 2053: * @see EventQueue::event - -: 2054: */ - -: 2055: template - -: 2056: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2057: - -: 2058: /** Creates an event bound to the event queue - -: 2059: * @see EventQueue::event - -: 2060: */ - -: 2061: template - -: 2062: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2063: - -: 2064: /** Creates an event bound to the event queue - -: 2065: * @see EventQueue::event - -: 2066: */ - -: 2067: template - -: 2068: Event event(R (*func)(A0, A1, A2, A3, A4)); - -: 2069: - -: 2070: /** Creates an event bound to the event queue - -: 2071: * @see EventQueue::event - -: 2072: */ - -: 2073: template - -: 2074: Event event(T *obj, R (T::*method)(A0, A1, A2, A3, A4)); - -: 2075: - -: 2076: /** Creates an event bound to the event queue - -: 2077: * @see EventQueue::event - -: 2078: */ - -: 2079: template - -: 2080: Event event(const T *obj, R (T::*method)(A0, A1, A2, A3, A4) const); - -: 2081: - -: 2082: /** Creates an event bound to the event queue - -: 2083: * @see EventQueue::event - -: 2084: */ - -: 2085: template - -: 2086: Event event(volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile); - -: 2087: - -: 2088: /** Creates an event bound to the event queue - -: 2089: * @see EventQueue::event - -: 2090: */ - -: 2091: template - -: 2092: Event event(const volatile T *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile); - -: 2093: - -: 2094: /** Creates an event bound to the event queue - -: 2095: * @see EventQueue::event - -: 2096: */ - -: 2097: template - -: 2098: Event event(mbed::Callback cb); - -: 2099: - -: 2100: /** Creates an event bound to the event queue - -: 2101: * @see EventQueue::event - -: 2102: */ - -: 2103: template - -: 2104: Event event(R (*func)(B0, A0, A1, A2, A3, A4), C0 c0); - -: 2105: - -: 2106: /** Creates an event bound to the event queue - -: 2107: * @see EventQueue::event - -: 2108: */ - -: 2109: template - -: 2110: Event event(T *obj, R (T::*method)(B0, A0, A1, A2, A3, A4), C0 c0); - -: 2111: - -: 2112: /** Creates an event bound to the event queue - -: 2113: * @see EventQueue::event - -: 2114: */ - -: 2115: template - -: 2116: Event event(const T *obj, R (T::*method)(B0, A0, A1, A2, A3, A4) const, C0 c0); - -: 2117: - -: 2118: /** Creates an event bound to the event queue - -: 2119: * @see EventQueue::event - -: 2120: */ - -: 2121: template - -: 2122: Event event(volatile T *obj, R (T::*method)(B0, A0, A1, A2, A3, A4) volatile, C0 c0); - -: 2123: - -: 2124: /** Creates an event bound to the event queue - -: 2125: * @see EventQueue::event - -: 2126: */ - -: 2127: template - -: 2128: Event event(const volatile T *obj, R (T::*method)(B0, A0, A1, A2, A3, A4) const volatile, C0 c0); - -: 2129: - -: 2130: /** Creates an event bound to the event queue - -: 2131: * @see EventQueue::event - -: 2132: */ - -: 2133: template - -: 2134: Event event(mbed::Callback cb, C0 c0); - -: 2135: - -: 2136: /** Creates an event bound to the event queue - -: 2137: * @see EventQueue::event - -: 2138: */ - -: 2139: template - -: 2140: Event event(R (*func)(B0, B1, A0, A1, A2, A3, A4), C0 c0, C1 c1); - -: 2141: - -: 2142: /** Creates an event bound to the event queue - -: 2143: * @see EventQueue::event - -: 2144: */ - -: 2145: template - -: 2146: Event event(T *obj, R (T::*method)(B0, B1, A0, A1, A2, A3, A4), C0 c0, C1 c1); - -: 2147: - -: 2148: /** Creates an event bound to the event queue - -: 2149: * @see EventQueue::event - -: 2150: */ - -: 2151: template - -: 2152: Event event(const T *obj, R (T::*method)(B0, B1, A0, A1, A2, A3, A4) const, C0 c0, C1 c1); - -: 2153: - -: 2154: /** Creates an event bound to the event queue - -: 2155: * @see EventQueue::event - -: 2156: */ - -: 2157: template - -: 2158: Event event(volatile T *obj, R (T::*method)(B0, B1, A0, A1, A2, A3, A4) volatile, C0 c0, C1 c1); - -: 2159: - -: 2160: /** Creates an event bound to the event queue - -: 2161: * @see EventQueue::event - -: 2162: */ - -: 2163: template - -: 2164: Event event(const volatile T *obj, R (T::*method)(B0, B1, A0, A1, A2, A3, A4) const volatile, C0 c0, C1 c1); - -: 2165: - -: 2166: /** Creates an event bound to the event queue - -: 2167: * @see EventQueue::event - -: 2168: */ - -: 2169: template - -: 2170: Event event(mbed::Callback cb, C0 c0, C1 c1); - -: 2171: - -: 2172: /** Creates an event bound to the event queue - -: 2173: * @see EventQueue::event - -: 2174: */ - -: 2175: template - -: 2176: Event event(R (*func)(B0, B1, B2, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2); - -: 2177: - -: 2178: /** Creates an event bound to the event queue - -: 2179: * @see EventQueue::event - -: 2180: */ - -: 2181: template - -: 2182: Event event(T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2); - -: 2183: - -: 2184: /** Creates an event bound to the event queue - -: 2185: * @see EventQueue::event - -: 2186: */ - -: 2187: template - -: 2188: Event event(const T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2, A3, A4) const, C0 c0, C1 c1, C2 c2); - -: 2189: - -: 2190: /** Creates an event bound to the event queue - -: 2191: * @see EventQueue::event - -: 2192: */ - -: 2193: template - -: 2194: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2, A3, A4) volatile, C0 c0, C1 c1, C2 c2); - -: 2195: - -: 2196: /** Creates an event bound to the event queue - -: 2197: * @see EventQueue::event - -: 2198: */ - -: 2199: template - -: 2200: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, A0, A1, A2, A3, A4) const volatile, C0 c0, C1 c1, C2 c2); - -: 2201: - -: 2202: /** Creates an event bound to the event queue - -: 2203: * @see EventQueue::event - -: 2204: */ - -: 2205: template - -: 2206: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2); - -: 2207: - -: 2208: /** Creates an event bound to the event queue - -: 2209: * @see EventQueue::event - -: 2210: */ - -: 2211: template - -: 2212: Event event(R (*func)(B0, B1, B2, B3, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2, C3 c3); - -: 2213: - -: 2214: /** Creates an event bound to the event queue - -: 2215: * @see EventQueue::event - -: 2216: */ - -: 2217: template - -: 2218: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2, C3 c3); - -: 2219: - -: 2220: /** Creates an event bound to the event queue - -: 2221: * @see EventQueue::event - -: 2222: */ - -: 2223: template - -: 2224: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2, A3, A4) const, C0 c0, C1 c1, C2 c2, C3 c3); - -: 2225: - -: 2226: /** Creates an event bound to the event queue - -: 2227: * @see EventQueue::event - -: 2228: */ - -: 2229: template - -: 2230: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2, A3, A4) volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 2231: - -: 2232: /** Creates an event bound to the event queue - -: 2233: * @see EventQueue::event - -: 2234: */ - -: 2235: template - -: 2236: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, A0, A1, A2, A3, A4) const volatile, C0 c0, C1 c1, C2 c2, C3 c3); - -: 2237: - -: 2238: /** Creates an event bound to the event queue - -: 2239: * @see EventQueue::event - -: 2240: */ - -: 2241: template - -: 2242: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3); - -: 2243: - -: 2244: /** Creates an event bound to the event queue - -: 2245: * @see EventQueue::event - -: 2246: */ - -: 2247: template - -: 2248: Event event(R (*func)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2249: - -: 2250: /** Creates an event bound to the event queue - -: 2251: * @see EventQueue::event - -: 2252: */ - -: 2253: template - -: 2254: Event event(T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2255: - -: 2256: /** Creates an event bound to the event queue - -: 2257: * @see EventQueue::event - -: 2258: */ - -: 2259: template - -: 2260: Event event(const T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2261: - -: 2262: /** Creates an event bound to the event queue - -: 2263: * @see EventQueue::event - -: 2264: */ - -: 2265: template - -: 2266: Event event(volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2267: - -: 2268: /** Creates an event bound to the event queue - -: 2269: * @see EventQueue::event - -: 2270: */ - -: 2271: template - -: 2272: Event event(const volatile T *obj, R (T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2273: - -: 2274: /** Creates an event bound to the event queue - -: 2275: * @see EventQueue::event - -: 2276: */ - -: 2277: template - -: 2278: Event event(mbed::Callback cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4); - -: 2279: - -: 2280:protected: - -: 2281: template - -: 2282: friend class Event; - -: 2283: struct equeue _equeue; - -: 2284: mbed::Callback _update; - -: 2285: - -: 2286: // Function attributes - -: 2287: template - #####: 2288: static void function_call(void *p) { - #####: 2289: (*(F*)p)(); - #####: 2290: } - -: 2291: - -: 2292: template - #####: 2293: static void function_dtor(void *p) { - #####: 2294: ((F*)p)->~F(); - #####: 2295: } - -: 2296: - -: 2297: // Context structures - -: 2298: template - -: 2299: struct context00 { - -: 2300: F f; - -: 2301: - -: 2302: context00(F f) - -: 2303: : f(f) {} - -: 2304: - -: 2305: void operator()() { - -: 2306: f(); - -: 2307: } - -: 2308: }; - -: 2309: - -: 2310: template - -: 2311: struct context10 { - -: 2312: F f; C0 c0; - -: 2313: - -: 2314: context10(F f, C0 c0) - -: 2315: : f(f), c0(c0) {} - -: 2316: - -: 2317: void operator()() { - -: 2318: f(c0); - -: 2319: } - -: 2320: }; - -: 2321: - -: 2322: template - -: 2323: struct context20 { - -: 2324: F f; C0 c0; C1 c1; - -: 2325: - -: 2326: context20(F f, C0 c0, C1 c1) - -: 2327: : f(f), c0(c0), c1(c1) {} - -: 2328: - -: 2329: void operator()() { - -: 2330: f(c0, c1); - -: 2331: } - -: 2332: }; - -: 2333: - -: 2334: template - -: 2335: struct context30 { - -: 2336: F f; C0 c0; C1 c1; C2 c2; - -: 2337: - -: 2338: context30(F f, C0 c0, C1 c1, C2 c2) - -: 2339: : f(f), c0(c0), c1(c1), c2(c2) {} - -: 2340: - -: 2341: void operator()() { - -: 2342: f(c0, c1, c2); - -: 2343: } - -: 2344: }; - -: 2345: - -: 2346: template - -: 2347: struct context40 { - -: 2348: F f; C0 c0; C1 c1; C2 c2; C3 c3; - -: 2349: - -: 2350: context40(F f, C0 c0, C1 c1, C2 c2, C3 c3) - -: 2351: : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {} - -: 2352: - -: 2353: void operator()() { - -: 2354: f(c0, c1, c2, c3); - -: 2355: } - -: 2356: }; - -: 2357: - -: 2358: template - -: 2359: struct context50 { - -: 2360: F f; C0 c0; C1 c1; C2 c2; C3 c3; C4 c4; - -: 2361: - -: 2362: context50(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4) - -: 2363: : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {} - -: 2364: - -: 2365: void operator()() { - -: 2366: f(c0, c1, c2, c3, c4); - -: 2367: } - -: 2368: }; - -: 2369: - -: 2370: template - -: 2371: struct context01 { - -: 2372: F f; - -: 2373: - -: 2374: context01(F f) - -: 2375: : f(f) {} - -: 2376: - -: 2377: void operator()(A0 a0) { - -: 2378: f(a0); - -: 2379: } - -: 2380: }; - -: 2381: - -: 2382: template - -: 2383: struct context11 { - -: 2384: F f; C0 c0; - -: 2385: - -: 2386: context11(F f, C0 c0) - -: 2387: : f(f), c0(c0) {} - -: 2388: - -: 2389: void operator()(A0 a0) { - -: 2390: f(c0, a0); - -: 2391: } - -: 2392: }; - -: 2393: - -: 2394: template - -: 2395: struct context21 { - -: 2396: F f; C0 c0; C1 c1; - -: 2397: - -: 2398: context21(F f, C0 c0, C1 c1) - -: 2399: : f(f), c0(c0), c1(c1) {} - -: 2400: - -: 2401: void operator()(A0 a0) { - -: 2402: f(c0, c1, a0); - -: 2403: } - -: 2404: }; - -: 2405: - -: 2406: template - -: 2407: struct context31 { - -: 2408: F f; C0 c0; C1 c1; C2 c2; - -: 2409: - -: 2410: context31(F f, C0 c0, C1 c1, C2 c2) - -: 2411: : f(f), c0(c0), c1(c1), c2(c2) {} - -: 2412: - -: 2413: void operator()(A0 a0) { - -: 2414: f(c0, c1, c2, a0); - -: 2415: } - -: 2416: }; - -: 2417: - -: 2418: template - -: 2419: struct context41 { - -: 2420: F f; C0 c0; C1 c1; C2 c2; C3 c3; - -: 2421: - -: 2422: context41(F f, C0 c0, C1 c1, C2 c2, C3 c3) - -: 2423: : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {} - -: 2424: - -: 2425: void operator()(A0 a0) { - -: 2426: f(c0, c1, c2, c3, a0); - -: 2427: } - -: 2428: }; - -: 2429: - -: 2430: template - -: 2431: struct context51 { - -: 2432: F f; C0 c0; C1 c1; C2 c2; C3 c3; C4 c4; - -: 2433: - -: 2434: context51(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4) - -: 2435: : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {} - -: 2436: - -: 2437: void operator()(A0 a0) { - -: 2438: f(c0, c1, c2, c3, c4, a0); - -: 2439: } - -: 2440: }; - -: 2441: - -: 2442: template - -: 2443: struct context02 { - -: 2444: F f; - -: 2445: - -: 2446: context02(F f) - -: 2447: : f(f) {} - -: 2448: - -: 2449: void operator()(A0 a0, A1 a1) { - -: 2450: f(a0, a1); - -: 2451: } - -: 2452: }; - -: 2453: - -: 2454: template - -: 2455: struct context12 { - -: 2456: F f; C0 c0; - -: 2457: - -: 2458: context12(F f, C0 c0) - -: 2459: : f(f), c0(c0) {} - -: 2460: - -: 2461: void operator()(A0 a0, A1 a1) { - -: 2462: f(c0, a0, a1); - -: 2463: } - -: 2464: }; - -: 2465: - -: 2466: template - -: 2467: struct context22 { - -: 2468: F f; C0 c0; C1 c1; - -: 2469: - -: 2470: context22(F f, C0 c0, C1 c1) - -: 2471: : f(f), c0(c0), c1(c1) {} - -: 2472: - -: 2473: void operator()(A0 a0, A1 a1) { - -: 2474: f(c0, c1, a0, a1); - -: 2475: } - -: 2476: }; - -: 2477: - -: 2478: template - -: 2479: struct context32 { - -: 2480: F f; C0 c0; C1 c1; C2 c2; - -: 2481: - -: 2482: context32(F f, C0 c0, C1 c1, C2 c2) - -: 2483: : f(f), c0(c0), c1(c1), c2(c2) {} - -: 2484: - -: 2485: void operator()(A0 a0, A1 a1) { - -: 2486: f(c0, c1, c2, a0, a1); - -: 2487: } - -: 2488: }; - -: 2489: - -: 2490: template - -: 2491: struct context42 { - -: 2492: F f; C0 c0; C1 c1; C2 c2; C3 c3; - -: 2493: - -: 2494: context42(F f, C0 c0, C1 c1, C2 c2, C3 c3) - -: 2495: : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {} - -: 2496: - -: 2497: void operator()(A0 a0, A1 a1) { - -: 2498: f(c0, c1, c2, c3, a0, a1); - -: 2499: } - -: 2500: }; - -: 2501: - -: 2502: template - -: 2503: struct context52 { - -: 2504: F f; C0 c0; C1 c1; C2 c2; C3 c3; C4 c4; - -: 2505: - -: 2506: context52(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4) - -: 2507: : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {} - -: 2508: - -: 2509: void operator()(A0 a0, A1 a1) { - -: 2510: f(c0, c1, c2, c3, c4, a0, a1); - -: 2511: } - -: 2512: }; - -: 2513: - -: 2514: template - -: 2515: struct context03 { - -: 2516: F f; - -: 2517: - -: 2518: context03(F f) - -: 2519: : f(f) {} - -: 2520: - -: 2521: void operator()(A0 a0, A1 a1, A2 a2) { - -: 2522: f(a0, a1, a2); - -: 2523: } - -: 2524: }; - -: 2525: - -: 2526: template - -: 2527: struct context13 { - -: 2528: F f; C0 c0; - -: 2529: - -: 2530: context13(F f, C0 c0) - -: 2531: : f(f), c0(c0) {} - -: 2532: - -: 2533: void operator()(A0 a0, A1 a1, A2 a2) { - -: 2534: f(c0, a0, a1, a2); - -: 2535: } - -: 2536: }; - -: 2537: - -: 2538: template - -: 2539: struct context23 { - -: 2540: F f; C0 c0; C1 c1; - -: 2541: - -: 2542: context23(F f, C0 c0, C1 c1) - -: 2543: : f(f), c0(c0), c1(c1) {} - -: 2544: - -: 2545: void operator()(A0 a0, A1 a1, A2 a2) { - -: 2546: f(c0, c1, a0, a1, a2); - -: 2547: } - -: 2548: }; - -: 2549: - -: 2550: template - -: 2551: struct context33 { - -: 2552: F f; C0 c0; C1 c1; C2 c2; - -: 2553: - -: 2554: context33(F f, C0 c0, C1 c1, C2 c2) - -: 2555: : f(f), c0(c0), c1(c1), c2(c2) {} - -: 2556: - -: 2557: void operator()(A0 a0, A1 a1, A2 a2) { - -: 2558: f(c0, c1, c2, a0, a1, a2); - -: 2559: } - -: 2560: }; - -: 2561: - -: 2562: template - -: 2563: struct context43 { - -: 2564: F f; C0 c0; C1 c1; C2 c2; C3 c3; - -: 2565: - -: 2566: context43(F f, C0 c0, C1 c1, C2 c2, C3 c3) - -: 2567: : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {} - -: 2568: - -: 2569: void operator()(A0 a0, A1 a1, A2 a2) { - -: 2570: f(c0, c1, c2, c3, a0, a1, a2); - -: 2571: } - -: 2572: }; - -: 2573: - -: 2574: template - -: 2575: struct context53 { - -: 2576: F f; C0 c0; C1 c1; C2 c2; C3 c3; C4 c4; - -: 2577: - -: 2578: context53(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4) - -: 2579: : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {} - -: 2580: - -: 2581: void operator()(A0 a0, A1 a1, A2 a2) { - -: 2582: f(c0, c1, c2, c3, c4, a0, a1, a2); - -: 2583: } - -: 2584: }; - -: 2585: - -: 2586: template - -: 2587: struct context04 { - -: 2588: F f; - -: 2589: - -: 2590: context04(F f) - -: 2591: : f(f) {} - -: 2592: - -: 2593: void operator()(A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2594: f(a0, a1, a2, a3); - -: 2595: } - -: 2596: }; - -: 2597: - -: 2598: template - -: 2599: struct context14 { - -: 2600: F f; C0 c0; - -: 2601: - -: 2602: context14(F f, C0 c0) - -: 2603: : f(f), c0(c0) {} - -: 2604: - -: 2605: void operator()(A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2606: f(c0, a0, a1, a2, a3); - -: 2607: } - -: 2608: }; - -: 2609: - -: 2610: template - -: 2611: struct context24 { - -: 2612: F f; C0 c0; C1 c1; - -: 2613: - -: 2614: context24(F f, C0 c0, C1 c1) - -: 2615: : f(f), c0(c0), c1(c1) {} - -: 2616: - -: 2617: void operator()(A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2618: f(c0, c1, a0, a1, a2, a3); - -: 2619: } - -: 2620: }; - -: 2621: - -: 2622: template - -: 2623: struct context34 { - -: 2624: F f; C0 c0; C1 c1; C2 c2; - -: 2625: - -: 2626: context34(F f, C0 c0, C1 c1, C2 c2) - -: 2627: : f(f), c0(c0), c1(c1), c2(c2) {} - -: 2628: - -: 2629: void operator()(A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2630: f(c0, c1, c2, a0, a1, a2, a3); - -: 2631: } - -: 2632: }; - -: 2633: - -: 2634: template - -: 2635: struct context44 { - -: 2636: F f; C0 c0; C1 c1; C2 c2; C3 c3; - -: 2637: - -: 2638: context44(F f, C0 c0, C1 c1, C2 c2, C3 c3) - -: 2639: : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {} - -: 2640: - -: 2641: void operator()(A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2642: f(c0, c1, c2, c3, a0, a1, a2, a3); - -: 2643: } - -: 2644: }; - -: 2645: - -: 2646: template - -: 2647: struct context54 { - -: 2648: F f; C0 c0; C1 c1; C2 c2; C3 c3; C4 c4; - -: 2649: - -: 2650: context54(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4) - -: 2651: : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {} - -: 2652: - -: 2653: void operator()(A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2654: f(c0, c1, c2, c3, c4, a0, a1, a2, a3); - -: 2655: } - -: 2656: }; - -: 2657: - -: 2658: template - -: 2659: struct context05 { - -: 2660: F f; - -: 2661: - -: 2662: context05(F f) - -: 2663: : f(f) {} - -: 2664: - -: 2665: void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 2666: f(a0, a1, a2, a3, a4); - -: 2667: } - -: 2668: }; - -: 2669: - -: 2670: template - -: 2671: struct context15 { - -: 2672: F f; C0 c0; - -: 2673: - -: 2674: context15(F f, C0 c0) - -: 2675: : f(f), c0(c0) {} - -: 2676: - -: 2677: void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 2678: f(c0, a0, a1, a2, a3, a4); - -: 2679: } - -: 2680: }; - -: 2681: - -: 2682: template - -: 2683: struct context25 { - -: 2684: F f; C0 c0; C1 c1; - -: 2685: - -: 2686: context25(F f, C0 c0, C1 c1) - -: 2687: : f(f), c0(c0), c1(c1) {} - -: 2688: - -: 2689: void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 2690: f(c0, c1, a0, a1, a2, a3, a4); - -: 2691: } - -: 2692: }; - -: 2693: - -: 2694: template - -: 2695: struct context35 { - -: 2696: F f; C0 c0; C1 c1; C2 c2; - -: 2697: - -: 2698: context35(F f, C0 c0, C1 c1, C2 c2) - -: 2699: : f(f), c0(c0), c1(c1), c2(c2) {} - -: 2700: - -: 2701: void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 2702: f(c0, c1, c2, a0, a1, a2, a3, a4); - -: 2703: } - -: 2704: }; - -: 2705: - -: 2706: template - -: 2707: struct context45 { - -: 2708: F f; C0 c0; C1 c1; C2 c2; C3 c3; - -: 2709: - -: 2710: context45(F f, C0 c0, C1 c1, C2 c2, C3 c3) - -: 2711: : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {} - -: 2712: - -: 2713: void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 2714: f(c0, c1, c2, c3, a0, a1, a2, a3, a4); - -: 2715: } - -: 2716: }; - -: 2717: - -: 2718: template - -: 2719: struct context55 { - -: 2720: F f; C0 c0; C1 c1; C2 c2; C3 c3; C4 c4; - -: 2721: - -: 2722: context55(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4) - -: 2723: : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {} - -: 2724: - -: 2725: void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 2726: f(c0, c1, c2, c3, c4, a0, a1, a2, a3, a4); - -: 2727: } - -: 2728: }; - -: 2729:}; - -: 2730: - -: 2731:} - -: 2732: - -: 2733:#endif - -: 2734: diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/FileHandle.h.gcov b/features/cellular/UNITTESTS/at/athandler/gcov/FileHandle.h.gcov deleted file mode 100644 index 5132cd2d0b..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/FileHandle.h.gcov +++ /dev/null @@ -1,267 +0,0 @@ - -: 0:Source:../../../../../platform/FileHandle.h - -: 0:Graph:objs/ATHandler_unit/ATHandler.gcno - -: 0:Data:objs/ATHandler_unit/ATHandler.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* mbed Microcontroller Library - -: 2: * Copyright (c) 2017 ARM Limited - -: 3: * - -: 4: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 5: * you may not use this file except in compliance with the License. - -: 6: * You may obtain a copy of the License at - -: 7: * - -: 8: * http://www.apache.org/licenses/LICENSE-2.0 - -: 9: * - -: 10: * Unless required by applicable law or agreed to in writing, software - -: 11: * distributed under the License is distributed on an "AS IS" BASIS, - -: 12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 13: * See the License for the specific language governing permissions and - -: 14: * limitations under the License. - -: 15: */ - -: 16:#ifndef MBED_FILEHANDLE_H - -: 17:#define MBED_FILEHANDLE_H - -: 18: - -: 19:typedef int FILEHANDLE; - -: 20: - -: 21:#include - -: 22:#include "Callback.h" - -: 23:#include "platform/mbed_poll.h" - -: 24:#include "platform/platform.h" - -: 25:#include "platform/NonCopyable.h" - -: 26: - -: 27:namespace mbed { - -: 28:/** \addtogroup platform */ - -: 29:/** @{*/ - -: 30:/** - -: 31: * \defgroup platform_FileHandle FileHandle functions - -: 32: * @{ - -: 33: */ - -: 34: - -: 35: - -: 36:/** Class FileHandle - -: 37: * - -: 38: * An abstract interface that represents operations on a file-like - -: 39: * object. The core functions are read, write, and seek, but only - -: 40: * a subset of these operations can be provided. - -: 41: * - -: 42: * @note to create a file, @see File - -: 43: * @note Synchronization level: Set by subclass - -: 44: */ - -: 45:class FileHandle : private NonCopyable { - -: 46:public: - -: 47: virtual ~FileHandle() {} - -: 48: - -: 49: /** Read the contents of a file into a buffer - -: 50: * - -: 51: * Devices acting as FileHandles should follow POSIX semantics: - -: 52: * - -: 53: * * if no data is available, and non-blocking set return -EAGAIN - -: 54: * * if no data is available, and blocking set, wait until some data is available - -: 55: * * If any data is available, call returns immediately - -: 56: * - -: 57: * @param buffer The buffer to read in to - -: 58: * @param size The number of bytes to read - -: 59: * @return The number of bytes read, 0 at end of file, negative error on failure - -: 60: */ - -: 61: virtual ssize_t read(void *buffer, size_t size) = 0; - -: 62: - -: 63: /** Write the contents of a buffer to a file - -: 64: * - -: 65: * Devices acting as FileHandles should follow POSIX semantics: - -: 66: * - -: 67: * * if blocking, block until all data is written - -: 68: * * if no data can be written, and non-blocking set, return -EAGAIN - -: 69: * * if some data can be written, and non-blocking set, write partial - -: 70: * - -: 71: * @param buffer The buffer to write from - -: 72: * @param size The number of bytes to write - -: 73: * @return The number of bytes written, negative error on failure - -: 74: */ - -: 75: virtual ssize_t write(const void *buffer, size_t size) = 0; - -: 76: - -: 77: /** Move the file position to a given offset from from a given location - -: 78: * - -: 79: * @param offset The offset from whence to move to - -: 80: * @param whence The start of where to seek - -: 81: * SEEK_SET to start from beginning of file, - -: 82: * SEEK_CUR to start from current position in file, - -: 83: * SEEK_END to start from end of file - -: 84: * @return The new offset of the file, negative error code on failure - -: 85: */ - -: 86: virtual off_t seek(off_t offset, int whence = SEEK_SET) = 0; - -: 87: - -: 88: /** Close a file - -: 89: * - -: 90: * @return 0 on success, negative error code on failure - -: 91: */ - -: 92: virtual int close() = 0; - -: 93: - -: 94: /** Flush any buffers associated with the file - -: 95: * - -: 96: * @return 0 on success, negative error code on failure - -: 97: */ - -: 98: virtual int sync() - -: 99: { - -: 100: return 0; - -: 101: } - -: 102: - -: 103: /** Check if the file in an interactive terminal device - -: 104: * - -: 105: * @return True if the file is a terminal - -: 106: * @return False if the file is not a terminal - -: 107: * @return Negative error code on failure - -: 108: */ - -: 109: virtual int isatty() - -: 110: { - -: 111: return false; - -: 112: } - -: 113: - -: 114: /** Get the file position of the file - -: 115: * - -: 116: * @note This is equivalent to seek(0, SEEK_CUR) - -: 117: * - -: 118: * @return The current offset in the file, negative error code on failure - -: 119: */ - -: 120: virtual off_t tell() - -: 121: { - -: 122: return seek(0, SEEK_CUR); - -: 123: } - -: 124: - -: 125: /** Rewind the file position to the beginning of the file - -: 126: * - -: 127: * @note This is equivalent to seek(0, SEEK_SET) - -: 128: */ - -: 129: virtual void rewind() - -: 130: { - -: 131: seek(0, SEEK_SET); - -: 132: } - -: 133: - -: 134: /** Get the size of the file - -: 135: * - -: 136: * @return Size of the file in bytes - -: 137: */ - -: 138: virtual off_t size(); - -: 139: - -: 140: /** Move the file position to a given offset from a given location. - -: 141: * - -: 142: * @param offset The offset from whence to move to - -: 143: * @param whence SEEK_SET for the start of the file, SEEK_CUR for the - -: 144: * current file position, or SEEK_END for the end of the file. - -: 145: * - -: 146: * @returns - -: 147: * new file position on success, - -: 148: * -1 on failure or unsupported - -: 149: */ - -: 150: MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by FileHandle::seek") - -: 151: virtual off_t lseek(off_t offset, int whence) - -: 152: { - -: 153: return seek(offset, whence); - -: 154: } - -: 155: - -: 156: /** Flush any buffers associated with the FileHandle, ensuring it - -: 157: * is up to date on disk - -: 158: * - -: 159: * @returns - -: 160: * 0 on success or un-needed, - -: 161: * -1 on error - -: 162: */ - -: 163: MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by FileHandle::sync") - -: 164: virtual int fsync() - -: 165: { - -: 166: return sync(); - -: 167: } - -: 168: - -: 169: /** Find the length of the file - -: 170: * - -: 171: * @returns - -: 172: * Length of the file - -: 173: */ - -: 174: MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by FileHandle::size") - -: 175: virtual off_t flen() - -: 176: { - -: 177: return size(); - -: 178: } - -: 179: - -: 180: /** Set blocking or non-blocking mode of the file operation like read/write. - -: 181: * Definition depends upon the subclass implementing FileHandle. - -: 182: * The default is blocking. - -: 183: * - -: 184: * @param blocking true for blocking mode, false for non-blocking mode. - -: 185: * - -: 186: * @return 0 on success - -: 187: * @return Negative error code on failure - -: 188: */ - -: 189: virtual int set_blocking(bool blocking) - -: 190: { - -: 191: return -1; - -: 192: } - -: 193: - -: 194: /** Check for poll event flags - -: 195: * The input parameter can be used or ignored - the could always return all events, - -: 196: * or could check just the events listed in events. - -: 197: * Call is non-blocking - returns instantaneous state of events. - -: 198: * Whenever an event occurs, the derived class should call the sigio() callback). - -: 199: * - -: 200: * @param events bitmask of poll events we're interested in - POLLIN/POLLOUT etc. - -: 201: * - -: 202: * @returns bitmask of poll events that have occurred. - -: 203: */ - -: 204: virtual short poll(short events) const - -: 205: { - -: 206: // Possible default for real files - -: 207: return POLLIN | POLLOUT; - -: 208: } - -: 209: - -: 210: /** Definition depends upon the subclass implementing FileHandle. - -: 211: * For example, if the FileHandle is of type Stream, writable() could return - -: 212: * true when there is ample buffer space available for write() calls. - -: 213: * - -: 214: * @returns true if the FileHandle is writable. - -: 215: */ - -: 216: bool writable() const - -: 217: { - -: 218: return poll(POLLOUT) & POLLOUT; - -: 219: } - -: 220: - -: 221: /** Definition depends upon the subclass implementing FileHandle. - -: 222: * For example, if the FileHandle is of type Stream, readable() could return - -: 223: * true when there is something available to read. - -: 224: * - -: 225: * @returns true when there is something available to read. - -: 226: */ - 49: 227: bool readable() const - -: 228: { - 49: 229: return poll(POLLIN) & POLLIN; - -: 230: } - -: 231: - -: 232: /** Register a callback on state change of the file. - -: 233: * - -: 234: * The specified callback will be called on state changes such as when - -: 235: * the file can be written to or read from. - -: 236: * - -: 237: * The callback may be called in an interrupt context and should not - -: 238: * perform expensive operations. - -: 239: * - -: 240: * Note! This is not intended as an attach-like asynchronous api, but rather - -: 241: * as a building block for constructing such functionality. - -: 242: * - -: 243: * The exact timing of when the registered function - -: 244: * is called is not guaranteed and susceptible to change. It should be used - -: 245: * as a cue to make read/write/poll calls to find the current state. - -: 246: * - -: 247: * @param func Function to call on state change - -: 248: */ - -: 249: virtual void sigio(Callback func) - -: 250: { - -: 251: //Default for real files. Do nothing for real files. - -: 252: } - -: 253:}; - -: 254: - -: 255:/**@}*/ - -: 256: - -: 257:/**@}*/ - -: 258: - -: 259: - -: 260:} // namespace mbed - -: 261: - -: 262:#endif diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/NonCopyable.h.gcov b/features/cellular/UNITTESTS/at/athandler/gcov/NonCopyable.h.gcov deleted file mode 100644 index 36538ed208..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/NonCopyable.h.gcov +++ /dev/null @@ -1,216 +0,0 @@ - -: 0:Source:../../../../../platform/NonCopyable.h - -: 0:Graph:objs/ATHandler_unit/ATHandler.gcno - -: 0:Data:objs/ATHandler_unit/ATHandler.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* Copyright (c) 2017 ARM Limited - -: 2: * - -: 3: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 4: * you may not use this file except in compliance with the License. - -: 5: * You may obtain a copy of the License at - -: 6: * - -: 7: * http://www.apache.org/licenses/LICENSE-2.0 - -: 8: * - -: 9: * Unless required by applicable law or agreed to in writing, software - -: 10: * distributed under the License is distributed on an "AS IS" BASIS, - -: 11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 12: * See the License for the specific language governing permissions and - -: 13: * limitations under the License. - -: 14: */ - -: 15: - -: 16:#ifndef MBED_NONCOPYABLE_H_ - -: 17:#define MBED_NONCOPYABLE_H_ - -: 18: - -: 19:#if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0)) - -: 20:#include "mbed_toolchain.h" - -: 21:#include "mbed_debug.h" - -: 22:#endif - -: 23: - -: 24:namespace mbed { - -: 25: - -: 26:/** - -: 27: * Inheriting from this class autogeneration of copy construction and copy - -: 28: * assignement operations. - -: 29: * - -: 30: * Classes which are not value type should inherit privately from this class - -: 31: * to avoid generation of invalid copy constructor or copy assignement operator - -: 32: * which can lead to unoticeable programming errors. - -: 33: * - -: 34: * As an example consider the following signature: - -: 35: * - -: 36: * @code - -: 37: * class Resource; - -: 38: * - -: 39: * class Foo { - -: 40: * public: - -: 41: * Foo() : _resource(new Resource()) { } - -: 42: * ~Foo() { delete _resource; } - -: 43: * private: - -: 44: * Resource* _resource; - -: 45: * } - -: 46: * - -: 47: * Foo get_foo(); - -: 48: * - -: 49: * Foo foo = get_foo(); - -: 50: * @endcode - -: 51: * - -: 52: * There is a bug in this function, it returns a temporary value which will be - -: 53: * byte copied into foo then destroyed. Unfortunately, internaly the Foo class - -: 54: * manage a pointer to a Resource object. This pointer will be released when the - -: 55: * temporary is destroyed and foo will manage a pointer to an already released - -: 56: * Resource. - -: 57: * - -: 58: * Two issues has to be fixed in the example above: - -: 59: * - Function signature has to be changed to reflect the fact that Foo - -: 60: * instances cannot be copied. In that case accessor should return a - -: 61: * reference to give access to objects already existing and managed. - -: 62: * Generator on the other hand should return a pointer to the created object. - -: 63: * - -: 64: * @code - -: 65: * // return a reference to an already managed Foo instance - -: 66: * Foo& get_foo(); - -: 67: * Foo& foo = get_foo(); - -: 68: * - -: 69: * // create a new Foo instance - -: 70: * Foo* make_foo(); - -: 71: * Foo* m = make_foo(); - -: 72: * @endcode - -: 73: * - -: 74: * - Copy constructor and copy assignement operator has to be made private - -: 75: * in the Foo class. It prevents unwanted copy of Foo objects. This can be - -: 76: * done by declaring copy constructor and copy assignement in the private - -: 77: * section of the Foo class. - -: 78: * - -: 79: * @code - -: 80: * class Foo { - -: 81: * public: - -: 82: * Foo() : _resource(new Resource()) { } - -: 83: * ~Foo() { delete _resource; } - -: 84: * private: - -: 85: * // disallow copy operations - -: 86: * Foo(const Foo&); - -: 87: * Foo& operator=(const Foo&); - -: 88: * // data members - -: 89: * Resource* _resource; - -: 90: * } - -: 91: * @endcode - -: 92: * - -: 93: * Another solution is to inherit privately from the NonCopyable class. - -: 94: * It reduces the boiler plate needed to avoid copy operations but more - -: 95: * importantly it clarifies the programer intent and the object semantic. - -: 96: * - -: 97: * class Foo : private NonCopyable { - -: 98: * public: - -: 99: * Foo() : _resource(new Resource()) { } - -: 100: * ~Foo() { delete _resource; } - -: 101: * private: - -: 102: * Resource* _resource; - -: 103: * } - -: 104: * - -: 105: * @tparam T The type that should be made non copyable. It prevent cases where - -: 106: * the empty base optimization cannot be applied and therefore ensure that the - -: 107: * cost of this semantic sugar is null. - -: 108: * - -: 109: * As an example, the empty base optimization is prohibited if one of the empty - -: 110: * base class is also a base type of the first non static data member: - -: 111: * - -: 112: * @code - -: 113: * struct A { }; - -: 114: * struct B : A { - -: 115: * int foo; - -: 116: * }; - -: 117: * // thanks to empty base optimization, sizeof(B) == sizeof(int) - -: 118: * - -: 119: * struct C : A { - -: 120: * B b; - -: 121: * }; - -: 122: * - -: 123: * // empty base optimization cannot be applied here because A from C and A from - -: 124: * // B shall have a different address. In that case, with the alignement - -: 125: * // sizeof(C) == 2* sizeof(int) - -: 126: * @endcode - -: 127: * - -: 128: * The solution to that problem is to templatize the empty class to makes it - -: 129: * unique to the type it is applied to: - -: 130: * - -: 131: * @code - -: 132: * template - -: 133: * struct A { }; - -: 134: * struct B : A { - -: 135: * int foo; - -: 136: * }; - -: 137: * struct C : A { - -: 138: * B b; - -: 139: * }; - -: 140: * - -: 141: * // empty base optimization can be applied B and C does not refer to the same - -: 142: * // kind of A. sizeof(C) == sizeof(B) == sizeof(int). - -: 143: * @endcode - -: 144: * - -: 145: * @note Compile time errors are disabled if the develop or the release profile - -: 146: * is used. To override this behavior and force compile time errors in all profile - -: 147: * set the configuration parameter "platform.force-non-copyable-error" to true. - -: 148: */ - -: 149:template - -: 150:class NonCopyable { - -: 151:protected: - -: 152: /** - -: 153: * Disalow construction of NonCopyable objects from outside of its hierarchy. - -: 154: */ - 38: 155: NonCopyable() { } - -: 156: /** - -: 157: * Disalow destruction of NonCopyable objects from outside of its hierarchy. - -: 158: */ - 38: 159: ~NonCopyable() { } - -: 160: - -: 161:#if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0)) - -: 162: /** - -: 163: * NonCopyable copy constructor. - -: 164: * - -: 165: * A compile time warning is issued when this function is used and a runtime - -: 166: * warning is printed when the copy construction of the non copyable happens. - -: 167: * - -: 168: * If you see this warning, your code is probably doing something unspecified. - -: 169: * Copy of non copyable resources can lead to resource leak and random error. - -: 170: */ - -: 171: MBED_DEPRECATED("Invalid copy construction of a NonCopyable resource.") - -: 172: NonCopyable(const NonCopyable&) - -: 173: { - -: 174: debug("Invalid copy construction of a NonCopyable resource: %s\r\n", MBED_PRETTY_FUNCTION); - -: 175: } - -: 176: - -: 177: /** - -: 178: * NonCopyable copy assignment operator. - -: 179: * - -: 180: * A compile time warning is issued when this function is used and a runtime - -: 181: * warning is printed when the copy construction of the non copyable happens. - -: 182: * - -: 183: * If you see this warning, your code is probably doing something unspecified. - -: 184: * Copy of non copyable resources can lead to resource leak and random error. - -: 185: */ - -: 186: MBED_DEPRECATED("Invalid copy assignment of a NonCopyable resource.") - -: 187: NonCopyable& operator=(const NonCopyable&) - -: 188: { - -: 189: debug("Invalid copy assignment of a NonCopyable resource: %s\r\n", MBED_PRETTY_FUNCTION); - -: 190: return *this; - -: 191: } - -: 192: - -: 193:#else - -: 194:private: - -: 195: /** - -: 196: * Declare copy constructor as private, any attempt to copy construct - -: 197: * a NonCopyable will fail at compile time. - -: 198: */ - -: 199: NonCopyable(const NonCopyable&); - -: 200: - -: 201: /** - -: 202: * Declare copy assignement operator as private, any attempt to copy assign - -: 203: * a NonCopyable will fail at compile time. - -: 204: */ - -: 205: NonCopyable& operator=(const NonCopyable&); - -: 206:#endif - -: 207:}; - -: 208: - -: 209:} // namespace mbed - -: 210: - -: 211:#endif /* MBED_NONCOPYABLE_H_ */ diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/PlatformMutex.h.gcov b/features/cellular/UNITTESTS/at/athandler/gcov/PlatformMutex.h.gcov deleted file mode 100644 index 091853765e..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/PlatformMutex.h.gcov +++ /dev/null @@ -1,64 +0,0 @@ - -: 0:Source:../../../../../platform/PlatformMutex.h - -: 0:Graph:objs/ATHandler_unit/ATHandler.gcno - -: 0:Data:objs/ATHandler_unit/ATHandler.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1: - -: 2:/** \addtogroup platform */ - -: 3:/** @{*/ - -: 4:/** - -: 5: * \defgroup platform_PlatformMutex PlatformMutex class - -: 6: * @{ - -: 7: */ - -: 8:/* mbed Microcontroller Library - -: 9: * Copyright (c) 2006-2013 ARM Limited - -: 10: * - -: 11: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 12: * you may not use this file except in compliance with the License. - -: 13: * You may obtain a copy of the License at - -: 14: * - -: 15: * http://www.apache.org/licenses/LICENSE-2.0 - -: 16: * - -: 17: * Unless required by applicable law or agreed to in writing, software - -: 18: * distributed under the License is distributed on an "AS IS" BASIS, - -: 19: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 20: * See the License for the specific language governing permissions and - -: 21: * limitations under the License. - -: 22: */ - -: 23:#ifndef PLATFORM_MUTEX_H - -: 24:#define PLATFORM_MUTEX_H - -: 25: - -: 26:#include "platform/NonCopyable.h" - -: 27: - -: 28:#ifdef MBED_CONF_RTOS_PRESENT - -: 29:#include "rtos/Mutex.h" - -: 30:typedef rtos::Mutex PlatformMutex; - -: 31:#else - -: 32:/** A stub mutex for when an RTOS is not present - -: 33:*/ - -: 34:class PlatformMutex : private mbed::NonCopyable { - -: 35:public: - 38: 36: PlatformMutex() { - -: 37: // Stub - -: 38: - 38: 39: } - 38: 40: ~PlatformMutex() { - -: 41: // Stub - 38: 42: } - -: 43: - 6: 44: void lock() { - -: 45: // Do nothing - 6: 46: } - -: 47: - 7: 48: void unlock() { - -: 49: // Do nothing - 7: 50: } - -: 51:}; - -: 52: - -: 53:#endif - -: 54: - -: 55:#endif - -: 56: - -: 57:/**@}*/ - -: 58: - -: 59:/**@}*/ diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/gcov_error.txt b/features/cellular/UNITTESTS/at/athandler/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/gcov_output.txt b/features/cellular/UNITTESTS/at/athandler/gcov/gcov_output.txt deleted file mode 100644 index 4b880e0b28..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/gcov_output.txt +++ /dev/null @@ -1,36 +0,0 @@ -File '../../../../../platform/Callback.h' -Lines executed:62.22% of 45 -Creating 'Callback.h.gcov' - -File '../../../../../events/EventQueue.h' -Lines executed:30.77% of 13 -Creating 'EventQueue.h.gcov' - -File '../../../../../platform/NonCopyable.h' -Lines executed:100.00% of 2 -Creating 'NonCopyable.h.gcov' - -File '../../../framework/AT/ATHandler.cpp' -Lines executed:97.76% of 536 -Creating 'ATHandler.cpp.gcov' - -File '../../../framework/AT/ATHandler.h' -Lines executed:100.00% of 1 -Creating 'ATHandler.h.gcov' - -File '../../../../../platform/FileHandle.h' -Lines executed:100.00% of 2 -Creating 'FileHandle.h.gcov' - -File '../../../../../platform/PlatformMutex.h' -Lines executed:100.00% of 8 -Creating 'PlatformMutex.h.gcov' - -File '../../../../../platform/mbed_debug.h' -Lines executed:100.00% of 2 -Creating 'mbed_debug.h.gcov' - -File '/usr/include/c++/5/new' -Lines executed:0.00% of 3 -Creating 'new.gcov' - diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/gcov_report.txt b/features/cellular/UNITTESTS/at/athandler/gcov/gcov_report.txt deleted file mode 100644 index 15e62b295d..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/gcov_report.txt +++ /dev/null @@ -1,9 +0,0 @@ - -100.00% ../framework/AT/ATHandler.h -100.00% Handle.h -100.00% ../platform/mbed_debug.h -100.00% ../platform/NonCopyable.h -100.00% ../platform/PlatformMutex.h - 30.77% ../events/EventQueue.h - 62.22% ../platform/Callback.h - 97.76% ../framework/AT/ATHandler.cpp diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/at/athandler/gcov/gcov_report.txt.html deleted file mode 100644 index a72eff5219..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/gcov_report.txt.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - -100.00% Handle.h - - - - - - -
CoverageFile
100.00% ../framework/AT/ATHandler.h
100.00% ../platform/mbed_debug.h
100.00% ../platform/NonCopyable.h
100.00% ../platform/PlatformMutex.h
30.77% ../events/EventQueue.h
62.22% ../platform/Callback.h
97.76% ../framework/AT/ATHandler.cpp
diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/mbed_debug.h.gcov b/features/cellular/UNITTESTS/at/athandler/gcov/mbed_debug.h.gcov deleted file mode 100644 index 3613bf1272..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/mbed_debug.h.gcov +++ /dev/null @@ -1,84 +0,0 @@ - -: 0:Source:../../../../../platform/mbed_debug.h - -: 0:Graph:objs/ATHandler_unit/ATHandler.gcno - -: 0:Data:objs/ATHandler_unit/ATHandler.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1: - -: 2:/** \addtogroup platform */ - -: 3:/** @{*/ - -: 4:/** - -: 5: * \defgroup platform_debug Debug functions - -: 6: * @{ - -: 7: */ - -: 8: - -: 9:/* mbed Microcontroller Library - -: 10: * Copyright (c) 2006-2013 ARM Limited - -: 11: * - -: 12: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 13: * you may not use this file except in compliance with the License. - -: 14: * You may obtain a copy of the License at - -: 15: * - -: 16: * http://www.apache.org/licenses/LICENSE-2.0 - -: 17: * - -: 18: * Unless required by applicable law or agreed to in writing, software - -: 19: * distributed under the License is distributed on an "AS IS" BASIS, - -: 20: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 21: * See the License for the specific language governing permissions and - -: 22: * limitations under the License. - -: 23: */ - -: 24:#ifndef MBED_DEBUG_H - -: 25:#define MBED_DEBUG_H - -: 26:#if DEVICE_STDIO_MESSAGES - -: 27:#include - -: 28:#include - -: 29:#endif - -: 30: - -: 31:#ifdef __cplusplus - -: 32:extern "C" { - -: 33:#endif - -: 34: - -: 35: - -: 36:/** Output a debug message - -: 37: * - -: 38: * @param format printf-style format string, followed by variables - -: 39: */ - 43: 40:static inline void debug(const char *format, ...) { - -: 41:#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) - -: 42: va_list args; - -: 43: va_start(args, format); - -: 44: vfprintf(stderr, format, args); - -: 45: va_end(args); - -: 46:#endif - 43: 47:} - -: 48: - -: 49: - -: 50:/** Conditionally output a debug message - -: 51: * - -: 52: * NOTE: If the condition is constant false (== 0) and the compiler optimization - -: 53: * level is greater than 0, then the whole function will be compiled away. - -: 54: * - -: 55: * @param condition output only if condition is true (!= 0) - -: 56: * @param format printf-style format string, followed by variables - -: 57: */ - -: 58:static inline void debug_if(int condition, const char *format, ...) { - -: 59:#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) - -: 60: if (condition) { - -: 61: va_list args; - -: 62: va_start(args, format); - -: 63: vfprintf(stderr, format, args); - -: 64: va_end(args); - -: 65: } - -: 66:#endif - -: 67:} - -: 68: - -: 69: - -: 70:#ifdef __cplusplus - -: 71:} - -: 72:#endif - -: 73: - -: 74:#endif - -: 75: - -: 76:/**@}*/ - -: 77: - -: 78:/**@}*/ - -: 79: diff --git a/features/cellular/UNITTESTS/at/athandler/gcov/new.gcov b/features/cellular/UNITTESTS/at/athandler/gcov/new.gcov deleted file mode 100644 index fc806b197d..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/gcov/new.gcov +++ /dev/null @@ -1,147 +0,0 @@ - -: 0:Source:/usr/include/c++/5/new - -: 0:Graph:objs/ATHandler_unit/ATHandler.gcno - -: 0:Data:objs/ATHandler_unit/ATHandler.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:// The -*- C++ -*- dynamic memory management header. - -: 2: - -: 3:// Copyright (C) 1994-2015 Free Software Foundation, Inc. - -: 4: - -: 5:// This file is part of GCC. - -: 6:// - -: 7:// GCC is free software; you can redistribute it and/or modify - -: 8:// it under the terms of the GNU General Public License as published by - -: 9:// the Free Software Foundation; either version 3, or (at your option) - -: 10:// any later version. - -: 11:// - -: 12:// GCC is distributed in the hope that it will be useful, - -: 13:// but WITHOUT ANY WARRANTY; without even the implied warranty of - -: 14:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - -: 15:// GNU General Public License for more details. - -: 16:// - -: 17:// Under Section 7 of GPL version 3, you are granted additional - -: 18:// permissions described in the GCC Runtime Library Exception, version - -: 19:// 3.1, as published by the Free Software Foundation. - -: 20: - -: 21:// You should have received a copy of the GNU General Public License and - -: 22:// a copy of the GCC Runtime Library Exception along with this program; - -: 23:// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - -: 24:// . - -: 25: - -: 26:/** @file new - -: 27: * This is a Standard C++ Library header. - -: 28: * - -: 29: * The header @c new defines several functions to manage dynamic memory and - -: 30: * handling memory allocation errors; see - -: 31: * http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more. - -: 32: */ - -: 33: - -: 34:#ifndef _NEW - -: 35:#define _NEW - -: 36: - -: 37:#pragma GCC system_header - -: 38: - -: 39:#include - -: 40:#include - -: 41: - -: 42:#pragma GCC visibility push(default) - -: 43: - -: 44:extern "C++" { - -: 45: - -: 46:namespace std - -: 47:{ - -: 48: /** - -: 49: * @brief Exception possibly thrown by @c new. - -: 50: * @ingroup exceptions - -: 51: * - -: 52: * @c bad_alloc (or classes derived from it) is used to report allocation - -: 53: * errors from the throwing forms of @c new. */ - -: 54: class bad_alloc : public exception - -: 55: { - -: 56: public: - -: 57: bad_alloc() throw() { } - -: 58: - -: 59: // This declaration is not useless: - -: 60: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - -: 61: virtual ~bad_alloc() throw(); - -: 62: - -: 63: // See comment in eh_exception.cc. - -: 64: virtual const char* what() const throw(); - -: 65: }; - -: 66: - -: 67:#if __cplusplus >= 201103L - -: 68: class bad_array_new_length : public bad_alloc - -: 69: { - -: 70: public: - -: 71: bad_array_new_length() throw() { }; - -: 72: - -: 73: // This declaration is not useless: - -: 74: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - -: 75: virtual ~bad_array_new_length() throw(); - -: 76: - -: 77: // See comment in eh_exception.cc. - -: 78: virtual const char* what() const throw(); - -: 79: }; - -: 80:#endif - -: 81: - -: 82: struct nothrow_t { }; - -: 83: - -: 84: extern const nothrow_t nothrow; - -: 85: - -: 86: /** If you write your own error handler to be called by @c new, it must - -: 87: * be of this type. */ - -: 88: typedef void (*new_handler)(); - -: 89: - -: 90: /// Takes a replacement handler as the argument, returns the - -: 91: /// previous handler. - -: 92: new_handler set_new_handler(new_handler) throw(); - -: 93: - -: 94:#if __cplusplus >= 201103L - -: 95: /// Return the current new handler. - -: 96: new_handler get_new_handler() noexcept; - -: 97:#endif - -: 98:} // namespace std - -: 99: - -: 100://@{ - -: 101:/** These are replaceable signatures: - -: 102: * - normal single new and delete (no arguments, throw @c bad_alloc on error) - -: 103: * - normal array new and delete (same) - -: 104: * - @c nothrow single new and delete (take a @c nothrow argument, return - -: 105: * @c NULL on error) - -: 106: * - @c nothrow array new and delete (same) - -: 107: * - -: 108: * Placement new and delete signatures (take a memory address argument, - -: 109: * does nothing) may not be replaced by a user's program. - -: 110:*/ - -: 111:void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) - -: 112: __attribute__((__externally_visible__)); - -: 113:void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) - -: 114: __attribute__((__externally_visible__)); - -: 115:void operator delete(void*) _GLIBCXX_USE_NOEXCEPT - -: 116: __attribute__((__externally_visible__)); - -: 117:void operator delete[](void*) _GLIBCXX_USE_NOEXCEPT - -: 118: __attribute__((__externally_visible__)); - -: 119:void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 120: __attribute__((__externally_visible__)); - -: 121:void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 122: __attribute__((__externally_visible__)); - -: 123:void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 124: __attribute__((__externally_visible__)); - -: 125:void operator delete[](void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 126: __attribute__((__externally_visible__)); - -: 127: - -: 128:// Default placement versions of operator new. - #####: 129:inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT - #####: 130:{ return __p; } - -: 131:inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT - -: 132:{ return __p; } - -: 133: - -: 134:// Default placement versions of operator delete. - #####: 135:inline void operator delete (void*, void*) _GLIBCXX_USE_NOEXCEPT { } - -: 136:inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { } - -: 137://@} - -: 138:} // extern "C++" - -: 139: - -: 140:#pragma GCC visibility pop - -: 141: - -: 142:#endif diff --git a/features/cellular/UNITTESTS/at/athandler/lib/libATHandler_unit.a b/features/cellular/UNITTESTS/at/athandler/lib/libATHandler_unit.a deleted file mode 100644 index 6215dfaf08..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/lib/libATHandler_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.d deleted file mode 100644 index 5551ea930c..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.d +++ /dev/null @@ -1,85 +0,0 @@ -objs/ATHandler_unit/ATHandler.o: ../../../framework/AT/ATHandler.cpp \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_poll.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h ../../../../../drivers/Timer.h \ - ../../../../../hal/ticker_api.h ../../../../../platform/mbed_sleep.h \ - ../../../../../hal/sleep_api.h ../../../../../platform/mbed_wait_api.h \ - ../../../../../platform/mbed_debug.h \ - ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../drivers/Timer.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_sleep.h: - -../../../../../hal/sleep_api.h: - -../../../../../platform/mbed_wait_api.h: - -../../../../../platform/mbed_debug.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.gcda deleted file mode 100644 index cdfba74631..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.gcno deleted file mode 100644 index 77bac32edf..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.o deleted file mode 100644 index d41e7d7553..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/ATHandler.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.d deleted file mode 100644 index de9ce9c469..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.d +++ /dev/null @@ -1,53 +0,0 @@ -objs/ATHandler_unit/AT_CellularBase_stub.o: \ - ../../stubs/AT_CellularBase_stub.cpp \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../platform/Callback.h ../../stubs/AT_CellularBase_stub.h \ - ../../../framework/AT/ATHandler.h - -../../../../../features/netsocket/nsapi_types.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../platform/Callback.h: - -../../stubs/AT_CellularBase_stub.h: - -../../../framework/AT/ATHandler.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.gcda deleted file mode 100644 index 380ae4a4b2..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.gcno deleted file mode 100644 index dd22f5b4b7..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.o deleted file mode 100644 index 1358f700cd..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/AT_CellularBase_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.d deleted file mode 100644 index 979a15e9db..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.d +++ /dev/null @@ -1,5 +0,0 @@ -objs/ATHandler_unit/CellularUtil_stub.o: \ - ../../stubs/CellularUtil_stub.cpp \ - ../../../framework/common/CellularUtil.h - -../../../framework/common/CellularUtil.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.gcda deleted file mode 100644 index 432c7675c1..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.gcno deleted file mode 100644 index c3754bdb86..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.o deleted file mode 100644 index 171968f196..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/CellularUtil_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.d deleted file mode 100644 index a09289994f..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.d +++ /dev/null @@ -1,31 +0,0 @@ -objs/ATHandler_unit/EventQueue_stub.o: ../../stubs/EventQueue_stub.cpp \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h ../../../../../platform/Callback.h - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.gcda deleted file mode 100644 index 651046ea21..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.gcno deleted file mode 100644 index 44611d8eae..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.o deleted file mode 100644 index 2c69b40aa2..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/EventQueue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.d deleted file mode 100644 index 23bee7d6c9..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.d +++ /dev/null @@ -1,41 +0,0 @@ -objs/ATHandler_unit/FileHandle_stub.o: ../../stubs/FileHandle_stub.cpp \ - ../../stubs/FileHandle_stub.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.gcda deleted file mode 100644 index 6a76111843..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.gcno deleted file mode 100644 index a002b99cf1..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.o deleted file mode 100644 index 82369f30cd..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.d deleted file mode 100644 index 9620dddb3d..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.d +++ /dev/null @@ -1,41 +0,0 @@ -objs/ATHandler_unit/Timer_stub.o: ../../stubs/Timer_stub.cpp \ - ../../../../../drivers/Timer.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../hal/ticker_api.h ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/mbed_sleep.h ../../../../../hal/sleep_api.h \ - ../../stubs/Timer_stub.h - -../../../../../drivers/Timer.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/mbed_sleep.h: - -../../../../../hal/sleep_api.h: - -../../stubs/Timer_stub.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.gcda deleted file mode 100644 index d759ea4b70..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.gcno deleted file mode 100644 index 42b7647e32..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.o deleted file mode 100644 index ff64901f37..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/Timer_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.d deleted file mode 100644 index 7466b77037..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.d +++ /dev/null @@ -1,3 +0,0 @@ -objs/ATHandler_unit/athandlertest.o: athandlertest.cpp test_athandler.h - -test_athandler.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.gcda deleted file mode 100644 index d44757f4f5..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.gcno deleted file mode 100644 index 249102a954..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.o deleted file mode 100644 index e40502e0c9..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/athandlertest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.d deleted file mode 100644 index 6f83b40617..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/ATHandler_unit/equeue_stub.o: ../../stubs/equeue_stub.c \ - ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.gcda deleted file mode 100644 index 4376fd6e37..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.gcno deleted file mode 100644 index e8e13c0ba7..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.o deleted file mode 100644 index 76b7c72d1f..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/equeue_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.d deleted file mode 100644 index e3dff71358..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/ATHandler_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.gcda deleted file mode 100644 index f6ec267ae0..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.gcno deleted file mode 100644 index d2a11b5a9f..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.o deleted file mode 100644 index 2d12c8dada..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.d deleted file mode 100644 index 2ced35bcf6..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/ATHandler_unit/mbed_assert_stub.o: ../../stubs/mbed_assert_stub.cpp \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.gcda deleted file mode 100644 index 764230abe5..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.gcno deleted file mode 100644 index 209183096f..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.o deleted file mode 100644 index 466ee4d189..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.d deleted file mode 100644 index b3ad87c0a0..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.d +++ /dev/null @@ -1,6 +0,0 @@ -objs/ATHandler_unit/mbed_poll_stub.o: ../../stubs/mbed_poll_stub.cpp \ - ../../../../../platform/mbed_poll.h ../../stubs/mbed_poll_stub.h - -../../../../../platform/mbed_poll.h: - -../../stubs/mbed_poll_stub.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.gcda deleted file mode 100644 index 454789ed2b..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.gcno deleted file mode 100644 index 11fd3d7746..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.o deleted file mode 100644 index c44c647b0e..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_poll_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.d deleted file mode 100644 index 2be1919781..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.d +++ /dev/null @@ -1,5 +0,0 @@ -objs/ATHandler_unit/mbed_wait_api_stub.o: \ - ../../stubs/mbed_wait_api_stub.cpp \ - ../../../../../platform/mbed_wait_api.h - -../../../../../platform/mbed_wait_api.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.gcda deleted file mode 100644 index 0a8159f5ae..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.gcno deleted file mode 100644 index e9adb29ca9..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.o deleted file mode 100644 index 45521d8d9d..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/mbed_wait_api_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.d deleted file mode 100644 index 210c5bba87..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.d +++ /dev/null @@ -1,123 +0,0 @@ -objs/ATHandler_unit/test_athandler.o: test_athandler.cpp test_athandler.h \ - ../../../framework/AT/AT_CellularNetwork.h \ - ../../../framework/API/CellularNetwork.h \ - ../../../../../features/netsocket/CellularInterface.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../features/netsocket/SocketAddress.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../features/netsocket/NetworkInterface.h \ - ../../../framework/common/CellularList.h \ - ../../../framework/AT/AT_CellularBase.h \ - ../../../framework/AT/ATHandler.h \ - ../../target_h/platform/mbed_retarget.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h \ - ../../../../../features/netsocket/nsapi_types.h \ - ../../../../../platform/Callback.h \ - ../../../../../features/netsocket/NetworkStack.h \ - ../../../framework/AT/ATHandler.h \ - ../../../framework/AT/AT_CellularStack.h ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/device.h ../../target_h/PinNames.h \ - ../../target_h/PeripheralNames.h ../../../framework/common/CellularLog.h \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../../../../platform/mbed_debug.h ../../stubs/mbed_poll_stub.h \ - ../../stubs/Timer_stub.h - -test_athandler.h: - -../../../framework/AT/AT_CellularNetwork.h: - -../../../framework/API/CellularNetwork.h: - -../../../../../features/netsocket/CellularInterface.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../features/netsocket/SocketAddress.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../features/netsocket/NetworkInterface.h: - -../../../framework/common/CellularList.h: - -../../../framework/AT/AT_CellularBase.h: - -../../../framework/AT/ATHandler.h: - -../../target_h/platform/mbed_retarget.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../features/netsocket/nsapi_types.h: - -../../../../../platform/Callback.h: - -../../../../../features/netsocket/NetworkStack.h: - -../../../framework/AT/ATHandler.h: - -../../../framework/AT/AT_CellularStack.h: - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../framework/common/CellularLog.h: - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../../../../platform/mbed_debug.h: - -../../stubs/mbed_poll_stub.h: - -../../stubs/Timer_stub.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.gcda deleted file mode 100644 index d97e1dced0..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.gcno deleted file mode 100644 index 5914e7626a..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.o deleted file mode 100644 index 286c523f16..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/test_athandler.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.d b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.d deleted file mode 100644 index 67cc6f184a..0000000000 --- a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.d +++ /dev/null @@ -1,9 +0,0 @@ -objs/ATHandler_unit/us_ticker_stub.o: ../../stubs/us_ticker_stub.cpp \ - ../../../../../hal/us_ticker_api.h ../../../../../hal/ticker_api.h \ - ../../target_h/device.h - -../../../../../hal/us_ticker_api.h: - -../../../../../hal/ticker_api.h: - -../../target_h/device.h: diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.gcda b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.gcda deleted file mode 100644 index d3992812a7..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.gcno b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.gcno deleted file mode 100644 index a38fbfb8d1..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.o b/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.o deleted file mode 100644 index b42c561e27..0000000000 Binary files a/features/cellular/UNITTESTS/at/athandler/objs/ATHandler_unit/us_ticker_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/cpputest_util.xml b/features/cellular/UNITTESTS/common/util/cpputest_util.xml deleted file mode 100644 index 01006aa0db..0000000000 --- a/features/cellular/UNITTESTS/common/util/cpputest_util.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/common/util/gcov/CellularUtil.cpp.gcov b/features/cellular/UNITTESTS/common/util/gcov/CellularUtil.cpp.gcov deleted file mode 100644 index 628e5cc733..0000000000 --- a/features/cellular/UNITTESTS/common/util/gcov/CellularUtil.cpp.gcov +++ /dev/null @@ -1,331 +0,0 @@ - -: 0:Source:../../../framework/common/CellularUtil.cpp - -: 0:Graph:objs/util_unit/CellularUtil.gcno - -: 0:Data:objs/util_unit/CellularUtil.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) , Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17:#include "CellularUtil.h" - -: 18:#include - -: 19:#include - -: 20: - -: 21:namespace mbed_cellular_util { - -: 22: - 7: 23:void convert_ipv6(char* ip) - -: 24:{ - 7: 25: if (!ip) { - 1: 26: return; - -: 27: } - -: 28: - 6: 29: int len = strlen(ip); - 6: 30: int pos = 0; - -: 31: int i; - -: 32: - 57: 33: for (i = 0; i < len; i++) { - 57: 34: if (ip[i] == '.') { - 24: 35: pos++; - -: 36: } - 57: 37: if (pos > 3) { - 6: 38: break; - -: 39: } - -: 40: } - -: 41: - -: 42: // more that 3 periods mean that it was ipv6 but in format of a1.a2.a3.a4.a5.a6.a7.a8.a9.a10.a11.a12.a13.a14.a15.a16 - -: 43: // we need to convert it to hexadecimal format separated with colons - 6: 44: if (pos > 3) { - 6: 45: pos = 0; - 6: 46: int ip_pos = 0; - -: 47: char b; - 6: 48: bool set_colon = false; - 262: 49: for (i = 0; i < len; i++) { - 256: 50: if (ip[i] == '.') { - 90: 51: b = (char)strtol (ip+ip_pos, NULL, 10); // convert to char to int so we can change it to hex string - 90: 52: pos += char_str_to_hex_str(&b, 1, ip+pos, !set_colon); // omit leading zeroes with using set_colon flag - 90: 53: if (set_colon) { - 42: 54: ip[pos++] = ':'; - 42: 55: set_colon = false; - -: 56: } else { - 48: 57: set_colon = true; - -: 58: } - 90: 59: ip_pos = i+1; // skip the '.' - -: 60: } - -: 61: - -: 62: // handle the last part which does not end with '.' but '\0' - 256: 63: if (i == len -1) { - 6: 64: b = (char)strtol(ip+ip_pos, NULL, 10); - 6: 65: pos += char_str_to_hex_str(&b, 1, ip+pos, !set_colon); - 6: 66: ip[pos] = '\0'; - -: 67: } - -: 68: } - -: 69: } - -: 70:} - -: 71: - -: 72:// For example "32.1.13.184.0.0.205.48.0.0.0.0.0.0.0.0" - 6: 73:void separate_ip4like_addresses(char* orig, char* ip, size_t ip_size, char* ip2, size_t ip2_size) - -: 74:{ - -: 75: // ipv4-like notation - 6: 76: int len = strlen(orig); - 6: 77: int count = 0, i = 0, pos = 0; - -: 78: char *temp; - -: 79: - 414: 80: for (; i < len; i++) { - 204: 81: if (orig[i] == '.') { - 74: 82: count++; - 74: 83: if (count == 4) { - 4: 84: pos = i; - 70: 85: } else if (count == 16) { - 1: 86: pos = i; - -: 87: } - -: 88: } - -: 89: } - -: 90: - 6: 91: if (count == 3) { // normal ipv4, copy to ip - 2: 92: if (ip_size > strlen(orig)) { - 2: 93: memcpy(ip, orig, strlen(orig)); - 2: 94: ip[strlen(orig)] = '\0'; - -: 95: } else { - #####: 96: ip[0] = '\0'; - -: 97: } - 2: 98: if (ip2) { - 1: 99: ip2[0] = '\0'; - -: 100: } - 4: 101: } else if (count == 7) { // ipv4 and subnet mask. Need to separate those. - 1: 102: temp = &orig[pos]; - 1: 103: if ((uint8_t)ip_size > temp-orig) { - 1: 104: memcpy(ip, orig, temp-orig); - 1: 105: ip[temp-orig] = '\0'; - -: 106: } - 1: 107: temp++; // skip the '.' - 1: 108: if (ip2 && (ip2_size > strlen(temp))) { - 1: 109: memcpy(ip2, temp, strlen(temp)); - 1: 110: ip2[strlen(temp)] = '\0'; - -: 111: } - 3: 112: } else if (count == 15) { // only one ipv6 address in ipv4-like notation - 2: 113: if (ip_size > strlen(orig)) { - 2: 114: memcpy(ip, orig, strlen(orig)); - 2: 115: ip[strlen(orig)] = '\0'; - 2: 116: convert_ipv6(ip); - -: 117: } else { - #####: 118: ip[0] = '\0'; - -: 119: } - 2: 120: if (ip2) { - 1: 121: ip2[0] = '\0'; - -: 122: } - 1: 123: } else if (count == 31){ // ipv6 + ipv6subnet mask in ipv4-like notation separated by dot '.' - 1: 124: temp = &orig[pos]; - 1: 125: if ((uint8_t)ip_size > temp-orig) { - 1: 126: memcpy(ip, orig, temp-orig); - 1: 127: ip[temp-orig] = '\0'; - 1: 128: convert_ipv6(ip); - -: 129: } - 1: 130: temp++; // skip the '.' - 1: 131: if (ip2 && (ip2_size > strlen(temp))) { - 1: 132: memcpy(ip2, temp, strlen(temp)); - 1: 133: ip2[strlen(temp)] = '\0'; - 1: 134: convert_ipv6(ip2); - -: 135: } - -: 136: } - 6: 137:} - -: 138: - 8: 139:void separate_ip_addresses(char* orig, char* ip, size_t ip_size, char* ip2, size_t ip2_size) - -: 140:{ - -: 141: // orig can include ipv4, ipv6, both or two ip4/ipv6 addresses. - -: 142: // also format depends on possible AT+CGPIAF - 8: 143: if (!orig || !ip) { - #####: 144: if (ip) { - #####: 145: ip[0] = '\0'; - -: 146: } - #####: 147: if (ip2) { - #####: 148: ip2[0] = '\0'; - -: 149: } - #####: 150: return; - -: 151: } - -: 152: // 1. try to found ':'. If it's found then we know that possible addresses are separated with space - -: 153: char *temp; - 8: 154: temp = strchr(orig, ':'); - -: 155: - 8: 156: if (temp != NULL) { - -: 157: // found ':' - 3: 158: temp = strstr(orig, " "); - -: 159: // found space as separator and it wasn't in beginning --> contains 2 ip addresses - 3: 160: if (temp && temp != orig) { - 2: 161: if ((uint8_t)ip_size > temp-orig) { - 2: 162: memcpy(ip, orig, temp-orig); - 2: 163: ip[temp-orig] = '\0'; - -: 164: } else { - #####: 165: ip[0] = '\0'; - -: 166: } - 2: 167: temp++; // skip the space - 4: 168: if (ip2 && (ip2_size > strlen(temp))) { - 2: 169: memcpy(ip2, temp, strlen(temp)); - 2: 170: ip2[strlen(temp)] = '\0'; - -: 171: } else { - #####: 172: ip2[0] = '\0'; - -: 173: } - -: 174: } else { - -: 175: // Space was the first char or no space found ---> only one ip, copy to ip - 1: 176: size_t size = strlen(orig); - 1: 177: if (temp) { - #####: 178: size = strlen(temp); - -: 179: } - -: 180: - 1: 181: if (ip_size > size) { - 1: 182: memcpy(ip, orig, size); - 1: 183: ip[size] = '\0'; - -: 184: } else { - #####: 185: ip[0] = '\0'; - -: 186: } - 1: 187: if (ip2) { - 1: 188: ip2[0] = '\0'; - -: 189: } - -: 190: } - -: 191: } else { - 5: 192: temp = strstr(orig, " "); - -: 193: // found space as separator and it wasn't in beginning --> contains 2 ip addresses - 5: 194: if (temp && temp != orig) { - 1: 195: separate_ip4like_addresses(temp++, ip2, ip2_size, NULL, 0); - 1: 196: orig[temp-orig-1] = '\0'; - 1: 197: separate_ip4like_addresses(orig, ip, ip_size, NULL, 0); - 1: 198: orig[temp-orig-1] = ' '; // put space back to keep orig as original - -: 199: } - -: 200: else { - 4: 201: separate_ip4like_addresses(orig, ip, ip_size, ip2, ip2_size); - -: 202: } - -: 203: } - -: 204:} - -: 205: - 2: 206:void prefer_ipv6(char* ip, size_t ip_size, char* ip2, size_t ip2_size) - -: 207:{ - 2: 208: if (!ip || !ip2) { - #####: 209: return; - -: 210: } - -: 211: // assume that that ipv6 is already in formatted to use ':' - -: 212: // 1. try to found ':'. If it's found then we know that this is ipv6 - -: 213: char *temp; - 2: 214: temp = strchr(ip, ':'); - 2: 215: if (temp) { - -: 216: // ip has ipv6 address, we can leave - #####: 217: return; - -: 218: } else { - -: 219: // ip was not ipv6, check if ip2 is - 2: 220: temp = strchr(ip2, ':'); - 2: 221: if (temp) { - -: 222: // ipv6 was found in ip2 but not in ip ---> we must swap them. Sadly ip and ip2 might not be pointers - -: 223: // so we can't just swap them, must use copy. - 2: 224: if (strlen(ip) < ip2_size && strlen(ip2) < ip_size && strlen(ip) < 64) { - -: 225: char tmp[64]; - 1: 226: strncpy(tmp, ip, strlen(ip)); - 1: 227: tmp[strlen(ip)] = '\0'; - 1: 228: strncpy(ip, ip2, strlen(ip2)); - 1: 229: ip[strlen(ip2)] = '\0'; - 1: 230: strncpy(ip2, tmp, strlen(tmp)); - 1: 231: ip2[strlen(tmp)] = '\0'; - -: 232: } - -: 233: } - -: 234: } - -: 235:} - -: 236: - #####: 237:void int_to_hex_str(uint8_t num, char* buf) - -: 238:{ - #####: 239: char charNum = num; - #####: 240: char_str_to_hex_str(&charNum, 1, buf); - #####: 241:} - -: 242: - #####: 243:int hex_str_to_int(const char *hex_string, int hex_string_length) - -: 244:{ - #####: 245: const int base = 16; - #####: 246: int character_as_integer, integer_output = 0; - -: 247: - #####: 248: for (int i=0;i= '0' && hex_string[i] <= '9') { - #####: 250: character_as_integer = hex_string[i] - '0'; - #####: 251: } else if (hex_string[i] >= 'A' && hex_string[i] <= 'F') { - #####: 252: character_as_integer = hex_string[i] - 'A' + 10; - -: 253: } else { - #####: 254: character_as_integer = hex_string[i] - 'a' + 10; - -: 255: } - #####: 256: integer_output *= base; - #####: 257: integer_output += character_as_integer; - -: 258: } - -: 259: - #####: 260: return integer_output; - -: 261:} - -: 262: - #####: 263:int hex_str_to_char_str(const char* str, uint16_t len, char *buf) - -: 264:{ - #####: 265: int strcount = 0; - #####: 266: for (int i = 0; i+1 < len; i += 2) { - #####: 267: int upper = hex_str_to_int(str+i, 1); - #####: 268: int lower = hex_str_to_int(str+i+1, 1); - #####: 269: buf[strcount] = ((upper<<4) & 0xF0) | (lower & 0x0F); - #####: 270: strcount++; - -: 271: } - -: 272: - #####: 273: return strcount; - -: 274:} - -: 275: - 3: 276:void uint_to_binary_str(uint32_t num, char* str, int str_size, int bit_cnt) - -: 277:{ - 3: 278: if (!str || str_size < bit_cnt) { - 2: 279: return; - -: 280: } - 1: 281: int tmp, pos = 0; - -: 282: - 33: 283: for (int i = 31; i >= 0; i--) { - 32: 284: tmp = num >> i; - 32: 285: if (i < bit_cnt) { - 32: 286: if (tmp&1) { - 4: 287: str[pos] = 1 + '0'; - -: 288: } else { - 28: 289: str[pos] = 0 + '0'; - -: 290: } - 32: 291: pos++; - -: 292: } - -: 293: } - -: 294:} - -: 295: - 102: 296:int char_str_to_hex_str(const char* str, uint16_t len, char *buf, bool omit_leading_zero) - -: 297:{ - 102: 298: if (!str || !buf) { - 2: 299: return 0; - -: 300: } - -: 301: - 100: 302: char *ptr = buf; - 100: 303: int i=0; - 334: 304: while (i < len) { - 117: 305: if (omit_leading_zero == true && i == 0 && !(str[i]>>4 & 0x0F)) { - 33: 306: *ptr++ = hex_values[(str[i]) & 0x0F]; - -: 307: } else { - 84: 308: *ptr++ = hex_values[((str[i])>>4) & 0x0F]; - 84: 309: *ptr++ = hex_values[(str[i]) & 0x0F]; - -: 310: } - 117: 311: i++; - -: 312: } - 100: 313: return ptr-buf; - -: 314:} - -: 315: - #####: 316:uint16_t get_dynamic_ip_port() - -: 317:{ - -: 318: static uint16_t port; - #####: 319: port++; - #####: 320: if (port < 49152) { - #####: 321: port = 49152; - -: 322: } - #####: 323: return port; - -: 324:} - -: 325: - -: 326:} // namespace mbed_cellular_util diff --git a/features/cellular/UNITTESTS/common/util/gcov/gcov_error.txt b/features/cellular/UNITTESTS/common/util/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/common/util/gcov/gcov_output.txt b/features/cellular/UNITTESTS/common/util/gcov/gcov_output.txt deleted file mode 100644 index a7cd4efb0f..0000000000 --- a/features/cellular/UNITTESTS/common/util/gcov/gcov_output.txt +++ /dev/null @@ -1,4 +0,0 @@ -File '../../../framework/common/CellularUtil.cpp' -Lines executed:76.14% of 176 -Creating 'CellularUtil.cpp.gcov' - diff --git a/features/cellular/UNITTESTS/common/util/gcov/gcov_report.txt b/features/cellular/UNITTESTS/common/util/gcov/gcov_report.txt deleted file mode 100644 index 7525c2799b..0000000000 --- a/features/cellular/UNITTESTS/common/util/gcov/gcov_report.txt +++ /dev/null @@ -1 +0,0 @@ - 76.14% ../framework/common/CellularUtil.cpp diff --git a/features/cellular/UNITTESTS/common/util/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/common/util/gcov/gcov_report.txt.html deleted file mode 100644 index 4bf39337bd..0000000000 --- a/features/cellular/UNITTESTS/common/util/gcov/gcov_report.txt.html +++ /dev/null @@ -1,4 +0,0 @@ - - - -
CoverageFile
76.14% ../framework/common/CellularUtil.cpp
diff --git a/features/cellular/UNITTESTS/common/util/lib/libutil_unit.a b/features/cellular/UNITTESTS/common/util/lib/libutil_unit.a deleted file mode 100644 index 97d5a04be6..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/lib/libutil_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.d b/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.d deleted file mode 100644 index e23f196db0..0000000000 --- a/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/util_unit/CellularUtil.o: ../../../framework/common/CellularUtil.cpp \ - ../../../framework/common/CellularUtil.h - -../../../framework/common/CellularUtil.h: diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.gcda b/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.gcda deleted file mode 100644 index bf590baee3..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.gcno b/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.gcno deleted file mode 100644 index 197220621c..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.o b/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.o deleted file mode 100644 index fa2fda8860..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/CellularUtil.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/main.d b/features/cellular/UNITTESTS/common/util/objs/util_unit/main.d deleted file mode 100644 index 3baca20fba..0000000000 --- a/features/cellular/UNITTESTS/common/util/objs/util_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/util_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/main.gcda b/features/cellular/UNITTESTS/common/util/objs/util_unit/main.gcda deleted file mode 100644 index 32ebb7ee97..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/main.gcno b/features/cellular/UNITTESTS/common/util/objs/util_unit/main.gcno deleted file mode 100644 index e4506ee04d..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/main.o b/features/cellular/UNITTESTS/common/util/objs/util_unit/main.o deleted file mode 100644 index 8f09eb696f..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.d b/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.d deleted file mode 100644 index 6e19e89c1f..0000000000 --- a/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.d +++ /dev/null @@ -1,6 +0,0 @@ -objs/util_unit/test_util.o: test_util.cpp test_util.h \ - ../../../framework/common/CellularUtil.h - -test_util.h: - -../../../framework/common/CellularUtil.h: diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.gcda b/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.gcda deleted file mode 100644 index cedf36c5b5..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.gcno b/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.gcno deleted file mode 100644 index 529a953ac2..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.o b/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.o deleted file mode 100644 index 37b53de2a1..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/test_util.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.d b/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.d deleted file mode 100644 index a303d4acd5..0000000000 --- a/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.d +++ /dev/null @@ -1,3 +0,0 @@ -objs/util_unit/utiltest.o: utiltest.cpp test_util.h - -test_util.h: diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.gcda b/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.gcda deleted file mode 100644 index adce1585cd..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.gcno b/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.gcno deleted file mode 100644 index a105de04de..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.o b/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.o deleted file mode 100644 index 7f95435358..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/objs/util_unit/utiltest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/util_unit_tests b/features/cellular/UNITTESTS/common/util/util_unit_tests deleted file mode 100755 index 4ca0249163..0000000000 Binary files a/features/cellular/UNITTESTS/common/util/util_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/common/util/util_unit_tests.txt b/features/cellular/UNITTESTS/common/util/util_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/Makefile b/features/cellular/UNITTESTS/mux/cellular_mux/Makefile similarity index 56% rename from features/cellular/UNITTESTS/mux/mbed_mux/Makefile rename to features/cellular/UNITTESTS/mux/cellular_mux/Makefile index 4fe1805ba4..175292aad3 100644 --- a/features/cellular/UNITTESTS/mux/mbed_mux/Makefile +++ b/features/cellular/UNITTESTS/mux/cellular_mux/Makefile @@ -1,15 +1,15 @@ include ../../makefile_defines.txt -COMPONENT_NAME = mbed_mux_unit +COMPONENT_NAME = cellular_mux_unit #This must be changed manually SRC_FILES = \ - ../../../framework/mux/mbed_mux.c + ../../../framework/mux/cellular_mux.c TEST_SRC_FILES = \ main.cpp \ - mbed_muxtest.cpp \ - test_mbed_mux.cpp \ + cellular_muxtest.cpp \ + test_cellular_mux.cpp \ include ../../MakefileWorker.mk diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/mbed_muxtest.cpp b/features/cellular/UNITTESTS/mux/cellular_mux/cellular_muxtest.cpp similarity index 58% rename from features/cellular/UNITTESTS/mux/mbed_mux/mbed_muxtest.cpp rename to features/cellular/UNITTESTS/mux/cellular_mux/cellular_muxtest.cpp index 0c35f2150c..781d34392e 100644 --- a/features/cellular/UNITTESTS/mux/mbed_mux/mbed_muxtest.cpp +++ b/features/cellular/UNITTESTS/mux/cellular_mux/cellular_muxtest.cpp @@ -2,15 +2,15 @@ * Copyright (c) 2015 ARM. All rights reserved. */ #include "CppUTest/TestHarness.h" -#include "test_mbed_mux.h" +#include "test_cellular_mux.h" -TEST_GROUP(mbed_mux) +TEST_GROUP(cellular_mux) { - Test_mbed_mux* unit; + Test_cellular_mux* unit; void setup() { - unit = new Test_mbed_mux(); + unit = new Test_cellular_mux(); } void teardown() @@ -19,7 +19,7 @@ TEST_GROUP(mbed_mux) } }; -TEST(mbed_mux, Create) +TEST(cellular_mux, Create) { CHECK(unit != NULL); } diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/main.cpp b/features/cellular/UNITTESTS/mux/cellular_mux/main.cpp similarity index 90% rename from features/cellular/UNITTESTS/mux/mbed_mux/main.cpp rename to features/cellular/UNITTESTS/mux/cellular_mux/main.cpp index 06cc58b5c3..931ae4db51 100644 --- a/features/cellular/UNITTESTS/mux/mbed_mux/main.cpp +++ b/features/cellular/UNITTESTS/mux/cellular_mux/main.cpp @@ -11,5 +11,5 @@ int main(int ac, char** av) return CommandLineTestRunner::RunAllTests(ac, av); } -IMPORT_TEST_GROUP(mbed_mux); +IMPORT_TEST_GROUP(cellular_mux); diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/test_mbed_mux.cpp b/features/cellular/UNITTESTS/mux/cellular_mux/test_cellular_mux.cpp similarity index 52% rename from features/cellular/UNITTESTS/mux/mbed_mux/test_mbed_mux.cpp rename to features/cellular/UNITTESTS/mux/cellular_mux/test_cellular_mux.cpp index 3eccddbbe1..75883d97f1 100644 --- a/features/cellular/UNITTESTS/mux/mbed_mux/test_mbed_mux.cpp +++ b/features/cellular/UNITTESTS/mux/cellular_mux/test_cellular_mux.cpp @@ -2,15 +2,15 @@ * Copyright (c) 2018 ARM. All rights reserved. */ #include "CppUTest/TestHarness.h" -#include "test_mbed_mux.h" +#include "test_cellular_mux.h" #include -Test_mbed_mux::Test_mbed_mux() +Test_cellular_mux::Test_cellular_mux() { } -Test_mbed_mux::~Test_mbed_mux() +Test_cellular_mux::~Test_cellular_mux() { } diff --git a/features/cellular/UNITTESTS/mux/cellular_mux/test_cellular_mux.h b/features/cellular/UNITTESTS/mux/cellular_mux/test_cellular_mux.h new file mode 100644 index 0000000000..f144af6f4e --- /dev/null +++ b/features/cellular/UNITTESTS/mux/cellular_mux/test_cellular_mux.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018 ARM. All rights reserved. + */ +#ifndef TEST_cellular_mux_H +#define TEST_cellular_mux_H + +class Test_cellular_mux +{ +public: + Test_cellular_mux(); + + virtual ~Test_cellular_mux(); +}; + +#endif // TEST_cellular_mux_H + diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/Makefile b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/Makefile similarity index 53% rename from features/cellular/UNITTESTS/mux/mbed_mux_data_service/Makefile rename to features/cellular/UNITTESTS/mux/cellular_mux_data_service/Makefile index a1f34e7863..28479f631e 100644 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/Makefile +++ b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/Makefile @@ -1,17 +1,17 @@ include ../../makefile_defines.txt -COMPONENT_NAME = mbed_mux_data_service_unit +COMPONENT_NAME = cellular_mux_data_service_unit #This must be changed manually SRC_FILES = \ - ../../../framework/mux/mbed_mux_data_service.c + ../../../framework/mux/cellular_mux_data_service.c TEST_SRC_FILES = \ main.cpp \ - mbed_mux_data_servicetest.cpp \ - test_mbed_mux_data_service.cpp \ + cellular_mux_data_servicetest.cpp \ + test_cellular_mux_data_service.cpp \ ../../stubs/FileHandle_stub.cpp \ - ../../stubs/mbed_mux_stub.cpp \ + ../../stubs/cellular_mux_stub.cpp \ ../../stubs/mbed_assert_stub.cpp \ include ../../MakefileWorker.mk diff --git a/features/cellular/UNITTESTS/mux/cellular_mux_data_service/cellular_mux_data_servicetest.cpp b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/cellular_mux_data_servicetest.cpp new file mode 100644 index 0000000000..5748f9111c --- /dev/null +++ b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/cellular_mux_data_servicetest.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2015 ARM. All rights reserved. + */ +#include "CppUTest/TestHarness.h" +#include "test_cellular_mux_data_service.h" + +TEST_GROUP(cellular_mux_data_service) +{ + Test_cellular_mux_data_service* unit; + + void setup() + { + unit = new Test_cellular_mux_data_service(); + } + + void teardown() + { + delete unit; + } +}; + +TEST(cellular_mux_data_service, Create) +{ + CHECK(unit != NULL); +} + +TEST(cellular_mux_data_service, test_cellular_mux_write) +{ + unit->test_cellular_mux_write(); +} + +TEST(cellular_mux_data_service, test_cellular_mux_read) +{ + unit->test_cellular_mux_read(); +} + +TEST(cellular_mux_data_service, test_cellular_mux_seek) +{ + unit->test_cellular_mux_seek(); +} + +TEST(cellular_mux_data_service, test_cellular_mux_close) +{ + unit->test_cellular_mux_close(); +} + +TEST(cellular_mux_data_service, test_cellular_mux_sigio) +{ + unit->test_cellular_mux_sigio(); +} diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/main.cpp b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/main.cpp similarity index 86% rename from features/cellular/UNITTESTS/mux/mbed_mux_data_service/main.cpp rename to features/cellular/UNITTESTS/mux/cellular_mux_data_service/main.cpp index 2e23232e3f..5fd20855ae 100644 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/main.cpp +++ b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/main.cpp @@ -11,5 +11,5 @@ int main(int ac, char** av) return CommandLineTestRunner::RunAllTests(ac, av); } -IMPORT_TEST_GROUP(mbed_mux_data_service); +IMPORT_TEST_GROUP(cellular_mux_data_service); diff --git a/features/cellular/UNITTESTS/mux/cellular_mux_data_service/test_cellular_mux_data_service.cpp b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/test_cellular_mux_data_service.cpp new file mode 100644 index 0000000000..a2f45a8cb2 --- /dev/null +++ b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/test_cellular_mux_data_service.cpp @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018 ARM. All rights reserved. + */ +#include "CppUTest/TestHarness.h" +#include "test_cellular_mux_data_service.h" +#include "cellular_mux.h" +#include "cellular_mux_stub.h" +#include + +using namespace mbed; + +Test_cellular_mux_data_service::Test_cellular_mux_data_service() +{ + +} + +Test_cellular_mux_data_service::~Test_cellular_mux_data_service() +{ +} + +void Test_cellular_mux_data_service::test_cellular_mux_write() +{ + MuxDataService mux; + char table[] = "ss"; + cellular_mux_stub::size_value = 6; + CHECK(6 == mux.write(table, 2)); +} + +void Test_cellular_mux_data_service::test_cellular_mux_read() +{ + MuxDataService mux; + char table[6]; + + cellular_mux_stub::size_value = 67; + CHECK(67 == mux.read(table, 6)); +} + +void Test_cellular_mux_data_service::test_cellular_mux_seek() +{ + MuxDataService mux; + CHECK(0 == mux.seek(0)); +} + +void Test_cellular_mux_data_service::test_cellular_mux_close() +{ + MuxDataService mux; + CHECK(0 == mux.close()); +} + +void cb() +{ + +} + +void Test_cellular_mux_data_service::test_cellular_mux_sigio() +{ + MuxDataService mux; + mux.sigio(cb); +} + diff --git a/features/cellular/UNITTESTS/mux/cellular_mux_data_service/test_cellular_mux_data_service.h b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/test_cellular_mux_data_service.h new file mode 100644 index 0000000000..dc621ef313 --- /dev/null +++ b/features/cellular/UNITTESTS/mux/cellular_mux_data_service/test_cellular_mux_data_service.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2018 ARM. All rights reserved. + */ +#ifndef TEST_cellular_mux_DATA_SERVICE_H +#define TEST_cellular_mux_DATA_SERVICE_H + +class Test_cellular_mux_data_service +{ +public: + Test_cellular_mux_data_service(); + + virtual ~Test_cellular_mux_data_service(); + + void test_cellular_mux_write(); + + void test_cellular_mux_read(); + + void test_cellular_mux_seek(); + + void test_cellular_mux_close(); + + void test_cellular_mux_sigio(); +}; + +#endif // TEST_cellular_mux_DATA_SERVICE_H + diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/cpputest_mbed_mux.xml b/features/cellular/UNITTESTS/mux/mbed_mux/cpputest_mbed_mux.xml deleted file mode 100644 index f07d3a57de..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/cpputest_mbed_mux.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/gcov_error.txt b/features/cellular/UNITTESTS/mux/mbed_mux/gcov_error.txt deleted file mode 100644 index 4c0badec5d..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/gcov_error.txt +++ /dev/null @@ -1 +0,0 @@ -objs/mbed_mux_unit/mbed_mux.gcda:cannot open data file, assuming not executed diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/gcov_output.txt b/features/cellular/UNITTESTS/mux/mbed_mux/gcov_output.txt deleted file mode 100644 index ba7ddabb23..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/gcov_output.txt +++ /dev/null @@ -1,32 +0,0 @@ -File '../../../framework/mux/mbed_mux.cpp' -No executable lines -Removing 'mbed_mux.cpp.gcov' - -File '../../../../../platform/Callback.h' -No executable lines -Removing 'Callback.h.gcov' - -File '../../../../../events/EventQueue.h' -No executable lines -Removing 'EventQueue.h.gcov' - -File '../../../../../platform/NonCopyable.h' -No executable lines -Removing 'NonCopyable.h.gcov' - -File '../../../framework/mux/mbed_mux.h' -No executable lines -Removing 'mbed_mux.h.gcov' - -File '../../../../../platform/FileHandle.h' -No executable lines -Removing 'FileHandle.h.gcov' - -File '../../../../../platform/PlatformMutex.h' -No executable lines -Removing 'PlatformMutex.h.gcov' - -File '/usr/include/c++/5/new' -No executable lines -Removing 'new.gcov' - diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/gcov_report.txt b/features/cellular/UNITTESTS/mux/mbed_mux/gcov_report.txt deleted file mode 100644 index 0749f0c9fc..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/gcov_report.txt +++ /dev/null @@ -1,9 +0,0 @@ - - 0.00% objs/mbed_mux_unit/mbed_mux., assuming not executed -No executable lines File ../events/EventQueue.h -No executable lines File ../framework/mux/mbed_mux.cpp -No executable lines File ../framework/mux/mbed_mux.h -No executable lines File ../platform/Callback.h -No executable lines File ../platform/FileHandle.h -No executable lines File ../platform/NonCopyable.h -No executable lines File ../platform/PlatformMutex.h diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/gcov_report.txt.html b/features/cellular/UNITTESTS/mux/mbed_mux/gcov_report.txt.html deleted file mode 100644 index 6ac2d47a47..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/gcov_report.txt.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - -No executable lines File ../framework/mux/mbed_mux.cpp -No executable lines File ../framework/mux/mbed_mux.h -No executable lines File ../platform/Callback.h -No executable lines File ../platform/FileHandle.h -No executable lines File ../platform/NonCopyable.h -No executable lines File ../platform/PlatformMutex.h -
CoverageFile
0.00% objs/mbed_mux_unit/mbed_mux., assuming not executed -No executable lines File ../events/EventQueue.h
diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/lib/libmbed_mux_unit.a b/features/cellular/UNITTESTS/mux/mbed_mux/lib/libmbed_mux_unit.a deleted file mode 100644 index bd4fc1b37d..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/lib/libmbed_mux_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/mbed_mux_unit_tests b/features/cellular/UNITTESTS/mux/mbed_mux/mbed_mux_unit_tests deleted file mode 100755 index 3868d6bb41..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/mbed_mux_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/mbed_mux_unit_tests.txt b/features/cellular/UNITTESTS/mux/mbed_mux/mbed_mux_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.d b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.d deleted file mode 100644 index 24d81ea222..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/mbed_mux_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.gcda b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.gcda deleted file mode 100644 index 995ba43123..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.gcno b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.gcno deleted file mode 100644 index 7ee801059a..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.o b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.o deleted file mode 100644 index 3c596832fc..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_mux.d b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_mux.d deleted file mode 100644 index d0e9f254ca..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_mux.d +++ /dev/null @@ -1,74 +0,0 @@ -objs/mbed_mux_unit/mbed_mux.o: ../../../framework/mux/mbed_mux.cpp \ - ../../../framework/mux/mbed_mux.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h ../../../../../rtos/Semaphore.h \ - ../../target_h/cmsis_os2.h ../../target_h/mbed_rtos1_types.h \ - ../../target_h/mbed_rtos_storage.h ../../target_h/cmsis_os2.h \ - ../../target_h/rtx_os.h ../../target_h/rtx_lib.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../target_h/mbed_retarget.h - -../../../framework/mux/mbed_mux.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../rtos/Semaphore.h: - -../../target_h/cmsis_os2.h: - -../../target_h/mbed_rtos1_types.h: - -../../target_h/mbed_rtos_storage.h: - -../../target_h/cmsis_os2.h: - -../../target_h/rtx_os.h: - -../../target_h/rtx_lib.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../target_h/mbed_retarget.h: diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_mux.gcno b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_mux.gcno deleted file mode 100644 index 74eaa02ebf..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_mux.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_mux.o b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_mux.o deleted file mode 100644 index 2452353d3d..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_mux.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.d b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.d deleted file mode 100644 index 655901092b..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.d +++ /dev/null @@ -1,3 +0,0 @@ -objs/mbed_mux_unit/mbed_muxtest.o: mbed_muxtest.cpp test_mbed_mux.h - -test_mbed_mux.h: diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.gcda b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.gcda deleted file mode 100644 index 1b0e2e9f44..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.gcno b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.gcno deleted file mode 100644 index 2444b4b4a8..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.o b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.o deleted file mode 100644 index 908e1d397e..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/mbed_muxtest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.d b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.d deleted file mode 100644 index 38a6081602..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.d +++ /dev/null @@ -1,3 +0,0 @@ -objs/mbed_mux_unit/test_mbed_mux.o: test_mbed_mux.cpp test_mbed_mux.h - -test_mbed_mux.h: diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.gcda b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.gcda deleted file mode 100644 index e298d6f5c5..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.gcno b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.gcno deleted file mode 100644 index 1cc44eb8a9..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.o b/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.o deleted file mode 100644 index 18dc304c44..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux/objs/mbed_mux_unit/test_mbed_mux.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux/test_mbed_mux.h b/features/cellular/UNITTESTS/mux/mbed_mux/test_mbed_mux.h deleted file mode 100644 index 79b99aab6d..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux/test_mbed_mux.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2018 ARM. All rights reserved. - */ -#ifndef TEST_MBED_MUX_H -#define TEST_MBED_MUX_H - -class Test_mbed_mux -{ -public: - Test_mbed_mux(); - - virtual ~Test_mbed_mux(); -}; - -#endif // TEST_MBED_MUX_H - diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/cpputest_mbed_mux_data_service.xml b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/cpputest_mbed_mux_data_service.xml deleted file mode 100644 index 431720c96a..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/cpputest_mbed_mux_data_service.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/Callback.h.gcov b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/Callback.h.gcov deleted file mode 100644 index 3f46f0f77e..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/Callback.h.gcov +++ /dev/null @@ -1,4557 +0,0 @@ - -: 0:Source:../../../../../platform/Callback.h - -: 0:Graph:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcno - -: 0:Data:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* mbed Microcontroller Library - -: 2: * Copyright (c) 2006-2015 ARM Limited - -: 3: * - -: 4: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 5: * you may not use this file except in compliance with the License. - -: 6: * You may obtain a copy of the License at - -: 7: * - -: 8: * http://www.apache.org/licenses/LICENSE-2.0 - -: 9: * - -: 10: * Unless required by applicable law or agreed to in writing, software - -: 11: * distributed under the License is distributed on an "AS IS" BASIS, - -: 12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 13: * See the License for the specific language governing permissions and - -: 14: * limitations under the License. - -: 15: */ - -: 16:#ifndef MBED_CALLBACK_H - -: 17:#define MBED_CALLBACK_H - -: 18: - -: 19:#include - -: 20:#include - -: 21:#include - -: 22:#include "platform/mbed_assert.h" - -: 23:#include "platform/mbed_toolchain.h" - -: 24: - -: 25:namespace mbed { - -: 26:/** \addtogroup platform */ - -: 27:/** @{*/ - -: 28:/** - -: 29: * \defgroup platform_Callback Callback class - -: 30: * @{ - -: 31: */ - -: 32: - -: 33:/** Callback class based on template specialization - -: 34: * - -: 35: * @note Synchronization level: Not protected - -: 36: */ - -: 37:template - -: 38:class Callback; - -: 39: - -: 40:// Internal sfinae declarations - -: 41:// - -: 42:// These are used to eliminate overloads based on type attributes - -: 43:// 1. Does a function object have a call operator - -: 44:// 2. Does a function object fit in the available storage - -: 45:// - -: 46:// These eliminations are handled cleanly by the compiler and avoid - -: 47:// massive and misleading error messages when confronted with an - -: 48:// invalid type (or worse, runtime failures) - -: 49:namespace detail { - -: 50: struct nil {}; - -: 51: - -: 52: template - -: 53: struct enable_if { typedef R type; }; - -: 54: - -: 55: template - -: 56: struct enable_if {}; - -: 57: - -: 58: template - -: 59: struct is_type { - -: 60: static const bool value = true; - -: 61: }; - -: 62:} - -: 63: - -: 64:#define MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M) \ - -: 65: typename detail::enable_if< \ - -: 66: detail::is_type::value && \ - -: 67: sizeof(F) <= sizeof(uintptr_t) \ - -: 68: >::type = detail::nil() - -: 69: - -: 70:/** Callback class based on template specialization - -: 71: * - -: 72: * @note Synchronization level: Not protected - -: 73: */ - -: 74:template - -: 75:class Callback { - -: 76:public: - -: 77: /** Create a Callback with a static function - -: 78: * @param func Static function to attach - -: 79: */ - -: 80: Callback(R (*func)() = 0) { - -: 81: if (!func) { - -: 82: memset(this, 0, sizeof(Callback)); - -: 83: } else { - -: 84: generate(func); - -: 85: } - -: 86: } - -: 87: - -: 88: /** Attach a Callback - -: 89: * @param func The Callback to attach - -: 90: */ - 1: 91: Callback(const Callback &func) { - 1: 92: if (func._ops) { - 1: 93: func._ops->move(this, &func); - -: 94: } - 1: 95: _ops = func._ops; - 1: 96: } - -: 97: - -: 98: /** Create a Callback with a member function - -: 99: * @param obj Pointer to object to invoke member function on - -: 100: * @param method Member function to attach - -: 101: */ - -: 102: template - -: 103: Callback(U *obj, R (T::*method)()) { - -: 104: generate(method_context(obj, method)); - -: 105: } - -: 106: - -: 107: /** Create a Callback with a member function - -: 108: * @param obj Pointer to object to invoke member function on - -: 109: * @param method Member function to attach - -: 110: */ - -: 111: template - -: 112: Callback(const U *obj, R (T::*method)() const) { - -: 113: generate(method_context(obj, method)); - -: 114: } - -: 115: - -: 116: /** Create a Callback with a member function - -: 117: * @param obj Pointer to object to invoke member function on - -: 118: * @param method Member function to attach - -: 119: */ - -: 120: template - -: 121: Callback(volatile U *obj, R (T::*method)() volatile) { - -: 122: generate(method_context(obj, method)); - -: 123: } - -: 124: - -: 125: /** Create a Callback with a member function - -: 126: * @param obj Pointer to object to invoke member function on - -: 127: * @param method Member function to attach - -: 128: */ - -: 129: template - -: 130: Callback(const volatile U *obj, R (T::*method)() const volatile) { - -: 131: generate(method_context(obj, method)); - -: 132: } - -: 133: - -: 134: /** Create a Callback with a static function and bound pointer - -: 135: * @param func Static function to attach - -: 136: * @param arg Pointer argument to function - -: 137: */ - -: 138: template - -: 139: Callback(R (*func)(T*), U *arg) { - -: 140: generate(function_context(func, arg)); - -: 141: } - -: 142: - -: 143: /** Create a Callback with a static function and bound pointer - -: 144: * @param func Static function to attach - -: 145: * @param arg Pointer argument to function - -: 146: */ - -: 147: template - -: 148: Callback(R (*func)(const T*), const U *arg) { - -: 149: generate(function_context(func, arg)); - -: 150: } - -: 151: - -: 152: /** Create a Callback with a static function and bound pointer - -: 153: * @param func Static function to attach - -: 154: * @param arg Pointer argument to function - -: 155: */ - -: 156: template - -: 157: Callback(R (*func)(volatile T*), volatile U *arg) { - -: 158: generate(function_context(func, arg)); - -: 159: } - -: 160: - -: 161: /** Create a Callback with a static function and bound pointer - -: 162: * @param func Static function to attach - -: 163: * @param arg Pointer argument to function - -: 164: */ - -: 165: template - -: 166: Callback(R (*func)(const volatile T*), const volatile U *arg) { - -: 167: generate(function_context(func, arg)); - -: 168: } - -: 169: - -: 170: /** Create a Callback with a function object - -: 171: * @param f Function object to attach - -: 172: * @note The function object is limited to a single word of storage - -: 173: */ - -: 174: template - -: 175: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { - -: 176: generate(f); - -: 177: } - -: 178: - -: 179: /** Create a Callback with a function object - -: 180: * @param f Function object to attach - -: 181: * @note The function object is limited to a single word of storage - -: 182: */ - -: 183: template - -: 184: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { - -: 185: generate(f); - -: 186: } - -: 187: - -: 188: /** Create a Callback with a function object - -: 189: * @param f Function object to attach - -: 190: * @note The function object is limited to a single word of storage - -: 191: */ - -: 192: template - -: 193: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { - -: 194: generate(f); - -: 195: } - -: 196: - -: 197: /** Create a Callback with a function object - -: 198: * @param f Function object to attach - -: 199: * @note The function object is limited to a single word of storage - -: 200: */ - -: 201: template - -: 202: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { - -: 203: generate(f); - -: 204: } - -: 205: - -: 206: /** Create a Callback with a static function and bound pointer - -: 207: * @param obj Pointer to object to bind to function - -: 208: * @param func Static function to attach - -: 209: * @deprecated - -: 210: * Arguments to callback have been reordered to Callback(func, arg) - -: 211: */ - -: 212: template - -: 213: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 214: "Arguments to callback have been reordered to Callback(func, arg)") - -: 215: Callback(U *obj, R (*func)(T*)) { - -: 216: new (this) Callback(func, obj); - -: 217: } - -: 218: - -: 219: /** Create a Callback with a static function and bound pointer - -: 220: * @param obj Pointer to object to bind to function - -: 221: * @param func Static function to attach - -: 222: * @deprecated - -: 223: * Arguments to callback have been reordered to Callback(func, arg) - -: 224: */ - -: 225: template - -: 226: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 227: "Arguments to callback have been reordered to Callback(func, arg)") - -: 228: Callback(const U *obj, R (*func)(const T*)) { - -: 229: new (this) Callback(func, obj); - -: 230: } - -: 231: - -: 232: /** Create a Callback with a static function and bound pointer - -: 233: * @param obj Pointer to object to bind to function - -: 234: * @param func Static function to attach - -: 235: * @deprecated - -: 236: * Arguments to callback have been reordered to Callback(func, arg) - -: 237: */ - -: 238: template - -: 239: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 240: "Arguments to callback have been reordered to Callback(func, arg)") - -: 241: Callback(volatile U *obj, R (*func)(volatile T*)) { - -: 242: new (this) Callback(func, obj); - -: 243: } - -: 244: - -: 245: /** Create a Callback with a static function and bound pointer - -: 246: * @param obj Pointer to object to bind to function - -: 247: * @param func Static function to attach - -: 248: * @deprecated - -: 249: * Arguments to callback have been reordered to Callback(func, arg) - -: 250: */ - -: 251: template - -: 252: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 253: "Arguments to callback have been reordered to Callback(func, arg)") - -: 254: Callback(const volatile U *obj, R (*func)(const volatile T*)) { - -: 255: new (this) Callback(func, obj); - -: 256: } - -: 257: - -: 258: /** Destroy a callback - -: 259: */ - #####: 260: ~Callback() { - #####: 261: if (_ops) { - #####: 262: _ops->dtor(this); - -: 263: } - #####: 264: } - -: 265: - -: 266: /** Attach a static function - -: 267: * @param func Static function to attach - -: 268: * @deprecated - -: 269: * Replaced by simple assignment 'Callback cb = func' - -: 270: */ - -: 271: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 272: "Replaced by simple assignment 'Callback cb = func") - -: 273: void attach(R (*func)()) { - -: 274: this->~Callback(); - -: 275: new (this) Callback(func); - -: 276: } - -: 277: - -: 278: /** Attach a Callback - -: 279: * @param func The Callback to attach - -: 280: * @deprecated - -: 281: * Replaced by simple assignment 'Callback cb = func' - -: 282: */ - -: 283: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 284: "Replaced by simple assignment 'Callback cb = func") - -: 285: void attach(const Callback &func) { - -: 286: this->~Callback(); - -: 287: new (this) Callback(func); - -: 288: } - -: 289: - -: 290: /** Attach a member function - -: 291: * @param obj Pointer to object to invoke member function on - -: 292: * @param method Member function to attach - -: 293: * @deprecated - -: 294: * Replaced by simple assignment 'Callback cb = func' - -: 295: */ - -: 296: template - -: 297: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 298: "Replaced by simple assignment 'Callback cb = func") - -: 299: void attach(U *obj, R (T::*method)()) { - -: 300: this->~Callback(); - -: 301: new (this) Callback(obj, method); - -: 302: } - -: 303: - -: 304: /** Attach a member function - -: 305: * @param obj Pointer to object to invoke member function on - -: 306: * @param method Member function to attach - -: 307: * @deprecated - -: 308: * Replaced by simple assignment 'Callback cb = func' - -: 309: */ - -: 310: template - -: 311: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 312: "Replaced by simple assignment 'Callback cb = func") - -: 313: void attach(const U *obj, R (T::*method)() const) { - -: 314: this->~Callback(); - -: 315: new (this) Callback(obj, method); - -: 316: } - -: 317: - -: 318: /** Attach a member function - -: 319: * @param obj Pointer to object to invoke member function on - -: 320: * @param method Member function to attach - -: 321: * @deprecated - -: 322: * Replaced by simple assignment 'Callback cb = func' - -: 323: */ - -: 324: template - -: 325: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 326: "Replaced by simple assignment 'Callback cb = func") - -: 327: void attach(volatile U *obj, R (T::*method)() volatile) { - -: 328: this->~Callback(); - -: 329: new (this) Callback(obj, method); - -: 330: } - -: 331: - -: 332: /** Attach a member function - -: 333: * @param obj Pointer to object to invoke member function on - -: 334: * @param method Member function to attach - -: 335: * @deprecated - -: 336: * Replaced by simple assignment 'Callback cb = func' - -: 337: */ - -: 338: template - -: 339: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 340: "Replaced by simple assignment 'Callback cb = func") - -: 341: void attach(const volatile U *obj, R (T::*method)() const volatile) { - -: 342: this->~Callback(); - -: 343: new (this) Callback(obj, method); - -: 344: } - -: 345: - -: 346: /** Attach a static function with a bound pointer - -: 347: * @param func Static function to attach - -: 348: * @param arg Pointer argument to function - -: 349: * @deprecated - -: 350: * Replaced by simple assignment 'Callback cb = func' - -: 351: */ - -: 352: template - -: 353: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 354: "Replaced by simple assignment 'Callback cb = func") - -: 355: void attach(R (*func)(T*), U *arg) { - -: 356: this->~Callback(); - -: 357: new (this) Callback(func, arg); - -: 358: } - -: 359: - -: 360: /** Attach a static function with a bound pointer - -: 361: * @param func Static function to attach - -: 362: * @param arg Pointer argument to function - -: 363: * @deprecated - -: 364: * Replaced by simple assignment 'Callback cb = func' - -: 365: */ - -: 366: template - -: 367: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 368: "Replaced by simple assignment 'Callback cb = func") - -: 369: void attach(R (*func)(const T*), const U *arg) { - -: 370: this->~Callback(); - -: 371: new (this) Callback(func, arg); - -: 372: } - -: 373: - -: 374: /** Attach a static function with a bound pointer - -: 375: * @param func Static function to attach - -: 376: * @param arg Pointer argument to function - -: 377: * @deprecated - -: 378: * Replaced by simple assignment 'Callback cb = func' - -: 379: */ - -: 380: template - -: 381: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 382: "Replaced by simple assignment 'Callback cb = func") - -: 383: void attach(R (*func)(volatile T*), volatile U *arg) { - -: 384: this->~Callback(); - -: 385: new (this) Callback(func, arg); - -: 386: } - -: 387: - -: 388: /** Attach a static function with a bound pointer - -: 389: * @param func Static function to attach - -: 390: * @param arg Pointer argument to function - -: 391: * @deprecated - -: 392: * Replaced by simple assignment 'Callback cb = func' - -: 393: */ - -: 394: template - -: 395: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 396: "Replaced by simple assignment 'Callback cb = func") - -: 397: void attach(R (*func)(const volatile T*), const volatile U *arg) { - -: 398: this->~Callback(); - -: 399: new (this) Callback(func, arg); - -: 400: } - -: 401: - -: 402: /** Attach a function object - -: 403: * @param f Function object to attach - -: 404: * @note The function object is limited to a single word of storage - -: 405: * @deprecated - -: 406: * Replaced by simple assignment 'Callback cb = func' - -: 407: */ - -: 408: template - -: 409: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 410: "Replaced by simple assignment 'Callback cb = func") - -: 411: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { - -: 412: this->~Callback(); - -: 413: new (this) Callback(f); - -: 414: } - -: 415: - -: 416: /** Attach a function object - -: 417: * @param f Function object to attach - -: 418: * @note The function object is limited to a single word of storage - -: 419: * @deprecated - -: 420: * Replaced by simple assignment 'Callback cb = func' - -: 421: */ - -: 422: template - -: 423: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 424: "Replaced by simple assignment 'Callback cb = func") - -: 425: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { - -: 426: this->~Callback(); - -: 427: new (this) Callback(f); - -: 428: } - -: 429: - -: 430: /** Attach a function object - -: 431: * @param f Function object to attach - -: 432: * @note The function object is limited to a single word of storage - -: 433: * @deprecated - -: 434: * Replaced by simple assignment 'Callback cb = func' - -: 435: */ - -: 436: template - -: 437: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 438: "Replaced by simple assignment 'Callback cb = func") - -: 439: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { - -: 440: this->~Callback(); - -: 441: new (this) Callback(f); - -: 442: } - -: 443: - -: 444: /** Attach a function object - -: 445: * @param f Function object to attach - -: 446: * @note The function object is limited to a single word of storage - -: 447: * @deprecated - -: 448: * Replaced by simple assignment 'Callback cb = func' - -: 449: */ - -: 450: template - -: 451: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 452: "Replaced by simple assignment 'Callback cb = func") - -: 453: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { - -: 454: this->~Callback(); - -: 455: new (this) Callback(f); - -: 456: } - -: 457: - -: 458: /** Attach a static function with a bound pointer - -: 459: * @param obj Pointer to object to bind to function - -: 460: * @param func Static function to attach - -: 461: * @deprecated - -: 462: * Arguments to callback have been reordered to attach(func, arg) - -: 463: */ - -: 464: template - -: 465: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 466: "Arguments to callback have been reordered to attach(func, arg)") - -: 467: void attach(U *obj, R (*func)(T*)) { - -: 468: this->~Callback(); - -: 469: new (this) Callback(func, obj); - -: 470: } - -: 471: - -: 472: /** Attach a static function with a bound pointer - -: 473: * @param obj Pointer to object to bind to function - -: 474: * @param func Static function to attach - -: 475: * @deprecated - -: 476: * Arguments to callback have been reordered to attach(func, arg) - -: 477: */ - -: 478: template - -: 479: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 480: "Arguments to callback have been reordered to attach(func, arg)") - -: 481: void attach(const U *obj, R (*func)(const T*)) { - -: 482: this->~Callback(); - -: 483: new (this) Callback(func, obj); - -: 484: } - -: 485: - -: 486: /** Attach a static function with a bound pointer - -: 487: * @param obj Pointer to object to bind to function - -: 488: * @param func Static function to attach - -: 489: * @deprecated - -: 490: * Arguments to callback have been reordered to attach(func, arg) - -: 491: */ - -: 492: template - -: 493: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 494: "Arguments to callback have been reordered to attach(func, arg)") - -: 495: void attach(volatile U *obj, R (*func)(volatile T*)) { - -: 496: this->~Callback(); - -: 497: new (this) Callback(func, obj); - -: 498: } - -: 499: - -: 500: /** Attach a static function with a bound pointer - -: 501: * @param obj Pointer to object to bind to function - -: 502: * @param func Static function to attach - -: 503: * @deprecated - -: 504: * Arguments to callback have been reordered to attach(func, arg) - -: 505: */ - -: 506: template - -: 507: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 508: "Arguments to callback have been reordered to attach(func, arg)") - -: 509: void attach(const volatile U *obj, R (*func)(const volatile T*)) { - -: 510: this->~Callback(); - -: 511: new (this) Callback(func, obj); - -: 512: } - -: 513: - -: 514: /** Assign a callback - -: 515: */ - 1: 516: Callback &operator=(const Callback &that) { - 1: 517: if (this != &that) { - 1: 518: this->~Callback(); - 1: 519: new (this) Callback(that); - -: 520: } - -: 521: - 1: 522: return *this; - -: 523: } - -: 524: - -: 525: /** Call the attached function - -: 526: */ - -: 527: R call() const { - -: 528: MBED_ASSERT(_ops); - -: 529: return _ops->call(this); - -: 530: } - -: 531: - -: 532: /** Call the attached function - -: 533: */ - -: 534: R operator()() const { - -: 535: return call(); - -: 536: } - -: 537: - -: 538: /** Test if function has been attached - -: 539: */ - -: 540: operator bool() const { - -: 541: return _ops; - -: 542: } - -: 543: - -: 544: /** Test for equality - -: 545: */ - -: 546: friend bool operator==(const Callback &l, const Callback &r) { - -: 547: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 548: } - -: 549: - -: 550: /** Test for inequality - -: 551: */ - -: 552: friend bool operator!=(const Callback &l, const Callback &r) { - -: 553: return !(l == r); - -: 554: } - -: 555: - -: 556: /** Static thunk for passing as C-style function - -: 557: * @param func Callback to call passed as void pointer - -: 558: * @return the value as determined by func which is of - -: 559: * type and determined by the signiture of func - -: 560: */ - -: 561: static R thunk(void *func) { - -: 562: return static_cast(func)->call(); - -: 563: } - -: 564: - -: 565:private: - -: 566: // Stored as pointer to function and pointer to optional object - -: 567: // Function pointer is stored as union of possible function types - -: 568: // to garuntee proper size and alignment - -: 569: struct _class; - -: 570: union { - -: 571: void (*_staticfunc)(); - -: 572: void (*_boundfunc)(_class*); - -: 573: void (_class::*_methodfunc)(); - -: 574: } _func; - -: 575: void *_obj; - -: 576: - -: 577: // Dynamically dispatched operations - -: 578: const struct ops { - -: 579: R (*call)(const void*); - -: 580: void (*move)(void*, const void*); - -: 581: void (*dtor)(void*); - -: 582: } *_ops; - -: 583: - -: 584: // Generate operations for function object - -: 585: template - -: 586: void generate(const F &f) { - -: 587: static const ops ops = { - -: 588: &Callback::function_call, - -: 589: &Callback::function_move, - -: 590: &Callback::function_dtor, - -: 591: }; - -: 592: - -: 593: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 594: "Type F must not exceed the size of the Callback class"); - -: 595: memset(this, 0, sizeof(Callback)); - -: 596: new (this) F(f); - -: 597: _ops = &ops; - -: 598: } - -: 599: - -: 600: // Function attributes - -: 601: template - -: 602: static R function_call(const void *p) { - -: 603: return (*(F*)p)(); - -: 604: } - -: 605: - -: 606: template - -: 607: static void function_move(void *d, const void *p) { - -: 608: new (d) F(*(F*)p); - -: 609: } - -: 610: - -: 611: template - -: 612: static void function_dtor(void *p) { - -: 613: ((F*)p)->~F(); - -: 614: } - -: 615: - -: 616: // Wrappers for functions with context - -: 617: template - -: 618: struct method_context { - -: 619: M method; - -: 620: O *obj; - -: 621: - -: 622: method_context(O *obj, M method) - -: 623: : method(method), obj(obj) {} - -: 624: - -: 625: R operator()() const { - -: 626: return (obj->*method)(); - -: 627: } - -: 628: }; - -: 629: - -: 630: template - -: 631: struct function_context { - -: 632: F func; - -: 633: A *arg; - -: 634: - -: 635: function_context(F func, A *arg) - -: 636: : func(func), arg(arg) {} - -: 637: - -: 638: R operator()() const { - -: 639: return func(arg); - -: 640: } - -: 641: }; - -: 642:}; - -: 643: - -: 644:/** Callback class based on template specialization - -: 645: * - -: 646: * @note Synchronization level: Not protected - -: 647: */ - -: 648:template - -: 649:class Callback { - -: 650:public: - -: 651: /** Create a Callback with a static function - -: 652: * @param func Static function to attach - -: 653: */ - -: 654: Callback(R (*func)(A0) = 0) { - -: 655: if (!func) { - -: 656: memset(this, 0, sizeof(Callback)); - -: 657: } else { - -: 658: generate(func); - -: 659: } - -: 660: } - -: 661: - -: 662: /** Attach a Callback - -: 663: * @param func The Callback to attach - -: 664: */ - -: 665: Callback(const Callback &func) { - -: 666: if (func._ops) { - -: 667: func._ops->move(this, &func); - -: 668: } - -: 669: _ops = func._ops; - -: 670: } - -: 671: - -: 672: /** Create a Callback with a member function - -: 673: * @param obj Pointer to object to invoke member function on - -: 674: * @param method Member function to attach - -: 675: */ - -: 676: template - -: 677: Callback(U *obj, R (T::*method)(A0)) { - -: 678: generate(method_context(obj, method)); - -: 679: } - -: 680: - -: 681: /** Create a Callback with a member function - -: 682: * @param obj Pointer to object to invoke member function on - -: 683: * @param method Member function to attach - -: 684: */ - -: 685: template - -: 686: Callback(const U *obj, R (T::*method)(A0) const) { - -: 687: generate(method_context(obj, method)); - -: 688: } - -: 689: - -: 690: /** Create a Callback with a member function - -: 691: * @param obj Pointer to object to invoke member function on - -: 692: * @param method Member function to attach - -: 693: */ - -: 694: template - -: 695: Callback(volatile U *obj, R (T::*method)(A0) volatile) { - -: 696: generate(method_context(obj, method)); - -: 697: } - -: 698: - -: 699: /** Create a Callback with a member function - -: 700: * @param obj Pointer to object to invoke member function on - -: 701: * @param method Member function to attach - -: 702: */ - -: 703: template - -: 704: Callback(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 705: generate(method_context(obj, method)); - -: 706: } - -: 707: - -: 708: /** Create a Callback with a static function and bound pointer - -: 709: * @param func Static function to attach - -: 710: * @param arg Pointer argument to function - -: 711: */ - -: 712: template - -: 713: Callback(R (*func)(T*, A0), U *arg) { - -: 714: generate(function_context(func, arg)); - -: 715: } - -: 716: - -: 717: /** Create a Callback with a static function and bound pointer - -: 718: * @param func Static function to attach - -: 719: * @param arg Pointer argument to function - -: 720: */ - -: 721: template - -: 722: Callback(R (*func)(const T*, A0), const U *arg) { - -: 723: generate(function_context(func, arg)); - -: 724: } - -: 725: - -: 726: /** Create a Callback with a static function and bound pointer - -: 727: * @param func Static function to attach - -: 728: * @param arg Pointer argument to function - -: 729: */ - -: 730: template - -: 731: Callback(R (*func)(volatile T*, A0), volatile U *arg) { - -: 732: generate(function_context(func, arg)); - -: 733: } - -: 734: - -: 735: /** Create a Callback with a static function and bound pointer - -: 736: * @param func Static function to attach - -: 737: * @param arg Pointer argument to function - -: 738: */ - -: 739: template - -: 740: Callback(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 741: generate(function_context(func, arg)); - -: 742: } - -: 743: - -: 744: /** Create a Callback with a function object - -: 745: * @param f Function object to attach - -: 746: * @note The function object is limited to a single word of storage - -: 747: */ - -: 748: template - -: 749: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { - -: 750: generate(f); - -: 751: } - -: 752: - -: 753: /** Create a Callback with a function object - -: 754: * @param f Function object to attach - -: 755: * @note The function object is limited to a single word of storage - -: 756: */ - -: 757: template - -: 758: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { - -: 759: generate(f); - -: 760: } - -: 761: - -: 762: /** Create a Callback with a function object - -: 763: * @param f Function object to attach - -: 764: * @note The function object is limited to a single word of storage - -: 765: */ - -: 766: template - -: 767: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { - -: 768: generate(f); - -: 769: } - -: 770: - -: 771: /** Create a Callback with a function object - -: 772: * @param f Function object to attach - -: 773: * @note The function object is limited to a single word of storage - -: 774: */ - -: 775: template - -: 776: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { - -: 777: generate(f); - -: 778: } - -: 779: - -: 780: /** Create a Callback with a static function and bound pointer - -: 781: * @param obj Pointer to object to bind to function - -: 782: * @param func Static function to attach - -: 783: * @deprecated - -: 784: * Arguments to callback have been reordered to Callback(func, arg) - -: 785: */ - -: 786: template - -: 787: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 788: "Arguments to callback have been reordered to Callback(func, arg)") - -: 789: Callback(U *obj, R (*func)(T*, A0)) { - -: 790: new (this) Callback(func, obj); - -: 791: } - -: 792: - -: 793: /** Create a Callback with a static function and bound pointer - -: 794: * @param obj Pointer to object to bind to function - -: 795: * @param func Static function to attach - -: 796: * @deprecated - -: 797: * Arguments to callback have been reordered to Callback(func, arg) - -: 798: */ - -: 799: template - -: 800: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 801: "Arguments to callback have been reordered to Callback(func, arg)") - -: 802: Callback(const U *obj, R (*func)(const T*, A0)) { - -: 803: new (this) Callback(func, obj); - -: 804: } - -: 805: - -: 806: /** Create a Callback with a static function and bound pointer - -: 807: * @param obj Pointer to object to bind to function - -: 808: * @param func Static function to attach - -: 809: * @deprecated - -: 810: * Arguments to callback have been reordered to Callback(func, arg) - -: 811: */ - -: 812: template - -: 813: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 814: "Arguments to callback have been reordered to Callback(func, arg)") - -: 815: Callback(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 816: new (this) Callback(func, obj); - -: 817: } - -: 818: - -: 819: /** Create a Callback with a static function and bound pointer - -: 820: * @param obj Pointer to object to bind to function - -: 821: * @param func Static function to attach - -: 822: * @deprecated - -: 823: * Arguments to callback have been reordered to Callback(func, arg) - -: 824: */ - -: 825: template - -: 826: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 827: "Arguments to callback have been reordered to Callback(func, arg)") - -: 828: Callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 829: new (this) Callback(func, obj); - -: 830: } - -: 831: - -: 832: /** Destroy a callback - -: 833: */ - -: 834: ~Callback() { - -: 835: if (_ops) { - -: 836: _ops->dtor(this); - -: 837: } - -: 838: } - -: 839: - -: 840: /** Attach a static function - -: 841: * @param func Static function to attach - -: 842: * @deprecated - -: 843: * Replaced by simple assignment 'Callback cb = func' - -: 844: */ - -: 845: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 846: "Replaced by simple assignment 'Callback cb = func") - -: 847: void attach(R (*func)(A0)) { - -: 848: this->~Callback(); - -: 849: new (this) Callback(func); - -: 850: } - -: 851: - -: 852: /** Attach a Callback - -: 853: * @param func The Callback to attach - -: 854: * @deprecated - -: 855: * Replaced by simple assignment 'Callback cb = func' - -: 856: */ - -: 857: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 858: "Replaced by simple assignment 'Callback cb = func") - -: 859: void attach(const Callback &func) { - -: 860: this->~Callback(); - -: 861: new (this) Callback(func); - -: 862: } - -: 863: - -: 864: /** Attach a member function - -: 865: * @param obj Pointer to object to invoke member function on - -: 866: * @param method Member function to attach - -: 867: * @deprecated - -: 868: * Replaced by simple assignment 'Callback cb = func' - -: 869: */ - -: 870: template - -: 871: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 872: "Replaced by simple assignment 'Callback cb = func") - -: 873: void attach(U *obj, R (T::*method)(A0)) { - -: 874: this->~Callback(); - -: 875: new (this) Callback(obj, method); - -: 876: } - -: 877: - -: 878: /** Attach a member function - -: 879: * @param obj Pointer to object to invoke member function on - -: 880: * @param method Member function to attach - -: 881: * @deprecated - -: 882: * Replaced by simple assignment 'Callback cb = func' - -: 883: */ - -: 884: template - -: 885: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 886: "Replaced by simple assignment 'Callback cb = func") - -: 887: void attach(const U *obj, R (T::*method)(A0) const) { - -: 888: this->~Callback(); - -: 889: new (this) Callback(obj, method); - -: 890: } - -: 891: - -: 892: /** Attach a member function - -: 893: * @param obj Pointer to object to invoke member function on - -: 894: * @param method Member function to attach - -: 895: * @deprecated - -: 896: * Replaced by simple assignment 'Callback cb = func' - -: 897: */ - -: 898: template - -: 899: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 900: "Replaced by simple assignment 'Callback cb = func") - -: 901: void attach(volatile U *obj, R (T::*method)(A0) volatile) { - -: 902: this->~Callback(); - -: 903: new (this) Callback(obj, method); - -: 904: } - -: 905: - -: 906: /** Attach a member function - -: 907: * @param obj Pointer to object to invoke member function on - -: 908: * @param method Member function to attach - -: 909: * @deprecated - -: 910: * Replaced by simple assignment 'Callback cb = func' - -: 911: */ - -: 912: template - -: 913: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 914: "Replaced by simple assignment 'Callback cb = func") - -: 915: void attach(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 916: this->~Callback(); - -: 917: new (this) Callback(obj, method); - -: 918: } - -: 919: - -: 920: /** Attach a static function with a bound pointer - -: 921: * @param func Static function to attach - -: 922: * @param arg Pointer argument to function - -: 923: * @deprecated - -: 924: * Replaced by simple assignment 'Callback cb = func' - -: 925: */ - -: 926: template - -: 927: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 928: "Replaced by simple assignment 'Callback cb = func") - -: 929: void attach(R (*func)(T*, A0), U *arg) { - -: 930: this->~Callback(); - -: 931: new (this) Callback(func, arg); - -: 932: } - -: 933: - -: 934: /** Attach a static function with a bound pointer - -: 935: * @param func Static function to attach - -: 936: * @param arg Pointer argument to function - -: 937: * @deprecated - -: 938: * Replaced by simple assignment 'Callback cb = func' - -: 939: */ - -: 940: template - -: 941: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 942: "Replaced by simple assignment 'Callback cb = func") - -: 943: void attach(R (*func)(const T*, A0), const U *arg) { - -: 944: this->~Callback(); - -: 945: new (this) Callback(func, arg); - -: 946: } - -: 947: - -: 948: /** Attach a static function with a bound pointer - -: 949: * @param func Static function to attach - -: 950: * @param arg Pointer argument to function - -: 951: * @deprecated - -: 952: * Replaced by simple assignment 'Callback cb = func' - -: 953: */ - -: 954: template - -: 955: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 956: "Replaced by simple assignment 'Callback cb = func") - -: 957: void attach(R (*func)(volatile T*, A0), volatile U *arg) { - -: 958: this->~Callback(); - -: 959: new (this) Callback(func, arg); - -: 960: } - -: 961: - -: 962: /** Attach a static function with a bound pointer - -: 963: * @param func Static function to attach - -: 964: * @param arg Pointer argument to function - -: 965: * @deprecated - -: 966: * Replaced by simple assignment 'Callback cb = func' - -: 967: */ - -: 968: template - -: 969: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 970: "Replaced by simple assignment 'Callback cb = func") - -: 971: void attach(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 972: this->~Callback(); - -: 973: new (this) Callback(func, arg); - -: 974: } - -: 975: - -: 976: /** Attach a function object - -: 977: * @param f Function object to attach - -: 978: * @note The function object is limited to a single word of storage - -: 979: * @deprecated - -: 980: * Replaced by simple assignment 'Callback cb = func' - -: 981: */ - -: 982: template - -: 983: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 984: "Replaced by simple assignment 'Callback cb = func") - -: 985: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { - -: 986: this->~Callback(); - -: 987: new (this) Callback(f); - -: 988: } - -: 989: - -: 990: /** Attach a function object - -: 991: * @param f Function object to attach - -: 992: * @note The function object is limited to a single word of storage - -: 993: * @deprecated - -: 994: * Replaced by simple assignment 'Callback cb = func' - -: 995: */ - -: 996: template - -: 997: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 998: "Replaced by simple assignment 'Callback cb = func") - -: 999: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { - -: 1000: this->~Callback(); - -: 1001: new (this) Callback(f); - -: 1002: } - -: 1003: - -: 1004: /** Attach a function object - -: 1005: * @param f Function object to attach - -: 1006: * @note The function object is limited to a single word of storage - -: 1007: * @deprecated - -: 1008: * Replaced by simple assignment 'Callback cb = func' - -: 1009: */ - -: 1010: template - -: 1011: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1012: "Replaced by simple assignment 'Callback cb = func") - -: 1013: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { - -: 1014: this->~Callback(); - -: 1015: new (this) Callback(f); - -: 1016: } - -: 1017: - -: 1018: /** Attach a function object - -: 1019: * @param f Function object to attach - -: 1020: * @note The function object is limited to a single word of storage - -: 1021: * @deprecated - -: 1022: * Replaced by simple assignment 'Callback cb = func' - -: 1023: */ - -: 1024: template - -: 1025: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1026: "Replaced by simple assignment 'Callback cb = func") - -: 1027: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { - -: 1028: this->~Callback(); - -: 1029: new (this) Callback(f); - -: 1030: } - -: 1031: - -: 1032: /** Attach a static function with a bound pointer - -: 1033: * @param obj Pointer to object to bind to function - -: 1034: * @param func Static function to attach - -: 1035: * @deprecated - -: 1036: * Arguments to callback have been reordered to attach(func, arg) - -: 1037: */ - -: 1038: template - -: 1039: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1040: "Arguments to callback have been reordered to attach(func, arg)") - -: 1041: void attach(U *obj, R (*func)(T*, A0)) { - -: 1042: this->~Callback(); - -: 1043: new (this) Callback(func, obj); - -: 1044: } - -: 1045: - -: 1046: /** Attach a static function with a bound pointer - -: 1047: * @param obj Pointer to object to bind to function - -: 1048: * @param func Static function to attach - -: 1049: * @deprecated - -: 1050: * Arguments to callback have been reordered to attach(func, arg) - -: 1051: */ - -: 1052: template - -: 1053: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1054: "Arguments to callback have been reordered to attach(func, arg)") - -: 1055: void attach(const U *obj, R (*func)(const T*, A0)) { - -: 1056: this->~Callback(); - -: 1057: new (this) Callback(func, obj); - -: 1058: } - -: 1059: - -: 1060: /** Attach a static function with a bound pointer - -: 1061: * @param obj Pointer to object to bind to function - -: 1062: * @param func Static function to attach - -: 1063: * @deprecated - -: 1064: * Arguments to callback have been reordered to attach(func, arg) - -: 1065: */ - -: 1066: template - -: 1067: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1068: "Arguments to callback have been reordered to attach(func, arg)") - -: 1069: void attach(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 1070: this->~Callback(); - -: 1071: new (this) Callback(func, obj); - -: 1072: } - -: 1073: - -: 1074: /** Attach a static function with a bound pointer - -: 1075: * @param obj Pointer to object to bind to function - -: 1076: * @param func Static function to attach - -: 1077: * @deprecated - -: 1078: * Arguments to callback have been reordered to attach(func, arg) - -: 1079: */ - -: 1080: template - -: 1081: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1082: "Arguments to callback have been reordered to attach(func, arg)") - -: 1083: void attach(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 1084: this->~Callback(); - -: 1085: new (this) Callback(func, obj); - -: 1086: } - -: 1087: - -: 1088: /** Assign a callback - -: 1089: */ - -: 1090: Callback &operator=(const Callback &that) { - -: 1091: if (this != &that) { - -: 1092: this->~Callback(); - -: 1093: new (this) Callback(that); - -: 1094: } - -: 1095: - -: 1096: return *this; - -: 1097: } - -: 1098: - -: 1099: /** Call the attached function - -: 1100: */ - -: 1101: R call(A0 a0) const { - -: 1102: MBED_ASSERT(_ops); - -: 1103: return _ops->call(this, a0); - -: 1104: } - -: 1105: - -: 1106: /** Call the attached function - -: 1107: */ - -: 1108: R operator()(A0 a0) const { - -: 1109: return call(a0); - -: 1110: } - -: 1111: - -: 1112: /** Test if function has been attached - -: 1113: */ - -: 1114: operator bool() const { - -: 1115: return _ops; - -: 1116: } - -: 1117: - -: 1118: /** Test for equality - -: 1119: */ - -: 1120: friend bool operator==(const Callback &l, const Callback &r) { - -: 1121: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 1122: } - -: 1123: - -: 1124: /** Test for inequality - -: 1125: */ - -: 1126: friend bool operator!=(const Callback &l, const Callback &r) { - -: 1127: return !(l == r); - -: 1128: } - -: 1129: - -: 1130: /** Static thunk for passing as C-style function - -: 1131: * @param func Callback to call passed as void pointer - -: 1132: * @param a0 An argument to be called with function func - -: 1133: * @return the value as determined by func which is of - -: 1134: * type and determined by the signiture of func - -: 1135: */ - -: 1136: static R thunk(void *func, A0 a0) { - -: 1137: return static_cast(func)->call(a0); - -: 1138: } - -: 1139: - -: 1140:private: - -: 1141: // Stored as pointer to function and pointer to optional object - -: 1142: // Function pointer is stored as union of possible function types - -: 1143: // to garuntee proper size and alignment - -: 1144: struct _class; - -: 1145: union { - -: 1146: void (*_staticfunc)(A0); - -: 1147: void (*_boundfunc)(_class*, A0); - -: 1148: void (_class::*_methodfunc)(A0); - -: 1149: } _func; - -: 1150: void *_obj; - -: 1151: - -: 1152: // Dynamically dispatched operations - -: 1153: const struct ops { - -: 1154: R (*call)(const void*, A0); - -: 1155: void (*move)(void*, const void*); - -: 1156: void (*dtor)(void*); - -: 1157: } *_ops; - -: 1158: - -: 1159: // Generate operations for function object - -: 1160: template - -: 1161: void generate(const F &f) { - -: 1162: static const ops ops = { - -: 1163: &Callback::function_call, - -: 1164: &Callback::function_move, - -: 1165: &Callback::function_dtor, - -: 1166: }; - -: 1167: - -: 1168: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 1169: "Type F must not exceed the size of the Callback class"); - -: 1170: memset(this, 0, sizeof(Callback)); - -: 1171: new (this) F(f); - -: 1172: _ops = &ops; - -: 1173: } - -: 1174: - -: 1175: // Function attributes - -: 1176: template - -: 1177: static R function_call(const void *p, A0 a0) { - -: 1178: return (*(F*)p)(a0); - -: 1179: } - -: 1180: - -: 1181: template - -: 1182: static void function_move(void *d, const void *p) { - -: 1183: new (d) F(*(F*)p); - -: 1184: } - -: 1185: - -: 1186: template - -: 1187: static void function_dtor(void *p) { - -: 1188: ((F*)p)->~F(); - -: 1189: } - -: 1190: - -: 1191: // Wrappers for functions with context - -: 1192: template - -: 1193: struct method_context { - -: 1194: M method; - -: 1195: O *obj; - -: 1196: - -: 1197: method_context(O *obj, M method) - -: 1198: : method(method), obj(obj) {} - -: 1199: - -: 1200: R operator()(A0 a0) const { - -: 1201: return (obj->*method)(a0); - -: 1202: } - -: 1203: }; - -: 1204: - -: 1205: template - -: 1206: struct function_context { - -: 1207: F func; - -: 1208: A *arg; - -: 1209: - -: 1210: function_context(F func, A *arg) - -: 1211: : func(func), arg(arg) {} - -: 1212: - -: 1213: R operator()(A0 a0) const { - -: 1214: return func(arg, a0); - -: 1215: } - -: 1216: }; - -: 1217:}; - -: 1218: - -: 1219:/** Callback class based on template specialization - -: 1220: * - -: 1221: * @note Synchronization level: Not protected - -: 1222: */ - -: 1223:template - -: 1224:class Callback { - -: 1225:public: - -: 1226: /** Create a Callback with a static function - -: 1227: * @param func Static function to attach - -: 1228: */ - -: 1229: Callback(R (*func)(A0, A1) = 0) { - -: 1230: if (!func) { - -: 1231: memset(this, 0, sizeof(Callback)); - -: 1232: } else { - -: 1233: generate(func); - -: 1234: } - -: 1235: } - -: 1236: - -: 1237: /** Attach a Callback - -: 1238: * @param func The Callback to attach - -: 1239: */ - -: 1240: Callback(const Callback &func) { - -: 1241: if (func._ops) { - -: 1242: func._ops->move(this, &func); - -: 1243: } - -: 1244: _ops = func._ops; - -: 1245: } - -: 1246: - -: 1247: /** Create a Callback with a member function - -: 1248: * @param obj Pointer to object to invoke member function on - -: 1249: * @param method Member function to attach - -: 1250: */ - -: 1251: template - -: 1252: Callback(U *obj, R (T::*method)(A0, A1)) { - -: 1253: generate(method_context(obj, method)); - -: 1254: } - -: 1255: - -: 1256: /** Create a Callback with a member function - -: 1257: * @param obj Pointer to object to invoke member function on - -: 1258: * @param method Member function to attach - -: 1259: */ - -: 1260: template - -: 1261: Callback(const U *obj, R (T::*method)(A0, A1) const) { - -: 1262: generate(method_context(obj, method)); - -: 1263: } - -: 1264: - -: 1265: /** Create a Callback with a member function - -: 1266: * @param obj Pointer to object to invoke member function on - -: 1267: * @param method Member function to attach - -: 1268: */ - -: 1269: template - -: 1270: Callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 1271: generate(method_context(obj, method)); - -: 1272: } - -: 1273: - -: 1274: /** Create a Callback with a member function - -: 1275: * @param obj Pointer to object to invoke member function on - -: 1276: * @param method Member function to attach - -: 1277: */ - -: 1278: template - -: 1279: Callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 1280: generate(method_context(obj, method)); - -: 1281: } - -: 1282: - -: 1283: /** Create a Callback with a static function and bound pointer - -: 1284: * @param func Static function to attach - -: 1285: * @param arg Pointer argument to function - -: 1286: */ - -: 1287: template - -: 1288: Callback(R (*func)(T*, A0, A1), U *arg) { - -: 1289: generate(function_context(func, arg)); - -: 1290: } - -: 1291: - -: 1292: /** Create a Callback with a static function and bound pointer - -: 1293: * @param func Static function to attach - -: 1294: * @param arg Pointer argument to function - -: 1295: */ - -: 1296: template - -: 1297: Callback(R (*func)(const T*, A0, A1), const U *arg) { - -: 1298: generate(function_context(func, arg)); - -: 1299: } - -: 1300: - -: 1301: /** Create a Callback with a static function and bound pointer - -: 1302: * @param func Static function to attach - -: 1303: * @param arg Pointer argument to function - -: 1304: */ - -: 1305: template - -: 1306: Callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 1307: generate(function_context(func, arg)); - -: 1308: } - -: 1309: - -: 1310: /** Create a Callback with a static function and bound pointer - -: 1311: * @param func Static function to attach - -: 1312: * @param arg Pointer argument to function - -: 1313: */ - -: 1314: template - -: 1315: Callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 1316: generate(function_context(func, arg)); - -: 1317: } - -: 1318: - -: 1319: /** Create a Callback with a function object - -: 1320: * @param f Function object to attach - -: 1321: * @note The function object is limited to a single word of storage - -: 1322: */ - -: 1323: template - -: 1324: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { - -: 1325: generate(f); - -: 1326: } - -: 1327: - -: 1328: /** Create a Callback with a function object - -: 1329: * @param f Function object to attach - -: 1330: * @note The function object is limited to a single word of storage - -: 1331: */ - -: 1332: template - -: 1333: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { - -: 1334: generate(f); - -: 1335: } - -: 1336: - -: 1337: /** Create a Callback with a function object - -: 1338: * @param f Function object to attach - -: 1339: * @note The function object is limited to a single word of storage - -: 1340: */ - -: 1341: template - -: 1342: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { - -: 1343: generate(f); - -: 1344: } - -: 1345: - -: 1346: /** Create a Callback with a function object - -: 1347: * @param f Function object to attach - -: 1348: * @note The function object is limited to a single word of storage - -: 1349: */ - -: 1350: template - -: 1351: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { - -: 1352: generate(f); - -: 1353: } - -: 1354: - -: 1355: /** Create a Callback with a static function and bound pointer - -: 1356: * @param obj Pointer to object to bind to function - -: 1357: * @param func Static function to attach - -: 1358: * @deprecated - -: 1359: * Arguments to callback have been reordered to Callback(func, arg) - -: 1360: */ - -: 1361: template - -: 1362: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1363: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1364: Callback(U *obj, R (*func)(T*, A0, A1)) { - -: 1365: new (this) Callback(func, obj); - -: 1366: } - -: 1367: - -: 1368: /** Create a Callback with a static function and bound pointer - -: 1369: * @param obj Pointer to object to bind to function - -: 1370: * @param func Static function to attach - -: 1371: * @deprecated - -: 1372: * Arguments to callback have been reordered to Callback(func, arg) - -: 1373: */ - -: 1374: template - -: 1375: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1376: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1377: Callback(const U *obj, R (*func)(const T*, A0, A1)) { - -: 1378: new (this) Callback(func, obj); - -: 1379: } - -: 1380: - -: 1381: /** Create a Callback with a static function and bound pointer - -: 1382: * @param obj Pointer to object to bind to function - -: 1383: * @param func Static function to attach - -: 1384: * @deprecated - -: 1385: * Arguments to callback have been reordered to Callback(func, arg) - -: 1386: */ - -: 1387: template - -: 1388: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1389: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1390: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 1391: new (this) Callback(func, obj); - -: 1392: } - -: 1393: - -: 1394: /** Create a Callback with a static function and bound pointer - -: 1395: * @param obj Pointer to object to bind to function - -: 1396: * @param func Static function to attach - -: 1397: * @deprecated - -: 1398: * Arguments to callback have been reordered to Callback(func, arg) - -: 1399: */ - -: 1400: template - -: 1401: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1402: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1403: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 1404: new (this) Callback(func, obj); - -: 1405: } - -: 1406: - -: 1407: /** Destroy a callback - -: 1408: */ - -: 1409: ~Callback() { - -: 1410: if (_ops) { - -: 1411: _ops->dtor(this); - -: 1412: } - -: 1413: } - -: 1414: - -: 1415: /** Attach a static function - -: 1416: * @param func Static function to attach - -: 1417: * @deprecated - -: 1418: * Replaced by simple assignment 'Callback cb = func' - -: 1419: */ - -: 1420: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1421: "Replaced by simple assignment 'Callback cb = func") - -: 1422: void attach(R (*func)(A0, A1)) { - -: 1423: this->~Callback(); - -: 1424: new (this) Callback(func); - -: 1425: } - -: 1426: - -: 1427: /** Attach a Callback - -: 1428: * @param func The Callback to attach - -: 1429: * @deprecated - -: 1430: * Replaced by simple assignment 'Callback cb = func' - -: 1431: */ - -: 1432: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1433: "Replaced by simple assignment 'Callback cb = func") - -: 1434: void attach(const Callback &func) { - -: 1435: this->~Callback(); - -: 1436: new (this) Callback(func); - -: 1437: } - -: 1438: - -: 1439: /** Attach a member function - -: 1440: * @param obj Pointer to object to invoke member function on - -: 1441: * @param method Member function to attach - -: 1442: * @deprecated - -: 1443: * Replaced by simple assignment 'Callback cb = func' - -: 1444: */ - -: 1445: template - -: 1446: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1447: "Replaced by simple assignment 'Callback cb = func") - -: 1448: void attach(U *obj, R (T::*method)(A0, A1)) { - -: 1449: this->~Callback(); - -: 1450: new (this) Callback(obj, method); - -: 1451: } - -: 1452: - -: 1453: /** Attach a member function - -: 1454: * @param obj Pointer to object to invoke member function on - -: 1455: * @param method Member function to attach - -: 1456: * @deprecated - -: 1457: * Replaced by simple assignment 'Callback cb = func' - -: 1458: */ - -: 1459: template - -: 1460: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1461: "Replaced by simple assignment 'Callback cb = func") - -: 1462: void attach(const U *obj, R (T::*method)(A0, A1) const) { - -: 1463: this->~Callback(); - -: 1464: new (this) Callback(obj, method); - -: 1465: } - -: 1466: - -: 1467: /** Attach a member function - -: 1468: * @param obj Pointer to object to invoke member function on - -: 1469: * @param method Member function to attach - -: 1470: * @deprecated - -: 1471: * Replaced by simple assignment 'Callback cb = func' - -: 1472: */ - -: 1473: template - -: 1474: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1475: "Replaced by simple assignment 'Callback cb = func") - -: 1476: void attach(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 1477: this->~Callback(); - -: 1478: new (this) Callback(obj, method); - -: 1479: } - -: 1480: - -: 1481: /** Attach a member function - -: 1482: * @param obj Pointer to object to invoke member function on - -: 1483: * @param method Member function to attach - -: 1484: * @deprecated - -: 1485: * Replaced by simple assignment 'Callback cb = func' - -: 1486: */ - -: 1487: template - -: 1488: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1489: "Replaced by simple assignment 'Callback cb = func") - -: 1490: void attach(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 1491: this->~Callback(); - -: 1492: new (this) Callback(obj, method); - -: 1493: } - -: 1494: - -: 1495: /** Attach a static function with a bound pointer - -: 1496: * @param func Static function to attach - -: 1497: * @param arg Pointer argument to function - -: 1498: * @deprecated - -: 1499: * Replaced by simple assignment 'Callback cb = func' - -: 1500: */ - -: 1501: template - -: 1502: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1503: "Replaced by simple assignment 'Callback cb = func") - -: 1504: void attach(R (*func)(T*, A0, A1), U *arg) { - -: 1505: this->~Callback(); - -: 1506: new (this) Callback(func, arg); - -: 1507: } - -: 1508: - -: 1509: /** Attach a static function with a bound pointer - -: 1510: * @param func Static function to attach - -: 1511: * @param arg Pointer argument to function - -: 1512: * @deprecated - -: 1513: * Replaced by simple assignment 'Callback cb = func' - -: 1514: */ - -: 1515: template - -: 1516: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1517: "Replaced by simple assignment 'Callback cb = func") - -: 1518: void attach(R (*func)(const T*, A0, A1), const U *arg) { - -: 1519: this->~Callback(); - -: 1520: new (this) Callback(func, arg); - -: 1521: } - -: 1522: - -: 1523: /** Attach a static function with a bound pointer - -: 1524: * @param func Static function to attach - -: 1525: * @param arg Pointer argument to function - -: 1526: * @deprecated - -: 1527: * Replaced by simple assignment 'Callback cb = func' - -: 1528: */ - -: 1529: template - -: 1530: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1531: "Replaced by simple assignment 'Callback cb = func") - -: 1532: void attach(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 1533: this->~Callback(); - -: 1534: new (this) Callback(func, arg); - -: 1535: } - -: 1536: - -: 1537: /** Attach a static function with a bound pointer - -: 1538: * @param func Static function to attach - -: 1539: * @param arg Pointer argument to function - -: 1540: * @deprecated - -: 1541: * Replaced by simple assignment 'Callback cb = func' - -: 1542: */ - -: 1543: template - -: 1544: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1545: "Replaced by simple assignment 'Callback cb = func") - -: 1546: void attach(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 1547: this->~Callback(); - -: 1548: new (this) Callback(func, arg); - -: 1549: } - -: 1550: - -: 1551: /** Attach a function object - -: 1552: * @param f Function object to attach - -: 1553: * @note The function object is limited to a single word of storage - -: 1554: * @deprecated - -: 1555: * Replaced by simple assignment 'Callback cb = func' - -: 1556: */ - -: 1557: template - -: 1558: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1559: "Replaced by simple assignment 'Callback cb = func") - -: 1560: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { - -: 1561: this->~Callback(); - -: 1562: new (this) Callback(f); - -: 1563: } - -: 1564: - -: 1565: /** Attach a function object - -: 1566: * @param f Function object to attach - -: 1567: * @note The function object is limited to a single word of storage - -: 1568: * @deprecated - -: 1569: * Replaced by simple assignment 'Callback cb = func' - -: 1570: */ - -: 1571: template - -: 1572: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1573: "Replaced by simple assignment 'Callback cb = func") - -: 1574: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { - -: 1575: this->~Callback(); - -: 1576: new (this) Callback(f); - -: 1577: } - -: 1578: - -: 1579: /** Attach a function object - -: 1580: * @param f Function object to attach - -: 1581: * @note The function object is limited to a single word of storage - -: 1582: * @deprecated - -: 1583: * Replaced by simple assignment 'Callback cb = func' - -: 1584: */ - -: 1585: template - -: 1586: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1587: "Replaced by simple assignment 'Callback cb = func") - -: 1588: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { - -: 1589: this->~Callback(); - -: 1590: new (this) Callback(f); - -: 1591: } - -: 1592: - -: 1593: /** Attach a function object - -: 1594: * @param f Function object to attach - -: 1595: * @note The function object is limited to a single word of storage - -: 1596: * @deprecated - -: 1597: * Replaced by simple assignment 'Callback cb = func' - -: 1598: */ - -: 1599: template - -: 1600: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1601: "Replaced by simple assignment 'Callback cb = func") - -: 1602: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { - -: 1603: this->~Callback(); - -: 1604: new (this) Callback(f); - -: 1605: } - -: 1606: - -: 1607: /** Attach a static function with a bound pointer - -: 1608: * @param obj Pointer to object to bind to function - -: 1609: * @param func Static function to attach - -: 1610: * @deprecated - -: 1611: * Arguments to callback have been reordered to attach(func, arg) - -: 1612: */ - -: 1613: template - -: 1614: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1615: "Arguments to callback have been reordered to attach(func, arg)") - -: 1616: void attach(U *obj, R (*func)(T*, A0, A1)) { - -: 1617: this->~Callback(); - -: 1618: new (this) Callback(func, obj); - -: 1619: } - -: 1620: - -: 1621: /** Attach a static function with a bound pointer - -: 1622: * @param obj Pointer to object to bind to function - -: 1623: * @param func Static function to attach - -: 1624: * @deprecated - -: 1625: * Arguments to callback have been reordered to attach(func, arg) - -: 1626: */ - -: 1627: template - -: 1628: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1629: "Arguments to callback have been reordered to attach(func, arg)") - -: 1630: void attach(const U *obj, R (*func)(const T*, A0, A1)) { - -: 1631: this->~Callback(); - -: 1632: new (this) Callback(func, obj); - -: 1633: } - -: 1634: - -: 1635: /** Attach a static function with a bound pointer - -: 1636: * @param obj Pointer to object to bind to function - -: 1637: * @param func Static function to attach - -: 1638: * @deprecated - -: 1639: * Arguments to callback have been reordered to attach(func, arg) - -: 1640: */ - -: 1641: template - -: 1642: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1643: "Arguments to callback have been reordered to attach(func, arg)") - -: 1644: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 1645: this->~Callback(); - -: 1646: new (this) Callback(func, obj); - -: 1647: } - -: 1648: - -: 1649: /** Attach a static function with a bound pointer - -: 1650: * @param obj Pointer to object to bind to function - -: 1651: * @param func Static function to attach - -: 1652: * @deprecated - -: 1653: * Arguments to callback have been reordered to attach(func, arg) - -: 1654: */ - -: 1655: template - -: 1656: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1657: "Arguments to callback have been reordered to attach(func, arg)") - -: 1658: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 1659: this->~Callback(); - -: 1660: new (this) Callback(func, obj); - -: 1661: } - -: 1662: - -: 1663: /** Assign a callback - -: 1664: */ - -: 1665: Callback &operator=(const Callback &that) { - -: 1666: if (this != &that) { - -: 1667: this->~Callback(); - -: 1668: new (this) Callback(that); - -: 1669: } - -: 1670: - -: 1671: return *this; - -: 1672: } - -: 1673: - -: 1674: /** Call the attached function - -: 1675: */ - -: 1676: R call(A0 a0, A1 a1) const { - -: 1677: MBED_ASSERT(_ops); - -: 1678: return _ops->call(this, a0, a1); - -: 1679: } - -: 1680: - -: 1681: /** Call the attached function - -: 1682: */ - -: 1683: R operator()(A0 a0, A1 a1) const { - -: 1684: return call(a0, a1); - -: 1685: } - -: 1686: - -: 1687: /** Test if function has been attached - -: 1688: */ - -: 1689: operator bool() const { - -: 1690: return _ops; - -: 1691: } - -: 1692: - -: 1693: /** Test for equality - -: 1694: */ - -: 1695: friend bool operator==(const Callback &l, const Callback &r) { - -: 1696: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 1697: } - -: 1698: - -: 1699: /** Test for inequality - -: 1700: */ - -: 1701: friend bool operator!=(const Callback &l, const Callback &r) { - -: 1702: return !(l == r); - -: 1703: } - -: 1704: - -: 1705: /** Static thunk for passing as C-style function - -: 1706: * @param func Callback to call passed as void pointer - -: 1707: * @param a0 An argument to be called with function func - -: 1708: * @param a1 An argument to be called with function func - -: 1709: * @return the value as determined by func which is of - -: 1710: * type and determined by the signiture of func - -: 1711: */ - -: 1712: static R thunk(void *func, A0 a0, A1 a1) { - -: 1713: return static_cast(func)->call(a0, a1); - -: 1714: } - -: 1715: - -: 1716:private: - -: 1717: // Stored as pointer to function and pointer to optional object - -: 1718: // Function pointer is stored as union of possible function types - -: 1719: // to garuntee proper size and alignment - -: 1720: struct _class; - -: 1721: union { - -: 1722: void (*_staticfunc)(A0, A1); - -: 1723: void (*_boundfunc)(_class*, A0, A1); - -: 1724: void (_class::*_methodfunc)(A0, A1); - -: 1725: } _func; - -: 1726: void *_obj; - -: 1727: - -: 1728: // Dynamically dispatched operations - -: 1729: const struct ops { - -: 1730: R (*call)(const void*, A0, A1); - -: 1731: void (*move)(void*, const void*); - -: 1732: void (*dtor)(void*); - -: 1733: } *_ops; - -: 1734: - -: 1735: // Generate operations for function object - -: 1736: template - -: 1737: void generate(const F &f) { - -: 1738: static const ops ops = { - -: 1739: &Callback::function_call, - -: 1740: &Callback::function_move, - -: 1741: &Callback::function_dtor, - -: 1742: }; - -: 1743: - -: 1744: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 1745: "Type F must not exceed the size of the Callback class"); - -: 1746: memset(this, 0, sizeof(Callback)); - -: 1747: new (this) F(f); - -: 1748: _ops = &ops; - -: 1749: } - -: 1750: - -: 1751: // Function attributes - -: 1752: template - -: 1753: static R function_call(const void *p, A0 a0, A1 a1) { - -: 1754: return (*(F*)p)(a0, a1); - -: 1755: } - -: 1756: - -: 1757: template - -: 1758: static void function_move(void *d, const void *p) { - -: 1759: new (d) F(*(F*)p); - -: 1760: } - -: 1761: - -: 1762: template - -: 1763: static void function_dtor(void *p) { - -: 1764: ((F*)p)->~F(); - -: 1765: } - -: 1766: - -: 1767: // Wrappers for functions with context - -: 1768: template - -: 1769: struct method_context { - -: 1770: M method; - -: 1771: O *obj; - -: 1772: - -: 1773: method_context(O *obj, M method) - -: 1774: : method(method), obj(obj) {} - -: 1775: - -: 1776: R operator()(A0 a0, A1 a1) const { - -: 1777: return (obj->*method)(a0, a1); - -: 1778: } - -: 1779: }; - -: 1780: - -: 1781: template - -: 1782: struct function_context { - -: 1783: F func; - -: 1784: A *arg; - -: 1785: - -: 1786: function_context(F func, A *arg) - -: 1787: : func(func), arg(arg) {} - -: 1788: - -: 1789: R operator()(A0 a0, A1 a1) const { - -: 1790: return func(arg, a0, a1); - -: 1791: } - -: 1792: }; - -: 1793:}; - -: 1794: - -: 1795:/** Callback class based on template specialization - -: 1796: * - -: 1797: * @note Synchronization level: Not protected - -: 1798: */ - -: 1799:template - -: 1800:class Callback { - -: 1801:public: - -: 1802: /** Create a Callback with a static function - -: 1803: * @param func Static function to attach - -: 1804: */ - -: 1805: Callback(R (*func)(A0, A1, A2) = 0) { - -: 1806: if (!func) { - -: 1807: memset(this, 0, sizeof(Callback)); - -: 1808: } else { - -: 1809: generate(func); - -: 1810: } - -: 1811: } - -: 1812: - -: 1813: /** Attach a Callback - -: 1814: * @param func The Callback to attach - -: 1815: */ - -: 1816: Callback(const Callback &func) { - -: 1817: if (func._ops) { - -: 1818: func._ops->move(this, &func); - -: 1819: } - -: 1820: _ops = func._ops; - -: 1821: } - -: 1822: - -: 1823: /** Create a Callback with a member function - -: 1824: * @param obj Pointer to object to invoke member function on - -: 1825: * @param method Member function to attach - -: 1826: */ - -: 1827: template - -: 1828: Callback(U *obj, R (T::*method)(A0, A1, A2)) { - -: 1829: generate(method_context(obj, method)); - -: 1830: } - -: 1831: - -: 1832: /** Create a Callback with a member function - -: 1833: * @param obj Pointer to object to invoke member function on - -: 1834: * @param method Member function to attach - -: 1835: */ - -: 1836: template - -: 1837: Callback(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 1838: generate(method_context(obj, method)); - -: 1839: } - -: 1840: - -: 1841: /** Create a Callback with a member function - -: 1842: * @param obj Pointer to object to invoke member function on - -: 1843: * @param method Member function to attach - -: 1844: */ - -: 1845: template - -: 1846: Callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 1847: generate(method_context(obj, method)); - -: 1848: } - -: 1849: - -: 1850: /** Create a Callback with a member function - -: 1851: * @param obj Pointer to object to invoke member function on - -: 1852: * @param method Member function to attach - -: 1853: */ - -: 1854: template - -: 1855: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 1856: generate(method_context(obj, method)); - -: 1857: } - -: 1858: - -: 1859: /** Create a Callback with a static function and bound pointer - -: 1860: * @param func Static function to attach - -: 1861: * @param arg Pointer argument to function - -: 1862: */ - -: 1863: template - -: 1864: Callback(R (*func)(T*, A0, A1, A2), U *arg) { - -: 1865: generate(function_context(func, arg)); - -: 1866: } - -: 1867: - -: 1868: /** Create a Callback with a static function and bound pointer - -: 1869: * @param func Static function to attach - -: 1870: * @param arg Pointer argument to function - -: 1871: */ - -: 1872: template - -: 1873: Callback(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 1874: generate(function_context(func, arg)); - -: 1875: } - -: 1876: - -: 1877: /** Create a Callback with a static function and bound pointer - -: 1878: * @param func Static function to attach - -: 1879: * @param arg Pointer argument to function - -: 1880: */ - -: 1881: template - -: 1882: Callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 1883: generate(function_context(func, arg)); - -: 1884: } - -: 1885: - -: 1886: /** Create a Callback with a static function and bound pointer - -: 1887: * @param func Static function to attach - -: 1888: * @param arg Pointer argument to function - -: 1889: */ - -: 1890: template - -: 1891: Callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 1892: generate(function_context(func, arg)); - -: 1893: } - -: 1894: - -: 1895: /** Create a Callback with a function object - -: 1896: * @param f Function object to attach - -: 1897: * @note The function object is limited to a single word of storage - -: 1898: */ - -: 1899: template - -: 1900: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { - -: 1901: generate(f); - -: 1902: } - -: 1903: - -: 1904: /** Create a Callback with a function object - -: 1905: * @param f Function object to attach - -: 1906: * @note The function object is limited to a single word of storage - -: 1907: */ - -: 1908: template - -: 1909: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { - -: 1910: generate(f); - -: 1911: } - -: 1912: - -: 1913: /** Create a Callback with a function object - -: 1914: * @param f Function object to attach - -: 1915: * @note The function object is limited to a single word of storage - -: 1916: */ - -: 1917: template - -: 1918: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { - -: 1919: generate(f); - -: 1920: } - -: 1921: - -: 1922: /** Create a Callback with a function object - -: 1923: * @param f Function object to attach - -: 1924: * @note The function object is limited to a single word of storage - -: 1925: */ - -: 1926: template - -: 1927: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { - -: 1928: generate(f); - -: 1929: } - -: 1930: - -: 1931: /** Create a Callback with a static function and bound pointer - -: 1932: * @param obj Pointer to object to bind to function - -: 1933: * @param func Static function to attach - -: 1934: * @deprecated - -: 1935: * Arguments to callback have been reordered to Callback(func, arg) - -: 1936: */ - -: 1937: template - -: 1938: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1939: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1940: Callback(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 1941: new (this) Callback(func, obj); - -: 1942: } - -: 1943: - -: 1944: /** Create a Callback with a static function and bound pointer - -: 1945: * @param obj Pointer to object to bind to function - -: 1946: * @param func Static function to attach - -: 1947: * @deprecated - -: 1948: * Arguments to callback have been reordered to Callback(func, arg) - -: 1949: */ - -: 1950: template - -: 1951: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1952: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1953: Callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 1954: new (this) Callback(func, obj); - -: 1955: } - -: 1956: - -: 1957: /** Create a Callback with a static function and bound pointer - -: 1958: * @param obj Pointer to object to bind to function - -: 1959: * @param func Static function to attach - -: 1960: * @deprecated - -: 1961: * Arguments to callback have been reordered to Callback(func, arg) - -: 1962: */ - -: 1963: template - -: 1964: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1965: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1966: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 1967: new (this) Callback(func, obj); - -: 1968: } - -: 1969: - -: 1970: /** Create a Callback with a static function and bound pointer - -: 1971: * @param obj Pointer to object to bind to function - -: 1972: * @param func Static function to attach - -: 1973: * @deprecated - -: 1974: * Arguments to callback have been reordered to Callback(func, arg) - -: 1975: */ - -: 1976: template - -: 1977: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 1978: "Arguments to callback have been reordered to Callback(func, arg)") - -: 1979: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 1980: new (this) Callback(func, obj); - -: 1981: } - -: 1982: - -: 1983: /** Destroy a callback - -: 1984: */ - -: 1985: ~Callback() { - -: 1986: if (_ops) { - -: 1987: _ops->dtor(this); - -: 1988: } - -: 1989: } - -: 1990: - -: 1991: /** Attach a static function - -: 1992: * @param func Static function to attach - -: 1993: * @deprecated - -: 1994: * Replaced by simple assignment 'Callback cb = func' - -: 1995: */ - -: 1996: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 1997: "Replaced by simple assignment 'Callback cb = func") - -: 1998: void attach(R (*func)(A0, A1, A2)) { - -: 1999: this->~Callback(); - -: 2000: new (this) Callback(func); - -: 2001: } - -: 2002: - -: 2003: /** Attach a Callback - -: 2004: * @param func The Callback to attach - -: 2005: * @deprecated - -: 2006: * Replaced by simple assignment 'Callback cb = func' - -: 2007: */ - -: 2008: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2009: "Replaced by simple assignment 'Callback cb = func") - -: 2010: void attach(const Callback &func) { - -: 2011: this->~Callback(); - -: 2012: new (this) Callback(func); - -: 2013: } - -: 2014: - -: 2015: /** Attach a member function - -: 2016: * @param obj Pointer to object to invoke member function on - -: 2017: * @param method Member function to attach - -: 2018: * @deprecated - -: 2019: * Replaced by simple assignment 'Callback cb = func' - -: 2020: */ - -: 2021: template - -: 2022: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2023: "Replaced by simple assignment 'Callback cb = func") - -: 2024: void attach(U *obj, R (T::*method)(A0, A1, A2)) { - -: 2025: this->~Callback(); - -: 2026: new (this) Callback(obj, method); - -: 2027: } - -: 2028: - -: 2029: /** Attach a member function - -: 2030: * @param obj Pointer to object to invoke member function on - -: 2031: * @param method Member function to attach - -: 2032: * @deprecated - -: 2033: * Replaced by simple assignment 'Callback cb = func' - -: 2034: */ - -: 2035: template - -: 2036: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2037: "Replaced by simple assignment 'Callback cb = func") - -: 2038: void attach(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 2039: this->~Callback(); - -: 2040: new (this) Callback(obj, method); - -: 2041: } - -: 2042: - -: 2043: /** Attach a member function - -: 2044: * @param obj Pointer to object to invoke member function on - -: 2045: * @param method Member function to attach - -: 2046: * @deprecated - -: 2047: * Replaced by simple assignment 'Callback cb = func' - -: 2048: */ - -: 2049: template - -: 2050: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2051: "Replaced by simple assignment 'Callback cb = func") - -: 2052: void attach(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 2053: this->~Callback(); - -: 2054: new (this) Callback(obj, method); - -: 2055: } - -: 2056: - -: 2057: /** Attach a member function - -: 2058: * @param obj Pointer to object to invoke member function on - -: 2059: * @param method Member function to attach - -: 2060: * @deprecated - -: 2061: * Replaced by simple assignment 'Callback cb = func' - -: 2062: */ - -: 2063: template - -: 2064: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2065: "Replaced by simple assignment 'Callback cb = func") - -: 2066: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 2067: this->~Callback(); - -: 2068: new (this) Callback(obj, method); - -: 2069: } - -: 2070: - -: 2071: /** Attach a static function with a bound pointer - -: 2072: * @param func Static function to attach - -: 2073: * @param arg Pointer argument to function - -: 2074: * @deprecated - -: 2075: * Replaced by simple assignment 'Callback cb = func' - -: 2076: */ - -: 2077: template - -: 2078: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2079: "Replaced by simple assignment 'Callback cb = func") - -: 2080: void attach(R (*func)(T*, A0, A1, A2), U *arg) { - -: 2081: this->~Callback(); - -: 2082: new (this) Callback(func, arg); - -: 2083: } - -: 2084: - -: 2085: /** Attach a static function with a bound pointer - -: 2086: * @param func Static function to attach - -: 2087: * @param arg Pointer argument to function - -: 2088: * @deprecated - -: 2089: * Replaced by simple assignment 'Callback cb = func' - -: 2090: */ - -: 2091: template - -: 2092: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2093: "Replaced by simple assignment 'Callback cb = func") - -: 2094: void attach(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 2095: this->~Callback(); - -: 2096: new (this) Callback(func, arg); - -: 2097: } - -: 2098: - -: 2099: /** Attach a static function with a bound pointer - -: 2100: * @param func Static function to attach - -: 2101: * @param arg Pointer argument to function - -: 2102: * @deprecated - -: 2103: * Replaced by simple assignment 'Callback cb = func' - -: 2104: */ - -: 2105: template - -: 2106: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2107: "Replaced by simple assignment 'Callback cb = func") - -: 2108: void attach(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 2109: this->~Callback(); - -: 2110: new (this) Callback(func, arg); - -: 2111: } - -: 2112: - -: 2113: /** Attach a static function with a bound pointer - -: 2114: * @param func Static function to attach - -: 2115: * @param arg Pointer argument to function - -: 2116: * @deprecated - -: 2117: * Replaced by simple assignment 'Callback cb = func' - -: 2118: */ - -: 2119: template - -: 2120: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2121: "Replaced by simple assignment 'Callback cb = func") - -: 2122: void attach(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 2123: this->~Callback(); - -: 2124: new (this) Callback(func, arg); - -: 2125: } - -: 2126: - -: 2127: /** Attach a function object - -: 2128: * @param f Function object to attach - -: 2129: * @note The function object is limited to a single word of storage - -: 2130: * @deprecated - -: 2131: * Replaced by simple assignment 'Callback cb = func' - -: 2132: */ - -: 2133: template - -: 2134: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2135: "Replaced by simple assignment 'Callback cb = func") - -: 2136: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { - -: 2137: this->~Callback(); - -: 2138: new (this) Callback(f); - -: 2139: } - -: 2140: - -: 2141: /** Attach a function object - -: 2142: * @param f Function object to attach - -: 2143: * @note The function object is limited to a single word of storage - -: 2144: * @deprecated - -: 2145: * Replaced by simple assignment 'Callback cb = func' - -: 2146: */ - -: 2147: template - -: 2148: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2149: "Replaced by simple assignment 'Callback cb = func") - -: 2150: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { - -: 2151: this->~Callback(); - -: 2152: new (this) Callback(f); - -: 2153: } - -: 2154: - -: 2155: /** Attach a function object - -: 2156: * @param f Function object to attach - -: 2157: * @note The function object is limited to a single word of storage - -: 2158: * @deprecated - -: 2159: * Replaced by simple assignment 'Callback cb = func' - -: 2160: */ - -: 2161: template - -: 2162: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2163: "Replaced by simple assignment 'Callback cb = func") - -: 2164: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { - -: 2165: this->~Callback(); - -: 2166: new (this) Callback(f); - -: 2167: } - -: 2168: - -: 2169: /** Attach a function object - -: 2170: * @param f Function object to attach - -: 2171: * @note The function object is limited to a single word of storage - -: 2172: * @deprecated - -: 2173: * Replaced by simple assignment 'Callback cb = func' - -: 2174: */ - -: 2175: template - -: 2176: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2177: "Replaced by simple assignment 'Callback cb = func") - -: 2178: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { - -: 2179: this->~Callback(); - -: 2180: new (this) Callback(f); - -: 2181: } - -: 2182: - -: 2183: /** Attach a static function with a bound pointer - -: 2184: * @param obj Pointer to object to bind to function - -: 2185: * @param func Static function to attach - -: 2186: * @deprecated - -: 2187: * Arguments to callback have been reordered to attach(func, arg) - -: 2188: */ - -: 2189: template - -: 2190: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2191: "Arguments to callback have been reordered to attach(func, arg)") - -: 2192: void attach(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 2193: this->~Callback(); - -: 2194: new (this) Callback(func, obj); - -: 2195: } - -: 2196: - -: 2197: /** Attach a static function with a bound pointer - -: 2198: * @param obj Pointer to object to bind to function - -: 2199: * @param func Static function to attach - -: 2200: * @deprecated - -: 2201: * Arguments to callback have been reordered to attach(func, arg) - -: 2202: */ - -: 2203: template - -: 2204: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2205: "Arguments to callback have been reordered to attach(func, arg)") - -: 2206: void attach(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 2207: this->~Callback(); - -: 2208: new (this) Callback(func, obj); - -: 2209: } - -: 2210: - -: 2211: /** Attach a static function with a bound pointer - -: 2212: * @param obj Pointer to object to bind to function - -: 2213: * @param func Static function to attach - -: 2214: * @deprecated - -: 2215: * Arguments to callback have been reordered to attach(func, arg) - -: 2216: */ - -: 2217: template - -: 2218: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2219: "Arguments to callback have been reordered to attach(func, arg)") - -: 2220: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 2221: this->~Callback(); - -: 2222: new (this) Callback(func, obj); - -: 2223: } - -: 2224: - -: 2225: /** Attach a static function with a bound pointer - -: 2226: * @param obj Pointer to object to bind to function - -: 2227: * @param func Static function to attach - -: 2228: * @deprecated - -: 2229: * Arguments to callback have been reordered to attach(func, arg) - -: 2230: */ - -: 2231: template - -: 2232: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2233: "Arguments to callback have been reordered to attach(func, arg)") - -: 2234: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 2235: this->~Callback(); - -: 2236: new (this) Callback(func, obj); - -: 2237: } - -: 2238: - -: 2239: /** Assign a callback - -: 2240: */ - -: 2241: Callback &operator=(const Callback &that) { - -: 2242: if (this != &that) { - -: 2243: this->~Callback(); - -: 2244: new (this) Callback(that); - -: 2245: } - -: 2246: - -: 2247: return *this; - -: 2248: } - -: 2249: - -: 2250: /** Call the attached function - -: 2251: */ - -: 2252: R call(A0 a0, A1 a1, A2 a2) const { - -: 2253: MBED_ASSERT(_ops); - -: 2254: return _ops->call(this, a0, a1, a2); - -: 2255: } - -: 2256: - -: 2257: /** Call the attached function - -: 2258: */ - -: 2259: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2260: return call(a0, a1, a2); - -: 2261: } - -: 2262: - -: 2263: /** Test if function has been attached - -: 2264: */ - -: 2265: operator bool() const { - -: 2266: return _ops; - -: 2267: } - -: 2268: - -: 2269: /** Test for equality - -: 2270: */ - -: 2271: friend bool operator==(const Callback &l, const Callback &r) { - -: 2272: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 2273: } - -: 2274: - -: 2275: /** Test for inequality - -: 2276: */ - -: 2277: friend bool operator!=(const Callback &l, const Callback &r) { - -: 2278: return !(l == r); - -: 2279: } - -: 2280: - -: 2281: /** Static thunk for passing as C-style function - -: 2282: * @param func Callback to call passed as void pointer - -: 2283: * @param a0 An argument to be called with function func - -: 2284: * @param a1 An argument to be called with function func - -: 2285: * @param a2 An argument to be called with function func - -: 2286: * @return the value as determined by func which is of - -: 2287: * type and determined by the signiture of func - -: 2288: */ - -: 2289: static R thunk(void *func, A0 a0, A1 a1, A2 a2) { - -: 2290: return static_cast(func)->call(a0, a1, a2); - -: 2291: } - -: 2292: - -: 2293:private: - -: 2294: // Stored as pointer to function and pointer to optional object - -: 2295: // Function pointer is stored as union of possible function types - -: 2296: // to garuntee proper size and alignment - -: 2297: struct _class; - -: 2298: union { - -: 2299: void (*_staticfunc)(A0, A1, A2); - -: 2300: void (*_boundfunc)(_class*, A0, A1, A2); - -: 2301: void (_class::*_methodfunc)(A0, A1, A2); - -: 2302: } _func; - -: 2303: void *_obj; - -: 2304: - -: 2305: // Dynamically dispatched operations - -: 2306: const struct ops { - -: 2307: R (*call)(const void*, A0, A1, A2); - -: 2308: void (*move)(void*, const void*); - -: 2309: void (*dtor)(void*); - -: 2310: } *_ops; - -: 2311: - -: 2312: // Generate operations for function object - -: 2313: template - -: 2314: void generate(const F &f) { - -: 2315: static const ops ops = { - -: 2316: &Callback::function_call, - -: 2317: &Callback::function_move, - -: 2318: &Callback::function_dtor, - -: 2319: }; - -: 2320: - -: 2321: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 2322: "Type F must not exceed the size of the Callback class"); - -: 2323: memset(this, 0, sizeof(Callback)); - -: 2324: new (this) F(f); - -: 2325: _ops = &ops; - -: 2326: } - -: 2327: - -: 2328: // Function attributes - -: 2329: template - -: 2330: static R function_call(const void *p, A0 a0, A1 a1, A2 a2) { - -: 2331: return (*(F*)p)(a0, a1, a2); - -: 2332: } - -: 2333: - -: 2334: template - -: 2335: static void function_move(void *d, const void *p) { - -: 2336: new (d) F(*(F*)p); - -: 2337: } - -: 2338: - -: 2339: template - -: 2340: static void function_dtor(void *p) { - -: 2341: ((F*)p)->~F(); - -: 2342: } - -: 2343: - -: 2344: // Wrappers for functions with context - -: 2345: template - -: 2346: struct method_context { - -: 2347: M method; - -: 2348: O *obj; - -: 2349: - -: 2350: method_context(O *obj, M method) - -: 2351: : method(method), obj(obj) {} - -: 2352: - -: 2353: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2354: return (obj->*method)(a0, a1, a2); - -: 2355: } - -: 2356: }; - -: 2357: - -: 2358: template - -: 2359: struct function_context { - -: 2360: F func; - -: 2361: A *arg; - -: 2362: - -: 2363: function_context(F func, A *arg) - -: 2364: : func(func), arg(arg) {} - -: 2365: - -: 2366: R operator()(A0 a0, A1 a1, A2 a2) const { - -: 2367: return func(arg, a0, a1, a2); - -: 2368: } - -: 2369: }; - -: 2370:}; - -: 2371: - -: 2372:/** Callback class based on template specialization - -: 2373: * - -: 2374: * @note Synchronization level: Not protected - -: 2375: */ - -: 2376:template - -: 2377:class Callback { - -: 2378:public: - -: 2379: /** Create a Callback with a static function - -: 2380: * @param func Static function to attach - -: 2381: */ - -: 2382: Callback(R (*func)(A0, A1, A2, A3) = 0) { - -: 2383: if (!func) { - -: 2384: memset(this, 0, sizeof(Callback)); - -: 2385: } else { - -: 2386: generate(func); - -: 2387: } - -: 2388: } - -: 2389: - -: 2390: /** Attach a Callback - -: 2391: * @param func The Callback to attach - -: 2392: */ - -: 2393: Callback(const Callback &func) { - -: 2394: if (func._ops) { - -: 2395: func._ops->move(this, &func); - -: 2396: } - -: 2397: _ops = func._ops; - -: 2398: } - -: 2399: - -: 2400: /** Create a Callback with a member function - -: 2401: * @param obj Pointer to object to invoke member function on - -: 2402: * @param method Member function to attach - -: 2403: */ - -: 2404: template - -: 2405: Callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 2406: generate(method_context(obj, method)); - -: 2407: } - -: 2408: - -: 2409: /** Create a Callback with a member function - -: 2410: * @param obj Pointer to object to invoke member function on - -: 2411: * @param method Member function to attach - -: 2412: */ - -: 2413: template - -: 2414: Callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 2415: generate(method_context(obj, method)); - -: 2416: } - -: 2417: - -: 2418: /** Create a Callback with a member function - -: 2419: * @param obj Pointer to object to invoke member function on - -: 2420: * @param method Member function to attach - -: 2421: */ - -: 2422: template - -: 2423: Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 2424: generate(method_context(obj, method)); - -: 2425: } - -: 2426: - -: 2427: /** Create a Callback with a member function - -: 2428: * @param obj Pointer to object to invoke member function on - -: 2429: * @param method Member function to attach - -: 2430: */ - -: 2431: template - -: 2432: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 2433: generate(method_context(obj, method)); - -: 2434: } - -: 2435: - -: 2436: /** Create a Callback with a static function and bound pointer - -: 2437: * @param func Static function to attach - -: 2438: * @param arg Pointer argument to function - -: 2439: */ - -: 2440: template - -: 2441: Callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 2442: generate(function_context(func, arg)); - -: 2443: } - -: 2444: - -: 2445: /** Create a Callback with a static function and bound pointer - -: 2446: * @param func Static function to attach - -: 2447: * @param arg Pointer argument to function - -: 2448: */ - -: 2449: template - -: 2450: Callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 2451: generate(function_context(func, arg)); - -: 2452: } - -: 2453: - -: 2454: /** Create a Callback with a static function and bound pointer - -: 2455: * @param func Static function to attach - -: 2456: * @param arg Pointer argument to function - -: 2457: */ - -: 2458: template - -: 2459: Callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 2460: generate(function_context(func, arg)); - -: 2461: } - -: 2462: - -: 2463: /** Create a Callback with a static function and bound pointer - -: 2464: * @param func Static function to attach - -: 2465: * @param arg Pointer argument to function - -: 2466: */ - -: 2467: template - -: 2468: Callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 2469: generate(function_context(func, arg)); - -: 2470: } - -: 2471: - -: 2472: /** Create a Callback with a function object - -: 2473: * @param f Function object to attach - -: 2474: * @note The function object is limited to a single word of storage - -: 2475: */ - -: 2476: template - -: 2477: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { - -: 2478: generate(f); - -: 2479: } - -: 2480: - -: 2481: /** Create a Callback with a function object - -: 2482: * @param f Function object to attach - -: 2483: * @note The function object is limited to a single word of storage - -: 2484: */ - -: 2485: template - -: 2486: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { - -: 2487: generate(f); - -: 2488: } - -: 2489: - -: 2490: /** Create a Callback with a function object - -: 2491: * @param f Function object to attach - -: 2492: * @note The function object is limited to a single word of storage - -: 2493: */ - -: 2494: template - -: 2495: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { - -: 2496: generate(f); - -: 2497: } - -: 2498: - -: 2499: /** Create a Callback with a function object - -: 2500: * @param f Function object to attach - -: 2501: * @note The function object is limited to a single word of storage - -: 2502: */ - -: 2503: template - -: 2504: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { - -: 2505: generate(f); - -: 2506: } - -: 2507: - -: 2508: /** Create a Callback with a static function and bound pointer - -: 2509: * @param obj Pointer to object to bind to function - -: 2510: * @param func Static function to attach - -: 2511: * @deprecated - -: 2512: * Arguments to callback have been reordered to Callback(func, arg) - -: 2513: */ - -: 2514: template - -: 2515: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2516: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2517: Callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 2518: new (this) Callback(func, obj); - -: 2519: } - -: 2520: - -: 2521: /** Create a Callback with a static function and bound pointer - -: 2522: * @param obj Pointer to object to bind to function - -: 2523: * @param func Static function to attach - -: 2524: * @deprecated - -: 2525: * Arguments to callback have been reordered to Callback(func, arg) - -: 2526: */ - -: 2527: template - -: 2528: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2529: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2530: Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 2531: new (this) Callback(func, obj); - -: 2532: } - -: 2533: - -: 2534: /** Create a Callback with a static function and bound pointer - -: 2535: * @param obj Pointer to object to bind to function - -: 2536: * @param func Static function to attach - -: 2537: * @deprecated - -: 2538: * Arguments to callback have been reordered to Callback(func, arg) - -: 2539: */ - -: 2540: template - -: 2541: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2542: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2543: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 2544: new (this) Callback(func, obj); - -: 2545: } - -: 2546: - -: 2547: /** Create a Callback with a static function and bound pointer - -: 2548: * @param obj Pointer to object to bind to function - -: 2549: * @param func Static function to attach - -: 2550: * @deprecated - -: 2551: * Arguments to callback have been reordered to Callback(func, arg) - -: 2552: */ - -: 2553: template - -: 2554: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2555: "Arguments to callback have been reordered to Callback(func, arg)") - -: 2556: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 2557: new (this) Callback(func, obj); - -: 2558: } - -: 2559: - -: 2560: /** Destroy a callback - -: 2561: */ - -: 2562: ~Callback() { - -: 2563: if (_ops) { - -: 2564: _ops->dtor(this); - -: 2565: } - -: 2566: } - -: 2567: - -: 2568: /** Attach a static function - -: 2569: * @param func Static function to attach - -: 2570: * @deprecated - -: 2571: * Replaced by simple assignment 'Callback cb = func' - -: 2572: */ - -: 2573: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2574: "Replaced by simple assignment 'Callback cb = func") - -: 2575: void attach(R (*func)(A0, A1, A2, A3)) { - -: 2576: this->~Callback(); - -: 2577: new (this) Callback(func); - -: 2578: } - -: 2579: - -: 2580: /** Attach a Callback - -: 2581: * @param func The Callback to attach - -: 2582: * @deprecated - -: 2583: * Replaced by simple assignment 'Callback cb = func' - -: 2584: */ - -: 2585: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2586: "Replaced by simple assignment 'Callback cb = func") - -: 2587: void attach(const Callback &func) { - -: 2588: this->~Callback(); - -: 2589: new (this) Callback(func); - -: 2590: } - -: 2591: - -: 2592: /** Attach a member function - -: 2593: * @param obj Pointer to object to invoke member function on - -: 2594: * @param method Member function to attach - -: 2595: * @deprecated - -: 2596: * Replaced by simple assignment 'Callback cb = func' - -: 2597: */ - -: 2598: template - -: 2599: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2600: "Replaced by simple assignment 'Callback cb = func") - -: 2601: void attach(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 2602: this->~Callback(); - -: 2603: new (this) Callback(obj, method); - -: 2604: } - -: 2605: - -: 2606: /** Attach a member function - -: 2607: * @param obj Pointer to object to invoke member function on - -: 2608: * @param method Member function to attach - -: 2609: * @deprecated - -: 2610: * Replaced by simple assignment 'Callback cb = func' - -: 2611: */ - -: 2612: template - -: 2613: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2614: "Replaced by simple assignment 'Callback cb = func") - -: 2615: void attach(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 2616: this->~Callback(); - -: 2617: new (this) Callback(obj, method); - -: 2618: } - -: 2619: - -: 2620: /** Attach a member function - -: 2621: * @param obj Pointer to object to invoke member function on - -: 2622: * @param method Member function to attach - -: 2623: * @deprecated - -: 2624: * Replaced by simple assignment 'Callback cb = func' - -: 2625: */ - -: 2626: template - -: 2627: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2628: "Replaced by simple assignment 'Callback cb = func") - -: 2629: void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 2630: this->~Callback(); - -: 2631: new (this) Callback(obj, method); - -: 2632: } - -: 2633: - -: 2634: /** Attach a member function - -: 2635: * @param obj Pointer to object to invoke member function on - -: 2636: * @param method Member function to attach - -: 2637: * @deprecated - -: 2638: * Replaced by simple assignment 'Callback cb = func' - -: 2639: */ - -: 2640: template - -: 2641: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2642: "Replaced by simple assignment 'Callback cb = func") - -: 2643: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 2644: this->~Callback(); - -: 2645: new (this) Callback(obj, method); - -: 2646: } - -: 2647: - -: 2648: /** Attach a static function with a bound pointer - -: 2649: * @param func Static function to attach - -: 2650: * @param arg Pointer argument to function - -: 2651: * @deprecated - -: 2652: * Replaced by simple assignment 'Callback cb = func' - -: 2653: */ - -: 2654: template - -: 2655: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2656: "Replaced by simple assignment 'Callback cb = func") - -: 2657: void attach(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 2658: this->~Callback(); - -: 2659: new (this) Callback(func, arg); - -: 2660: } - -: 2661: - -: 2662: /** Attach a static function with a bound pointer - -: 2663: * @param func Static function to attach - -: 2664: * @param arg Pointer argument to function - -: 2665: * @deprecated - -: 2666: * Replaced by simple assignment 'Callback cb = func' - -: 2667: */ - -: 2668: template - -: 2669: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2670: "Replaced by simple assignment 'Callback cb = func") - -: 2671: void attach(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 2672: this->~Callback(); - -: 2673: new (this) Callback(func, arg); - -: 2674: } - -: 2675: - -: 2676: /** Attach a static function with a bound pointer - -: 2677: * @param func Static function to attach - -: 2678: * @param arg Pointer argument to function - -: 2679: * @deprecated - -: 2680: * Replaced by simple assignment 'Callback cb = func' - -: 2681: */ - -: 2682: template - -: 2683: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2684: "Replaced by simple assignment 'Callback cb = func") - -: 2685: void attach(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 2686: this->~Callback(); - -: 2687: new (this) Callback(func, arg); - -: 2688: } - -: 2689: - -: 2690: /** Attach a static function with a bound pointer - -: 2691: * @param func Static function to attach - -: 2692: * @param arg Pointer argument to function - -: 2693: * @deprecated - -: 2694: * Replaced by simple assignment 'Callback cb = func' - -: 2695: */ - -: 2696: template - -: 2697: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2698: "Replaced by simple assignment 'Callback cb = func") - -: 2699: void attach(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 2700: this->~Callback(); - -: 2701: new (this) Callback(func, arg); - -: 2702: } - -: 2703: - -: 2704: /** Attach a function object - -: 2705: * @param f Function object to attach - -: 2706: * @note The function object is limited to a single word of storage - -: 2707: * @deprecated - -: 2708: * Replaced by simple assignment 'Callback cb = func' - -: 2709: */ - -: 2710: template - -: 2711: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2712: "Replaced by simple assignment 'Callback cb = func") - -: 2713: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { - -: 2714: this->~Callback(); - -: 2715: new (this) Callback(f); - -: 2716: } - -: 2717: - -: 2718: /** Attach a function object - -: 2719: * @param f Function object to attach - -: 2720: * @note The function object is limited to a single word of storage - -: 2721: * @deprecated - -: 2722: * Replaced by simple assignment 'Callback cb = func' - -: 2723: */ - -: 2724: template - -: 2725: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2726: "Replaced by simple assignment 'Callback cb = func") - -: 2727: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { - -: 2728: this->~Callback(); - -: 2729: new (this) Callback(f); - -: 2730: } - -: 2731: - -: 2732: /** Attach a function object - -: 2733: * @param f Function object to attach - -: 2734: * @note The function object is limited to a single word of storage - -: 2735: * @deprecated - -: 2736: * Replaced by simple assignment 'Callback cb = func' - -: 2737: */ - -: 2738: template - -: 2739: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2740: "Replaced by simple assignment 'Callback cb = func") - -: 2741: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { - -: 2742: this->~Callback(); - -: 2743: new (this) Callback(f); - -: 2744: } - -: 2745: - -: 2746: /** Attach a function object - -: 2747: * @param f Function object to attach - -: 2748: * @note The function object is limited to a single word of storage - -: 2749: * @deprecated - -: 2750: * Replaced by simple assignment 'Callback cb = func' - -: 2751: */ - -: 2752: template - -: 2753: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 2754: "Replaced by simple assignment 'Callback cb = func") - -: 2755: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { - -: 2756: this->~Callback(); - -: 2757: new (this) Callback(f); - -: 2758: } - -: 2759: - -: 2760: /** Attach a static function with a bound pointer - -: 2761: * @param obj Pointer to object to bind to function - -: 2762: * @param func Static function to attach - -: 2763: * @deprecated - -: 2764: * Arguments to callback have been reordered to attach(func, arg) - -: 2765: */ - -: 2766: template - -: 2767: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2768: "Arguments to callback have been reordered to attach(func, arg)") - -: 2769: void attach(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 2770: this->~Callback(); - -: 2771: new (this) Callback(func, obj); - -: 2772: } - -: 2773: - -: 2774: /** Attach a static function with a bound pointer - -: 2775: * @param obj Pointer to object to bind to function - -: 2776: * @param func Static function to attach - -: 2777: * @deprecated - -: 2778: * Arguments to callback have been reordered to attach(func, arg) - -: 2779: */ - -: 2780: template - -: 2781: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2782: "Arguments to callback have been reordered to attach(func, arg)") - -: 2783: void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 2784: this->~Callback(); - -: 2785: new (this) Callback(func, obj); - -: 2786: } - -: 2787: - -: 2788: /** Attach a static function with a bound pointer - -: 2789: * @param obj Pointer to object to bind to function - -: 2790: * @param func Static function to attach - -: 2791: * @deprecated - -: 2792: * Arguments to callback have been reordered to attach(func, arg) - -: 2793: */ - -: 2794: template - -: 2795: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2796: "Arguments to callback have been reordered to attach(func, arg)") - -: 2797: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 2798: this->~Callback(); - -: 2799: new (this) Callback(func, obj); - -: 2800: } - -: 2801: - -: 2802: /** Attach a static function with a bound pointer - -: 2803: * @param obj Pointer to object to bind to function - -: 2804: * @param func Static function to attach - -: 2805: * @deprecated - -: 2806: * Arguments to callback have been reordered to attach(func, arg) - -: 2807: */ - -: 2808: template - -: 2809: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 2810: "Arguments to callback have been reordered to attach(func, arg)") - -: 2811: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 2812: this->~Callback(); - -: 2813: new (this) Callback(func, obj); - -: 2814: } - -: 2815: - -: 2816: /** Assign a callback - -: 2817: */ - -: 2818: Callback &operator=(const Callback &that) { - -: 2819: if (this != &that) { - -: 2820: this->~Callback(); - -: 2821: new (this) Callback(that); - -: 2822: } - -: 2823: - -: 2824: return *this; - -: 2825: } - -: 2826: - -: 2827: /** Call the attached function - -: 2828: */ - -: 2829: R call(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2830: MBED_ASSERT(_ops); - -: 2831: return _ops->call(this, a0, a1, a2, a3); - -: 2832: } - -: 2833: - -: 2834: /** Call the attached function - -: 2835: */ - -: 2836: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2837: return call(a0, a1, a2, a3); - -: 2838: } - -: 2839: - -: 2840: /** Test if function has been attached - -: 2841: */ - -: 2842: operator bool() const { - -: 2843: return _ops; - -: 2844: } - -: 2845: - -: 2846: /** Test for equality - -: 2847: */ - -: 2848: friend bool operator==(const Callback &l, const Callback &r) { - -: 2849: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 2850: } - -: 2851: - -: 2852: /** Test for inequality - -: 2853: */ - -: 2854: friend bool operator!=(const Callback &l, const Callback &r) { - -: 2855: return !(l == r); - -: 2856: } - -: 2857: - -: 2858: /** Static thunk for passing as C-style function - -: 2859: * @param func Callback to call passed as void pointer - -: 2860: * @param a0 An argument to be called with function func - -: 2861: * @param a1 An argument to be called with function func - -: 2862: * @param a2 An argument to be called with function func - -: 2863: * @param a3 An argument to be called with function func - -: 2864: * @return the value as determined by func which is of - -: 2865: * type and determined by the signiture of func - -: 2866: */ - -: 2867: static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2868: return static_cast(func)->call(a0, a1, a2, a3); - -: 2869: } - -: 2870: - -: 2871:private: - -: 2872: // Stored as pointer to function and pointer to optional object - -: 2873: // Function pointer is stored as union of possible function types - -: 2874: // to garuntee proper size and alignment - -: 2875: struct _class; - -: 2876: union { - -: 2877: void (*_staticfunc)(A0, A1, A2, A3); - -: 2878: void (*_boundfunc)(_class*, A0, A1, A2, A3); - -: 2879: void (_class::*_methodfunc)(A0, A1, A2, A3); - -: 2880: } _func; - -: 2881: void *_obj; - -: 2882: - -: 2883: // Dynamically dispatched operations - -: 2884: const struct ops { - -: 2885: R (*call)(const void*, A0, A1, A2, A3); - -: 2886: void (*move)(void*, const void*); - -: 2887: void (*dtor)(void*); - -: 2888: } *_ops; - -: 2889: - -: 2890: // Generate operations for function object - -: 2891: template - -: 2892: void generate(const F &f) { - -: 2893: static const ops ops = { - -: 2894: &Callback::function_call, - -: 2895: &Callback::function_move, - -: 2896: &Callback::function_dtor, - -: 2897: }; - -: 2898: - -: 2899: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 2900: "Type F must not exceed the size of the Callback class"); - -: 2901: memset(this, 0, sizeof(Callback)); - -: 2902: new (this) F(f); - -: 2903: _ops = &ops; - -: 2904: } - -: 2905: - -: 2906: // Function attributes - -: 2907: template - -: 2908: static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3) { - -: 2909: return (*(F*)p)(a0, a1, a2, a3); - -: 2910: } - -: 2911: - -: 2912: template - -: 2913: static void function_move(void *d, const void *p) { - -: 2914: new (d) F(*(F*)p); - -: 2915: } - -: 2916: - -: 2917: template - -: 2918: static void function_dtor(void *p) { - -: 2919: ((F*)p)->~F(); - -: 2920: } - -: 2921: - -: 2922: // Wrappers for functions with context - -: 2923: template - -: 2924: struct method_context { - -: 2925: M method; - -: 2926: O *obj; - -: 2927: - -: 2928: method_context(O *obj, M method) - -: 2929: : method(method), obj(obj) {} - -: 2930: - -: 2931: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2932: return (obj->*method)(a0, a1, a2, a3); - -: 2933: } - -: 2934: }; - -: 2935: - -: 2936: template - -: 2937: struct function_context { - -: 2938: F func; - -: 2939: A *arg; - -: 2940: - -: 2941: function_context(F func, A *arg) - -: 2942: : func(func), arg(arg) {} - -: 2943: - -: 2944: R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { - -: 2945: return func(arg, a0, a1, a2, a3); - -: 2946: } - -: 2947: }; - -: 2948:}; - -: 2949: - -: 2950:/** Callback class based on template specialization - -: 2951: * - -: 2952: * @note Synchronization level: Not protected - -: 2953: */ - -: 2954:template - -: 2955:class Callback { - -: 2956:public: - -: 2957: /** Create a Callback with a static function - -: 2958: * @param func Static function to attach - -: 2959: */ - -: 2960: Callback(R (*func)(A0, A1, A2, A3, A4) = 0) { - -: 2961: if (!func) { - -: 2962: memset(this, 0, sizeof(Callback)); - -: 2963: } else { - -: 2964: generate(func); - -: 2965: } - -: 2966: } - -: 2967: - -: 2968: /** Attach a Callback - -: 2969: * @param func The Callback to attach - -: 2970: */ - -: 2971: Callback(const Callback &func) { - -: 2972: if (func._ops) { - -: 2973: func._ops->move(this, &func); - -: 2974: } - -: 2975: _ops = func._ops; - -: 2976: } - -: 2977: - -: 2978: /** Create a Callback with a member function - -: 2979: * @param obj Pointer to object to invoke member function on - -: 2980: * @param method Member function to attach - -: 2981: */ - -: 2982: template - -: 2983: Callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 2984: generate(method_context(obj, method)); - -: 2985: } - -: 2986: - -: 2987: /** Create a Callback with a member function - -: 2988: * @param obj Pointer to object to invoke member function on - -: 2989: * @param method Member function to attach - -: 2990: */ - -: 2991: template - -: 2992: Callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 2993: generate(method_context(obj, method)); - -: 2994: } - -: 2995: - -: 2996: /** Create a Callback with a member function - -: 2997: * @param obj Pointer to object to invoke member function on - -: 2998: * @param method Member function to attach - -: 2999: */ - -: 3000: template - -: 3001: Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 3002: generate(method_context(obj, method)); - -: 3003: } - -: 3004: - -: 3005: /** Create a Callback with a member function - -: 3006: * @param obj Pointer to object to invoke member function on - -: 3007: * @param method Member function to attach - -: 3008: */ - -: 3009: template - -: 3010: Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 3011: generate(method_context(obj, method)); - -: 3012: } - -: 3013: - -: 3014: /** Create a Callback with a static function and bound pointer - -: 3015: * @param func Static function to attach - -: 3016: * @param arg Pointer argument to function - -: 3017: */ - -: 3018: template - -: 3019: Callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 3020: generate(function_context(func, arg)); - -: 3021: } - -: 3022: - -: 3023: /** Create a Callback with a static function and bound pointer - -: 3024: * @param func Static function to attach - -: 3025: * @param arg Pointer argument to function - -: 3026: */ - -: 3027: template - -: 3028: Callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 3029: generate(function_context(func, arg)); - -: 3030: } - -: 3031: - -: 3032: /** Create a Callback with a static function and bound pointer - -: 3033: * @param func Static function to attach - -: 3034: * @param arg Pointer argument to function - -: 3035: */ - -: 3036: template - -: 3037: Callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 3038: generate(function_context(func, arg)); - -: 3039: } - -: 3040: - -: 3041: /** Create a Callback with a static function and bound pointer - -: 3042: * @param func Static function to attach - -: 3043: * @param arg Pointer argument to function - -: 3044: */ - -: 3045: template - -: 3046: Callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 3047: generate(function_context(func, arg)); - -: 3048: } - -: 3049: - -: 3050: /** Create a Callback with a function object - -: 3051: * @param f Function object to attach - -: 3052: * @note The function object is limited to a single word of storage - -: 3053: */ - -: 3054: template - -: 3055: Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { - -: 3056: generate(f); - -: 3057: } - -: 3058: - -: 3059: /** Create a Callback with a function object - -: 3060: * @param f Function object to attach - -: 3061: * @note The function object is limited to a single word of storage - -: 3062: */ - -: 3063: template - -: 3064: Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { - -: 3065: generate(f); - -: 3066: } - -: 3067: - -: 3068: /** Create a Callback with a function object - -: 3069: * @param f Function object to attach - -: 3070: * @note The function object is limited to a single word of storage - -: 3071: */ - -: 3072: template - -: 3073: Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { - -: 3074: generate(f); - -: 3075: } - -: 3076: - -: 3077: /** Create a Callback with a function object - -: 3078: * @param f Function object to attach - -: 3079: * @note The function object is limited to a single word of storage - -: 3080: */ - -: 3081: template - -: 3082: Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { - -: 3083: generate(f); - -: 3084: } - -: 3085: - -: 3086: /** Create a Callback with a static function and bound pointer - -: 3087: * @param obj Pointer to object to bind to function - -: 3088: * @param func Static function to attach - -: 3089: * @deprecated - -: 3090: * Arguments to callback have been reordered to Callback(func, arg) - -: 3091: */ - -: 3092: template - -: 3093: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3094: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3095: Callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 3096: new (this) Callback(func, obj); - -: 3097: } - -: 3098: - -: 3099: /** Create a Callback with a static function and bound pointer - -: 3100: * @param obj Pointer to object to bind to function - -: 3101: * @param func Static function to attach - -: 3102: * @deprecated - -: 3103: * Arguments to callback have been reordered to Callback(func, arg) - -: 3104: */ - -: 3105: template - -: 3106: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3107: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3108: Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 3109: new (this) Callback(func, obj); - -: 3110: } - -: 3111: - -: 3112: /** Create a Callback with a static function and bound pointer - -: 3113: * @param obj Pointer to object to bind to function - -: 3114: * @param func Static function to attach - -: 3115: * @deprecated - -: 3116: * Arguments to callback have been reordered to Callback(func, arg) - -: 3117: */ - -: 3118: template - -: 3119: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3120: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3121: Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 3122: new (this) Callback(func, obj); - -: 3123: } - -: 3124: - -: 3125: /** Create a Callback with a static function and bound pointer - -: 3126: * @param obj Pointer to object to bind to function - -: 3127: * @param func Static function to attach - -: 3128: * @deprecated - -: 3129: * Arguments to callback have been reordered to Callback(func, arg) - -: 3130: */ - -: 3131: template - -: 3132: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3133: "Arguments to callback have been reordered to Callback(func, arg)") - -: 3134: Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 3135: new (this) Callback(func, obj); - -: 3136: } - -: 3137: - -: 3138: /** Destroy a callback - -: 3139: */ - -: 3140: ~Callback() { - -: 3141: if (_ops) { - -: 3142: _ops->dtor(this); - -: 3143: } - -: 3144: } - -: 3145: - -: 3146: /** Attach a static function - -: 3147: * @param func Static function to attach - -: 3148: * @deprecated - -: 3149: * Replaced by simple assignment 'Callback cb = func' - -: 3150: */ - -: 3151: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3152: "Replaced by simple assignment 'Callback cb = func") - -: 3153: void attach(R (*func)(A0, A1, A2, A3, A4)) { - -: 3154: this->~Callback(); - -: 3155: new (this) Callback(func); - -: 3156: } - -: 3157: - -: 3158: /** Attach a Callback - -: 3159: * @param func The Callback to attach - -: 3160: * @deprecated - -: 3161: * Replaced by simple assignment 'Callback cb = func' - -: 3162: */ - -: 3163: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3164: "Replaced by simple assignment 'Callback cb = func") - -: 3165: void attach(const Callback &func) { - -: 3166: this->~Callback(); - -: 3167: new (this) Callback(func); - -: 3168: } - -: 3169: - -: 3170: /** Attach a member function - -: 3171: * @param obj Pointer to object to invoke member function on - -: 3172: * @param method Member function to attach - -: 3173: * @deprecated - -: 3174: * Replaced by simple assignment 'Callback cb = func' - -: 3175: */ - -: 3176: template - -: 3177: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3178: "Replaced by simple assignment 'Callback cb = func") - -: 3179: void attach(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 3180: this->~Callback(); - -: 3181: new (this) Callback(obj, method); - -: 3182: } - -: 3183: - -: 3184: /** Attach a member function - -: 3185: * @param obj Pointer to object to invoke member function on - -: 3186: * @param method Member function to attach - -: 3187: * @deprecated - -: 3188: * Replaced by simple assignment 'Callback cb = func' - -: 3189: */ - -: 3190: template - -: 3191: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3192: "Replaced by simple assignment 'Callback cb = func") - -: 3193: void attach(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 3194: this->~Callback(); - -: 3195: new (this) Callback(obj, method); - -: 3196: } - -: 3197: - -: 3198: /** Attach a member function - -: 3199: * @param obj Pointer to object to invoke member function on - -: 3200: * @param method Member function to attach - -: 3201: * @deprecated - -: 3202: * Replaced by simple assignment 'Callback cb = func' - -: 3203: */ - -: 3204: template - -: 3205: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3206: "Replaced by simple assignment 'Callback cb = func") - -: 3207: void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 3208: this->~Callback(); - -: 3209: new (this) Callback(obj, method); - -: 3210: } - -: 3211: - -: 3212: /** Attach a member function - -: 3213: * @param obj Pointer to object to invoke member function on - -: 3214: * @param method Member function to attach - -: 3215: * @deprecated - -: 3216: * Replaced by simple assignment 'Callback cb = func' - -: 3217: */ - -: 3218: template - -: 3219: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3220: "Replaced by simple assignment 'Callback cb = func") - -: 3221: void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 3222: this->~Callback(); - -: 3223: new (this) Callback(obj, method); - -: 3224: } - -: 3225: - -: 3226: /** Attach a static function with a bound pointer - -: 3227: * @param func Static function to attach - -: 3228: * @param arg Pointer argument to function - -: 3229: * @deprecated - -: 3230: * Replaced by simple assignment 'Callback cb = func' - -: 3231: */ - -: 3232: template - -: 3233: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3234: "Replaced by simple assignment 'Callback cb = func") - -: 3235: void attach(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 3236: this->~Callback(); - -: 3237: new (this) Callback(func, arg); - -: 3238: } - -: 3239: - -: 3240: /** Attach a static function with a bound pointer - -: 3241: * @param func Static function to attach - -: 3242: * @param arg Pointer argument to function - -: 3243: * @deprecated - -: 3244: * Replaced by simple assignment 'Callback cb = func' - -: 3245: */ - -: 3246: template - -: 3247: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3248: "Replaced by simple assignment 'Callback cb = func") - -: 3249: void attach(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 3250: this->~Callback(); - -: 3251: new (this) Callback(func, arg); - -: 3252: } - -: 3253: - -: 3254: /** Attach a static function with a bound pointer - -: 3255: * @param func Static function to attach - -: 3256: * @param arg Pointer argument to function - -: 3257: * @deprecated - -: 3258: * Replaced by simple assignment 'Callback cb = func' - -: 3259: */ - -: 3260: template - -: 3261: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3262: "Replaced by simple assignment 'Callback cb = func") - -: 3263: void attach(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 3264: this->~Callback(); - -: 3265: new (this) Callback(func, arg); - -: 3266: } - -: 3267: - -: 3268: /** Attach a static function with a bound pointer - -: 3269: * @param func Static function to attach - -: 3270: * @param arg Pointer argument to function - -: 3271: * @deprecated - -: 3272: * Replaced by simple assignment 'Callback cb = func' - -: 3273: */ - -: 3274: template - -: 3275: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3276: "Replaced by simple assignment 'Callback cb = func") - -: 3277: void attach(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 3278: this->~Callback(); - -: 3279: new (this) Callback(func, arg); - -: 3280: } - -: 3281: - -: 3282: /** Attach a function object - -: 3283: * @param f Function object to attach - -: 3284: * @note The function object is limited to a single word of storage - -: 3285: * @deprecated - -: 3286: * Replaced by simple assignment 'Callback cb = func' - -: 3287: */ - -: 3288: template - -: 3289: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3290: "Replaced by simple assignment 'Callback cb = func") - -: 3291: void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { - -: 3292: this->~Callback(); - -: 3293: new (this) Callback(f); - -: 3294: } - -: 3295: - -: 3296: /** Attach a function object - -: 3297: * @param f Function object to attach - -: 3298: * @note The function object is limited to a single word of storage - -: 3299: * @deprecated - -: 3300: * Replaced by simple assignment 'Callback cb = func' - -: 3301: */ - -: 3302: template - -: 3303: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3304: "Replaced by simple assignment 'Callback cb = func") - -: 3305: void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { - -: 3306: this->~Callback(); - -: 3307: new (this) Callback(f); - -: 3308: } - -: 3309: - -: 3310: /** Attach a function object - -: 3311: * @param f Function object to attach - -: 3312: * @note The function object is limited to a single word of storage - -: 3313: * @deprecated - -: 3314: * Replaced by simple assignment 'Callback cb = func' - -: 3315: */ - -: 3316: template - -: 3317: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3318: "Replaced by simple assignment 'Callback cb = func") - -: 3319: void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { - -: 3320: this->~Callback(); - -: 3321: new (this) Callback(f); - -: 3322: } - -: 3323: - -: 3324: /** Attach a function object - -: 3325: * @param f Function object to attach - -: 3326: * @note The function object is limited to a single word of storage - -: 3327: * @deprecated - -: 3328: * Replaced by simple assignment 'Callback cb = func' - -: 3329: */ - -: 3330: template - -: 3331: MBED_DEPRECATED_SINCE("mbed-os-5.4", - -: 3332: "Replaced by simple assignment 'Callback cb = func") - -: 3333: void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { - -: 3334: this->~Callback(); - -: 3335: new (this) Callback(f); - -: 3336: } - -: 3337: - -: 3338: /** Attach a static function with a bound pointer - -: 3339: * @param obj Pointer to object to bind to function - -: 3340: * @param func Static function to attach - -: 3341: * @deprecated - -: 3342: * Arguments to callback have been reordered to attach(func, arg) - -: 3343: */ - -: 3344: template - -: 3345: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3346: "Arguments to callback have been reordered to attach(func, arg)") - -: 3347: void attach(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 3348: this->~Callback(); - -: 3349: new (this) Callback(func, obj); - -: 3350: } - -: 3351: - -: 3352: /** Attach a static function with a bound pointer - -: 3353: * @param obj Pointer to object to bind to function - -: 3354: * @param func Static function to attach - -: 3355: * @deprecated - -: 3356: * Arguments to callback have been reordered to attach(func, arg) - -: 3357: */ - -: 3358: template - -: 3359: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3360: "Arguments to callback have been reordered to attach(func, arg)") - -: 3361: void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 3362: this->~Callback(); - -: 3363: new (this) Callback(func, obj); - -: 3364: } - -: 3365: - -: 3366: /** Attach a static function with a bound pointer - -: 3367: * @param obj Pointer to object to bind to function - -: 3368: * @param func Static function to attach - -: 3369: * @deprecated - -: 3370: * Arguments to callback have been reordered to attach(func, arg) - -: 3371: */ - -: 3372: template - -: 3373: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3374: "Arguments to callback have been reordered to attach(func, arg)") - -: 3375: void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 3376: this->~Callback(); - -: 3377: new (this) Callback(func, obj); - -: 3378: } - -: 3379: - -: 3380: /** Attach a static function with a bound pointer - -: 3381: * @param obj Pointer to object to bind to function - -: 3382: * @param func Static function to attach - -: 3383: * @deprecated - -: 3384: * Arguments to callback have been reordered to attach(func, arg) - -: 3385: */ - -: 3386: template - -: 3387: MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3388: "Arguments to callback have been reordered to attach(func, arg)") - -: 3389: void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 3390: this->~Callback(); - -: 3391: new (this) Callback(func, obj); - -: 3392: } - -: 3393: - -: 3394: /** Assign a callback - -: 3395: */ - -: 3396: Callback &operator=(const Callback &that) { - -: 3397: if (this != &that) { - -: 3398: this->~Callback(); - -: 3399: new (this) Callback(that); - -: 3400: } - -: 3401: - -: 3402: return *this; - -: 3403: } - -: 3404: - -: 3405: /** Call the attached function - -: 3406: */ - -: 3407: R call(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3408: MBED_ASSERT(_ops); - -: 3409: return _ops->call(this, a0, a1, a2, a3, a4); - -: 3410: } - -: 3411: - -: 3412: /** Call the attached function - -: 3413: */ - -: 3414: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3415: return call(a0, a1, a2, a3, a4); - -: 3416: } - -: 3417: - -: 3418: /** Test if function has been attached - -: 3419: */ - -: 3420: operator bool() const { - -: 3421: return _ops; - -: 3422: } - -: 3423: - -: 3424: /** Test for equality - -: 3425: */ - -: 3426: friend bool operator==(const Callback &l, const Callback &r) { - -: 3427: return memcmp(&l, &r, sizeof(Callback)) == 0; - -: 3428: } - -: 3429: - -: 3430: /** Test for inequality - -: 3431: */ - -: 3432: friend bool operator!=(const Callback &l, const Callback &r) { - -: 3433: return !(l == r); - -: 3434: } - -: 3435: - -: 3436: /** Static thunk for passing as C-style function - -: 3437: * @param func Callback to call passed as void pointer - -: 3438: * @param a0 An argument to be called with function func - -: 3439: * @param a1 An argument to be called with function func - -: 3440: * @param a2 An argument to be called with function func - -: 3441: * @param a3 An argument to be called with function func - -: 3442: * @param a4 An argument to be called with function func - -: 3443: * @return the value as determined by func which is of - -: 3444: * type and determined by the signiture of func - -: 3445: */ - -: 3446: static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 3447: return static_cast(func)->call(a0, a1, a2, a3, a4); - -: 3448: } - -: 3449: - -: 3450:private: - -: 3451: // Stored as pointer to function and pointer to optional object - -: 3452: // Function pointer is stored as union of possible function types - -: 3453: // to garuntee proper size and alignment - -: 3454: struct _class; - -: 3455: union { - -: 3456: void (*_staticfunc)(A0, A1, A2, A3, A4); - -: 3457: void (*_boundfunc)(_class*, A0, A1, A2, A3, A4); - -: 3458: void (_class::*_methodfunc)(A0, A1, A2, A3, A4); - -: 3459: } _func; - -: 3460: void *_obj; - -: 3461: - -: 3462: // Dynamically dispatched operations - -: 3463: const struct ops { - -: 3464: R (*call)(const void*, A0, A1, A2, A3, A4); - -: 3465: void (*move)(void*, const void*); - -: 3466: void (*dtor)(void*); - -: 3467: } *_ops; - -: 3468: - -: 3469: // Generate operations for function object - -: 3470: template - -: 3471: void generate(const F &f) { - -: 3472: static const ops ops = { - -: 3473: &Callback::function_call, - -: 3474: &Callback::function_move, - -: 3475: &Callback::function_dtor, - -: 3476: }; - -: 3477: - -: 3478: MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - -: 3479: "Type F must not exceed the size of the Callback class"); - -: 3480: memset(this, 0, sizeof(Callback)); - -: 3481: new (this) F(f); - -: 3482: _ops = &ops; - -: 3483: } - -: 3484: - -: 3485: // Function attributes - -: 3486: template - -: 3487: static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - -: 3488: return (*(F*)p)(a0, a1, a2, a3, a4); - -: 3489: } - -: 3490: - -: 3491: template - -: 3492: static void function_move(void *d, const void *p) { - -: 3493: new (d) F(*(F*)p); - -: 3494: } - -: 3495: - -: 3496: template - -: 3497: static void function_dtor(void *p) { - -: 3498: ((F*)p)->~F(); - -: 3499: } - -: 3500: - -: 3501: // Wrappers for functions with context - -: 3502: template - -: 3503: struct method_context { - -: 3504: M method; - -: 3505: O *obj; - -: 3506: - -: 3507: method_context(O *obj, M method) - -: 3508: : method(method), obj(obj) {} - -: 3509: - -: 3510: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3511: return (obj->*method)(a0, a1, a2, a3, a4); - -: 3512: } - -: 3513: }; - -: 3514: - -: 3515: template - -: 3516: struct function_context { - -: 3517: F func; - -: 3518: A *arg; - -: 3519: - -: 3520: function_context(F func, A *arg) - -: 3521: : func(func), arg(arg) {} - -: 3522: - -: 3523: R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { - -: 3524: return func(arg, a0, a1, a2, a3, a4); - -: 3525: } - -: 3526: }; - -: 3527:}; - -: 3528: - -: 3529:// Internally used event type - -: 3530:typedef Callback event_callback_t; - -: 3531: - -: 3532: - -: 3533:/** Create a callback class with type infered from the arguments - -: 3534: * - -: 3535: * @param func Static function to attach - -: 3536: * @return Callback with infered type - -: 3537: */ - -: 3538:template - -: 3539:Callback callback(R (*func)() = 0) { - -: 3540: return Callback(func); - -: 3541:} - -: 3542: - -: 3543:/** Create a callback class with type infered from the arguments - -: 3544: * - -: 3545: * @param func Static function to attach - -: 3546: * @return Callback with infered type - -: 3547: */ - -: 3548:template - -: 3549:Callback callback(const Callback &func) { - -: 3550: return Callback(func); - -: 3551:} - -: 3552: - -: 3553:/** Create a callback class with type infered from the arguments - -: 3554: * - -: 3555: * @param obj Optional pointer to object to bind to function - -: 3556: * @param method Member function to attach - -: 3557: * @return Callback with infered type - -: 3558: */ - -: 3559:template - -: 3560:Callback callback(U *obj, R (T::*method)()) { - -: 3561: return Callback(obj, method); - -: 3562:} - -: 3563: - -: 3564:/** Create a callback class with type infered from the arguments - -: 3565: * - -: 3566: * @param obj Optional pointer to object to bind to function - -: 3567: * @param method Member function to attach - -: 3568: * @return Callback with infered type - -: 3569: */ - -: 3570:template - -: 3571:Callback callback(const U *obj, R (T::*method)() const) { - -: 3572: return Callback(obj, method); - -: 3573:} - -: 3574: - -: 3575:/** Create a callback class with type infered from the arguments - -: 3576: * - -: 3577: * @param obj Optional pointer to object to bind to function - -: 3578: * @param method Member function to attach - -: 3579: * @return Callback with infered type - -: 3580: */ - -: 3581:template - -: 3582:Callback callback(volatile U *obj, R (T::*method)() volatile) { - -: 3583: return Callback(obj, method); - -: 3584:} - -: 3585: - -: 3586:/** Create a callback class with type infered from the arguments - -: 3587: * - -: 3588: * @param obj Optional pointer to object to bind to function - -: 3589: * @param method Member function to attach - -: 3590: * @return Callback with infered type - -: 3591: */ - -: 3592:template - -: 3593:Callback callback(const volatile U *obj, R (T::*method)() const volatile) { - -: 3594: return Callback(obj, method); - -: 3595:} - -: 3596: - -: 3597:/** Create a callback class with type infered from the arguments - -: 3598: * - -: 3599: * @param func Static function to attach - -: 3600: * @param arg Pointer argument to function - -: 3601: * @return Callback with infered type - -: 3602: */ - -: 3603:template - -: 3604:Callback callback(R (*func)(T*), U *arg) { - -: 3605: return Callback(func, arg); - -: 3606:} - -: 3607: - -: 3608:/** Create a callback class with type infered from the arguments - -: 3609: * - -: 3610: * @param func Static function to attach - -: 3611: * @param arg Pointer argument to function - -: 3612: * @return Callback with infered type - -: 3613: */ - -: 3614:template - -: 3615:Callback callback(R (*func)(const T*), const U *arg) { - -: 3616: return Callback(func, arg); - -: 3617:} - -: 3618: - -: 3619:/** Create a callback class with type infered from the arguments - -: 3620: * - -: 3621: * @param func Static function to attach - -: 3622: * @param arg Pointer argument to function - -: 3623: * @return Callback with infered type - -: 3624: */ - -: 3625:template - -: 3626:Callback callback(R (*func)(volatile T*), volatile U *arg) { - -: 3627: return Callback(func, arg); - -: 3628:} - -: 3629: - -: 3630:/** Create a callback class with type infered from the arguments - -: 3631: * - -: 3632: * @param func Static function to attach - -: 3633: * @param arg Pointer argument to function - -: 3634: * @return Callback with infered type - -: 3635: */ - -: 3636:template - -: 3637:Callback callback(R (*func)(const volatile T*), const volatile U *arg) { - -: 3638: return Callback(func, arg); - -: 3639:} - -: 3640: - -: 3641:/** Create a callback class with type infered from the arguments - -: 3642: * - -: 3643: * @param obj Optional pointer to object to bind to function - -: 3644: * @param func Static function to attach - -: 3645: * @return Callback with infered type - -: 3646: * @deprecated - -: 3647: * Arguments to callback have been reordered to callback(func, arg) - -: 3648: */ - -: 3649:template - -: 3650:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3651: "Arguments to callback have been reordered to callback(func, arg)") - -: 3652:Callback callback(U *obj, R (*func)(T*)) { - -: 3653: return Callback(func, obj); - -: 3654:} - -: 3655: - -: 3656:/** Create a callback class with type infered from the arguments - -: 3657: * - -: 3658: * @param obj Optional pointer to object to bind to function - -: 3659: * @param func Static function to attach - -: 3660: * @return Callback with infered type - -: 3661: * @deprecated - -: 3662: * Arguments to callback have been reordered to callback(func, arg) - -: 3663: */ - -: 3664:template - -: 3665:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3666: "Arguments to callback have been reordered to callback(func, arg)") - -: 3667:Callback callback(const U *obj, R (*func)(const T*)) { - -: 3668: return Callback(func, obj); - -: 3669:} - -: 3670: - -: 3671:/** Create a callback class with type infered from the arguments - -: 3672: * - -: 3673: * @param obj Optional pointer to object to bind to function - -: 3674: * @param func Static function to attach - -: 3675: * @return Callback with infered type - -: 3676: * @deprecated - -: 3677: * Arguments to callback have been reordered to callback(func, arg) - -: 3678: */ - -: 3679:template - -: 3680:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3681: "Arguments to callback have been reordered to callback(func, arg)") - -: 3682:Callback callback(volatile U *obj, R (*func)(volatile T*)) { - -: 3683: return Callback(func, obj); - -: 3684:} - -: 3685: - -: 3686:/** Create a callback class with type infered from the arguments - -: 3687: * - -: 3688: * @param obj Optional pointer to object to bind to function - -: 3689: * @param func Static function to attach - -: 3690: * @return Callback with infered type - -: 3691: * @deprecated - -: 3692: * Arguments to callback have been reordered to callback(func, arg) - -: 3693: */ - -: 3694:template - -: 3695:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3696: "Arguments to callback have been reordered to callback(func, arg)") - -: 3697:Callback callback(const volatile U *obj, R (*func)(const volatile T*)) { - -: 3698: return Callback(func, obj); - -: 3699:} - -: 3700: - -: 3701: - -: 3702:/** Create a callback class with type infered from the arguments - -: 3703: * - -: 3704: * @param func Static function to attach - -: 3705: * @return Callback with infered type - -: 3706: */ - -: 3707:template - -: 3708:Callback callback(R (*func)(A0) = 0) { - -: 3709: return Callback(func); - -: 3710:} - -: 3711: - -: 3712:/** Create a callback class with type infered from the arguments - -: 3713: * - -: 3714: * @param func Static function to attach - -: 3715: * @return Callback with infered type - -: 3716: */ - -: 3717:template - -: 3718:Callback callback(const Callback &func) { - -: 3719: return Callback(func); - -: 3720:} - -: 3721: - -: 3722:/** Create a callback class with type infered from the arguments - -: 3723: * - -: 3724: * @param obj Optional pointer to object to bind to function - -: 3725: * @param method Member function to attach - -: 3726: * @return Callback with infered type - -: 3727: */ - -: 3728:template - -: 3729:Callback callback(U *obj, R (T::*method)(A0)) { - -: 3730: return Callback(obj, method); - -: 3731:} - -: 3732: - -: 3733:/** Create a callback class with type infered from the arguments - -: 3734: * - -: 3735: * @param obj Optional pointer to object to bind to function - -: 3736: * @param method Member function to attach - -: 3737: * @return Callback with infered type - -: 3738: */ - -: 3739:template - -: 3740:Callback callback(const U *obj, R (T::*method)(A0) const) { - -: 3741: return Callback(obj, method); - -: 3742:} - -: 3743: - -: 3744:/** Create a callback class with type infered from the arguments - -: 3745: * - -: 3746: * @param obj Optional pointer to object to bind to function - -: 3747: * @param method Member function to attach - -: 3748: * @return Callback with infered type - -: 3749: */ - -: 3750:template - -: 3751:Callback callback(volatile U *obj, R (T::*method)(A0) volatile) { - -: 3752: return Callback(obj, method); - -: 3753:} - -: 3754: - -: 3755:/** Create a callback class with type infered from the arguments - -: 3756: * - -: 3757: * @param obj Optional pointer to object to bind to function - -: 3758: * @param method Member function to attach - -: 3759: * @return Callback with infered type - -: 3760: */ - -: 3761:template - -: 3762:Callback callback(const volatile U *obj, R (T::*method)(A0) const volatile) { - -: 3763: return Callback(obj, method); - -: 3764:} - -: 3765: - -: 3766:/** Create a callback class with type infered from the arguments - -: 3767: * - -: 3768: * @param func Static function to attach - -: 3769: * @param arg Pointer argument to function - -: 3770: * @return Callback with infered type - -: 3771: */ - -: 3772:template - -: 3773:Callback callback(R (*func)(T*, A0), U *arg) { - -: 3774: return Callback(func, arg); - -: 3775:} - -: 3776: - -: 3777:/** Create a callback class with type infered from the arguments - -: 3778: * - -: 3779: * @param func Static function to attach - -: 3780: * @param arg Pointer argument to function - -: 3781: * @return Callback with infered type - -: 3782: */ - -: 3783:template - -: 3784:Callback callback(R (*func)(const T*, A0), const U *arg) { - -: 3785: return Callback(func, arg); - -: 3786:} - -: 3787: - -: 3788:/** Create a callback class with type infered from the arguments - -: 3789: * - -: 3790: * @param func Static function to attach - -: 3791: * @param arg Pointer argument to function - -: 3792: * @return Callback with infered type - -: 3793: */ - -: 3794:template - -: 3795:Callback callback(R (*func)(volatile T*, A0), volatile U *arg) { - -: 3796: return Callback(func, arg); - -: 3797:} - -: 3798: - -: 3799:/** Create a callback class with type infered from the arguments - -: 3800: * - -: 3801: * @param func Static function to attach - -: 3802: * @param arg Pointer argument to function - -: 3803: * @return Callback with infered type - -: 3804: */ - -: 3805:template - -: 3806:Callback callback(R (*func)(const volatile T*, A0), const volatile U *arg) { - -: 3807: return Callback(func, arg); - -: 3808:} - -: 3809: - -: 3810:/** Create a callback class with type infered from the arguments - -: 3811: * - -: 3812: * @param obj Optional pointer to object to bind to function - -: 3813: * @param func Static function to attach - -: 3814: * @return Callback with infered type - -: 3815: * @deprecated - -: 3816: * Arguments to callback have been reordered to callback(func, arg) - -: 3817: */ - -: 3818:template - -: 3819:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3820: "Arguments to callback have been reordered to callback(func, arg)") - -: 3821:Callback callback(U *obj, R (*func)(T*, A0)) { - -: 3822: return Callback(func, obj); - -: 3823:} - -: 3824: - -: 3825:/** Create a callback class with type infered from the arguments - -: 3826: * - -: 3827: * @param obj Optional pointer to object to bind to function - -: 3828: * @param func Static function to attach - -: 3829: * @return Callback with infered type - -: 3830: * @deprecated - -: 3831: * Arguments to callback have been reordered to callback(func, arg) - -: 3832: */ - -: 3833:template - -: 3834:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3835: "Arguments to callback have been reordered to callback(func, arg)") - -: 3836:Callback callback(const U *obj, R (*func)(const T*, A0)) { - -: 3837: return Callback(func, obj); - -: 3838:} - -: 3839: - -: 3840:/** Create a callback class with type infered from the arguments - -: 3841: * - -: 3842: * @param obj Optional pointer to object to bind to function - -: 3843: * @param func Static function to attach - -: 3844: * @return Callback with infered type - -: 3845: * @deprecated - -: 3846: * Arguments to callback have been reordered to callback(func, arg) - -: 3847: */ - -: 3848:template - -: 3849:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3850: "Arguments to callback have been reordered to callback(func, arg)") - -: 3851:Callback callback(volatile U *obj, R (*func)(volatile T*, A0)) { - -: 3852: return Callback(func, obj); - -: 3853:} - -: 3854: - -: 3855:/** Create a callback class with type infered from the arguments - -: 3856: * - -: 3857: * @param obj Optional pointer to object to bind to function - -: 3858: * @param func Static function to attach - -: 3859: * @return Callback with infered type - -: 3860: * @deprecated - -: 3861: * Arguments to callback have been reordered to callback(func, arg) - -: 3862: */ - -: 3863:template - -: 3864:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3865: "Arguments to callback have been reordered to callback(func, arg)") - -: 3866:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { - -: 3867: return Callback(func, obj); - -: 3868:} - -: 3869: - -: 3870: - -: 3871:/** Create a callback class with type infered from the arguments - -: 3872: * - -: 3873: * @param func Static function to attach - -: 3874: * @return Callback with infered type - -: 3875: */ - -: 3876:template - -: 3877:Callback callback(R (*func)(A0, A1) = 0) { - -: 3878: return Callback(func); - -: 3879:} - -: 3880: - -: 3881:/** Create a callback class with type infered from the arguments - -: 3882: * - -: 3883: * @param func Static function to attach - -: 3884: * @return Callback with infered type - -: 3885: */ - -: 3886:template - -: 3887:Callback callback(const Callback &func) { - -: 3888: return Callback(func); - -: 3889:} - -: 3890: - -: 3891:/** Create a callback class with type infered from the arguments - -: 3892: * - -: 3893: * @param obj Optional pointer to object to bind to function - -: 3894: * @param method Member function to attach - -: 3895: * @return Callback with infered type - -: 3896: */ - -: 3897:template - -: 3898:Callback callback(U *obj, R (T::*method)(A0, A1)) { - -: 3899: return Callback(obj, method); - -: 3900:} - -: 3901: - -: 3902:/** Create a callback class with type infered from the arguments - -: 3903: * - -: 3904: * @param obj Optional pointer to object to bind to function - -: 3905: * @param method Member function to attach - -: 3906: * @return Callback with infered type - -: 3907: */ - -: 3908:template - -: 3909:Callback callback(const U *obj, R (T::*method)(A0, A1) const) { - -: 3910: return Callback(obj, method); - -: 3911:} - -: 3912: - -: 3913:/** Create a callback class with type infered from the arguments - -: 3914: * - -: 3915: * @param obj Optional pointer to object to bind to function - -: 3916: * @param method Member function to attach - -: 3917: * @return Callback with infered type - -: 3918: */ - -: 3919:template - -: 3920:Callback callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { - -: 3921: return Callback(obj, method); - -: 3922:} - -: 3923: - -: 3924:/** Create a callback class with type infered from the arguments - -: 3925: * - -: 3926: * @param obj Optional pointer to object to bind to function - -: 3927: * @param method Member function to attach - -: 3928: * @return Callback with infered type - -: 3929: */ - -: 3930:template - -: 3931:Callback callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - -: 3932: return Callback(obj, method); - -: 3933:} - -: 3934: - -: 3935:/** Create a callback class with type infered from the arguments - -: 3936: * - -: 3937: * @param func Static function to attach - -: 3938: * @param arg Pointer argument to function - -: 3939: * @return Callback with infered type - -: 3940: */ - -: 3941:template - -: 3942:Callback callback(R (*func)(T*, A0, A1), U *arg) { - -: 3943: return Callback(func, arg); - -: 3944:} - -: 3945: - -: 3946:/** Create a callback class with type infered from the arguments - -: 3947: * - -: 3948: * @param func Static function to attach - -: 3949: * @param arg Pointer argument to function - -: 3950: * @return Callback with infered type - -: 3951: */ - -: 3952:template - -: 3953:Callback callback(R (*func)(const T*, A0, A1), const U *arg) { - -: 3954: return Callback(func, arg); - -: 3955:} - -: 3956: - -: 3957:/** Create a callback class with type infered from the arguments - -: 3958: * - -: 3959: * @param func Static function to attach - -: 3960: * @param arg Pointer argument to function - -: 3961: * @return Callback with infered type - -: 3962: */ - -: 3963:template - -: 3964:Callback callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { - -: 3965: return Callback(func, arg); - -: 3966:} - -: 3967: - -: 3968:/** Create a callback class with type infered from the arguments - -: 3969: * - -: 3970: * @param func Static function to attach - -: 3971: * @param arg Pointer argument to function - -: 3972: * @return Callback with infered type - -: 3973: */ - -: 3974:template - -: 3975:Callback callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - -: 3976: return Callback(func, arg); - -: 3977:} - -: 3978: - -: 3979:/** Create a callback class with type infered from the arguments - -: 3980: * - -: 3981: * @param obj Optional pointer to object to bind to function - -: 3982: * @param func Static function to attach - -: 3983: * @return Callback with infered type - -: 3984: * @deprecated - -: 3985: * Arguments to callback have been reordered to callback(func, arg) - -: 3986: */ - -: 3987:template - -: 3988:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 3989: "Arguments to callback have been reordered to callback(func, arg)") - -: 3990:Callback callback(U *obj, R (*func)(T*, A0, A1)) { - -: 3991: return Callback(func, obj); - -: 3992:} - -: 3993: - -: 3994:/** Create a callback class with type infered from the arguments - -: 3995: * - -: 3996: * @param obj Optional pointer to object to bind to function - -: 3997: * @param func Static function to attach - -: 3998: * @return Callback with infered type - -: 3999: * @deprecated - -: 4000: * Arguments to callback have been reordered to callback(func, arg) - -: 4001: */ - -: 4002:template - -: 4003:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4004: "Arguments to callback have been reordered to callback(func, arg)") - -: 4005:Callback callback(const U *obj, R (*func)(const T*, A0, A1)) { - -: 4006: return Callback(func, obj); - -: 4007:} - -: 4008: - -: 4009:/** Create a callback class with type infered from the arguments - -: 4010: * - -: 4011: * @param obj Optional pointer to object to bind to function - -: 4012: * @param func Static function to attach - -: 4013: * @return Callback with infered type - -: 4014: * @deprecated - -: 4015: * Arguments to callback have been reordered to callback(func, arg) - -: 4016: */ - -: 4017:template - -: 4018:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4019: "Arguments to callback have been reordered to callback(func, arg)") - -: 4020:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { - -: 4021: return Callback(func, obj); - -: 4022:} - -: 4023: - -: 4024:/** Create a callback class with type infered from the arguments - -: 4025: * - -: 4026: * @param obj Optional pointer to object to bind to function - -: 4027: * @param func Static function to attach - -: 4028: * @return Callback with infered type - -: 4029: * @deprecated - -: 4030: * Arguments to callback have been reordered to callback(func, arg) - -: 4031: */ - -: 4032:template - -: 4033:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4034: "Arguments to callback have been reordered to callback(func, arg)") - -: 4035:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { - -: 4036: return Callback(func, obj); - -: 4037:} - -: 4038: - -: 4039: - -: 4040:/** Create a callback class with type infered from the arguments - -: 4041: * - -: 4042: * @param func Static function to attach - -: 4043: * @return Callback with infered type - -: 4044: */ - -: 4045:template - -: 4046:Callback callback(R (*func)(A0, A1, A2) = 0) { - -: 4047: return Callback(func); - -: 4048:} - -: 4049: - -: 4050:/** Create a callback class with type infered from the arguments - -: 4051: * - -: 4052: * @param func Static function to attach - -: 4053: * @return Callback with infered type - -: 4054: */ - -: 4055:template - -: 4056:Callback callback(const Callback &func) { - -: 4057: return Callback(func); - -: 4058:} - -: 4059: - -: 4060:/** Create a callback class with type infered from the arguments - -: 4061: * - -: 4062: * @param obj Optional pointer to object to bind to function - -: 4063: * @param method Member function to attach - -: 4064: * @return Callback with infered type - -: 4065: */ - -: 4066:template - -: 4067:Callback callback(U *obj, R (T::*method)(A0, A1, A2)) { - -: 4068: return Callback(obj, method); - -: 4069:} - -: 4070: - -: 4071:/** Create a callback class with type infered from the arguments - -: 4072: * - -: 4073: * @param obj Optional pointer to object to bind to function - -: 4074: * @param method Member function to attach - -: 4075: * @return Callback with infered type - -: 4076: */ - -: 4077:template - -: 4078:Callback callback(const U *obj, R (T::*method)(A0, A1, A2) const) { - -: 4079: return Callback(obj, method); - -: 4080:} - -: 4081: - -: 4082:/** Create a callback class with type infered from the arguments - -: 4083: * - -: 4084: * @param obj Optional pointer to object to bind to function - -: 4085: * @param method Member function to attach - -: 4086: * @return Callback with infered type - -: 4087: */ - -: 4088:template - -: 4089:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - -: 4090: return Callback(obj, method); - -: 4091:} - -: 4092: - -: 4093:/** Create a callback class with type infered from the arguments - -: 4094: * - -: 4095: * @param obj Optional pointer to object to bind to function - -: 4096: * @param method Member function to attach - -: 4097: * @return Callback with infered type - -: 4098: */ - -: 4099:template - -: 4100:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - -: 4101: return Callback(obj, method); - -: 4102:} - -: 4103: - -: 4104:/** Create a callback class with type infered from the arguments - -: 4105: * - -: 4106: * @param func Static function to attach - -: 4107: * @param arg Pointer argument to function - -: 4108: * @return Callback with infered type - -: 4109: */ - -: 4110:template - -: 4111:Callback callback(R (*func)(T*, A0, A1, A2), U *arg) { - -: 4112: return Callback(func, arg); - -: 4113:} - -: 4114: - -: 4115:/** Create a callback class with type infered from the arguments - -: 4116: * - -: 4117: * @param func Static function to attach - -: 4118: * @param arg Pointer argument to function - -: 4119: * @return Callback with infered type - -: 4120: */ - -: 4121:template - -: 4122:Callback callback(R (*func)(const T*, A0, A1, A2), const U *arg) { - -: 4123: return Callback(func, arg); - -: 4124:} - -: 4125: - -: 4126:/** Create a callback class with type infered from the arguments - -: 4127: * - -: 4128: * @param func Static function to attach - -: 4129: * @param arg Pointer argument to function - -: 4130: * @return Callback with infered type - -: 4131: */ - -: 4132:template - -: 4133:Callback callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - -: 4134: return Callback(func, arg); - -: 4135:} - -: 4136: - -: 4137:/** Create a callback class with type infered from the arguments - -: 4138: * - -: 4139: * @param func Static function to attach - -: 4140: * @param arg Pointer argument to function - -: 4141: * @return Callback with infered type - -: 4142: */ - -: 4143:template - -: 4144:Callback callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - -: 4145: return Callback(func, arg); - -: 4146:} - -: 4147: - -: 4148:/** Create a callback class with type infered from the arguments - -: 4149: * - -: 4150: * @param obj Optional pointer to object to bind to function - -: 4151: * @param func Static function to attach - -: 4152: * @return Callback with infered type - -: 4153: * @deprecated - -: 4154: * Arguments to callback have been reordered to callback(func, arg) - -: 4155: */ - -: 4156:template - -: 4157:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4158: "Arguments to callback have been reordered to callback(func, arg)") - -: 4159:Callback callback(U *obj, R (*func)(T*, A0, A1, A2)) { - -: 4160: return Callback(func, obj); - -: 4161:} - -: 4162: - -: 4163:/** Create a callback class with type infered from the arguments - -: 4164: * - -: 4165: * @param obj Optional pointer to object to bind to function - -: 4166: * @param func Static function to attach - -: 4167: * @return Callback with infered type - -: 4168: * @deprecated - -: 4169: * Arguments to callback have been reordered to callback(func, arg) - -: 4170: */ - -: 4171:template - -: 4172:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4173: "Arguments to callback have been reordered to callback(func, arg)") - -: 4174:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { - -: 4175: return Callback(func, obj); - -: 4176:} - -: 4177: - -: 4178:/** Create a callback class with type infered from the arguments - -: 4179: * - -: 4180: * @param obj Optional pointer to object to bind to function - -: 4181: * @param func Static function to attach - -: 4182: * @return Callback with infered type - -: 4183: * @deprecated - -: 4184: * Arguments to callback have been reordered to callback(func, arg) - -: 4185: */ - -: 4186:template - -: 4187:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4188: "Arguments to callback have been reordered to callback(func, arg)") - -: 4189:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { - -: 4190: return Callback(func, obj); - -: 4191:} - -: 4192: - -: 4193:/** Create a callback class with type infered from the arguments - -: 4194: * - -: 4195: * @param obj Optional pointer to object to bind to function - -: 4196: * @param func Static function to attach - -: 4197: * @return Callback with infered type - -: 4198: * @deprecated - -: 4199: * Arguments to callback have been reordered to callback(func, arg) - -: 4200: */ - -: 4201:template - -: 4202:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4203: "Arguments to callback have been reordered to callback(func, arg)") - -: 4204:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { - -: 4205: return Callback(func, obj); - -: 4206:} - -: 4207: - -: 4208: - -: 4209:/** Create a callback class with type infered from the arguments - -: 4210: * - -: 4211: * @param func Static function to attach - -: 4212: * @return Callback with infered type - -: 4213: */ - -: 4214:template - -: 4215:Callback callback(R (*func)(A0, A1, A2, A3) = 0) { - -: 4216: return Callback(func); - -: 4217:} - -: 4218: - -: 4219:/** Create a callback class with type infered from the arguments - -: 4220: * - -: 4221: * @param func Static function to attach - -: 4222: * @return Callback with infered type - -: 4223: */ - -: 4224:template - -: 4225:Callback callback(const Callback &func) { - -: 4226: return Callback(func); - -: 4227:} - -: 4228: - -: 4229:/** Create a callback class with type infered from the arguments - -: 4230: * - -: 4231: * @param obj Optional pointer to object to bind to function - -: 4232: * @param method Member function to attach - -: 4233: * @return Callback with infered type - -: 4234: */ - -: 4235:template - -: 4236:Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { - -: 4237: return Callback(obj, method); - -: 4238:} - -: 4239: - -: 4240:/** Create a callback class with type infered from the arguments - -: 4241: * - -: 4242: * @param obj Optional pointer to object to bind to function - -: 4243: * @param method Member function to attach - -: 4244: * @return Callback with infered type - -: 4245: */ - -: 4246:template - -: 4247:Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - -: 4248: return Callback(obj, method); - -: 4249:} - -: 4250: - -: 4251:/** Create a callback class with type infered from the arguments - -: 4252: * - -: 4253: * @param obj Optional pointer to object to bind to function - -: 4254: * @param method Member function to attach - -: 4255: * @return Callback with infered type - -: 4256: */ - -: 4257:template - -: 4258:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - -: 4259: return Callback(obj, method); - -: 4260:} - -: 4261: - -: 4262:/** Create a callback class with type infered from the arguments - -: 4263: * - -: 4264: * @param obj Optional pointer to object to bind to function - -: 4265: * @param method Member function to attach - -: 4266: * @return Callback with infered type - -: 4267: */ - -: 4268:template - -: 4269:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - -: 4270: return Callback(obj, method); - -: 4271:} - -: 4272: - -: 4273:/** Create a callback class with type infered from the arguments - -: 4274: * - -: 4275: * @param func Static function to attach - -: 4276: * @param arg Pointer argument to function - -: 4277: * @return Callback with infered type - -: 4278: */ - -: 4279:template - -: 4280:Callback callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { - -: 4281: return Callback(func, arg); - -: 4282:} - -: 4283: - -: 4284:/** Create a callback class with type infered from the arguments - -: 4285: * - -: 4286: * @param func Static function to attach - -: 4287: * @param arg Pointer argument to function - -: 4288: * @return Callback with infered type - -: 4289: */ - -: 4290:template - -: 4291:Callback callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - -: 4292: return Callback(func, arg); - -: 4293:} - -: 4294: - -: 4295:/** Create a callback class with type infered from the arguments - -: 4296: * - -: 4297: * @param func Static function to attach - -: 4298: * @param arg Pointer argument to function - -: 4299: * @return Callback with infered type - -: 4300: */ - -: 4301:template - -: 4302:Callback callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - -: 4303: return Callback(func, arg); - -: 4304:} - -: 4305: - -: 4306:/** Create a callback class with type infered from the arguments - -: 4307: * - -: 4308: * @param func Static function to attach - -: 4309: * @param arg Pointer argument to function - -: 4310: * @return Callback with infered type - -: 4311: */ - -: 4312:template - -: 4313:Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - -: 4314: return Callback(func, arg); - -: 4315:} - -: 4316: - -: 4317:/** Create a callback class with type infered from the arguments - -: 4318: * - -: 4319: * @param obj Optional pointer to object to bind to function - -: 4320: * @param func Static function to attach - -: 4321: * @return Callback with infered type - -: 4322: * @deprecated - -: 4323: * Arguments to callback have been reordered to callback(func, arg) - -: 4324: */ - -: 4325:template - -: 4326:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4327: "Arguments to callback have been reordered to callback(func, arg)") - -: 4328:Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { - -: 4329: return Callback(func, obj); - -: 4330:} - -: 4331: - -: 4332:/** Create a callback class with type infered from the arguments - -: 4333: * - -: 4334: * @param obj Optional pointer to object to bind to function - -: 4335: * @param func Static function to attach - -: 4336: * @return Callback with infered type - -: 4337: * @deprecated - -: 4338: * Arguments to callback have been reordered to callback(func, arg) - -: 4339: */ - -: 4340:template - -: 4341:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4342: "Arguments to callback have been reordered to callback(func, arg)") - -: 4343:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { - -: 4344: return Callback(func, obj); - -: 4345:} - -: 4346: - -: 4347:/** Create a callback class with type infered from the arguments - -: 4348: * - -: 4349: * @param obj Optional pointer to object to bind to function - -: 4350: * @param func Static function to attach - -: 4351: * @return Callback with infered type - -: 4352: * @deprecated - -: 4353: * Arguments to callback have been reordered to callback(func, arg) - -: 4354: */ - -: 4355:template - -: 4356:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4357: "Arguments to callback have been reordered to callback(func, arg)") - -: 4358:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { - -: 4359: return Callback(func, obj); - -: 4360:} - -: 4361: - -: 4362:/** Create a callback class with type infered from the arguments - -: 4363: * - -: 4364: * @param obj Optional pointer to object to bind to function - -: 4365: * @param func Static function to attach - -: 4366: * @return Callback with infered type - -: 4367: * @deprecated - -: 4368: * Arguments to callback have been reordered to callback(func, arg) - -: 4369: */ - -: 4370:template - -: 4371:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4372: "Arguments to callback have been reordered to callback(func, arg)") - -: 4373:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { - -: 4374: return Callback(func, obj); - -: 4375:} - -: 4376: - -: 4377: - -: 4378:/** Create a callback class with type infered from the arguments - -: 4379: * - -: 4380: * @param func Static function to attach - -: 4381: * @return Callback with infered type - -: 4382: */ - -: 4383:template - -: 4384:Callback callback(R (*func)(A0, A1, A2, A3, A4) = 0) { - -: 4385: return Callback(func); - -: 4386:} - -: 4387: - -: 4388:/** Create a callback class with type infered from the arguments - -: 4389: * - -: 4390: * @param func Static function to attach - -: 4391: * @return Callback with infered type - -: 4392: */ - -: 4393:template - -: 4394:Callback callback(const Callback &func) { - -: 4395: return Callback(func); - -: 4396:} - -: 4397: - -: 4398:/** Create a callback class with type infered from the arguments - -: 4399: * - -: 4400: * @param obj Optional pointer to object to bind to function - -: 4401: * @param method Member function to attach - -: 4402: * @return Callback with infered type - -: 4403: */ - -: 4404:template - -: 4405:Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - -: 4406: return Callback(obj, method); - -: 4407:} - -: 4408: - -: 4409:/** Create a callback class with type infered from the arguments - -: 4410: * - -: 4411: * @param obj Optional pointer to object to bind to function - -: 4412: * @param method Member function to attach - -: 4413: * @return Callback with infered type - -: 4414: */ - -: 4415:template - -: 4416:Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - -: 4417: return Callback(obj, method); - -: 4418:} - -: 4419: - -: 4420:/** Create a callback class with type infered from the arguments - -: 4421: * - -: 4422: * @param obj Optional pointer to object to bind to function - -: 4423: * @param method Member function to attach - -: 4424: * @return Callback with infered type - -: 4425: */ - -: 4426:template - -: 4427:Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - -: 4428: return Callback(obj, method); - -: 4429:} - -: 4430: - -: 4431:/** Create a callback class with type infered from the arguments - -: 4432: * - -: 4433: * @param obj Optional pointer to object to bind to function - -: 4434: * @param method Member function to attach - -: 4435: * @return Callback with infered type - -: 4436: */ - -: 4437:template - -: 4438:Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - -: 4439: return Callback(obj, method); - -: 4440:} - -: 4441: - -: 4442:/** Create a callback class with type infered from the arguments - -: 4443: * - -: 4444: * @param func Static function to attach - -: 4445: * @param arg Pointer argument to function - -: 4446: * @return Callback with infered type - -: 4447: */ - -: 4448:template - -: 4449:Callback callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - -: 4450: return Callback(func, arg); - -: 4451:} - -: 4452: - -: 4453:/** Create a callback class with type infered from the arguments - -: 4454: * - -: 4455: * @param func Static function to attach - -: 4456: * @param arg Pointer argument to function - -: 4457: * @return Callback with infered type - -: 4458: */ - -: 4459:template - -: 4460:Callback callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - -: 4461: return Callback(func, arg); - -: 4462:} - -: 4463: - -: 4464:/** Create a callback class with type infered from the arguments - -: 4465: * - -: 4466: * @param func Static function to attach - -: 4467: * @param arg Pointer argument to function - -: 4468: * @return Callback with infered type - -: 4469: */ - -: 4470:template - -: 4471:Callback callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - -: 4472: return Callback(func, arg); - -: 4473:} - -: 4474: - -: 4475:/** Create a callback class with type infered from the arguments - -: 4476: * - -: 4477: * @param func Static function to attach - -: 4478: * @param arg Pointer argument to function - -: 4479: * @return Callback with infered type - -: 4480: */ - -: 4481:template - -: 4482:Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - -: 4483: return Callback(func, arg); - -: 4484:} - -: 4485: - -: 4486:/** Create a callback class with type infered from the arguments - -: 4487: * - -: 4488: * @param obj Optional pointer to object to bind to function - -: 4489: * @param func Static function to attach - -: 4490: * @return Callback with infered type - -: 4491: * @deprecated - -: 4492: * Arguments to callback have been reordered to callback(func, arg) - -: 4493: */ - -: 4494:template - -: 4495:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4496: "Arguments to callback have been reordered to callback(func, arg)") - -: 4497:Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { - -: 4498: return Callback(func, obj); - -: 4499:} - -: 4500: - -: 4501:/** Create a callback class with type infered from the arguments - -: 4502: * - -: 4503: * @param obj Optional pointer to object to bind to function - -: 4504: * @param func Static function to attach - -: 4505: * @return Callback with infered type - -: 4506: * @deprecated - -: 4507: * Arguments to callback have been reordered to callback(func, arg) - -: 4508: */ - -: 4509:template - -: 4510:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4511: "Arguments to callback have been reordered to callback(func, arg)") - -: 4512:Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { - -: 4513: return Callback(func, obj); - -: 4514:} - -: 4515: - -: 4516:/** Create a callback class with type infered from the arguments - -: 4517: * - -: 4518: * @param obj Optional pointer to object to bind to function - -: 4519: * @param func Static function to attach - -: 4520: * @return Callback with infered type - -: 4521: * @deprecated - -: 4522: * Arguments to callback have been reordered to callback(func, arg) - -: 4523: */ - -: 4524:template - -: 4525:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4526: "Arguments to callback have been reordered to callback(func, arg)") - -: 4527:Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { - -: 4528: return Callback(func, obj); - -: 4529:} - -: 4530: - -: 4531:/** Create a callback class with type infered from the arguments - -: 4532: * - -: 4533: * @param obj Optional pointer to object to bind to function - -: 4534: * @param func Static function to attach - -: 4535: * @return Callback with infered type - -: 4536: * @deprecated - -: 4537: * Arguments to callback have been reordered to callback(func, arg) - -: 4538: */ - -: 4539:template - -: 4540:MBED_DEPRECATED_SINCE("mbed-os-5.1", - -: 4541: "Arguments to callback have been reordered to callback(func, arg)") - -: 4542:Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { - -: 4543: return Callback(func, obj); - -: 4544:} - -: 4545: - -: 4546:/**@}*/ - -: 4547: - -: 4548:/**@}*/ - -: 4549: - -: 4550:} // namespace mbed - -: 4551: - -: 4552:#endif diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/FileHandle.h.gcov b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/FileHandle.h.gcov deleted file mode 100644 index ccfef9680d..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/FileHandle.h.gcov +++ /dev/null @@ -1,267 +0,0 @@ - -: 0:Source:../../../../../platform/FileHandle.h - -: 0:Graph:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcno - -: 0:Data:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* mbed Microcontroller Library - -: 2: * Copyright (c) 2017 ARM Limited - -: 3: * - -: 4: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 5: * you may not use this file except in compliance with the License. - -: 6: * You may obtain a copy of the License at - -: 7: * - -: 8: * http://www.apache.org/licenses/LICENSE-2.0 - -: 9: * - -: 10: * Unless required by applicable law or agreed to in writing, software - -: 11: * distributed under the License is distributed on an "AS IS" BASIS, - -: 12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 13: * See the License for the specific language governing permissions and - -: 14: * limitations under the License. - -: 15: */ - -: 16:#ifndef MBED_FILEHANDLE_H - -: 17:#define MBED_FILEHANDLE_H - -: 18: - -: 19:typedef int FILEHANDLE; - -: 20: - -: 21:#include - -: 22:#include "Callback.h" - -: 23:#include "platform/mbed_poll.h" - -: 24:#include "platform/platform.h" - -: 25:#include "platform/NonCopyable.h" - -: 26: - -: 27:namespace mbed { - -: 28:/** \addtogroup platform */ - -: 29:/** @{*/ - -: 30:/** - -: 31: * \defgroup platform_FileHandle FileHandle functions - -: 32: * @{ - -: 33: */ - -: 34: - -: 35: - -: 36:/** Class FileHandle - -: 37: * - -: 38: * An abstract interface that represents operations on a file-like - -: 39: * object. The core functions are read, write, and seek, but only - -: 40: * a subset of these operations can be provided. - -: 41: * - -: 42: * @note to create a file, @see File - -: 43: * @note Synchronization level: Set by subclass - -: 44: */ - -: 45:class FileHandle : private NonCopyable { - -: 46:public: - #####: 47: virtual ~FileHandle() {} - -: 48: - -: 49: /** Read the contents of a file into a buffer - -: 50: * - -: 51: * Devices acting as FileHandles should follow POSIX semantics: - -: 52: * - -: 53: * * if no data is available, and non-blocking set return -EAGAIN - -: 54: * * if no data is available, and blocking set, wait until some data is available - -: 55: * * If any data is available, call returns immediately - -: 56: * - -: 57: * @param buffer The buffer to read in to - -: 58: * @param size The number of bytes to read - -: 59: * @return The number of bytes read, 0 at end of file, negative error on failure - -: 60: */ - -: 61: virtual ssize_t read(void *buffer, size_t size) = 0; - -: 62: - -: 63: /** Write the contents of a buffer to a file - -: 64: * - -: 65: * Devices acting as FileHandles should follow POSIX semantics: - -: 66: * - -: 67: * * if blocking, block until all data is written - -: 68: * * if no data can be written, and non-blocking set, return -EAGAIN - -: 69: * * if some data can be written, and non-blocking set, write partial - -: 70: * - -: 71: * @param buffer The buffer to write from - -: 72: * @param size The number of bytes to write - -: 73: * @return The number of bytes written, negative error on failure - -: 74: */ - -: 75: virtual ssize_t write(const void *buffer, size_t size) = 0; - -: 76: - -: 77: /** Move the file position to a given offset from from a given location - -: 78: * - -: 79: * @param offset The offset from whence to move to - -: 80: * @param whence The start of where to seek - -: 81: * SEEK_SET to start from beginning of file, - -: 82: * SEEK_CUR to start from current position in file, - -: 83: * SEEK_END to start from end of file - -: 84: * @return The new offset of the file, negative error code on failure - -: 85: */ - -: 86: virtual off_t seek(off_t offset, int whence = SEEK_SET) = 0; - -: 87: - -: 88: /** Close a file - -: 89: * - -: 90: * @return 0 on success, negative error code on failure - -: 91: */ - -: 92: virtual int close() = 0; - -: 93: - -: 94: /** Flush any buffers associated with the file - -: 95: * - -: 96: * @return 0 on success, negative error code on failure - -: 97: */ - #####: 98: virtual int sync() - -: 99: { - #####: 100: return 0; - -: 101: } - -: 102: - -: 103: /** Check if the file in an interactive terminal device - -: 104: * - -: 105: * @return True if the file is a terminal - -: 106: * @return False if the file is not a terminal - -: 107: * @return Negative error code on failure - -: 108: */ - #####: 109: virtual int isatty() - -: 110: { - #####: 111: return false; - -: 112: } - -: 113: - -: 114: /** Get the file position of the file - -: 115: * - -: 116: * @note This is equivalent to seek(0, SEEK_CUR) - -: 117: * - -: 118: * @return The current offset in the file, negative error code on failure - -: 119: */ - #####: 120: virtual off_t tell() - -: 121: { - #####: 122: return seek(0, SEEK_CUR); - -: 123: } - -: 124: - -: 125: /** Rewind the file position to the beginning of the file - -: 126: * - -: 127: * @note This is equivalent to seek(0, SEEK_SET) - -: 128: */ - #####: 129: virtual void rewind() - -: 130: { - #####: 131: seek(0, SEEK_SET); - #####: 132: } - -: 133: - -: 134: /** Get the size of the file - -: 135: * - -: 136: * @return Size of the file in bytes - -: 137: */ - -: 138: virtual off_t size(); - -: 139: - -: 140: /** Move the file position to a given offset from a given location. - -: 141: * - -: 142: * @param offset The offset from whence to move to - -: 143: * @param whence SEEK_SET for the start of the file, SEEK_CUR for the - -: 144: * current file position, or SEEK_END for the end of the file. - -: 145: * - -: 146: * @returns - -: 147: * new file position on success, - -: 148: * -1 on failure or unsupported - -: 149: */ - -: 150: MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by FileHandle::seek") - #####: 151: virtual off_t lseek(off_t offset, int whence) - -: 152: { - #####: 153: return seek(offset, whence); - -: 154: } - -: 155: - -: 156: /** Flush any buffers associated with the FileHandle, ensuring it - -: 157: * is up to date on disk - -: 158: * - -: 159: * @returns - -: 160: * 0 on success or un-needed, - -: 161: * -1 on error - -: 162: */ - -: 163: MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by FileHandle::sync") - #####: 164: virtual int fsync() - -: 165: { - #####: 166: return sync(); - -: 167: } - -: 168: - -: 169: /** Find the length of the file - -: 170: * - -: 171: * @returns - -: 172: * Length of the file - -: 173: */ - -: 174: MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by FileHandle::size") - #####: 175: virtual off_t flen() - -: 176: { - #####: 177: return size(); - -: 178: } - -: 179: - -: 180: /** Set blocking or non-blocking mode of the file operation like read/write. - -: 181: * Definition depends upon the subclass implementing FileHandle. - -: 182: * The default is blocking. - -: 183: * - -: 184: * @param blocking true for blocking mode, false for non-blocking mode. - -: 185: * - -: 186: * @return 0 on success - -: 187: * @return Negative error code on failure - -: 188: */ - #####: 189: virtual int set_blocking(bool blocking) - -: 190: { - #####: 191: return -1; - -: 192: } - -: 193: - -: 194: /** Check for poll event flags - -: 195: * The input parameter can be used or ignored - the could always return all events, - -: 196: * or could check just the events listed in events. - -: 197: * Call is non-blocking - returns instantaneous state of events. - -: 198: * Whenever an event occurs, the derived class should call the sigio() callback). - -: 199: * - -: 200: * @param events bitmask of poll events we're interested in - POLLIN/POLLOUT etc. - -: 201: * - -: 202: * @returns bitmask of poll events that have occurred. - -: 203: */ - #####: 204: virtual short poll(short events) const - -: 205: { - -: 206: // Possible default for real files - #####: 207: return POLLIN | POLLOUT; - -: 208: } - -: 209: - -: 210: /** Definition depends upon the subclass implementing FileHandle. - -: 211: * For example, if the FileHandle is of type Stream, writable() could return - -: 212: * true when there is ample buffer space available for write() calls. - -: 213: * - -: 214: * @returns true if the FileHandle is writable. - -: 215: */ - -: 216: bool writable() const - -: 217: { - -: 218: return poll(POLLOUT) & POLLOUT; - -: 219: } - -: 220: - -: 221: /** Definition depends upon the subclass implementing FileHandle. - -: 222: * For example, if the FileHandle is of type Stream, readable() could return - -: 223: * true when there is something available to read. - -: 224: * - -: 225: * @returns true when there is something available to read. - -: 226: */ - -: 227: bool readable() const - -: 228: { - -: 229: return poll(POLLIN) & POLLIN; - -: 230: } - -: 231: - -: 232: /** Register a callback on state change of the file. - -: 233: * - -: 234: * The specified callback will be called on state changes such as when - -: 235: * the file can be written to or read from. - -: 236: * - -: 237: * The callback may be called in an interrupt context and should not - -: 238: * perform expensive operations. - -: 239: * - -: 240: * Note! This is not intended as an attach-like asynchronous api, but rather - -: 241: * as a building block for constructing such functionality. - -: 242: * - -: 243: * The exact timing of when the registered function - -: 244: * is called is not guaranteed and susceptible to change. It should be used - -: 245: * as a cue to make read/write/poll calls to find the current state. - -: 246: * - -: 247: * @param func Function to call on state change - -: 248: */ - -: 249: virtual void sigio(Callback func) - -: 250: { - -: 251: //Default for real files. Do nothing for real files. - -: 252: } - -: 253:}; - -: 254: - -: 255:/**@}*/ - -: 256: - -: 257:/**@}*/ - -: 258: - -: 259: - -: 260:} // namespace mbed - -: 261: - -: 262:#endif diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/NonCopyable.h.gcov b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/NonCopyable.h.gcov deleted file mode 100644 index 533a202245..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/NonCopyable.h.gcov +++ /dev/null @@ -1,216 +0,0 @@ - -: 0:Source:../../../../../platform/NonCopyable.h - -: 0:Graph:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcno - -: 0:Data:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* Copyright (c) 2017 ARM Limited - -: 2: * - -: 3: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 4: * you may not use this file except in compliance with the License. - -: 5: * You may obtain a copy of the License at - -: 6: * - -: 7: * http://www.apache.org/licenses/LICENSE-2.0 - -: 8: * - -: 9: * Unless required by applicable law or agreed to in writing, software - -: 10: * distributed under the License is distributed on an "AS IS" BASIS, - -: 11: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 12: * See the License for the specific language governing permissions and - -: 13: * limitations under the License. - -: 14: */ - -: 15: - -: 16:#ifndef MBED_NONCOPYABLE_H_ - -: 17:#define MBED_NONCOPYABLE_H_ - -: 18: - -: 19:#if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0)) - -: 20:#include "mbed_toolchain.h" - -: 21:#include "mbed_debug.h" - -: 22:#endif - -: 23: - -: 24:namespace mbed { - -: 25: - -: 26:/** - -: 27: * Inheriting from this class autogeneration of copy construction and copy - -: 28: * assignement operations. - -: 29: * - -: 30: * Classes which are not value type should inherit privately from this class - -: 31: * to avoid generation of invalid copy constructor or copy assignement operator - -: 32: * which can lead to unoticeable programming errors. - -: 33: * - -: 34: * As an example consider the following signature: - -: 35: * - -: 36: * @code - -: 37: * class Resource; - -: 38: * - -: 39: * class Foo { - -: 40: * public: - -: 41: * Foo() : _resource(new Resource()) { } - -: 42: * ~Foo() { delete _resource; } - -: 43: * private: - -: 44: * Resource* _resource; - -: 45: * } - -: 46: * - -: 47: * Foo get_foo(); - -: 48: * - -: 49: * Foo foo = get_foo(); - -: 50: * @endcode - -: 51: * - -: 52: * There is a bug in this function, it returns a temporary value which will be - -: 53: * byte copied into foo then destroyed. Unfortunately, internaly the Foo class - -: 54: * manage a pointer to a Resource object. This pointer will be released when the - -: 55: * temporary is destroyed and foo will manage a pointer to an already released - -: 56: * Resource. - -: 57: * - -: 58: * Two issues has to be fixed in the example above: - -: 59: * - Function signature has to be changed to reflect the fact that Foo - -: 60: * instances cannot be copied. In that case accessor should return a - -: 61: * reference to give access to objects already existing and managed. - -: 62: * Generator on the other hand should return a pointer to the created object. - -: 63: * - -: 64: * @code - -: 65: * // return a reference to an already managed Foo instance - -: 66: * Foo& get_foo(); - -: 67: * Foo& foo = get_foo(); - -: 68: * - -: 69: * // create a new Foo instance - -: 70: * Foo* make_foo(); - -: 71: * Foo* m = make_foo(); - -: 72: * @endcode - -: 73: * - -: 74: * - Copy constructor and copy assignement operator has to be made private - -: 75: * in the Foo class. It prevents unwanted copy of Foo objects. This can be - -: 76: * done by declaring copy constructor and copy assignement in the private - -: 77: * section of the Foo class. - -: 78: * - -: 79: * @code - -: 80: * class Foo { - -: 81: * public: - -: 82: * Foo() : _resource(new Resource()) { } - -: 83: * ~Foo() { delete _resource; } - -: 84: * private: - -: 85: * // disallow copy operations - -: 86: * Foo(const Foo&); - -: 87: * Foo& operator=(const Foo&); - -: 88: * // data members - -: 89: * Resource* _resource; - -: 90: * } - -: 91: * @endcode - -: 92: * - -: 93: * Another solution is to inherit privately from the NonCopyable class. - -: 94: * It reduces the boiler plate needed to avoid copy operations but more - -: 95: * importantly it clarifies the programer intent and the object semantic. - -: 96: * - -: 97: * class Foo : private NonCopyable { - -: 98: * public: - -: 99: * Foo() : _resource(new Resource()) { } - -: 100: * ~Foo() { delete _resource; } - -: 101: * private: - -: 102: * Resource* _resource; - -: 103: * } - -: 104: * - -: 105: * @tparam T The type that should be made non copyable. It prevent cases where - -: 106: * the empty base optimization cannot be applied and therefore ensure that the - -: 107: * cost of this semantic sugar is null. - -: 108: * - -: 109: * As an example, the empty base optimization is prohibited if one of the empty - -: 110: * base class is also a base type of the first non static data member: - -: 111: * - -: 112: * @code - -: 113: * struct A { }; - -: 114: * struct B : A { - -: 115: * int foo; - -: 116: * }; - -: 117: * // thanks to empty base optimization, sizeof(B) == sizeof(int) - -: 118: * - -: 119: * struct C : A { - -: 120: * B b; - -: 121: * }; - -: 122: * - -: 123: * // empty base optimization cannot be applied here because A from C and A from - -: 124: * // B shall have a different address. In that case, with the alignement - -: 125: * // sizeof(C) == 2* sizeof(int) - -: 126: * @endcode - -: 127: * - -: 128: * The solution to that problem is to templatize the empty class to makes it - -: 129: * unique to the type it is applied to: - -: 130: * - -: 131: * @code - -: 132: * template - -: 133: * struct A { }; - -: 134: * struct B : A { - -: 135: * int foo; - -: 136: * }; - -: 137: * struct C : A { - -: 138: * B b; - -: 139: * }; - -: 140: * - -: 141: * // empty base optimization can be applied B and C does not refer to the same - -: 142: * // kind of A. sizeof(C) == sizeof(B) == sizeof(int). - -: 143: * @endcode - -: 144: * - -: 145: * @note Compile time errors are disabled if the develop or the release profile - -: 146: * is used. To override this behavior and force compile time errors in all profile - -: 147: * set the configuration parameter "platform.force-non-copyable-error" to true. - -: 148: */ - -: 149:template - -: 150:class NonCopyable { - -: 151:protected: - -: 152: /** - -: 153: * Disalow construction of NonCopyable objects from outside of its hierarchy. - -: 154: */ - -: 155: NonCopyable() { } - -: 156: /** - -: 157: * Disalow destruction of NonCopyable objects from outside of its hierarchy. - -: 158: */ - #####: 159: ~NonCopyable() { } - -: 160: - -: 161:#if (!defined(MBED_DEBUG) && (MBED_CONF_PLATFORM_FORCE_NON_COPYABLE_ERROR == 0)) - -: 162: /** - -: 163: * NonCopyable copy constructor. - -: 164: * - -: 165: * A compile time warning is issued when this function is used and a runtime - -: 166: * warning is printed when the copy construction of the non copyable happens. - -: 167: * - -: 168: * If you see this warning, your code is probably doing something unspecified. - -: 169: * Copy of non copyable resources can lead to resource leak and random error. - -: 170: */ - -: 171: MBED_DEPRECATED("Invalid copy construction of a NonCopyable resource.") - -: 172: NonCopyable(const NonCopyable&) - -: 173: { - -: 174: debug("Invalid copy construction of a NonCopyable resource: %s\r\n", MBED_PRETTY_FUNCTION); - -: 175: } - -: 176: - -: 177: /** - -: 178: * NonCopyable copy assignment operator. - -: 179: * - -: 180: * A compile time warning is issued when this function is used and a runtime - -: 181: * warning is printed when the copy construction of the non copyable happens. - -: 182: * - -: 183: * If you see this warning, your code is probably doing something unspecified. - -: 184: * Copy of non copyable resources can lead to resource leak and random error. - -: 185: */ - -: 186: MBED_DEPRECATED("Invalid copy assignment of a NonCopyable resource.") - -: 187: NonCopyable& operator=(const NonCopyable&) - -: 188: { - -: 189: debug("Invalid copy assignment of a NonCopyable resource: %s\r\n", MBED_PRETTY_FUNCTION); - -: 190: return *this; - -: 191: } - -: 192: - -: 193:#else - -: 194:private: - -: 195: /** - -: 196: * Declare copy constructor as private, any attempt to copy construct - -: 197: * a NonCopyable will fail at compile time. - -: 198: */ - -: 199: NonCopyable(const NonCopyable&); - -: 200: - -: 201: /** - -: 202: * Declare copy assignement operator as private, any attempt to copy assign - -: 203: * a NonCopyable will fail at compile time. - -: 204: */ - -: 205: NonCopyable& operator=(const NonCopyable&); - -: 206:#endif - -: 207:}; - -: 208: - -: 209:} // namespace mbed - -: 210: - -: 211:#endif /* MBED_NONCOPYABLE_H_ */ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_error.txt b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_error.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_output.txt b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_output.txt deleted file mode 100644 index 51d39c462d..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_output.txt +++ /dev/null @@ -1,24 +0,0 @@ -File '../../../framework/mux/mbed_mux.h' -Lines executed:0.00% of 1 -Creating 'mbed_mux.h.gcov' - -File '../../../../../platform/Callback.h' -Lines executed:71.43% of 14 -Creating 'Callback.h.gcov' - -File '../../../../../platform/NonCopyable.h' -Lines executed:0.00% of 1 -Creating 'NonCopyable.h.gcov' - -File '../../../framework/mux/mbed_mux_data_service.cpp' -Lines executed:100.00% of 13 -Creating 'mbed_mux_data_service.cpp.gcov' - -File '../../../../../platform/FileHandle.h' -Lines executed:0.00% of 20 -Creating 'FileHandle.h.gcov' - -File '/usr/include/c++/5/new' -Lines executed:0.00% of 3 -Creating 'new.gcov' - diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_report.txt b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_report.txt deleted file mode 100644 index 59de8ced58..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_report.txt +++ /dev/null @@ -1,6 +0,0 @@ - - 0.00% ../framework/mux/mbed_mux.h - 0.00% Handle.h - 0.00% ../platform/NonCopyable.h -100.00% ../framework/mux/mbed_mux_data_service.cpp - 71.43% ../platform/Callback.h diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_report.txt.html b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_report.txt.html deleted file mode 100644 index 12e71117aa..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/gcov_report.txt.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 0.00% Handle.h - - - -
CoverageFile
0.00% ../framework/mux/mbed_mux.h
0.00% ../platform/NonCopyable.h
100.00% ../framework/mux/mbed_mux_data_service.cpp
71.43% ../platform/Callback.h
diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/mbed_mux.h.gcov b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/mbed_mux.h.gcov deleted file mode 100644 index b2a03aaf59..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/mbed_mux.h.gcov +++ /dev/null @@ -1,570 +0,0 @@ - -: 0:Source:../../../framework/mux/mbed_mux.h - -: 0:Graph:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcno - -: 0:Data:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) 2006-2017, Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17: - -: 18:#ifndef MUX_H - -: 19:#define MUX_H - -: 20: - -: 21:#include - -: 22:#include "FileHandle.h" - -: 23:#include "PlatformMutex.h" - -: 24:#include "Semaphore.h" - -: 25:#include "EventQueue.h" - -: 26: - -: 27:#define MUX_DLCI_INVALID_ID 0 /* Invalid DLCI ID. Used to invalidate MuxDataService object. */ - -: 28:#define MUX_CRC_TABLE_LEN 256u /* CRC table length in number of bytes. */ - -: 29: - -: 30:#ifndef MBED_CONF_MUX_DLCI_COUNT - -: 31:#define MBED_CONF_MUX_DLCI_COUNT 3u /* Number of supported DLCI IDs. */ - -: 32:#endif - -: 33:#ifndef MBED_CONF_MUX_BUFFER_SIZE - -: 34:#define MBED_CONF_MUX_BUFFER_SIZE 31u /* Size of TX/Rx buffers in number of bytes. */ - -: 35:#endif - -: 36: - -: 37:/* More RAM needs to allocated if more than 4 DLCI ID to be supported see @ref tx_callback_context for details. */ - -: 38:MBED_STATIC_ASSERT(MBED_CONF_MUX_DLCI_COUNT <= 4u, ""); - -: 39: - -: 40: - -: 41:/* @todo: - -: 42:I assume that we need to export some kind of #defines for EVENT_SIZE and MAX_EVENT_COUNT (max number of events that can - -: 43:be queued at the same time by the module inside EventQueue, so that the application designer can calculate the RAM - -: 44:storage requirements correctly at compile time. - -: 45:*/ - -: 46: - -: 47:namespace mbed { - -: 48: - #####: 49:class MuxDataService : public FileHandle - -: 50:{ - -: 51: friend class Mux; - -: 52:public: - -: 53: - -: 54: /** Enqueue user data for transmission. - -: 55: * - -: 56: * @note: This is API is only meant to be used for the multiplexer (user) data service tx. Supplied buffer can be - -: 57: * reused/freed upon call return. - -: 58: * - -: 59: * @param buffer Begin of the user data. - -: 60: * @param size The number of bytes to write. - -: 61: * @return The number of bytes written. - -: 62: */ - -: 63: virtual ssize_t write(const void* buffer, size_t size); - -: 64: - -: 65: /** Read user data into a buffer. - -: 66: * - -: 67: * @note: This is API is only meant to be used for the multiplexer (user) data service rx. - -: 68: * - -: 69: * @param buffer The buffer to read in to. - -: 70: * @param size The number of bytes to read. - -: 71: * @return The number of bytes read, -EAGAIN if no data available for read. - -: 72: */ - -: 73: virtual ssize_t read(void *buffer, size_t size); - -: 74: - -: 75: /** Not supported by the implementation. */ - -: 76: virtual off_t seek(off_t offset, int whence = SEEK_SET); - -: 77: - -: 78: /** Not supported by the implementation. */ - -: 79: virtual int close(); - -: 80: - -: 81: /** Register a callback on completion of enqueued write and read operations. - -: 82: * - -: 83: * @note: The registered callback is called within thread context supplied in eventqueue_attach. - -: 84: * - -: 85: * @param func Function to call upon event generation. - -: 86: */ - -: 87: virtual void sigio(Callback func); - -: 88: - -: 89: /** Constructor. */ - -: 90: MuxDataService() : _dlci(MUX_DLCI_INVALID_ID) {}; - -: 91: - -: 92:private: - -: 93: - -: 94: /* Deny copy constructor. */ - -: 95: MuxDataService(const MuxDataService& obj); - -: 96: - -: 97: /* Deny assignment operator. */ - -: 98: MuxDataService& operator=(const MuxDataService& obj); - -: 99: - -: 100: uint8_t _dlci; /* DLCI number. Valid range 1 - 63. */ - -: 101: Callback _sigio_cb; /* Registered signal callback. */ - -: 102:}; - -: 103: - -: 104: - -: 105:class Mux - -: 106:{ - -: 107: friend class MuxDataService; - -: 108:public: - -: 109: - -: 110: /* Definition for multiplexer establishment status type. */ - -: 111: enum MuxEstablishStatus { - -: 112: MUX_ESTABLISH_SUCCESS = 0, /* Peer accepted the request. */ - -: 113: MUX_ESTABLISH_REJECT, /* Peer rejected the request. */ - -: 114: MUX_ESTABLISH_TIMEOUT, /* Timeout occurred for the request. */ - -: 115: MUX_ESTABLISH_MAX /* Enumeration upper bound. */ - -: 116: }; - -: 117: - -: 118: /* @ref MuxEstablishStatus type assigned to _shared_memory variable, which has sizeof(uint8_t) storage class. Enforce - -: 119: expected behaviour compile time. */ - -: 120: MBED_STATIC_ASSERT(sizeof(MuxEstablishStatus) == sizeof(uint), ""); - -: 121: - -: 122: /* Definition for multiplexer establishment return code type. */ - -: 123: enum MuxReturnStatus { - -: 124: MUX_STATUS_SUCCESS = 0, - -: 125: MUX_STATUS_INPROGRESS, - -: 126: MUX_STATUS_INVALID_RANGE, - -: 127: MUX_STATUS_MUX_NOT_OPEN, - -: 128: MUX_STATUS_NO_RESOURCE, - -: 129: MUX_STATUS_MAX - -: 130: }; - -: 131: - -: 132: /** Module init. */ - -: 133: static void module_init(); - -: 134: - -: 135: /** Establish the multiplexer control channel. - -: 136: * - -: 137: * @note: Relevant request specific parameters are fixed at compile time within multiplexer component. - -: 138: * @note: Call returns when response from the peer is received, timeout or write error occurs. - -: 139: * - -: 140: * @param status Operation completion code. - -: 141: * - -: 142: * @return MUX_STATUS_SUCCESS Operation completed, check status for completion code. - -: 143: * @return MUX_STATUS_INPROGRESS Operation not started, control channel open already in progress. - -: 144: * @return MUX_STATUS_NO_RESOURCE Operation not started, multiplexer control channel already open. - -: 145: */ - -: 146: static MuxReturnStatus mux_start(MuxEstablishStatus &status); - -: 147: - -: 148: /** Establish a DLCI. - -: 149: * - -: 150: * @note: Relevant request specific parameters are fixed at compile time within multiplexer component. - -: 151: * @note: Call returns when response from the peer is received or timeout occurs. - -: 152: * - -: 153: * @warning: Not allowed to be called from callback context. - -: 154: * - -: 155: * @param dlci_id ID of the DLCI to establish. Valid range 1 - 63. - -: 156: * @param status Operation completion code. - -: 157: * @param obj Valid object upon status having MUX_ESTABLISH_SUCCESS, NULL upon failure. - -: 158: * - -: 159: * @return MUX_STATUS_SUCCESS Operation completed, check status for completion code. - -: 160: * @return MUX_STATUS_INPROGRESS Operation not started, DLCI establishment already in progress. - -: 161: * @return MUX_STATUS_INVALID_RANGE Operation not started, DLCI ID not in valid range. - -: 162: * @return MUX_STATUS_MUX_NOT_OPEN Operation not started, no established multiplexer control channel exists. - -: 163: * @return MUX_STATUS_NO_RESOURCE Operation not started, dlci_id, or all available DLCI ID resources, - -: 164: * already in use. - -: 165: */ - -: 166: static MuxReturnStatus dlci_establish(uint8_t dlci_id, MuxEstablishStatus &status, FileHandle **obj); - -: 167: - -: 168: /** Attach serial interface to the object. - -: 169: * - -: 170: * @param serial Serial interface to be used. - -: 171: */ - -: 172: static void serial_attach(FileHandle *serial); - -: 173: - -: 174: /** Attach EventQueue interface to the object. - -: 175: * - -: 176: * @param event_queue Event queue interface to be used. - -: 177: */ - -: 178: static void eventqueue_attach(events::EventQueue *event_queue); - -: 179: - -: 180:private: - -: 181: - -: 182: /* Definition for Rx event type. */ - -: 183: enum RxEvent { - -: 184: RX_READ = 0, - -: 185: RX_RESUME, - -: 186: RX_EVENT_MAX - -: 187: }; - -: 188: - -: 189: /* Definition for Tx state machine. */ - -: 190: enum TxState { - -: 191: TX_IDLE = 0, - -: 192: TX_RETRANSMIT_ENQUEUE, - -: 193: TX_RETRANSMIT_DONE, - -: 194: TX_INTERNAL_RESP, - -: 195: TX_NORETRANSMIT, - -: 196: TX_STATE_MAX - -: 197: }; - -: 198: - -: 199: /* Definition for Rx state machine. */ - -: 200: enum RxState { - -: 201: RX_FRAME_START = 0, - -: 202: RX_HEADER_READ, - -: 203: RX_TRAILER_READ, - -: 204: RX_SUSPEND, - -: 205: RX_STATE_MAX - -: 206: }; - -: 207: - -: 208: /* Definition for frame type within rx path. */ - -: 209: enum FrameRxType { - -: 210: FRAME_RX_TYPE_SABM = 0, - -: 211: FRAME_RX_TYPE_UA, - -: 212: FRAME_RX_TYPE_DM, - -: 213: FRAME_RX_TYPE_DISC, - -: 214: FRAME_RX_TYPE_UIH, - -: 215: FRAME_RX_TYPE_NOT_SUPPORTED, - -: 216: FRAME_RX_TYPE_MAX - -: 217: }; - -: 218: - -: 219: /* Definition for frame type within tx path. */ - -: 220: enum FrameTxType { - -: 221: FRAME_TX_TYPE_SABM = 0, - -: 222: FRAME_TX_TYPE_DM, - -: 223: FRAME_TX_TYPE_UIH, - -: 224: FRAME_TX_TYPE_MAX - -: 225: }; - -: 226: - -: 227: /** Registered time-out expiration event. */ - -: 228: static void on_timeout(); - -: 229: - -: 230: /** Registered deferred call event in safe (thread context) supplied in eventqueue_attach. */ - -: 231: static void on_deferred_call(); - -: 232: - -: 233: /** Registered sigio callback from FileHandle. */ - -: 234: static void on_sigio(); - -: 235: - -: 236: /** Calculate fcs. - -: 237: * - -: 238: * @param buffer Input buffer. - -: 239: * @param input_len Input length in number of bytes. - -: 240: * - -: 241: * @return Calculated fcs. - -: 242: */ - -: 243: static uint8_t fcs_calculate(const uint8_t *buffer, uint8_t input_len); - -: 244: - -: 245: /** Construct sabm request message. - -: 246: * - -: 247: * @param dlci_id ID of the DLCI to establish - -: 248: */ - -: 249: static void sabm_request_construct(uint8_t dlci_id); - -: 250: - -: 251: /** Construct dm response message. - -: 252: */ - -: 253: static void dm_response_construct(); - -: 254: - -: 255: /** Construct user information frame. - -: 256: * - -: 257: * @param dlci_id ID of the DLCI to establish - -: 258: * @param buffer - -: 259: * @param size - -: 260: */ - -: 261: static void user_information_construct(uint8_t dlci_id, const void *buffer, size_t size); - -: 262: - -: 263: /** Do write operation if pending data available. - -: 264: */ - -: 265: static void write_do(); - -: 266: - -: 267: /** Generate Rx event. - -: 268: * - -: 269: * @param event Rx event - -: 270: */ - -: 271: static void rx_event_do(RxEvent event); - -: 272: - -: 273: /** Rx event frame start read state. - -: 274: * - -: 275: * @return Number of bytes read, -EAGAIN if no data available. - -: 276: */ - -: 277: static ssize_t on_rx_read_state_frame_start(); - -: 278: - -: 279: /** Rx event header read state. - -: 280: * - -: 281: * @return Number of bytes read, -EAGAIN if no data available. - -: 282: */ - -: 283: static ssize_t on_rx_read_state_header_read(); - -: 284: - -: 285: /** Rx event trailer read state. - -: 286: * - -: 287: * @return Number of bytes read, -EAGAIN if no data available. - -: 288: */ - -: 289: static ssize_t on_rx_read_state_trailer_read(); - -: 290: - -: 291: /** Rx event suspend read state. - -: 292: * - -: 293: * @return Number of bytes read, -EAGAIN if no data available. - -: 294: */ - -: 295: static ssize_t on_rx_read_state_suspend(); - -: 296: - -: 297: /** Process received SABM frame. */ - -: 298: static void on_rx_frame_sabm(); - -: 299: - -: 300: /** Process received UA frame. */ - -: 301: static void on_rx_frame_ua(); - -: 302: - -: 303: /** Process received DM frame. */ - -: 304: static void on_rx_frame_dm(); - -: 305: - -: 306: /** Process received DISC frame. */ - -: 307: static void on_rx_frame_disc(); - -: 308: - -: 309: /** Process received UIH frame. */ - -: 310: static void on_rx_frame_uih(); - -: 311: - -: 312: /** Process received frame, which is not supported. */ - -: 313: static void on_rx_frame_not_supported(); - -: 314: - -: 315: /** Process valid received frame. */ - -: 316: static void valid_rx_frame_decode(); - -: 317: - -: 318: /** SABM frame tx path post processing. */ - -: 319: static void on_post_tx_frame_sabm(); - -: 320: - -: 321: /** DM frame tx path post processing. */ - -: 322: static void on_post_tx_frame_dm(); - -: 323: - -: 324: /** UIH frame tx path post processing. */ - -: 325: static void on_post_tx_frame_uih(); - -: 326: - -: 327: /** Resolve rx frame type. - -: 328: * - -: 329: * @return Frame type. - -: 330: */ - -: 331: static Mux::FrameRxType frame_rx_type_resolve(); - -: 332: - -: 333: /** Resolve tx frame type. - -: 334: * - -: 335: * @return Frame type. - -: 336: */ - -: 337: static Mux::FrameTxType frame_tx_type_resolve(); - -: 338: - -: 339: /** Begin the frame retransmit sequence. */ - -: 340: static void frame_retransmit_begin(); - -: 341: - -: 342: /** TX state entry functions. */ - -: 343: static void tx_retransmit_enqueu_entry_run(); - -: 344: static void tx_retransmit_done_entry_run(); - -: 345: static void tx_idle_entry_run(); - -: 346: static void tx_internal_resp_entry_run(); - -: 347: static void tx_noretransmit_entry_run(); - -: 348: typedef void (*tx_state_entry_func_t)(); - -: 349: - -: 350: /** TX state exit function. */ - -: 351: static void tx_idle_exit_run(); - -: 352: typedef void (*tx_state_exit_func_t)(); - -: 353: - -: 354: /** Change Tx state machine state. - -: 355: * - -: 356: * @param new_state State to transit. - -: 357: * @param entry_func State entry function. - -: 358: * @param exit_func State exit function. - -: 359: */ - -: 360: static void tx_state_change(TxState new_state, tx_state_entry_func_t entry_func, tx_state_exit_func_t exit_func); - -: 361: - -: 362: /** RX state entry functions. */ - -: 363: static void rx_header_read_entry_run(); - -: 364: typedef void (*rx_state_entry_func_t)(); - -: 365: - -: 366: /** Null action function. */ - -: 367: static void null_action(); - -: 368: - -: 369: /** Change Rx state machine state. - -: 370: * - -: 371: * @param new_state State to transit. - -: 372: * @param entry_func State entry function. - -: 373: */ - -: 374: static void rx_state_change(RxState new_state, rx_state_entry_func_t entry_func); - -: 375: - -: 376: /** Begin DM frame transmit sequence. */ - -: 377: static void dm_response_send(); - -: 378: - -: 379: /** Append DLCI ID to storage. - -: 380: * - -: 381: * @param dlci_id ID of the DLCI to append. - -: 382: */ - -: 383: static void dlci_id_append(uint8_t dlci_id); - -: 384: - -: 385: /** Get file handle based on DLCI ID. - -: 386: * - -: 387: * @param dlci_id ID of the DLCI used as the key - -: 388: * - -: 389: * @return Valid object reference or NULL if not found. - -: 390: */ - -: 391: static MuxDataService* file_handle_get(uint8_t dlci_id); - -: 392: - -: 393: /** Evaluate is DLCI ID in use. - -: 394: * - -: 395: * @param dlci_id ID of the DLCI yo evaluate - -: 396: * - -: 397: * @return True if in use, false otherwise. - -: 398: */ - -: 399: static bool is_dlci_in_use(uint8_t dlci_id); - -: 400: - -: 401: /** Evaluate is DLCI ID queue full. - -: 402: * - -: 403: * @return True if full, false otherwise. - -: 404: */ - -: 405: static bool is_dlci_q_full(); - -: 406: - -: 407: /** Begin pending self iniated multiplexer open sequence. */ - -: 408: static void pending_self_iniated_mux_open_start(); - -: 409: - -: 410: /** Begin pending self iniated DLCI establishment sequence. */ - -: 411: static void pending_self_iniated_dlci_open_start(); - -: 412: - -: 413: /** Begin pending peer iniated DLCI establishment sequence. - -: 414: * - -: 415: * @param dlci_id ID of the DLCI to establish. - -: 416: */ - -: 417: static void pending_peer_iniated_dlci_open_start(uint8_t dlci_id); - -: 418: - -: 419: /** Enqueue user data for transmission. - -: 420: * - -: 421: * @note: This is API is only meant to be used for the multiplexer (user) data service tx. Supplied buffer can be - -: 422: * reused/freed upon call return. - -: 423: * - -: 424: * @param dlci_id ID of the DLCI to use. - -: 425: * @param buffer Begin of the user data. - -: 426: * @param size The number of bytes to write. - -: 427: * @return The number of bytes written, negative error on failure. - -: 428: */ - -: 429: static ssize_t user_data_tx(uint8_t dlci_id, const void* buffer, size_t size); - -: 430: - -: 431: /** Read user data into a buffer. - -: 432: * - -: 433: * @note: This is API is only meant to be used for the multiplexer (user) data service rx. - -: 434: * - -: 435: * @param buffer The buffer to read in to. - -: 436: * @param size The number of bytes to read. - -: 437: * @return The number of bytes read, -EAGAIN if no data availabe for read. - -: 438: */ - -: 439: static ssize_t user_data_rx(void* buffer, size_t size); - -: 440: - -: 441: /** Clear TX callback pending bit. - -: 442: * - -: 443: * @param bit Bit to clear. - -: 444: */ - -: 445: static void tx_callback_pending_bit_clear(uint8_t bit); - -: 446: - -: 447: /** Set TX callback pending bit for supplied DLCI ID. - -: 448: * - -: 449: * @param dlci_id DLCI ID for bit to set. - -: 450: */ - -: 451: static void tx_callback_pending_bit_set(uint8_t dlci_id); - -: 452: - -: 453: /** Advance the current TX callback index bit. - -: 454: * - -: 455: * @return The current TX callback index bit after advanced. - -: 456: */ - -: 457: static uint8_t tx_callback_index_advance(); - -: 458: - -: 459: /** Get the TX callback pending bitmask. - -: 460: * - -: 461: * @return TX callback pending bitmask. - -: 462: */ - -: 463: static uint8_t tx_callback_pending_mask_get(); - -: 464: - -: 465: /** Dispatch TX callback based on supplied bit. - -: 466: * - -: 467: * @param bit Bit indetifier of callback to dispatch. - -: 468: */ - -: 469: static void tx_callback_dispatch(uint8_t bit); - -: 470: - -: 471: /** Run main processing loop for resolving pending TX callbacks and dispatching them if they exists. - -: 472: */ - -: 473: static void tx_callbacks_run(); - -: 474: - -: 475: /** Get data service object based on supplied bit id. - -: 476: * - -: 477: * @param bit Bit indetifier of data service object to get. - -: 478: * @return Data service object reference. - -: 479: */ - -: 480: static MuxDataService& tx_callback_lookup(uint8_t bit); - -: 481: - -: 482: /** Get minimum of 2 supplied paramaters. - -: 483: * - -: 484: * @param size_1 1st param for comparisation. - -: 485: * @param size_2 2nd param for comparisation. - -: 486: * @return Minimum of supplied paramaters. - -: 487: */ - -: 488: static size_t min(uint8_t size_1, size_t size_2); - -: 489: - -: 490: /** Enqueue callback to event queue. - -: 491: */ - -: 492: static void event_queue_enqueue(); - -: 493: - -: 494: /** Verify is FCS valid in RX frame. - -: 495: * - -: 496: * @return True upon valid FCS, false otherwise. - -: 497: */ - -: 498: static bool is_rx_fcs_valid(); - -: 499: - -: 500: /* Deny object creation. */ - -: 501: Mux(); - -: 502: - -: 503: /* Deny copy constructor. */ - -: 504: Mux(const Mux& obj); - -: 505: - -: 506: /* Deny assignment operator. */ - -: 507: Mux& operator=(const Mux& obj); - -: 508: - -: 509: /* Definition for Tx context type. */ - -: 510: struct tx_context_t { - -: 511: int timer_id; /* Timer id. */ - -: 512: union { - -: 513: uint32_t align_4_byte; /* Force 4-byte alignment. */ - -: 514: uint8_t buffer[MBED_CONF_MUX_BUFFER_SIZE]; /* Rx buffer. */ - -: 515: }; - -: 516: uint8_t retransmit_counter; /* Frame retransmission counter. */ - -: 517: uint8_t bytes_remaining; /* Bytes remaining in the buffer to write. */ - -: 518: uint8_t offset; /* Offset in the buffer where to write from. */ - -: 519: uint8_t tx_callback_context; /* Context for the TX callback dispatching logic as follows: - -: 520: - 4 LO bits contain the pending callback mask - -: 521: - 4 HI bits contain the current bit used for masking */ - -: 522: TxState tx_state; /* Tx state machine current state. */ - -: 523: - -: 524: }; - -: 525: - -: 526: /* Definition for Rx context type. */ - -: 527: struct rx_context_t { - -: 528: union { - -: 529: uint32_t align_4_byte; /* Force 4-byte alignment. */ - -: 530: uint8_t buffer[MBED_CONF_MUX_BUFFER_SIZE]; /* Rx buffer. */ - -: 531: }; - -: 532: uint8_t offset; /* Offset in the buffer where to read to. */ - -: 533: uint8_t read_length; /* Amount to read in number of bytes. */ - -: 534: RxState rx_state; /* Rx state machine current state. */ - -: 535: }; - -: 536: - -: 537: /* Definition for state type. */ - -: 538: struct state_t { - -: 539: uint16_t is_mux_open : 1; /* True when multiplexer is open. */ - -: 540: uint16_t is_mux_open_pending : 1; /* True when multiplexer open is pending. */ - -: 541: uint16_t is_mux_open_running : 1; /* True when multiplexer open is running. */ - -: 542: uint16_t is_dlci_open_pending : 1; /* True when DLCI open is pending. */ - -: 543: uint16_t is_dlci_open_running : 1; /* True when DLCI open is running. */ - -: 544: uint16_t is_system_thread_context : 1; /* True when current context is system thread context. */ - -: 545: uint16_t is_tx_callback_context : 1; /* True when current context is TX callback context. */ - -: 546: uint16_t is_user_tx_pending : 1; /* True when user TX is pending. */ - -: 547: uint16_t is_user_rx_ready : 1; /* True when user RX is ready/available. */ - -: 548: }; - -: 549: - -: 550: static FileHandle* _serial; /* Serial used. */ - -: 551: static events::EventQueue* _event_q; /* Event queue used. */ - -: 552: static rtos::Semaphore _semaphore; /* Semaphore used. */ - -: 553: static PlatformMutex _mutex; /* Mutex used. */ - -: 554: static MuxDataService _mux_objects[MBED_CONF_MUX_DLCI_COUNT]; /* Number of supported DLCIs. */ - -: 555: static tx_context_t _tx_context; /* Tx context. */ - -: 556: static rx_context_t _rx_context; /* Rx context. */ - -: 557: static state_t _state; /* General state context. */ - -: 558: static const uint8_t _crctable[MUX_CRC_TABLE_LEN]; /* CRC table used for frame FCS. */ - -: 559: static uint8_t _shared_memory; /* Shared memory used passing data between user and - -: 560: system threads. */ - -: 561:}; - -: 562: - -: 563:} // namespace mbed - -: 564: - -: 565:#endif diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/mbed_mux_data_service.cpp.gcov b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/mbed_mux_data_service.cpp.gcov deleted file mode 100644 index c14d436eb8..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/mbed_mux_data_service.cpp.gcov +++ /dev/null @@ -1,58 +0,0 @@ - -: 0:Source:../../../framework/mux/mbed_mux_data_service.cpp - -: 0:Graph:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcno - -: 0:Data:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:/* - -: 2: * Copyright (c) , Arm Limited and affiliates. - -: 3: * SPDX-License-Identifier: Apache-2.0 - -: 4: * - -: 5: * Licensed under the Apache License, Version 2.0 (the "License"); - -: 6: * you may not use this file except in compliance with the License. - -: 7: * You may obtain a copy of the License at - -: 8: * - -: 9: * http://www.apache.org/licenses/LICENSE-2.0 - -: 10: * - -: 11: * Unless required by applicable law or agreed to in writing, software - -: 12: * distributed under the License is distributed on an "AS IS" BASIS, - -: 13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -: 14: * See the License for the specific language governing permissions and - -: 15: * limitations under the License. - -: 16: */ - -: 17:#include "mbed_mux.h" - -: 18: - -: 19:namespace mbed - -: 20:{ - -: 21: - 1: 22:ssize_t MuxDataService::write(const void* buffer, size_t size) - -: 23:{ - 1: 24: return Mux::user_data_tx(_dlci, buffer, size); - -: 25:} - -: 26: - -: 27: - 1: 28:ssize_t MuxDataService::read(void *buffer, size_t size) - -: 29:{ - 1: 30: return Mux::user_data_rx(buffer, size); - -: 31:} - -: 32: - -: 33: - 1: 34:off_t MuxDataService::seek(off_t offset, int whence) - -: 35:{ - 1: 36: MBED_ASSERT(false); - 1: 37: return 0; - -: 38:} - -: 39: - -: 40: - 1: 41:int MuxDataService::close() - -: 42:{ - 1: 43: MBED_ASSERT(false); - 1: 44: return 0; - -: 45:} - -: 46: - -: 47: - 1: 48:void MuxDataService::sigio(Callback func) - -: 49:{ - 1: 50: _sigio_cb = func; - 1: 51:} - -: 52: - -: 53:} // namespace mbed diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/new.gcov b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/new.gcov deleted file mode 100644 index e23a55be1e..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/gcov/new.gcov +++ /dev/null @@ -1,147 +0,0 @@ - -: 0:Source:/usr/include/c++/5/new - -: 0:Graph:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcno - -: 0:Data:objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcda - -: 0:Runs:1 - -: 0:Programs:1 - -: 1:// The -*- C++ -*- dynamic memory management header. - -: 2: - -: 3:// Copyright (C) 1994-2015 Free Software Foundation, Inc. - -: 4: - -: 5:// This file is part of GCC. - -: 6:// - -: 7:// GCC is free software; you can redistribute it and/or modify - -: 8:// it under the terms of the GNU General Public License as published by - -: 9:// the Free Software Foundation; either version 3, or (at your option) - -: 10:// any later version. - -: 11:// - -: 12:// GCC is distributed in the hope that it will be useful, - -: 13:// but WITHOUT ANY WARRANTY; without even the implied warranty of - -: 14:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - -: 15:// GNU General Public License for more details. - -: 16:// - -: 17:// Under Section 7 of GPL version 3, you are granted additional - -: 18:// permissions described in the GCC Runtime Library Exception, version - -: 19:// 3.1, as published by the Free Software Foundation. - -: 20: - -: 21:// You should have received a copy of the GNU General Public License and - -: 22:// a copy of the GCC Runtime Library Exception along with this program; - -: 23:// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - -: 24:// . - -: 25: - -: 26:/** @file new - -: 27: * This is a Standard C++ Library header. - -: 28: * - -: 29: * The header @c new defines several functions to manage dynamic memory and - -: 30: * handling memory allocation errors; see - -: 31: * http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more. - -: 32: */ - -: 33: - -: 34:#ifndef _NEW - -: 35:#define _NEW - -: 36: - -: 37:#pragma GCC system_header - -: 38: - -: 39:#include - -: 40:#include - -: 41: - -: 42:#pragma GCC visibility push(default) - -: 43: - -: 44:extern "C++" { - -: 45: - -: 46:namespace std - -: 47:{ - -: 48: /** - -: 49: * @brief Exception possibly thrown by @c new. - -: 50: * @ingroup exceptions - -: 51: * - -: 52: * @c bad_alloc (or classes derived from it) is used to report allocation - -: 53: * errors from the throwing forms of @c new. */ - -: 54: class bad_alloc : public exception - -: 55: { - -: 56: public: - -: 57: bad_alloc() throw() { } - -: 58: - -: 59: // This declaration is not useless: - -: 60: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - -: 61: virtual ~bad_alloc() throw(); - -: 62: - -: 63: // See comment in eh_exception.cc. - -: 64: virtual const char* what() const throw(); - -: 65: }; - -: 66: - -: 67:#if __cplusplus >= 201103L - -: 68: class bad_array_new_length : public bad_alloc - -: 69: { - -: 70: public: - -: 71: bad_array_new_length() throw() { }; - -: 72: - -: 73: // This declaration is not useless: - -: 74: // http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118 - -: 75: virtual ~bad_array_new_length() throw(); - -: 76: - -: 77: // See comment in eh_exception.cc. - -: 78: virtual const char* what() const throw(); - -: 79: }; - -: 80:#endif - -: 81: - -: 82: struct nothrow_t { }; - -: 83: - -: 84: extern const nothrow_t nothrow; - -: 85: - -: 86: /** If you write your own error handler to be called by @c new, it must - -: 87: * be of this type. */ - -: 88: typedef void (*new_handler)(); - -: 89: - -: 90: /// Takes a replacement handler as the argument, returns the - -: 91: /// previous handler. - -: 92: new_handler set_new_handler(new_handler) throw(); - -: 93: - -: 94:#if __cplusplus >= 201103L - -: 95: /// Return the current new handler. - -: 96: new_handler get_new_handler() noexcept; - -: 97:#endif - -: 98:} // namespace std - -: 99: - -: 100://@{ - -: 101:/** These are replaceable signatures: - -: 102: * - normal single new and delete (no arguments, throw @c bad_alloc on error) - -: 103: * - normal array new and delete (same) - -: 104: * - @c nothrow single new and delete (take a @c nothrow argument, return - -: 105: * @c NULL on error) - -: 106: * - @c nothrow array new and delete (same) - -: 107: * - -: 108: * Placement new and delete signatures (take a memory address argument, - -: 109: * does nothing) may not be replaced by a user's program. - -: 110:*/ - -: 111:void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) - -: 112: __attribute__((__externally_visible__)); - -: 113:void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc) - -: 114: __attribute__((__externally_visible__)); - -: 115:void operator delete(void*) _GLIBCXX_USE_NOEXCEPT - -: 116: __attribute__((__externally_visible__)); - -: 117:void operator delete[](void*) _GLIBCXX_USE_NOEXCEPT - -: 118: __attribute__((__externally_visible__)); - -: 119:void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 120: __attribute__((__externally_visible__)); - -: 121:void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 122: __attribute__((__externally_visible__)); - -: 123:void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 124: __attribute__((__externally_visible__)); - -: 125:void operator delete[](void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT - -: 126: __attribute__((__externally_visible__)); - -: 127: - -: 128:// Default placement versions of operator new. - #####: 129:inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT - #####: 130:{ return __p; } - -: 131:inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT - -: 132:{ return __p; } - -: 133: - -: 134:// Default placement versions of operator delete. - #####: 135:inline void operator delete (void*, void*) _GLIBCXX_USE_NOEXCEPT { } - -: 136:inline void operator delete[](void*, void*) _GLIBCXX_USE_NOEXCEPT { } - -: 137://@} - -: 138:} // extern "C++" - -: 139: - -: 140:#pragma GCC visibility pop - -: 141: - -: 142:#endif diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/lib/libmbed_mux_data_service_unit.a b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/lib/libmbed_mux_data_service_unit.a deleted file mode 100644 index 88a2a083db..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/lib/libmbed_mux_data_service_unit.a and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/mbed_mux_data_service_unit_tests b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/mbed_mux_data_service_unit_tests deleted file mode 100755 index 09d7d8b6d6..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/mbed_mux_data_service_unit_tests and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/mbed_mux_data_service_unit_tests.txt b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/mbed_mux_data_service_unit_tests.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/mbed_mux_data_servicetest.cpp b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/mbed_mux_data_servicetest.cpp deleted file mode 100644 index 9d35cf7ff4..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/mbed_mux_data_servicetest.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2015 ARM. All rights reserved. - */ -#include "CppUTest/TestHarness.h" -#include "test_mbed_mux_data_service.h" - -TEST_GROUP(mbed_mux_data_service) -{ - Test_mbed_mux_data_service* unit; - - void setup() - { - unit = new Test_mbed_mux_data_service(); - } - - void teardown() - { - delete unit; - } -}; - -TEST(mbed_mux_data_service, Create) -{ - CHECK(unit != NULL); -} - -TEST(mbed_mux_data_service, test_mbed_mux_write) -{ - unit->test_mbed_mux_write(); -} - -TEST(mbed_mux_data_service, test_mbed_mux_read) -{ - unit->test_mbed_mux_read(); -} - -TEST(mbed_mux_data_service, test_mbed_mux_seek) -{ - unit->test_mbed_mux_seek(); -} - -TEST(mbed_mux_data_service, test_mbed_mux_close) -{ - unit->test_mbed_mux_close(); -} - -TEST(mbed_mux_data_service, test_mbed_mux_sigio) -{ - unit->test_mbed_mux_sigio(); -} diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.d b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.d deleted file mode 100644 index 19570c6213..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.d +++ /dev/null @@ -1,42 +0,0 @@ -objs/mbed_mux_data_service_unit/FileHandle_stub.o: \ - ../../stubs/FileHandle_stub.cpp ../../stubs/FileHandle_stub.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h - -../../stubs/FileHandle_stub.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.gcda b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.gcda deleted file mode 100644 index 4ec71f5abe..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.gcno b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.gcno deleted file mode 100644 index 585c5c93c0..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.o b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.o deleted file mode 100644 index 07dc67586e..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/FileHandle_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.d b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.d deleted file mode 100644 index b14289d5b1..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.d +++ /dev/null @@ -1 +0,0 @@ -objs/mbed_mux_data_service_unit/main.o: main.cpp diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.gcda b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.gcda deleted file mode 100644 index 8601216976..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.gcno b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.gcno deleted file mode 100644 index 01aee5e93b..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.o b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.o deleted file mode 100644 index 0bffe8ea09..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/main.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.d b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.d deleted file mode 100644 index 509e30caba..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.d +++ /dev/null @@ -1,7 +0,0 @@ -objs/mbed_mux_data_service_unit/mbed_assert_stub.o: \ - ../../stubs/mbed_assert_stub.cpp ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.gcda b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.gcda deleted file mode 100644 index 047706e21c..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.gcno b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.gcno deleted file mode 100644 index 75083a4012..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.o b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.o deleted file mode 100644 index 0399dcee9c..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_assert_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.d b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.d deleted file mode 100644 index 59690d6dfa..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.d +++ /dev/null @@ -1,73 +0,0 @@ -objs/mbed_mux_data_service_unit/mbed_mux_data_service.o: \ - ../../../framework/mux/mbed_mux_data_service.cpp \ - ../../../framework/mux/mbed_mux.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h ../../../../../rtos/Semaphore.h \ - ../../target_h/cmsis_os2.h ../../target_h/mbed_rtos1_types.h \ - ../../target_h/mbed_rtos_storage.h ../../target_h/cmsis_os2.h \ - ../../target_h/rtx_os.h ../../target_h/rtx_lib.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h - -../../../framework/mux/mbed_mux.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../rtos/Semaphore.h: - -../../target_h/cmsis_os2.h: - -../../target_h/mbed_rtos1_types.h: - -../../target_h/mbed_rtos_storage.h: - -../../target_h/cmsis_os2.h: - -../../target_h/rtx_os.h: - -../../target_h/rtx_lib.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcda b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcda deleted file mode 100644 index 678d1d9bec..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcno b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcno deleted file mode 100644 index 40a3721422..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.o b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.o deleted file mode 100644 index a66f01bfc4..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_service.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.d b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.d deleted file mode 100644 index 1e4e4c91b2..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.d +++ /dev/null @@ -1,4 +0,0 @@ -objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.o: \ - mbed_mux_data_servicetest.cpp test_mbed_mux_data_service.h - -test_mbed_mux_data_service.h: diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.gcda b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.gcda deleted file mode 100644 index 059e275d5e..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.gcno b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.gcno deleted file mode 100644 index b611ad804b..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.o b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.o deleted file mode 100644 index daa950003f..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_data_servicetest.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.d b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.d deleted file mode 100644 index 1372f66c9d..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.d +++ /dev/null @@ -1,75 +0,0 @@ -objs/mbed_mux_data_service_unit/mbed_mux_stub.o: \ - ../../stubs/mbed_mux_stub.cpp ../../../framework/mux/mbed_mux.h \ - ../../../../../platform/FileHandle.h ../../../../../platform/Callback.h \ - ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h ../../../../../rtos/Semaphore.h \ - ../../target_h/cmsis_os2.h ../../target_h/mbed_rtos1_types.h \ - ../../target_h/mbed_rtos_storage.h ../../target_h/cmsis_os2.h \ - ../../target_h/rtx_os.h ../../target_h/rtx_lib.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../stubs/mbed_mux_stub.h - -../../../framework/mux/mbed_mux.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../rtos/Semaphore.h: - -../../target_h/cmsis_os2.h: - -../../target_h/mbed_rtos1_types.h: - -../../target_h/mbed_rtos_storage.h: - -../../target_h/cmsis_os2.h: - -../../target_h/rtx_os.h: - -../../target_h/rtx_lib.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../stubs/mbed_mux_stub.h: diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.gcda b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.gcda deleted file mode 100644 index 562a8be598..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.gcno b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.gcno deleted file mode 100644 index f31aecd55d..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.o b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.o deleted file mode 100644 index 0b5552c315..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/mbed_mux_stub.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.d b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.d deleted file mode 100644 index 7994df72a7..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.d +++ /dev/null @@ -1,77 +0,0 @@ -objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.o: \ - test_mbed_mux_data_service.cpp test_mbed_mux_data_service.h \ - ../../../framework/mux/mbed_mux.h ../../../../../platform/FileHandle.h \ - ../../../../../platform/Callback.h ../../../../../platform/mbed_assert.h \ - ../../../../../platform/mbed_preprocessor.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_poll.h ../../../../../platform/platform.h \ - ../../target_h/platform/mbed_retarget.h ../../target_h/device.h \ - ../../target_h/PinNames.h ../../target_h/PeripheralNames.h \ - ../../../../../platform/NonCopyable.h \ - ../../../../../platform/mbed_toolchain.h \ - ../../../../../platform/mbed_debug.h \ - ../../../../../platform/PlatformMutex.h ../../../../../rtos/Semaphore.h \ - ../../target_h/cmsis_os2.h ../../target_h/mbed_rtos1_types.h \ - ../../target_h/mbed_rtos_storage.h ../../target_h/cmsis_os2.h \ - ../../target_h/rtx_os.h ../../target_h/rtx_lib.h \ - ../../../../../events/EventQueue.h ../../../../../events/equeue/equeue.h \ - ../../../../../events/equeue/equeue_platform.h \ - ../../../../../platform/Callback.h ../../stubs/mbed_mux_stub.h - -test_mbed_mux_data_service.h: - -../../../framework/mux/mbed_mux.h: - -../../../../../platform/FileHandle.h: - -../../../../../platform/Callback.h: - -../../../../../platform/mbed_assert.h: - -../../../../../platform/mbed_preprocessor.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_poll.h: - -../../../../../platform/platform.h: - -../../target_h/platform/mbed_retarget.h: - -../../target_h/device.h: - -../../target_h/PinNames.h: - -../../target_h/PeripheralNames.h: - -../../../../../platform/NonCopyable.h: - -../../../../../platform/mbed_toolchain.h: - -../../../../../platform/mbed_debug.h: - -../../../../../platform/PlatformMutex.h: - -../../../../../rtos/Semaphore.h: - -../../target_h/cmsis_os2.h: - -../../target_h/mbed_rtos1_types.h: - -../../target_h/mbed_rtos_storage.h: - -../../target_h/cmsis_os2.h: - -../../target_h/rtx_os.h: - -../../target_h/rtx_lib.h: - -../../../../../events/EventQueue.h: - -../../../../../events/equeue/equeue.h: - -../../../../../events/equeue/equeue_platform.h: - -../../../../../platform/Callback.h: - -../../stubs/mbed_mux_stub.h: diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.gcda b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.gcda deleted file mode 100644 index b28023ce8c..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.gcda and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.gcno b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.gcno deleted file mode 100644 index 483ce79ef8..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.gcno and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.o b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.o deleted file mode 100644 index 2bbe4d7ba4..0000000000 Binary files a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/objs/mbed_mux_data_service_unit/test_mbed_mux_data_service.o and /dev/null differ diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/test_mbed_mux_data_service.cpp b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/test_mbed_mux_data_service.cpp deleted file mode 100644 index 959ed66a24..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/test_mbed_mux_data_service.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2018 ARM. All rights reserved. - */ -#include "CppUTest/TestHarness.h" -#include "test_mbed_mux_data_service.h" -#include "mbed_mux.h" -#include "mbed_mux_stub.h" -#include - -using namespace mbed; - -Test_mbed_mux_data_service::Test_mbed_mux_data_service() -{ - -} - -Test_mbed_mux_data_service::~Test_mbed_mux_data_service() -{ -} - -void Test_mbed_mux_data_service::test_mbed_mux_write() -{ - MuxDataService mux; - char table[] = "ss"; - mbed_mux_stub::size_value = 6; - CHECK(6 == mux.write(table, 2)); -} - -void Test_mbed_mux_data_service::test_mbed_mux_read() -{ - MuxDataService mux; - char table[6]; - - mbed_mux_stub::size_value = 67; - CHECK(67 == mux.read(table, 6)); -} - -void Test_mbed_mux_data_service::test_mbed_mux_seek() -{ - MuxDataService mux; - CHECK(0 == mux.seek(0)); -} - -void Test_mbed_mux_data_service::test_mbed_mux_close() -{ - MuxDataService mux; - CHECK(0 == mux.close()); -} - -void cb() -{ - -} - -void Test_mbed_mux_data_service::test_mbed_mux_sigio() -{ - MuxDataService mux; - mux.sigio(cb); -} - diff --git a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/test_mbed_mux_data_service.h b/features/cellular/UNITTESTS/mux/mbed_mux_data_service/test_mbed_mux_data_service.h deleted file mode 100644 index b09aca71d8..0000000000 --- a/features/cellular/UNITTESTS/mux/mbed_mux_data_service/test_mbed_mux_data_service.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2018 ARM. All rights reserved. - */ -#ifndef TEST_MBED_MUX_DATA_SERVICE_H -#define TEST_MBED_MUX_DATA_SERVICE_H - -class Test_mbed_mux_data_service -{ -public: - Test_mbed_mux_data_service(); - - virtual ~Test_mbed_mux_data_service(); - - void test_mbed_mux_write(); - - void test_mbed_mux_read(); - - void test_mbed_mux_seek(); - - void test_mbed_mux_close(); - - void test_mbed_mux_sigio(); -}; - -#endif // TEST_MBED_MUX_DATA_SERVICE_H - diff --git a/features/cellular/UNITTESTS/stubs/mbed_mux_stub.cpp b/features/cellular/UNITTESTS/stubs/cellular_mux_stub.cpp similarity index 60% rename from features/cellular/UNITTESTS/stubs/mbed_mux_stub.cpp rename to features/cellular/UNITTESTS/stubs/cellular_mux_stub.cpp index b82d9ab782..8435425130 100644 --- a/features/cellular/UNITTESTS/stubs/mbed_mux_stub.cpp +++ b/features/cellular/UNITTESTS/stubs/cellular_mux_stub.cpp @@ -1,11 +1,11 @@ -#include "mbed_mux.h" -#include "mbed_mux_stub.h" +#include "cellular_mux.h" +#include "cellular_mux_stub.h" using namespace mbed; -ssize_t mbed_mux_stub::size_value = 0; -Mux::MuxReturnStatus mbed_mux_stub::status_value = Mux::MUX_STATUS_SUCCESS; +ssize_t cellular_mux_stub::size_value = 0; +Mux::MuxReturnStatus cellular_mux_stub::status_value = Mux::MUX_STATUS_SUCCESS; void Mux::module_init() @@ -15,12 +15,12 @@ void Mux::module_init() Mux::MuxReturnStatus Mux::mux_start(MuxEstablishStatus &status) { - return mbed_mux_stub::status_value; + return cellular_mux_stub::status_value; } Mux::MuxReturnStatus Mux::dlci_establish(uint8_t dlci_id, MuxEstablishStatus &status, FileHandle **obj) { - return mbed_mux_stub::status_value; + return cellular_mux_stub::status_value; } void Mux::serial_attach(FileHandle *serial) @@ -36,11 +36,11 @@ void Mux::eventqueue_attach(events::EventQueue *event_queue) //Private functions are needed because those are static ssize_t Mux::user_data_tx(uint8_t dlci_id, const void* buffer, size_t size) { - return mbed_mux_stub::size_value; + return cellular_mux_stub::size_value; } ssize_t Mux::user_data_rx(void* buffer, size_t size) { - return mbed_mux_stub::size_value; + return cellular_mux_stub::size_value; } diff --git a/features/cellular/UNITTESTS/stubs/mbed_mux_stub.h b/features/cellular/UNITTESTS/stubs/cellular_mux_stub.h similarity index 56% rename from features/cellular/UNITTESTS/stubs/mbed_mux_stub.h rename to features/cellular/UNITTESTS/stubs/cellular_mux_stub.h index a2324f9a05..649970abbe 100644 --- a/features/cellular/UNITTESTS/stubs/mbed_mux_stub.h +++ b/features/cellular/UNITTESTS/stubs/cellular_mux_stub.h @@ -1,9 +1,9 @@ -#ifndef __MBED_MUX_STUB_H__ -#define __MBED_MUX_STUB_H__ +#ifndef __cellular_mux_STUB_H__ +#define __cellular_mux_STUB_H__ #include -namespace mbed_mux_stub +namespace cellular_mux_stub { extern ssize_t size_value; extern mbed::Mux::MuxReturnStatus status_value; diff --git a/features/cellular/framework/mux/mbed_mux.cpp b/features/cellular/framework/mux/cellular_mux.cpp similarity index 99% rename from features/cellular/framework/mux/mbed_mux.cpp rename to features/cellular/framework/mux/cellular_mux.cpp index 08b40849ec..2d37c72401 100644 --- a/features/cellular/framework/mux/mbed_mux.cpp +++ b/features/cellular/framework/mux/cellular_mux.cpp @@ -16,7 +16,7 @@ */ #include -#include "mbed_mux.h" +#include "cellular_mux.h" #include "mbed_retarget.h" using namespace rtos; diff --git a/features/cellular/framework/mux/mbed_mux.h b/features/cellular/framework/mux/cellular_mux.h similarity index 100% rename from features/cellular/framework/mux/mbed_mux.h rename to features/cellular/framework/mux/cellular_mux.h diff --git a/features/cellular/framework/mux/mbed_mux_data_service.cpp b/features/cellular/framework/mux/cellular_mux_data_service.cpp similarity index 97% rename from features/cellular/framework/mux/mbed_mux_data_service.cpp rename to features/cellular/framework/mux/cellular_mux_data_service.cpp index 48f7c86922..915779fd91 100644 --- a/features/cellular/framework/mux/mbed_mux_data_service.cpp +++ b/features/cellular/framework/mux/cellular_mux_data_service.cpp @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "mbed_mux.h" +#include "cellular_mux.h" namespace mbed {