Hello EMW3162 example based on NSAPI & mbed classic
Dependencies: NetworkSocketAPI emw3162-driver mbed
Revision 1:4b994d2bf473, committed 2016-11-14
- Comitter:
- Maggie17
- Date:
- Mon Nov 14 02:46:05 2016 +0000
- Parent:
- 0:574b4e9ce478
- Commit message:
- fix some bugs
Changed in this revision
diff -r 574b4e9ce478 -r 4b994d2bf473 emw3162-driver.lib --- a/emw3162-driver.lib Fri Nov 04 02:21:47 2016 +0000 +++ b/emw3162-driver.lib Mon Nov 14 02:46:05 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/users/Maggie17/code/emw3162-driver/#3c8bed04849d +https://developer.mbed.org/users/Maggie17/code/emw3162-driver/#fb6251306b21
diff -r 574b4e9ce478 -r 4b994d2bf473 main.cpp --- a/main.cpp Fri Nov 04 02:21:47 2016 +0000 +++ b/main.cpp Mon Nov 14 02:46:05 2016 +0000 @@ -18,7 +18,7 @@ #include "EMW3162Interface.h" #include "TCPSocket.h" -ESP8266Interface wifi(D1, D0); +EMW3162Interface wifi(D1, D0); DigitalOut led(LED_GREEN); void blink() @@ -33,14 +33,14 @@ printf("NetworkSocketAPI Example\r\n"); - wifi.connect("iPhone", "mlq114759655", NSAPI_SECURITY_WPA2); + wifi.connect("iPhone", "mlq114759655"); const char *ip = wifi.get_ip_address(); const char *mac = wifi.get_mac_address(); printf("IP address is: %s\r\n", ip ? ip : "No IP"); printf("MAC address is: %s\r\n", mac ? mac : "No MAC"); - SocketAddress addr(&wifi, "mbed.org"); - printf("mbed.org resolved to: %s\r\n", addr.get_ip_address()); + SocketAddress addr(&wifi, "www.google.com"); + printf("www.google.com resolved to: %s\r\n", addr.get_ip_address()); TCPSocket socket(&wifi); socket.connect("4.ifcfg.me", 23);
diff -r 574b4e9ce478 -r 4b994d2bf473 mbed.bld --- a/mbed.bld Fri Nov 04 02:21:47 2016 +0000 +++ b/mbed.bld Mon Nov 14 02:46:05 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/0ab6a29f35bf \ No newline at end of file