Example program for the C027Interface
Dependencies: C027Interface NetworkSocketAPI mbed
Diff: main.cpp
- Revision:
- 9:da5a230fa4f4
- Parent:
- 7:6787b920b496
- Child:
- 11:b7e531a4d661
--- a/main.cpp Wed Jun 17 21:04:47 2015 +0000 +++ b/main.cpp Wed Jun 17 23:38:33 2015 +0000 @@ -44,6 +44,18 @@ printf("Gateway: %s\n", wifi.getGateway()); printf("Mask: %s\n", wifi.getNetworkMask()); printf("MAC: %s\n", wifi.getMACAddress()); + + //Endpoint google; + wifi.set_address(wifi.get_host_by_name("www.google.com")); + wifi.set_address("216.58.192.46"); + wifi.set_port(80); + + //Socket socket; + char buf[1024]; + wifi.connect(*wifi.endpoint); + wifi.recv(buf, 1024); + wifi.send(buf, sizeof(buf)); + wifi.close(*wifi.endpoint); wifi.disconnect();