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
Tests/Test08.cpp
- Committer:
- ashleymills
- Date:
- 2012-09-19
- Revision:
- 46:d2c22206031a
- Parent:
- 45:f68fea0831d7
- Child:
- 47:85c30274cc9b
File content as of revision 46:d2c22206031a:
#include "Test08.h" Test08::Test08(VodafoneUSBModem *m) : VodafoneTestCase(m) { _description = gTest08Description; _testCaseNumber = 8; } void Test08::setupTest() {} bool Test08::executeTest() { bool outcome = true; LOG("Description: %s",gTest08Description); LOG("Connecting to internet"); if(_modem->connect("internet","web","web")==0) { LOG("Connected to internet"); } else { LOG("Failed to connect to internet"); outcome = false; } struct hostent *server; do { while(1) { LOG("Getting host address"); server = ::gethostbyname("m2mthings.com"); if(server==NULL) { LOG("Failure getting host address!"); outcome = false; //break; } else { LOG("got host address, length %d",server->h_length); break; } } if(server->h_length==4) { LOG("DNS lookup returned %d.%d.%d.%d", server->h_addr[0], server->h_addr[1], server->h_addr[2], server->h_addr[3] ); } else { LOG("Only IPv4 addresses are supported."); outcome = false; break; } } while(0); _modem->disconnect(); return outcome; } void Test08::endTest() { }