File Config for Ethernet connection
ConfigEthernet.h@1:379ead29a2ba, 2016-04-04 (annotated)
- Committer:
- 13075593
- Date:
- Mon Apr 04 22:03:43 2016 +0000
- Revision:
- 1:379ead29a2ba
- Parent:
- 0:0463a140d716
v1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
13075593 | 0:0463a140d716 | 1 | #ifndef CONFIG_ETHERNET_H |
13075593 | 0:0463a140d716 | 2 | #define CONFIG_ETHERNET_H |
13075593 | 0:0463a140d716 | 3 | |
13075593 | 0:0463a140d716 | 4 | #include "mbed.h" |
13075593 | 0:0463a140d716 | 5 | #include "rtos.h" |
13075593 | 0:0463a140d716 | 6 | #include "EthernetInterface.h" |
13075593 | 0:0463a140d716 | 7 | #include <string> |
13075593 | 0:0463a140d716 | 8 | |
13075593 | 0:0463a140d716 | 9 | class ConfigEthernet |
13075593 | 0:0463a140d716 | 10 | { |
13075593 | 0:0463a140d716 | 11 | public: |
13075593 | 0:0463a140d716 | 12 | ConfigEthernet(string _ip, string _mask, string _gateway); |
13075593 | 0:0463a140d716 | 13 | void initConnection(); |
13075593 | 0:0463a140d716 | 14 | void disconnect(); |
13075593 | 0:0463a140d716 | 15 | |
13075593 | 0:0463a140d716 | 16 | private: |
13075593 | 0:0463a140d716 | 17 | EthernetInterface eth; |
13075593 | 0:0463a140d716 | 18 | Serial *pc; |
13075593 | 0:0463a140d716 | 19 | const char *ip; |
13075593 | 0:0463a140d716 | 20 | const char *mask; |
13075593 | 0:0463a140d716 | 21 | const char *gateway; |
13075593 | 0:0463a140d716 | 22 | }; |
13075593 | 0:0463a140d716 | 23 | |
13075593 | 0:0463a140d716 | 24 | #endif |