Skip to content

Commit

Permalink
Major update v1.2b, add UDP, DNS support
Browse files Browse the repository at this point in the history
- Enable user configuration for UIP_ACTIVE_OPEN to save memory/prog
space ( disables client functionality of uIP IP stack )
- Link UIP BUFFER SIZE directly to the RF24Network MAX_PAYLOAD_SIZE
variable to simplify configuration by only setting the variable in one
place
- Add support for UDP
- Re-organize config file
- Limit TCP window size and MSS to 511 bytes. For some reason, uIP
doesn't handle packets properly if this is defined at a larger value.
(See TCP flow control and congestion avoidance)
- Config uip logging via serial (disabled)
- Add debugging for UDP
- Add debugging for DNS
- Consolidate uip and RF24Ethernet includes into RF24Ethernet.h
- Remove the need for use_device() function. (maintained for backwards
compatibility)
- Proper handling of multiple connections. Data buffers allocated on a
per-connection basis.
- De-include all arp code when using TUN / RF24Mesh
- Add slight delay before responding after a payload is received
- Support for payload sizes larger than 255 bytes (max 511)
- Cleanup debugging printouts
- Condense uip_poll and uip_rexmit code
- Fix slight mistake in logic for window re-opening
- Fix logic in available() to handle changes with multiple connections
- Add code for Client.flush(); and Client.peek();
  • Loading branch information
TMRh20 committed Jan 16, 2015
1 parent 1efcca8 commit c7c21d3
Show file tree
Hide file tree
Showing 13 changed files with 1,319 additions and 204 deletions.
438 changes: 438 additions & 0 deletions Dns.cpp

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions Dns.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Arduino DNS client for Enc28J60-based Ethernet shield
// (c) Copyright 2009-2010 MCQN Ltd.
// Released under Apache License, version 2.0

#ifndef DNSClient_h
#define DNSClient_h

#include "RF24Ethernet.h"

#if UIP_CONF_UDP > 0


class DNSClient
{
public:
// ctor
void begin(const IPAddress& aDNSServer);

/** Convert a numeric IP address string into a four-byte IP address.
@param aIPAddrString IP address to convert
@param aResult IPAddress structure to store the returned IP address
@result 1 if aIPAddrString was successfully converted to an IP address,
else error code
*/
int inet_aton(const char *aIPAddrString, IPAddress& aResult);

/** Resolve the given hostname to an IP address.
@param aHostname Name to be resolved
@param aResult IPAddress structure to store the returned IP address
@result 1 if aIPAddrString was successfully converted to an IP address,
else error code
*/
int getHostByName(const char* aHostname, IPAddress& aResult);

protected:
uint16_t BuildRequest(const char* aName);
uint16_t ProcessResponse(uint16_t aTimeout, IPAddress& aAddress);

IPAddress iDNSServer;
uint16_t iRequestId;
RF24UDP iUdp;
};

#endif
#endif
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "RF24Ethernet - TCP/IP over RF24Network"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "Beta 1.1"
PROJECT_NUMBER = 1.2b

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
Loading

0 comments on commit c7c21d3

Please sign in to comment.