Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LM75B M2XStreamClient jsonlite mbed-rtos mbed
Fork of m2x-seeed_ethernet_demo by
Diff: WIZnet_Library/WIZnetInterface/DNSClient/DNSClient.h
- Revision:
- 8:a94ba2e0cd04
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/WIZnet_Library/WIZnetInterface/DNSClient/DNSClient.h Thu Sep 25 16:36:51 2014 +0000
@@ -0,0 +1,35 @@
+// DNSClient.h 2013/4/5
+#pragma once
+
+#include "UDPSocket.h"
+
+class DNSClient {
+public:
+ DNSClient(const char* hostname = NULL);
+ DNSClient(Endpoint* pHost);
+ virtual ~DNSClient();
+ bool lookup(const char* hostname = NULL);
+ uint32_t ip;
+protected:
+ void poll();
+ void callback();
+ int response(uint8_t buf[], int size);
+ int query(uint8_t buf[], int size, const char* hostname);
+ void resolve(const char* hostname);
+ uint8_t m_id[2];
+ Timer m_interval;
+ int m_retry;
+ const char* m_hostname;
+private:
+ enum MyNetDnsState
+ {
+ MYNETDNS_START,
+ MYNETDNS_PROCESSING, //Req has not completed
+ MYNETDNS_NOTFOUND,
+ MYNETDNS_ERROR,
+ MYNETDNS_OK
+ };
+ MyNetDnsState m_state;
+ UDPSocket *m_udp;
+};
+
