SimpleSocket 1.0 examples
Dependencies: EthernetNetIf SimpleSocket 1.0 mbed
main.cpp@13:1adb19edf716, 2011-08-19 (annotated)
- Committer:
- yamaguch
- Date:
- Fri Aug 19 02:42:25 2011 +0000
- Revision:
- 13:1adb19edf716
- Parent:
- 12:52170a866d4a
- Child:
- 15:ae9aff693b07
fixed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yamaguch |
1:7350a2598a80 | 1 | #include "mbed.h" |
yamaguch |
1:7350a2598a80 | 2 | #include "EthernetNetIf.h" |
yamaguch |
4:59056313fbfa | 3 | #include "SimpleSocket.h" |
yamaguch |
2:304672a01127 | 4 | |
yamaguch |
8:b35559c14d17 | 5 | void echoserver(int port); |
yamaguch |
10:62ce72ee3e91 | 6 | void echoclient(char *server, int port, char *message); |
yamaguch |
8:b35559c14d17 | 7 | void httpclient(char *url); |
yamaguch |
8:b35559c14d17 | 8 | void simpleclient(char *servername, int port); |
yamaguch |
13:1adb19edf716 | 9 | //void stationclient(char *request); |
yamaguch |
1:7350a2598a80 | 10 | |
yamaguch |
1:7350a2598a80 | 11 | int main() { |
yamaguch |
4:59056313fbfa | 12 | EthernetNetIf eth; |
yamaguch |
4:59056313fbfa | 13 | EthernetErr ethErr = eth.setup(); |
yamaguch |
4:59056313fbfa | 14 | if (ethErr) error("Error %d in setup.\n", ethErr); |
yamaguch |
2:304672a01127 | 15 | |
yamaguch |
10:62ce72ee3e91 | 16 | //echoserver(7777); |
yamaguch |
13:1adb19edf716 | 17 | echoclient("10.0.3.20", 7777, "Hello world\n"); |
yamaguch |
13:1adb19edf716 | 18 | //httpclient("http://10.0.3.20:7777/index.html"); |
yamaguch |
8:b35559c14d17 | 19 | //simpleclient("10.0.3.20", 7); |
yamaguch |
10:62ce72ee3e91 | 20 | //stationclient("DigitalIn 9"); |
yamaguch |
0:c41b68a4a296 | 21 | } |