Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos mbed HTTPClient VodafoneUSBModem
main.cpp
00001 #define __DEBUG__ 4 //Maximum verbosity 00002 #ifndef __MODULE__ 00003 #define __MODULE__ "main.cpp" 00004 #endif 00005 00006 #include "LogHeader.h" 00007 00008 #include "mbed.h" 00009 #include "rtos.h" 00010 #include "VodafoneUSBModem.h" 00011 00012 #include "VodafoneTestCase.h" 00013 #include "TestManager.h" 00014 00015 DigitalOut led1(LED1); 00016 DigitalOut led2(LED2); 00017 DigitalOut led3(LED3); 00018 DigitalOut led4(LED4); 00019 00020 extern "C" void HardFault_Handler() { error("Hard Fault!\n"); } 00021 00022 time_t startTime = 0; 00023 time_t gPreviousUptime = 0; 00024 time_t gUptime = 0; 00025 00026 void setTime() { 00027 struct tm t; 00028 t.tm_year = 100; 00029 t.tm_mon = 0; 00030 t.tm_mday = 0; 00031 t.tm_hour = 0; 00032 t.tm_min = 0; 00033 t.tm_sec = 0; 00034 set_time(mktime(&t)); 00035 } 00036 00037 int main() { 00038 00039 DBG_INIT(); 00040 DBG_SET_SPEED(115200); 00041 DBG_SET_NEWLINE("\r\n"); 00042 00043 setTime(); 00044 size_t currentTime = time(NULL); 00045 fprintf(stdout,"Invocation time: %s\r\n",ctime(¤tTime)); 00046 00047 VodafoneUSBModem modem; 00048 LOG("Constructing TestManager"); 00049 LOG("Running tests."); 00050 TestManager *m = new TestManager(&modem); 00051 00052 m->runTestProfile(TESTS_AUTOMATED); 00053 //m->runTestProfile(TESTS_INTERNET); 00054 //m->runTestProfile(TESTS_SMS); 00055 //m->runTest(15); 00056 00057 // this thread just waits and blinks leds periodically 00058 while(1) { 00059 led1 = !led1; 00060 Thread::wait(500); 00061 led1 = !led1; 00062 Thread::wait(1000); 00063 time_t now = time(NULL); 00064 gPreviousUptime = gUptime; 00065 gUptime = now-startTime; 00066 } 00067 }
Generated on Sun Jul 17 2022 01:04:13 by
1.7.2