![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
SimpleSocket 1.0 examples
Dependencies: EthernetNetIf SimpleSocket 1.0 mbed
Diff: main.cpp
- Revision:
- 33:39d9cdf99de8
- Parent:
- 32:00114e36de90
- Child:
- 34:a108bcc26b69
--- a/main.cpp Wed Oct 26 12:47:31 2011 +0000 +++ b/main.cpp Wed Nov 02 12:16:51 2011 +0000 @@ -1,33 +1,15 @@ #include "EthernetNetIf.h" #include "SimpleSocket.h" - -void scanftest(int port); -void echoserver(int port); -void echoserver2(int port); -void echoclient(char *server, int port, char *message); -void httpclient(char *url); -void relayserver(int port, char *target, int targetport); -void webserver(); -void udpsend(); -void udpreceive(); -void multicast(); -void ntpclient(); -void supertweet(); +#include "functions.h" int main() { - EthernetNetIf eth; - EthernetErr ethErr = eth.setup(); - if (ethErr) error("Error %d in setup.\n", ethErr); - //supertweet(); - //ntpclient(); - multicast(); - //udpsend(); - //udpreceive(); - //webserver(); - //scanftest(7777); - //echoserver(7777); - //echoserver2(7777); - //echoclient("10.0.3.17", 7777, "Hello world\n"); - //httpclient("http://www.senio.co.jp/index.html"); - //relayserver(8888, "10.0.3.17", 1234); + for (int i = 0; functions[i].name; i++) + printf("[%d] %s\n", i, functions[i]); + + printf("Select => "); + int n; + scanf("%d", &n); + printf("%d was selected, starting %s\n", n, functions[n].name); + + functions[n].func(); } \ No newline at end of file