Example program for the BSDInterface
Dependencies: BSDInterface NetworkSocketAPI
Fork of HelloLWIPInterface by
Revision 47:ac3cc44106cb, committed 2016-02-28
- Comitter:
- geky
- Date:
- Sun Feb 28 02:02:32 2016 +0000
- Parent:
- 46:cf5ab96729e1
- Child:
- 48:8a34f47ed1e2
- Commit message:
- Created example program for the BSDInterface
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BSDInterface.lib Sun Feb 28 02:02:32 2016 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/teams/NetworkSocketAPI/code/BSDInterface/#d92b89886434
--- a/LWIPInterface.lib Thu Feb 25 11:11:25 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://developer.mbed.org/teams/NetworkSocketAPI/code/LWIPInterface/#7fb7e78cb17f
--- a/main.cpp Thu Feb 25 11:11:25 2016 -0600 +++ b/main.cpp Sun Feb 28 02:02:32 2016 +0000 @@ -14,26 +14,23 @@ * limitations under the License. */ -#include "mbed.h" -#include "LWIPInterface.h" +#include "BSDInterface.h" #include "TCPSocket.h" DigitalOut myled(LED_GREEN); void flash(){ myled = !myled; } -LWIPInterface eth; -TCPSocket socket(ð); +BSDInterface iface; +TCPSocket socket(&iface); int main() { - Ticker t; - t.attach(flash, 0.4f); printf("NetworkSocketAPI Example\r\n"); - eth.connect(); + iface.connect(); - const char *ip = eth.getIPAddress(); - const char *mac = eth.getMACAddress(); + const char *ip = iface.getIPAddress(); + const char *mac = iface.getMACAddress(); printf("IP Address is: %s\r\n", (ip) ? ip : "No IP"); printf("MAC Address is: %s\r\n", (mac) ? mac : "No MAC"); @@ -45,7 +42,7 @@ size = socket.recv(recieved, sizeof(recieved)); socket.close(); - eth.disconnect(); + iface.disconnect(); printf("Recieved: %ld bytes, %02x%02x%02x%02x\r\n", size, recieved[0], recieved[1], recieved[2], recieved[3]);
--- a/mbed-rtos.lib Thu Feb 25 11:11:25 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/mbed-rtos/#b4c5542476ba
--- a/mbed.bld Thu Feb 25 11:11:25 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3 \ No newline at end of file