ublox-at-cellular-interface
Diff: TESTS/unit_tests/default/main.cpp
- Revision:
- 45:14fb8a6a5c03
- Parent:
- 42:98808477a691
--- a/TESTS/unit_tests/default/main.cpp Mon Jan 06 14:29:40 2020 +0500 +++ b/TESTS/unit_tests/default/main.cpp Thu Apr 09 15:10:07 2020 +0500 @@ -1151,6 +1151,32 @@ #endif #ifdef TARGET_UBLOX_C030_R41XM +void test_set_initial_rat() { + + int currentSelectedRat = -1, currentPreferredRat = -1, currentSecondPreferredRat = -1; + + // Power-up the modem + TEST_ASSERT(interface->init()); + + // Check if modem is registered with network + if (interface->is_registered_csd() || interface->is_registered_psd() || interface->is_registered_eps()) { + tr_error("RAT should only be set in detached state"); + // Deregister from Network + drop_connection(interface); + } + + // Set RAT + TEST_ASSERT(interface->set_modem_rat(UbloxATCellularInterface::LTE_CATM1)); + tr_debug("RAT configured\n"); + + // Get latest set RAT on modem + TEST_ASSERT(interface->get_modem_rat(¤tSelectedRat, ¤tPreferredRat, ¤tSecondPreferredRat)); + tr_debug("new selected RAT: %d\n", currentSelectedRat); + + // Check RAT configured correctly + TEST_ASSERT(currentSelectedRat == UbloxATCellularInterface::LTE_CATM1); +} + void test_mno_profile() { int previous_profile, current_profile; @@ -1250,6 +1276,7 @@ // Test cases Case cases[] = { #ifdef TARGET_UBLOX_C030_R41XM + Case("Set initial RAT test", test_set_initial_rat), Case("MNO profile test", test_mno_profile), Case("edrx test", test_edrx), #endif