Skip to content

Commit 9ef2d0d

Browse files
author
Mirela Chirica
committed
Cellular: Fix information greentea tests for BC95 modem
1 parent 8db370c commit 9ef2d0d

File tree

1 file changed

+5
-1
lines changed
  • features/cellular/TESTS/api/cellular_information

1 file changed

+5
-1
lines changed

features/cellular/TESTS/api/cellular_information/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
#include "mbed.h"
3939

40+
41+
#include "AT_CellularInformation.h"
4042
#include "CellularConnectionFSM.h"
4143
#include "CellularDevice.h"
4244
#include "../../cellular_tests_common.h"
@@ -81,7 +83,9 @@ static void test_information_interface()
8183
TEST_ASSERT(info->get_manufacturer(buf, kbuf_size) == NSAPI_ERROR_OK);
8284
TEST_ASSERT(info->get_model(buf, kbuf_size) == NSAPI_ERROR_OK);
8385
TEST_ASSERT(info->get_revision(buf, kbuf_size) == NSAPI_ERROR_OK);
84-
TEST_ASSERT(info->get_serial_number(buf, kbuf_size, CellularInformation::SN) == NSAPI_ERROR_OK);
86+
TEST_ASSERT((info->get_serial_number(buf, kbuf_size, CellularInformation::SN) == NSAPI_ERROR_OK) ||
87+
((((AT_CellularInformation *)info)->get_device_error().errType == 3) && // 3 == CME error from the modem
88+
(((AT_CellularInformation *)info)->get_device_error().errCode == 4))); // 4 == "operation not supported"
8589

8690
nsapi_error_t err = info->get_serial_number(buf, kbuf_size, CellularInformation::IMEI);
8791
TEST_ASSERT(err == NSAPI_ERROR_UNSUPPORTED || err == NSAPI_ERROR_OK);

0 commit comments

Comments
 (0)