SimpleSocket 1.0 examples
Dependencies: EthernetNetIf SimpleSocket 1.0 mbed
main.cpp@33:39d9cdf99de8, 2011-11-02 (annotated)
- Committer:
- yamaguch
- Date:
- Wed Nov 02 12:16:51 2011 +0000
- Revision:
- 33:39d9cdf99de8
- Parent:
- 32:00114e36de90
- Child:
- 34:a108bcc26b69
added examples
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yamaguch |
1:7350a2598a80 | 1 | #include "EthernetNetIf.h" |
yamaguch |
4:59056313fbfa | 2 | #include "SimpleSocket.h" |
yamaguch |
33:39d9cdf99de8 | 3 | #include "functions.h" |
yamaguch |
1:7350a2598a80 | 4 | |
yamaguch |
1:7350a2598a80 | 5 | int main() { |
yamaguch |
33:39d9cdf99de8 | 6 | for (int i = 0; functions[i].name; i++) |
yamaguch |
33:39d9cdf99de8 | 7 | printf("[%d] %s\n", i, functions[i]); |
yamaguch |
33:39d9cdf99de8 | 8 | |
yamaguch |
33:39d9cdf99de8 | 9 | printf("Select => "); |
yamaguch |
33:39d9cdf99de8 | 10 | int n; |
yamaguch |
33:39d9cdf99de8 | 11 | scanf("%d", &n); |
yamaguch |
33:39d9cdf99de8 | 12 | printf("%d was selected, starting %s\n", n, functions[n].name); |
yamaguch |
33:39d9cdf99de8 | 13 | |
yamaguch |
33:39d9cdf99de8 | 14 | functions[n].func(); |
yamaguch |
0:c41b68a4a296 | 15 | } |