Skip to content

Commit d7ecd4a

Browse files
author
Hasnain Virk
authored
Merge pull request #11 from ARMmbed/update_ptr
Update mbed-os pointer
2 parents 7a9f8d2 + 17580e0 commit d7ecd4a

File tree

5 files changed

+24
-57
lines changed

5 files changed

+24
-57
lines changed

Jenkinsfile

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,26 @@ try {
1616

1717
// Map RaaS instances to corresponding test suites
1818
def raas = [
19-
"cellular_smoke_ublox_c027.json": "8072",
20-
"cellular_smoke_mts_dragonfly.json": "8072"
19+
"cellular_smoke_ublox_c027.json": "8072"
20+
// Currently dragonfly is not supported by RAAS, skip it
21+
//"cellular_smoke_mts_dragonfly.json": "8072"
2122
]
2223

2324
// List of targets with supported modem families
2425
def target_families = [
25-
"UBLOX": ["UBLOX_C027"],
26-
"MTS_DRAGONFLY": ["MTS_DRAGONFLY_F411RE"]
26+
"UBLOX": ["UBLOX_C027"]
2727
]
2828

2929
// Supported Modems
3030
def targets = [
31-
"UBLOX_C027",
32-
"UBLOX_C030",
33-
"MTS_DRAGONFLY_F411RE"
31+
"UBLOX_C027"
3432
]
3533

3634
// Map toolchains to compilers
3735
def toolchains = [
3836
ARM: "armcc",
39-
GCC_ARM: "arm-none-eabi-gcc"//,
40-
//IAR: "iar_arm"
37+
GCC_ARM: "arm-none-eabi-gcc",
38+
IAR: "iar_arm"
4139
]
4240

4341
def stepsForParallel = [:]
@@ -89,9 +87,6 @@ def buildStep(target_family, target, compilerLabel, toolchain) {
8987
checkout scm
9088
def config_file = "mbed_app.json"
9189

92-
// Change target type
93-
execute("sed -i 's/\"platform\": .*/\"platform\": \"${target_family}\"/' ${config_file}")
94-
9590
// Activate traces
9691
execute("sed -i 's/\"mbed-trace.enable\": false/\"mbed-trace.enable\": true/' ${config_file}")
9792

@@ -148,9 +143,9 @@ def run_smoke(target_families, raasPort, suite_to_run, toolchains, targets) {
148143
}
149144
}
150145
if ("${suiteName}" == "cellular_smoke_mts_dragonfly") {
151-
execute("python clitest.py --suitedir mbed-clitest-suites/suites/ --suite ${suite_to_run} --type hardware --reset hard --raas 193.208.80.31:${raasPort} --tcdir mbed-clitest-suites/cellular --failure_return_value -vvv -w --log log_${raasPort}_${suiteName}")
146+
execute("python clitest.py --suitedir mbed-clitest-suites/suites/ --suite ${suite_to_run} --type hardware --reset hard --raas 62.44.193.186:${raasPort} --tcdir mbed-clitest-suites/cellular --failure_return_value -vvv -w --log log_${raasPort}_${suiteName}")
152147
} else {
153-
execute("python clitest.py --suitedir mbed-clitest-suites/suites/ --suite ${suite_to_run} --type hardware --reset --raas 193.208.80.31:${raasPort} --tcdir mbed-clitest-suites/cellular --failure_return_value -vvv -w --log log_${raasPort}_${suiteName}")
148+
execute("python clitest.py --suitedir mbed-clitest-suites/suites/ --suite ${suite_to_run} --type hardware --reset --raas 62.44.193.186:${raasPort} --tcdir mbed-clitest-suites/cellular --failure_return_value -vvv -w --log log_${raasPort}_${suiteName}")
154149
}
155150
archive "log_${raasPort}_${suiteName}/**/*"
156151
}

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
# mbed-os-example-cellular
22

3-
For MTS Dragonfly, please change platform section in mbed_app.json as:
43

5-
```json
6-
"config": {
7-
"platform": "MTS_DRAGONFLY"
8-
},
9-
```

main.cpp

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
#include <inttypes.h>
33
#include "mbed.h"
44
#include "BufferedSerial.h"
5-
6-
#define UBLOX 0
7-
#define MTS_DRAGONFLY 1
8-
9-
#if MBED_CONF_APP_PLATFORM == UBLOX
10-
#include "ublox_modem_driver/UbloxCellularInterface.h"
11-
UbloxCellularInterface *iface;
12-
#elif MBED_CONF_APP_PLATFORM == MTS_DRAGONFLY
13-
#include "dragonfly_modem_driver/DragonFlyCellularInterface.h"
14-
DragonFlyCellularInterface *iface;
15-
#endif
5+
#include "ReferenceCellularInterface.h"
166
#include "UDPSocket.h"
177
#include "common_functions.h"
188
#if defined(FEATURE_COMMON_PAL)
@@ -24,6 +14,7 @@ DragonFlyCellularInterface *iface;
2414
#define tr_error(...) (void(0)) //dummies if feature common pal is not added
2515
#endif //defined(FEATURE_COMMON_PAL)
2616

