Demo starter application to connect WiGo to NSP and expose on-board sensors

Dependencies:   NVIC_set_all_priorities cc3000_hostdriver_mbedsocket mbed nsdl_lib TEMT6200 TSI Wi-Go_eCompass_Lib_V3 WiGo_BattCharger

This is the mbed project for the IoT World Hackathon event, June 17th and 18th in Palo Also.

The setup instructions for participants are at the Setup page of this wiki:

http://mbed.org/teams/MBED_DEMOS/code/IoT_World_Hackathon_WiGo_NSP_Demo/wiki/Setup-Guide-for-the-IoT-World-Hackathon

Files at this revision

API Documentation at this revision

Comitter:
michaeljkoster
Date:
Sat Jun 14 02:37:08 2014 +0000
Parent:
2:4a6a726423bb
Child:
4:727f1aeb717a
Commit message:
cleanup

Changed in this revision

nsdl_run.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/nsdl_run.cpp	Fri Jun 13 23:28:26 2014 +0000
+++ b/nsdl_run.cpp	Sat Jun 14 02:37:08 2014 +0000
@@ -1,27 +1,15 @@
 #include "mbed.h"
 #include "cc3000.h"
-//#include "C12832_lcd.h"
 #include "nsdl_support.h"
 #include "dbg.h"
-// Include various resources
-//#include "temperature.h"
-//#include "light.h"
-//#include "gps.h"
-//#include "relay.h"
 #include "UDPSocket.h"
 #include "Endpoint.h"
 
-//static C12832_LCD lcd;
-//Serial pc(USBTX, USBRX); // tx, rx
 extern Serial pc;
 
 // ****************************************************************************
 // Configuration section
 
-// Ethernet configuration
-/* Define this to enable DHCP, otherwise manual address configuration is used */
-#define DHCP
-
 // default timeout values for DHCP, ARP, keepalive, disable socket timeout
 uint32_t dhcp = 14400;
 uint32_t arp = 3600;
@@ -29,11 +17,6 @@
 uint32_t inactivity = 0;
 int32_t to_rtn;
 
-/* Manual IP configurations, if DHCP not defined */
-#define IP      "10.45.0.206"
-#define MASK    "255.255.255.0"
-#define GW      "10.45.0.1"
-
 // NSP configuration
 /* Change this IP address to that of your NanoService Platform installation */
 //static const char* NSP_ADDRESS = "192.168.1.220"; /* Arndale board running NSP on local network for Hackathon */ 
@@ -52,28 +35,14 @@
 // EthernetInterface eth;
 extern cc3000 wifi;
 
-// this modified to startup as an option in the Wi-Go demo
-
 static void ethernet_init()
 {
-//    char mbed_uid[33]; // for creating unique name for the board
 
 // set timeout values to disable socket timeout  
     to_rtn = wifi._netapp.timeout_values(&dhcp, &arp, &keep_alive, &inactivity);
     pc.printf("timeout set: %d\r\n", to_rtn);
 
-    /* Initialize network */
-//#ifdef DHCP
-//    NSDL_DEBUG("DHCP in use\r\n");
-//    eth.init();
-//#else
-//    eth.init(IP, MASK, GW);
-//#endif
-//    if(eth.connect(30000) == 0)
-//        pc.printf("Connect OK\n\r");
-
-//    mbed_interface_uid(mbed_uid);
-// make a unique name from the MAC address
+//    make a unique name from the MAC address
       wifi.get_mac_address(myMAC);
       printf("MAC address %02x:%02x:%02x:%02x:%02x:%02x \r\n", myMAC[0], myMAC[1], myMAC[2], myMAC[3], myMAC[4], myMAC[5]);
       sprintf(MACstr, "%02X%02X%02X%02X%02X%02X", myMAC[0], myMAC[1], myMAC[2], myMAC[3], myMAC[4], myMAC[5]);
@@ -84,9 +53,6 @@
       strncat(endpoint_name, MACstr, 12);
       pc.printf("EP NAME: %s\r\n",endpoint_name);
 
-//    lcd.locate(0,11);
-//    lcd.printf("IP:%s", eth.getIPAddress());
-
     NSDL_DEBUG("IP Address:%s ", wifi.getIPAddress());
 }
 
@@ -105,9 +71,6 @@
     
     NSDL_DEBUG("name: %s", endpoint_name);
     NSDL_DEBUG("NSP=%s - port %d\n", NSP_ADDRESS, NSP_PORT);
-
-//    lcd.locate(0,22);
-//    lcd.printf("EP name:%s\n", endpoint_name);
 }
 
 // ****************************************************************************
@@ -159,6 +122,7 @@
 
 // ****************************************************************************
 // Program entry point
+// this modified to startup as an option in the Wi-Go demo
 
 void nsdl_run()
 {