diff --git a/features/cellular/TESTS/api/cellular_information/main.cpp b/features/cellular/TESTS/api/cellular_information/main.cpp index 48f6468fa4..7f8607afd2 100644 --- a/features/cellular/TESTS/api/cellular_information/main.cpp +++ b/features/cellular/TESTS/api/cellular_information/main.cpp @@ -37,6 +37,8 @@ #include "mbed.h" + +#include "AT_CellularInformation.h" #include "CellularConnectionFSM.h" #include "CellularDevice.h" #include "../../cellular_tests_common.h" @@ -81,7 +83,9 @@ static void test_information_interface() TEST_ASSERT(info->get_manufacturer(buf, kbuf_size) == NSAPI_ERROR_OK); TEST_ASSERT(info->get_model(buf, kbuf_size) == NSAPI_ERROR_OK); TEST_ASSERT(info->get_revision(buf, kbuf_size) == NSAPI_ERROR_OK); - TEST_ASSERT(info->get_serial_number(buf, kbuf_size, CellularInformation::SN) == NSAPI_ERROR_OK); + TEST_ASSERT((info->get_serial_number(buf, kbuf_size, CellularInformation::SN) == NSAPI_ERROR_OK) || + ((((AT_CellularInformation *)info)->get_device_error().errType == 3) && // 3 == CME error from the modem + (((AT_CellularInformation *)info)->get_device_error().errCode == 4))); // 4 == "operation not supported" nsapi_error_t err = info->get_serial_number(buf, kbuf_size, CellularInformation::IMEI); TEST_ASSERT(err == NSAPI_ERROR_UNSUPPORTED || err == NSAPI_ERROR_OK);