Example program for MTS Universal Socked Modem Shield and WiFi Shield. Test that you can connect to Axeda with your account.
Dependencies: AxedaWrapper SocketModem mbed
Fork of axeda_wrapper_dev by
Diff: main.cpp
- Revision:
- 2:8c58dd4197c6
- Parent:
- 1:f0b38aa21aaf
- Child:
- 3:7ba95d6503e4
- Child:
- 4:bb9bfd6be913
--- a/main.cpp Sat Jan 04 06:37:13 2014 +0000 +++ b/main.cpp Sat Jan 04 07:58:48 2014 +0000 @@ -4,7 +4,9 @@ // set to 1 for cellular shield board // set to 0 for wifi shield board -#define CELL_SHIELD 1 +#define CELL_SHIELD 0 + +std::string ssid = "belkin54g"; using namespace mts; @@ -74,7 +76,7 @@ Transport::setTransport(Transport::WIFI); Wifi* wifi = Wifi::getInstance(); printf("Init: %s\n\r", wifi->init(serial) ? "SUCCESS" : "FAILURE"); - printf("Set Network: %s\n\r", getCodeNames(wifi->setNetwork("", Wifi::WPA2, "")).c_str()); + printf("Set Network: %s\n\r", getCodeNames(wifi->setNetwork(ssid, Wifi::NONE, "")).c_str()); printf("Set DHCP: %s\n\r", getCodeNames(wifi->setDeviceIP("DHCP")).c_str()); printf("Signal Strnegth (dBm): %d\n\r", wifi->getSignalStrength()); printf("Is Connected: %s\n\r", wifi->isConnected() ? "True" : "False"); @@ -82,9 +84,8 @@ printf("Is Connected: %s\n\r", wifi->isConnected() ? "True" : "False"); #endif - std::string serial_num = ""; + std::string serial_num = "MWF-0001"; AxedaWrapper* client = new AxedaWrapper(serial_num); - //AxedaWrapper* client = new AxedaWrapper(serial_num, "mbed", "54.235.103.204"); bool retval; while (true) { int val = rand();