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: NySNICInterface mbed-rtos mbed
Fork of RESTServer_team4 by
Revision 10:1caf4a3ce823, committed 2015-03-14
- 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 |
diff -r 01aa69185ed8 -r 1caf4a3ce823 main.cpp
--- 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
