Ethernet interface for W5500 with bug fixed in socket::close()
Fork of EthernetInterfaceW5500 by
DNSClient/DNSClient.h@5:fb15c35d1e28, 2013-08-27 (annotated)
- Committer:
- va009039
- Date:
- Tue Aug 27 12:50:11 2013 +0000
- Revision:
- 5:fb15c35d1e28
WIZ820ioInterface?first commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
va009039 | 5:fb15c35d1e28 | 1 | // DNSClient.h 2013/4/5 |
va009039 | 5:fb15c35d1e28 | 2 | #pragma once |
va009039 | 5:fb15c35d1e28 | 3 | |
va009039 | 5:fb15c35d1e28 | 4 | #include "UDPSocket.h" |
va009039 | 5:fb15c35d1e28 | 5 | |
va009039 | 5:fb15c35d1e28 | 6 | class DNSClient { |
va009039 | 5:fb15c35d1e28 | 7 | public: |
va009039 | 5:fb15c35d1e28 | 8 | DNSClient(const char* hostname = NULL); |
va009039 | 5:fb15c35d1e28 | 9 | DNSClient(Endpoint* pHost); |
va009039 | 5:fb15c35d1e28 | 10 | virtual ~DNSClient(); |
va009039 | 5:fb15c35d1e28 | 11 | bool lookup(const char* hostname = NULL); |
va009039 | 5:fb15c35d1e28 | 12 | uint32_t ip; |
va009039 | 5:fb15c35d1e28 | 13 | protected: |
va009039 | 5:fb15c35d1e28 | 14 | void poll(); |
va009039 | 5:fb15c35d1e28 | 15 | void callback(); |
va009039 | 5:fb15c35d1e28 | 16 | int response(uint8_t buf[], int size); |
va009039 | 5:fb15c35d1e28 | 17 | int query(uint8_t buf[], int size, const char* hostname); |
va009039 | 5:fb15c35d1e28 | 18 | void resolve(const char* hostname); |
va009039 | 5:fb15c35d1e28 | 19 | uint8_t m_id[2]; |
va009039 | 5:fb15c35d1e28 | 20 | Timer m_interval; |
va009039 | 5:fb15c35d1e28 | 21 | int m_retry; |
va009039 | 5:fb15c35d1e28 | 22 | const char* m_hostname; |
va009039 | 5:fb15c35d1e28 | 23 | private: |
va009039 | 5:fb15c35d1e28 | 24 | enum MyNetDnsState |
va009039 | 5:fb15c35d1e28 | 25 | { |
va009039 | 5:fb15c35d1e28 | 26 | MYNETDNS_START, |
va009039 | 5:fb15c35d1e28 | 27 | MYNETDNS_PROCESSING, //Req has not completed |
va009039 | 5:fb15c35d1e28 | 28 | MYNETDNS_NOTFOUND, |
va009039 | 5:fb15c35d1e28 | 29 | MYNETDNS_ERROR, |
va009039 | 5:fb15c35d1e28 | 30 | MYNETDNS_OK |
va009039 | 5:fb15c35d1e28 | 31 | }; |
va009039 | 5:fb15c35d1e28 | 32 | MyNetDnsState m_state; |
va009039 | 5:fb15c35d1e28 | 33 | UDPSocket *m_udp; |
va009039 | 5:fb15c35d1e28 | 34 | }; |