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: MMA8451Q SocketModem jsonlite mbed
Fork of MTS_M2x_Example by
Revision 2:76e0d5968991, committed 2014-01-04
- Comitter:
- sam_grove
- Date:
- Sat Jan 04 06:37:50 2014 +0000
- Parent:
- 1:b12a128aae0e
- Child:
- 3:d24e8bec5610
- Child:
- 5:d4a4e2577be3
- Commit message:
- Initial commit
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Jan 04 06:27:12 2014 +0000
+++ b/main.cpp Sat Jan 04 06:37:50 2014 +0000
@@ -4,13 +4,15 @@
using namespace mts;
-const char key[] = "1f706ed9764457981e61b427767f65a5";
-const char feed[] = "5996c26815bd3245c8ec35089d51b614";
-const char stream[] = "test_test_test";
+const char key[] = "b26a78445f81fcc56e42ffa42350fb09";
+const char feed[] = "9ed5d71fe2b0b2ea6ddd7d8d65206250";
+const char stream[] = "amb-temp";
// 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";
int main() {
#if CELL_SHIELD
@@ -23,7 +25,7 @@
serial->baud(115200);
Transport::setTransport(Transport::CELLULAR);
Cellular* cell = Cellular::getInstance();
- cell->init(serial);
+ cell->init(serial, PTA4, PTC9); //DCD and DTR pins for KL46Z
int max_tries = 5;
int i;
@@ -78,7 +80,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");
