Added support for CMDA modem in HTTPClientTest

Also remove unnecessary thread from main
pull/90/head^2
Bogdan Marinescu 2013-10-22 11:57:55 +03:00
parent cabc4b6b9d
commit 7f35fc4b76
2 changed files with 14 additions and 15 deletions

View File

@ -10,6 +10,8 @@ int httptest(CellularModem& modem, const char* apn, const char* username, const
HTTPClient http;
char str[512];
modem.power(true);
Thread::wait(1000);
int ret = modem.connect(apn, username, password);
if(ret)
{

View File

@ -1,6 +1,12 @@
#include "UBloxUSBGSMModem.h"
#include "UbloxUSBGSMModem.h"
#include "UbloxUSBCDMAModem.h"
#include "httptest.h"
#if !defined(MODEM_UBLOX_GSM) && !defined(MODEM_UBLOX_CDMA)
#warning No modem defined, using GSM by default
#define MODEM_UBLOX_GSM
#endif
#ifndef MODEM_APN
#warning APN not specified, using "internet"
#define MODEM_APN "internet"
@ -16,23 +22,14 @@
#define MODEM_PASSWORD NULL
#endif
void test(void const* data)
int main()
{
#ifdef MODEM_UBLOX_GSM
UbloxUSBGSMModem modem;
#else
UbloxUSBCDMAModem modem(p18, true, 1);
#endif
httptest(modem, MODEM_APN, MODEM_USERNAME, MODEM_PASSWORD);
while (true);
}
int main()
{
Thread testTask(test, NULL, osPriorityNormal, 1024 * 4);
DigitalOut led(LED1);
while (true)
{
led = !led;
Thread::wait(1000);
}
return 0;
}