Skip to content

Commit 0533254

Browse files
author
Antti Kauppila
authored
Merge pull request #11992 from AnttiKauppila/feature-cellular
Feature cellular: Optimising memory footprint
2 parents 24c6c4c + 0bd6135 commit 0533254

File tree

111 files changed

+677
-946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+677
-946
lines changed

UNITTESTS/features/cellular/framework/AT/at_cellularbase/at_cellularbasetest.cpp

Lines changed: 0 additions & 159 deletions
This file was deleted.

UNITTESTS/features/cellular/framework/AT/at_cellularbase/unittest.cmake

Lines changed: 0 additions & 30 deletions
This file was deleted.

UNITTESTS/features/cellular/framework/AT/at_cellularcontext/at_cellularcontexttest.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include "AT_CellularStack.h"
2727
#include "Semaphore_stub.h"
2828
#include "CellularDevice_stub.h"
29+
#include "AT_CellularDevice_stub.h"
2930
#include "equeue_stub.h"
30-
#include "AT_CellularBase_stub.h"
3131
#include "CellularUtil_stub.h"
3232
#include "PinNames.h"
3333

@@ -76,7 +76,7 @@ class TestAT_CellularContext : public testing::Test {
7676
// *INDENT-ON*
7777
class my_stack : public AT_CellularStack {
7878
public:
79-
my_stack(ATHandler &atHandler) : AT_CellularStack(atHandler, 1, IPV4_STACK) {}
79+
my_stack(ATHandler &atHandler, AT_CellularDevice &device) : AT_CellularStack(atHandler, 1, IPV4_STACK, device) {}
8080
virtual int get_max_socket_count()
8181
{
8282
return 1;
@@ -117,9 +117,9 @@ class my_stack : public AT_CellularStack {
117117
class my_AT_CTX : public AT_CellularContext {
118118
public:
119119
my_AT_CTX(ATHandler &at, CellularDevice *device, const char *apn = MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN) :
120-
AT_CellularContext(at, device, apn), _st(at)
120+
AT_CellularContext(at, device, apn), _st(at, *get_device())
121121
{
122-
AT_CellularBase_stub::supported_bool = false;
122+
AT_CellularDevice_stub::supported_bool = false;
123123
}
124124
virtual ~my_AT_CTX() {}
125125

@@ -152,7 +152,7 @@ class my_AT_CTX : public AT_CellularContext {
152152
class my_AT_CTXIPV6 : public AT_CellularContext {
153153
public:
154154
my_AT_CTXIPV6(ATHandler &at, CellularDevice *device, const char *apn = MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN) :
155-
AT_CellularContext(at, device, apn), _st(at) {}
155+
AT_CellularContext(at, device, apn), _st(at, *get_device()) {}
156156
virtual ~my_AT_CTXIPV6() {}
157157
virtual NetworkStack *get_stack()
158158
{
@@ -579,13 +579,13 @@ TEST_F(TestAT_CellularContext, connect_disconnect_sync)
579579
ATHandler_stub::read_string_index = 2;
580580
ASSERT_EQ(ctx1.connect(), NSAPI_ERROR_OK);
581581

582-
AT_CellularBase_stub::supported_bool = true;
582+
AT_CellularDevice_stub::supported_bool = true;
583583
ASSERT_EQ(ctx1.disconnect(), NSAPI_ERROR_OK);
584584
ATHandler_stub::resp_info_true_counter = 1;
585585
ATHandler_stub::read_string_table[1] = (char *)"IPV4V6";
586586
ATHandler_stub::read_string_index = 2;
587587
ASSERT_EQ(ctx1.connect(), NSAPI_ERROR_OK);
588-
AT_CellularBase_stub::supported_bool = false;
588+
AT_CellularDevice_stub::supported_bool = false;
589589

590590
ASSERT_EQ(ctx1.disconnect(), NSAPI_ERROR_OK);
591591
ATHandler_stub::resp_info_true_counter = 1;

UNITTESTS/features/cellular/framework/AT/at_cellularcontext/unittest.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ set(unittest-sources
2121
set(unittest-test-sources
2222
features/cellular/framework/AT/at_cellularcontext/at_cellularcontexttest.cpp
2323
stubs/ATHandler_stub.cpp
24-
stubs/AT_CellularBase_stub.cpp
2524
stubs/AT_CellularDevice_stub.cpp
2625
stubs/AT_CellularStack_stub.cpp
2726
stubs/AT_CellularNetwork_stub.cpp

UNITTESTS/features/cellular/framework/AT/at_cellulardevice/at_cellulardevicetest.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <string.h>
1919
#include "AT_CellularDevice.h"
2020
#include "ATHandler_stub.h"
21-
#include "AT_CellularBase_stub.h"
21+
#include "AT_CellularDevice_stub.h"
2222

2323
using namespace mbed;
2424
using namespace events;
@@ -70,7 +70,6 @@ TEST_F(TestAT_CellularDevice, test_AT_CellularDevice_get_at_handler)
7070
EXPECT_TRUE(dev.open_network(&fh1)); // AT fh1 ref count 2
7171
dev.modem_debug_on(true);
7272
EXPECT_TRUE(dev.open_sms(&fh2));
73-
AT_CellularBase_stub::handler_value = AT_CellularBase_stub::handler_at_constructor_value;
7473
EXPECT_TRUE(dev.open_information(&fh3));
7574
ATHandler_stub::fh_value = &fh1;
7675

@@ -132,7 +131,6 @@ TEST_F(TestAT_CellularDevice, test_AT_CellularDevice_close_network)
132131
AT_CellularDevice dev(&fh1);
133132

134133
EXPECT_TRUE(dev.open_network(&fh1));
135-
AT_CellularBase_stub::handler_value = AT_CellularBase_stub::handler_at_constructor_value;
136134
EXPECT_EQ(ATHandler_stub::ref_count, 1);
137135

138136
dev.close_network();
@@ -144,7 +142,6 @@ TEST_F(TestAT_CellularDevice, test_AT_CellularDevice_close_sms)
144142
AT_CellularDevice dev(&fh1);
145143

146144
EXPECT_TRUE(dev.open_sms(&fh1));
147-
AT_CellularBase_stub::handler_value = AT_CellularBase_stub::handler_at_constructor_value;
148145
EXPECT_EQ(ATHandler_stub::ref_count, 1);
149146

150147
dev.close_sms();
@@ -159,16 +156,11 @@ TEST_F(TestAT_CellularDevice, test_AT_CellularDevice_close_information)
159156
EXPECT_TRUE(dev.open_information(&fh1));
160157

161158
ATHandler_stub::fh_value = NULL;
162-
AT_CellularBase_stub::handler_value = NULL;
163159
dev.close_information();
164160

165-
EventQueue que;
166161
ATHandler_stub::fh_value = &fh1;
167-
ATHandler at(&fh1, que, 0, ",");
168-
AT_CellularBase_stub::handler_value = &at;
169162

170163
EXPECT_TRUE(dev.open_information(&fh1));
171-
AT_CellularBase_stub::handler_value = AT_CellularBase_stub::handler_at_constructor_value;
172164

173165
dev.close_information();
174166

UNITTESTS/features/cellular/framework/AT/at_cellulardevice/unittest.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ set(unittest-test-sources
2929
stubs/AT_CellularSMS_stub.cpp
3030
stubs/AT_CellularInformation_stub.cpp
3131
stubs/CellularUtil_stub.cpp
32-
stubs/AT_CellularBase_stub.cpp
3332
stubs/NetworkInterface_stub.cpp
3433
stubs/NetworkInterfaceDefaults_stub.cpp
3534
stubs/EventQueue_stub.cpp

0 commit comments

Comments
 (0)