From 1bc84404b29cde2e84bfcac0fe41e0c7f34748ba Mon Sep 17 00:00:00 2001 From: Ari Parkkila Date: Wed, 28 Nov 2018 23:35:43 -0800 Subject: [PATCH] Cellular: Removed set_power_level() --- .../at_cellularpower/at_cellularpowertest.cpp | 16 ---------------- UNITTESTS/stubs/AT_CellularPower_stub.cpp | 5 ----- .../TESTS/api/cellular_power/main.cpp | 2 -- .../cellular/framework/API/CellularPower.h | 19 ------------------- .../framework/AT/AT_CellularPower.cpp | 10 ---------- .../cellular/framework/AT/AT_CellularPower.h | 2 -- 6 files changed, 54 deletions(-) diff --git a/UNITTESTS/features/cellular/framework/AT/at_cellularpower/at_cellularpowertest.cpp b/UNITTESTS/features/cellular/framework/AT/at_cellularpower/at_cellularpowertest.cpp index eae2eb16b8..d92636bb88 100644 --- a/UNITTESTS/features/cellular/framework/AT/at_cellularpower/at_cellularpowertest.cpp +++ b/UNITTESTS/features/cellular/framework/AT/at_cellularpower/at_cellularpowertest.cpp @@ -75,22 +75,6 @@ TEST_F(TestAT_CellularPower, test_AT_CellularPower_off) EXPECT_TRUE(NSAPI_ERROR_UNSUPPORTED == pow.off()); } -TEST_F(TestAT_CellularPower, test_AT_CellularPower_set_power_level) -{ - EventQueue que; - FileHandle_stub fh1; - ATHandler at(&fh1, que, 0, ","); - - AT_CellularPower pow(at); - ATHandler_stub::nsapi_error_value = NSAPI_ERROR_OK; - EXPECT_TRUE(NSAPI_ERROR_OK == pow.set_power_level(6)); - EXPECT_TRUE(NSAPI_ERROR_OK == pow.set_power_level(1, 1)); - EXPECT_TRUE(NSAPI_ERROR_OK == pow.set_power_level(1, 0)); - - ATHandler_stub::nsapi_error_value = NSAPI_ERROR_DEVICE_ERROR; - EXPECT_TRUE(NSAPI_ERROR_DEVICE_ERROR == pow.set_power_level(6)); -} - TEST_F(TestAT_CellularPower, test_AT_CellularPower_reset) { EventQueue que; diff --git a/UNITTESTS/stubs/AT_CellularPower_stub.cpp b/UNITTESTS/stubs/AT_CellularPower_stub.cpp index 6b544ff407..a4e9c52b62 100644 --- a/UNITTESTS/stubs/AT_CellularPower_stub.cpp +++ b/UNITTESTS/stubs/AT_CellularPower_stub.cpp @@ -40,11 +40,6 @@ nsapi_error_t AT_CellularPower::off() return NSAPI_ERROR_OK; } -nsapi_error_t AT_CellularPower::set_power_level(int func_level, int do_reset) -{ - return NSAPI_ERROR_OK; -} - nsapi_error_t AT_CellularPower::reset() { return NSAPI_ERROR_OK; diff --git a/features/cellular/TESTS/api/cellular_power/main.cpp b/features/cellular/TESTS/api/cellular_power/main.cpp index a043479c06..000e4ed480 100644 --- a/features/cellular/TESTS/api/cellular_power/main.cpp +++ b/features/cellular/TESTS/api/cellular_power/main.cpp @@ -81,8 +81,6 @@ static void test_power_interface() TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED); wait_for_power(pwr); - TEST_ASSERT(pwr->set_power_level(1, 0) == NSAPI_ERROR_OK); - err = pwr->reset(); TEST_ASSERT(err == NSAPI_ERROR_OK); wait_for_power(pwr); diff --git a/features/cellular/framework/API/CellularPower.h b/features/cellular/framework/API/CellularPower.h index 32420bee88..59dc83aca7 100644 --- a/features/cellular/framework/API/CellularPower.h +++ b/features/cellular/framework/API/CellularPower.h @@ -58,25 +58,6 @@ public: */ virtual nsapi_error_t off() = 0; - /** Set cellular device power level by enabling/disabling functionality. - * - * @param func_level: - * 0 minimum functionality - * 1 full functionality. Enable (turn on) the transmit and receive RF circuits for all supported radio access technologies. - * For MTs supporting +CSRA, this equals the RATs indicated by the response of +CSRA=?. Current +CSRA setting is ignored. - * It is not required that the MT transmit and receive RF circuits are in a disabled state for this setting to have effect. - * 2 disable (turn off) MT transmit RF circuits only - * 3 disable (turn off) MT receive RF circuits only - * 4 disable (turn off) both MT transmit and receive RF circuits - * @param do_reset 0 for do not reset, 1 for reset the device when changing the functionality - * - * @remark See 3GPP TS 27.007 CFUN for more details - * - * @return NSAPI_ERROR_OK on success - * NSAPI_ERROR_DEVICE_ERROR on failure - */ - virtual nsapi_error_t set_power_level(int func_level, int do_reset = 0) = 0; - /** Reset and wake-up cellular device. * * @return NSAPI_ERROR_OK on success diff --git a/features/cellular/framework/AT/AT_CellularPower.cpp b/features/cellular/framework/AT/AT_CellularPower.cpp index af0feb9c16..4be451cdea 100644 --- a/features/cellular/framework/AT/AT_CellularPower.cpp +++ b/features/cellular/framework/AT/AT_CellularPower.cpp @@ -42,16 +42,6 @@ nsapi_error_t AT_CellularPower::off() return NSAPI_ERROR_UNSUPPORTED; } -nsapi_error_t AT_CellularPower::set_power_level(int func_level, int do_reset) -{ - _at.lock(); - _at.cmd_start("AT+CFUN="); - _at.write_int(func_level); - _at.write_int(do_reset); - _at.cmd_stop_read_resp(); - return _at.unlock_return_error(); -} - nsapi_error_t AT_CellularPower::reset() { _at.lock(); diff --git a/features/cellular/framework/AT/AT_CellularPower.h b/features/cellular/framework/AT/AT_CellularPower.h index e88dfa6280..cd7dc21b20 100644 --- a/features/cellular/framework/AT/AT_CellularPower.h +++ b/features/cellular/framework/AT/AT_CellularPower.h @@ -38,8 +38,6 @@ public: virtual nsapi_error_t off(); - virtual nsapi_error_t set_power_level(int func_level, int do_reset = 0); - virtual nsapi_error_t reset(); };