17+
ReferenceCellularInterface iface;
2718
UDPSocket *socket;
2819
static const char *host_name = "2.pool.ntp.org";
2920
static const int port = 123;
@@ -58,24 +49,21 @@ static void unlock()
5849
mtx.unlock();
5950
}
6051

61-
// main() runs in its own thread in the OS
62-
63-
6452
int do_ntp()
6553
{
6654
int ntp_values[12] = { 0 };
6755
time_t TIME1970 = 2208988800U;
6856

6957
UDPSocket sock;
7058

71-
int ret = sock.open(iface);
59+
int ret = sock.open(&iface);
7260
if (ret) {
7361
tr_error("UDPSocket.open() fails, code: %d", ret);
7462
return -1;
7563
}
7664

7765
SocketAddress nist;
78-
ret = iface->gethostbyname(host_name, &nist);
66+
ret = iface.gethostbyname(host_name, &nist);
7967
if (ret) {
8068
tr_error("Couldn't resolve remote host: %s, code: %d", host_name, ret);
8169
return -1;
@@ -126,22 +114,16 @@ int do_ntp()
126114
return -1;
127115
}
128116

129-
#if MBED_CONF_APP_PLATFORM == UBLOX
130-
UbloxCellularInterface my_iface(false);
131-
#elif MBED_CONF_APP_PLATFORM == MTS_DRAGONFLY
132-
DragonFlyCellularInterface my_iface(false);
133-
#endif
134-
135117
nsapi_error_t connection()
136118
{
137119
nsapi_error_t retcode;
138120
bool disconnected = false;
139121

140-
while (!iface->isConnected()) {
122+
while (!iface.isConnected()) {
141123

142-
retcode = iface->connect();
124+
retcode = iface.connect();
143125
if (retcode == NSAPI_ERROR_AUTH_FAILURE) {
144-
tr_error("Authentication Failure. Exiting application");
126+
printf("\n\nAuthentication Failure. Exiting application\n");
145127
return retcode;
146128
} else if (retcode != NSAPI_ERROR_OK) {
147129
tr_error("Couldn't connect: %d", retcode);
@@ -151,15 +133,15 @@ nsapi_error_t connection()
151133
break;
152134
}
153135

154-
tr_info("Connection Established.");
136+
printf("\n\nConnection Established.\n");
155137

156138
return NSAPI_ERROR_OK;
157139
}
158140

159141
int getTime()
160142
{
161143
int retcode = -1;
162-
if (iface->isConnected()) {
144+
if (iface.isConnected()) {
163145
retcode = do_ntp();
164146
} else {
165147
/* Determine why the network is down */
@@ -189,12 +171,11 @@ int main()
189171

190172
nsapi_error_t retcode = NSAPI_ERROR_OK;
191173

192-
iface = &my_iface;
193-
iface->set_SIM_pin("1234");
174+
iface.set_SIM_pin("1234");
194175

195-
iface->set_credentials("internet");
176+
iface.set_credentials("internet");
196177

197-
iface->connection_lost_notification_cb(ppp_connection_down_cb);
178+
iface.connection_status_cb(ppp_connection_down_cb);
198179

199180
tr_debug("Connecting...");
200181
retcode = connection();
@@ -204,7 +185,7 @@ int main()
204185
}
205186

206187
if (getTime() == 0) {
207-
tr_info("Done.");
188+
printf("\n\nDone.\n");
208189
}
209190

210191
return 0;

mbed-os.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/hasnainvirk/mbed-os/#f88c23e845098216196bbbd1f3ba5f49b90bb3a8
1+
https://github.com/hasnainvirk/mbed-os/#351572324f4f18b5d0d20f29374f4314e7c8a084

mbed_app.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"config": {
3-
"platform": "UBLOX"
4-
},
52
"macros": ["OS_MAINSTKSIZE=512"],
63
"target_overrides": {
74
"*": {
@@ -16,7 +13,7 @@
1613
"platform.default-serial-baud-rate": 115200,
1714
"lwip.debug-enabled":false,
1815
"lwip.enable-ppp-trace": false,
19-
"lwip.use-mbed-trace": true,
16+
"lwip.use-mbed-trace": false,
2017
"mbed-trace.enable": 1
2118
}
2219
}

0 commit comments

Comments
 (0)