Skip to content

Commit 7f35fc4

Browse files
committed
Added support for CMDA modem in HTTPClientTest
Also remove unnecessary thread from main
1 parent cabc4b6 commit 7f35fc4

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

libraries/tests/net/cellular/http/common/httptest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ int httptest(CellularModem& modem, const char* apn, const char* username, const
1010
HTTPClient http;
1111
char str[512];
1212

13+
modem.power(true);
14+
Thread::wait(1000);
1315
int ret = modem.connect(apn, username, password);
1416
if(ret)
1517
{
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
#include "UBloxUSBGSMModem.h"
1+
#include "UbloxUSBGSMModem.h"
2+
#include "UbloxUSBCDMAModem.h"
23
#include "httptest.h"
34

5+
#if !defined(MODEM_UBLOX_GSM) && !defined(MODEM_UBLOX_CDMA)
6+
#warning No modem defined, using GSM by default
7+
#define MODEM_UBLOX_GSM
8+
#endif
9+
410
#ifndef MODEM_APN
511
#warning APN not specified, using "internet"
612
#define MODEM_APN "internet"
@@ -16,23 +22,14 @@
1622
#define MODEM_PASSWORD NULL
1723
#endif
1824

19-
void test(void const* data)
25+
int main()
2026
{
27+
#ifdef MODEM_UBLOX_GSM
2128
UbloxUSBGSMModem modem;
29+
#else
30+
UbloxUSBCDMAModem modem(p18, true, 1);
31+
#endif
2232
httptest(modem, MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD);
2333
while (true);
2434
}
2535

26-
int main()
27-
{
28-
Thread testTask(test, NULL, osPriorityNormal, 1024 * 4);
29-
DigitalOut led(LED1);
30-
31-
while (true)
32-
{
33-
led = !led;
34-
Thread::wait(1000);
35-
}
36-
return 0;
37-
}
38-

0 commit comments

Comments
 (0)