au wot hackathon0314 test program

Dependencies:   NySNICInterface mbed-rtos mbed

Fork of RESTServer_team4 by y ishida

Files at this revision

API Documentation at this revision

Comitter:
kanpapa
Date:
Sat Mar 14 10:58:45 2015 +0000
Parent:
9:01aa69185ed8
Commit message:
beta version

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sun Feb 15 13:18:24 2015 +0000
+++ b/main.cpp	Sat Mar 14 10:58:45 2015 +0000
@@ -9,8 +9,8 @@
  */
 
 /* Set this */ 
-#define WIFI_SSID           ""
-#define WIFI_SECUTIRY_KEY   ""
+#define WIFI_SSID           "KDDI_hackathon04"
+#define WIFI_SECUTIRY_KEY   "123456789"
 #define WIFI_SECURITY_TYPE  e_SEC_WPA2_AES
 //#define WIFI_SECURITY_TYPE  e_SEC_OPEN
 //#define WIFI_SECURITY_TYPE  e_SEC_WEP
@@ -18,15 +18,18 @@
 //#define WIFI_SECURITY_TYPE  e_SEC_WPA2_AES
 //#define WIFI_SECURITY_TYPE  e_SEC_WPA2_MIXED
 
+#define IP_ADDRESS      "192.168.100.149"
+#define NET_MASK        "255.255.255.0"
+#define DEFAULT_GATEWAY "192.168.100.1"
 
-#define IP_ADDRESS      "192.168.100.44"
-#define NET_MASK        "255.255.255.0"
-#define DEFAULT_GATEWAY "192.168.0.1"
 #define PORT_NUMBER     80
 
 #define _DEBUG
 
 Serial pc(USBTX, USBRX);    // This is required when defined "_DEBUG"
+
+Serial tocos(p13, p14);     // TOCOS TWE-Lite (Serial)
+
 /** Wi-Fi SNIC UART Interface*/
 C_SNIC_WifiInterface     mSNICwifi( p9, p10, NC, NC, p30 );
 
@@ -75,13 +78,24 @@
     
     int retIp = mSNICwifi.setIPConfig(false, IP_ADDRESS, NET_MASK, DEFAULT_GATEWAY);
     
+    printf("IP_ADDRESS:%s, NET_MASK:%s, DEFAULT_GATEWAY:%s\r\n",IP_ADDRESS, NET_MASK, DEFAULT_GATEWAY);
+    
 }
 
+void uart_callback() {
+    // Note: you need to actually read from the serial to clear the RX interrupt
+    sprintf("%c\n", pc.getc());
+    led2 = !led2;
+}
 
 int main()
 {
     // for debug
     pc.baud( 115200 );
+
+    pc.printf("program start.\r\n");
+    
+    tocos.attach(&uart_callback);
     
     mPwmMotorL.period_ms(20);
     mPwmMotorR.period_ms(20);
@@ -97,6 +111,4 @@
     wait(1);
     pc.printf("server running.\r\n");
     srv.run();
-}
-
-
+}
\ No newline at end of file