This document details the changes between each release.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added
elapsedTime::reset()for resetting the timer back to zero. - Added
repassignment operator and constructor toelapsedTimefor assigning a count. - Added
elapsedTimeoperators that use a count. - Added a
settimeofday()implementation in the HAL for Teensy, gated on the newQNETHERNET_PROVIDE_TEENSY_SETTIMEOFDAYconfiguration macro. - Added
qnethernet_hal_entropy_available()function to the HAL. - Added
operator(buf, size)andavailable()toqindesign::security::random_device.
- Enabled raw frame support and loopback by default.
- Changed SNTPClient example to assume that the
settimeofday()function exists. - Changed entropy functions to set
errnotoEIOinstead ofEAGAINon entropy generation failure. - Made the HAL's
qnethernet_hal_deinit_entropy()andqnethernet_hal_estimate entropy()weak.
- Removed
qindesign::security::RandomDevicein favour of thestd::random_device-mimickingqindesign::security::random_device.
- Fixed the ElapsedTime example to actually toggle the LED.
- Fixed Teensy 4.1 driver to clear the MAC address hash-collision bookkeeping when the driver is uninitialized.
- Fixed TRNG (entropy) access for lower operating frequencies, on Teensy 4.
- Fixed to add some
errnoassignments and update some related comments and docs.
- Added a ping call to the main program.
- Added
qindesign::network::util::steady_clock_msandqindesign::network::util::arm_high_resolution_clockclasses that conform to the Clock C++ named requirement. These can be used with thestd::chronoAPI. The first provides a wrapper forqnethernet_hal_millis(). The second wraps the ARM DWT_CYCCNT cycle counter. - Added printing chrono clock times to network-up in the main program.
- Added
qindesign::network::util::elapsedTime<Clock>, a class similar toelapsedMillis, but uses astd::chronoClock. - Added support to the W5500 driver for interrupts via a pin.
- New SimpleIPerfServer example. It just reads from a socket as fast as possible.
- Added
write(const void*, size_t)convenience functions to allPrint-like classes. - New ChronoClocks example that demonstrates how to use the new Clocks and
std::chronofeatures. - Added
EthernetClass::linkInfo()to replacelinkSpeed(),linkIsFullDuplex(), andlinkIsCrossover(). - Implemented setting link speed, duplex, and auto-negotiation in Teensy 4.1 and W5500 drivers.
- Added
driver_reset_phy()driver function for resetting the PHY. - Added to
DriverCapabilities:isAutoNegotiationSettableisPHYResettable
- Added call to
qnethernet_hal_deinit_entropy()inRandomDevicedestructor. - Added
RandomDevice::entropy()to matchstd::random_device::entropy(). - Added
qindesign::security::random_deviceto mimicstd::random_device. - New ElapsedTime example that shows how to use the new
elapsedTimeutility.
- Improved Ping example by always sending, even if a send fails. It was stopping on error.
- Changed some sizes to
size_tinstead ofint:writeFully(client, data, len)example in the ReadmeEthernetClass::kMACAddrSizeEthernetClass::maxMulticastGroups()EthernetClass::dnsServerIP(index)EthernetClass::setDNSServerIP(index, ip)DNSClient::maxServers()DNSClient::setServer(index, ip)DNSClient::getServer(index)EthernetClient::maxSockets()EthernetFrame::maxFrameLen()EthernetFrame::minFrameLen()EthernetServer::maxListeners()EthernetUDP::maxSockets()MDNSClass::maxServices()
- Changed
EthernetClass::begin(mac, timeout)return type toboolfromint. - Robustness changes:
- Removed all implicit conversions
- Handle all return values in some way
- Reduced the number of #defines in favour of constants, enums, and static inline functions
- Changed
MDNSClassto usestd::stringinstead of the ArduinoString. - Updated examples to be more consistent with each other.
- Changed drivers to always loop until a frame can be sent instead of returning
ERR_WOULDBLOCKor NULL. - Marked IPerfServer example as "Under Repair".
- Now excluding the FCS (Frame Check Sequence) from all frame length-related definitions and use.
- Made dramatic improvements to the W5500 driver with much better buffering and how it waits to send frames.
- Updated the W5500 driver's
driver_deinit()function to power down the PHY. - Updated drivers to change link settings and get link info as a group. See the
new
LinkSettingsandLinkInfostructs. - Changed all definitions of, uses of, and references to max. and min. frame length to exclude the FCS (frame check sequence).
- Made
QNETHERNET_ENABLE_PING_SENDon by default. - Updated SNTPClient example to use
settimeofday()to set the time. - Updated RandomNumbers example to use new
qindesign::security::random_deviceclass.
- Removed from
EthernetClass(and replaced withlinkInfo()):linkSpeed()linkIsFullDuplex()linkIsCrossover()
- Fixed
EthernetClass::ping(ip, ttl)to return -1 if sending the ping failed. - Fixed RawFrameMonitor example tag interpretation to split at <=1500 and assume values in the range 1501-1535 are a type.
- Fixed setting an incorrect register in the entropy module (Teensy 4).
- Changed
DNSClientto not ignore a zero timeout. This had caused a potential use-after-scope. - Added better checks in the driver output for any buffer copy errors.
- Now checking for NULL buffer arguments in
write()ofEthernetUDPandEthernetFrameClass. - Fixed
MDNSClass:- Ensure there's final NULs after copying some strings.
- Avoid undefined casting between
void*and a function pointer. - Added some NULL argument checking.
DNSClientno longer ignores a timeout of zero. This was causing a potential use-after-scope.- Fixed the entropy module (Teensy 4) to not depend on a possibly stale
errno. - Clarified in the
EthernetServerandEthernetUDPdocs that thebeginXXX()functions are non-transactional in that they callend()orstop()first. - Fixed connection and listener iteration to first take a snapshot of the lists so that it's not possible to change the lists while iterating over them.
- Added tests for some of the print utility functions and classes.
- Added the
QNETHERNET_ENABLE_PING_REPLYmacro to disable ICMP echo replies. - Added a "Requirements" section listing some library requirements to the README.
- Added a
QNETHERNET_PROVIDE_GNU_VERBOSE_TERMINATE_HANDLERconfiguration option for including our own version of__gnu_cxx::__verbose_terminate_handlerfor space-saving reasons. - New
StreamDecoratorclass that also doesprintfchecking. - Added
driver_restart_auto_negotiation()driver function for restarting link auto-negotiation. This is useful for when EMF brings the link down. A new "EMF interference mitigation" section was also added to the Readme. - Added
qindesign::network::util::isBroadcast(ip, localIP, mask). - New
EthernetUDP::destIP()for getting the destination IP address from a received packet.
- Improved code style and structure.
- Made
NullPrint::availableForWrite()returnINT_MAXinstead of zero. - Changed
EthernetUDP::stop()to not clear the current packet. - Changed
DNSClient::hostByName()functions to use a default value ofQNETHERNET_DEFAULT_DNS_LOOKUP_TIMEOUTfor the timeout parameter. - Improved SimplePing example to catch DNS lookup errors.
- Changed ping send enable macro to
QNETHERNET_ENABLE_PING_SENDfromQNETHERNET_ENABLE_PING. - Updated to support C++11 and C11 compilers.
- Improved setting of
errno. - Added
printfchecking toPrintDecorator. - Replaced function-like-macros with
static inlineC functions. - Renamed
QNETHERNET_ENABLE_ALTCP_DEFAULT_FUNCTIONSmacro toQNETHERNET_PROVIDE_ALTCP_DEFAULT_FUNCTIONS. EthernetUDPandEthernetFramenow share some common circular buffer code in an internal utility class.- Replaced macros in
EthernetClientwith inline functions.
- Fixed
EthernetUDPinternal packet clear to reset all variables. - Now keeping any manually-set link UP state sticky so that the driver can choose not to set it to DOWN.
- Updated Ping and SimplePing examples to work with other systems by
changing use of
elapsedMillistounsigned longplus calculations. - Fixed
ConnectionManager::iterateConnections()calls to not callEthernet.loop()in the callback because that could potentially invalidate the iterator. Also added notes about potential iteration invalidation to theiterateConnections()anditerateListeners()docs. - Fixed
EthernetClientread()andpeek()to return the correct value if not connected.
- Added missing src/qnethernet/platforms/pgmspace.h file.
- Added a way to iterate over the internal TCP connection PCBs.
- Added calls to
Ethernet.loop()in more places. - Added setting
errnotoENETDOWNinEthernetClassin more places where network initialization is checked. - Added setting
errnotoENOSYSwhen some networking feature isn't implemented. - Added support for ping (ICMP echo).
- Added two ping examples: Ping and SimplePing.
- Added new configuration and default macros to qnethernet_opts.h:
QNETHERNET_ENABLE_PINGQNETHERNET_DEFAULT_PING_IDQNETHERNET_DEFAULT_PING_TIMEOUTQNETHERNET_DEFAULT_PING_TTL
- Made
qnethernet_hal_get_system_mac_address(mac)weak. - Made
EthernetClass::hostByName(hostname, result)const. - Made
qnethernet_hal_get_system_mac_address(mac)weak. - Improved code style and structure.
- Changed
errnovalue inEthernetClass::joinGroup(ip)if network is not initialized toENETDOWNfromENOTCONN. - Updated lwIP to latest master (4599f551).
- Added
qnethernet_hal_micros(). - Added secure TCP initial sequence numbers (ISNs), enabled with the new
QNETHERNET_ENABLE_SECURE_TCP_ISNmacro. The default is enabled.
- Changed some functions to take a
void*instead of auint8_t*. - Changed definition of
TCP_MSSto be based onMTUinstead of being a constant. - Updated LinkWatcher example to only print detectable details.
- Updated lwIP to latest release (STABLE-2_2_1_RELEASE, 77dcd25a).
- Restored automatic entropy initialization when including
qnethernet/security/RandomDevice.h. Callingqnethernet_hal_entropy()orqnethernet_hal_fill_entropy()will generate random values again without a prior call toqnethernet_hal_init_entropy()orRandomDevice::instance(). This also affects lwIP's internalLWIP_RAND().
- Added
qnethernet_hal_fill_entropy(buf, size)for filling a buffer with random values. - Added
EthernetClient::setConnectionTimeoutEnabled(flag)to enable or disable blocking with calls toconnect(...)andstop(). This supersedes calls toconnectNoWait(...)andclose(). Also addedisConnectionTimeoutEnabled(). - Added templated versions of
util::writeFully()andutil::writeMagic()that use a break function that static_casts a given object to abool. - Added
EthernetClient::connecting()for determining if the client is still in the process of connecting during a non-blocking connect.
- Remove internal uses of
StringfromMDNSClassand replace them with char arrays. - Updated Mbed TLS version mentions to 2.28.9 from 2.28.8.
- Made
EthernetClient::isNoDelay()const. - Disallow compilation for Teensyduino < 1.59 because there's no support for
casting a
const IPAddressto auint32_tor for equality-comparing them. - Replaced
EthernetClient::writeFully(const char *, size_t)andwriteFully(const uint8_t *, size_t)withwriteFully(const void *, size_t). - Updated the file structure to put most sources underneath src/qnethernet/.
- Changed
EthernetClient::setConnectionTimeout(timeout)andconnectionTimeout()to use 32-bit values. - Renamed
qnethernet_hal_rand()andqnethernet_hal_init_rand()toqnethernet_hal_entropy()andqnethernet_hal_init_entropy(), respectively. - Changed the non-entropy version of the entropy functions in the HAL to use
std::minstd_randinstead ofstd::rand()andstd::srand(). - Changed uses of "www.example.com" to "www.google.com" in the examples and tests.
- Now using
(void)instead of()for all C function declarations because()doesn't mean "no parameters" in C. - Fixed
driver_unsupported'sdriver_init(void)parameters to be empty.
- Fixed wait-for-close for non-altcp connections.
- Added a SimpleHTTPClient example.
- Added a way to get the driver capabilities:
EthernetClass::driverCapabilities()anddriver_get_capabilities(dc). - Added a way to get the library version:
EthernetClass::libraryVersion(). - New
QNETHERNET_DO_LOOP_IN_YIELDconfiguration macro for indicating that the library should attempt to hook into or overrideyield()to callEthernet.loop(). - New version of
receiveQueueSize()inEthernetUDPandEthernetFramethat returns the number of unprocessed packets or frames. - Added
droppedReceiveCount()andtotalReceiveCount()toEthernetUDPandEthernetFrame. - Added
driver_set_link_speed(speed)anddriver_set_link_full_duplex(flag). - Added
EthernetClass::renewDHCP(). - Added
EthernetClass::interfaceName(). - Added
setOutgoingTTL(ttl)andoutgoingTTL()functions for modifying and accessing the TTL field, respectively, in the outgoing IP header, toEthernetClientandEthernetUDP. - Added
EthernetUDP::receivedTTL()for retrieving the TTL value of the last received packet. - Added "Compatibility with other APIs" section to the README.
- Separated setting the MAC address from driver initialization.
- Changed the netif name to "en0".
- Added macro-gated calls to
Ethernet.loop()after anyyield()s in case an overridden version doesn't call this. This affects:DNSClient::getHostByName()EthernetClass::waitForLink()EthernetClass::waitForLocalIP()EthernetClient::connect()EthernetClient::stop()
- Updated example
yield()implementation notes for non-EventResponder versions. - Changed
setReceiveQueueSize(size)tosetReceiveQueueCapacity(capacity)andreceiveQueueSize()toreceiveQueueCapacity()in bothEthernetUDPandEthernetFrame. - Updated
QNETHERNET_ENABLE_RAW_FRAME_LOOPBACKbehaviour to also check for the broadcast MAC addresses. - Added
FLASHMEMto some driver functions. - Changed
EthernetClassandMDNSClasshostname()function to return aconst char *instead of aString. - Now always setting the DNS in
EthernetClass::begin(ip, mask, gateway, dns), even if it's zero. - Use rename instead of end-then-start when the netif has already been added,
in
MDNSClass::begin(hostname). - DHCP is started when just the IP address is the "any" address instead of all of the IP address, netmask, and gateway.
begin(ip, mask, gateway, dns)now always sets the DNS address.Ethernet.broadcastIP()now returns 255.255.255.255 if Ethernet is not initialized.
- Removed
EthernetClass::isLinkStateDetectable()in favour of the driver capabilities. - Removed
get_uint32(ip)utility function because astatic_cast<uint32_t>()is sufficient. - Removed
const IPAddressequality comparison operators because these exist in Teensyduino 1.59.
- Fixed iperf v2 tests by commenting out per-block settings compare.
- Fixed restarting the netif by also bringing the link down.
- Fixed a bug related to closing a TCP socket when using altcp.
- Fixed being able to process more than one incoming frame in a row in the driver.
- Added protected access to the internal
std::FILE*stream in theStdioPrintutility class. - Added more unit tests:
- test_ethernet:
- test_server_zero_port
- test_server_accept
- test_server_construct_int_port
- test_ethernet:
- Added
printfformat string checking forPrint-derived classes. As of this writing, Teensyduino (1.59) and other platforms don't do compiler checking forPrint::printf. - Added more support for
errno. Appropriate functions will set this after encountering an error. - Added tests for the Arduino-API
begin(...)functions. - Added a way to utilize an externally-defined driver.
- Added
driver_is_mac_settable()to the driver API. This checks if the MAC address can be set.
- Updated and improved PixelPusherServer example.
- Call
qnethernet_hal_get_system_mac_address(mac)in the unsupported driver'sdriver_get_system_mac(mac)implementation. This enables MAC address retrieval for more platforms when communication isn't needed; Teensy 4.0, for example. - Turned the internal MAC address into an optional and simplified the
Ethernetconstructor. This change should make it easier to initialze a MAC address from a custom driver. - Changed Arduino-API non-DHCP
begin(...)functions to returnbool. - Improved driver logic so that lwIP options can be included in the driver headers.
- Improved
OSCPrinterexample to use the UDP data directly. - Renamed
driver_set_mac_address_allowed()todriver_set_incoming_mac_address_allowed(). - Changed
driver_proc_input(netif)to return apbuf*.
- Fixed
EthernetServer::port()to return the system-chosen port if a zero value was specified. - Fixed
EthernetUDP::stop()to leave any multicast group joined when starting to listen on a multicast address. - Fixed MAC address restore if an Arduino-API non-DHCP
begin(...)call fails. - Fixed
EthernetClient::read()andpeek()to return -1 instead of 0 when there's no internal state. - Properly initializing multicast filtering so that it happens before
igmp_start(), which sets up the all-systems group.
- Added raw frame loopback support and a
QNETHERNET_ENABLE_RAW_FRAME_LOOPBACKmacro to enable. - Added a fourth step to the MbedTLSDemo example instructions: modify the config.
- New
EthernetFrameClassfunctions:destinationMAC(),sourceMAC(),etherTypeOrLength(), andpayload(). - Consolidated all the hardware abstraction layer (HAL) functions into one
place:
qnethernet_hal.cpp. - New
NullPrintandPrintDecoratorutility classes in theqindesign::network::utilnamespace. - Added
driver_is_link_state_detectable()function to the driver. This is for detecting whether the hardware is able to read the link state. - Added
EthernetClass::isLinkStateDetectable()to detect whether the driver is capable of detecting link state. - Added
setOutgoingDiffServ(ds)andoutgoingDiffServ()functions for modifying and accessing the differentiated services (DiffServ) field, respectively, in the outgoing IP header, toEthernetClientandEthernetUDP. - Added
EthernetUDP::receivedDiffServ()for retrieving the DiffServ value of the last received packet. - Added
EthernetFrameClass::clear()for clearing the outgoing and incoming buffers.
- Updated the Mbed TLS version in the README and comments to 2.28.8 (was 2.28.6).
- Updated
mbedtls_hardware_poll()in MbedTLSDemo example for other platforms. - Renamed
QNETHERNET_ENABLE_CUSTOM_WRITEtoQNETHERNET_CUSTOM_WRITE. - Improved the PixelPusherServer example.
- The address-changed callback is now called for independent IP address, netmask, and gateway changes.
- Improved link function documentation for
linkStatus(),linkState(), andisLinkStateDetectable(). - Updated
EthernetClient::setNoDelay(flag)to return whether successful. - Add another 2 to
MEMP_NUM_SYS_TIMEOUToption for mDNS, for a total of an additional 8. Timeout exhaustion was still observed with 6. Why 8 and not 7: - Updated
EthernetClient::connect()to return a Boolean value. (The function signatures don't change; they still return anint.) This matches the new definition at Ethernet - client.connect(). - Changed
EthernetClient::connectNoWait()return types tobool.
- Improved marking of unused parameters.
- Fixed up use of
__has_include(), per: __has_include (The C Preprocessor) - In mDNS, ensure there's at least an empty TXT record, otherwise the SRV record doesn't appear.
- Make the alternative
yield()implementationextern "C". - Fixed
EthernetUDPdata copy for zero-length outgoing packets.pbuf_take()considers NULL data an error, so only copy the data if the packet's size is not zero.
- New
QNETHERNET_FLUSH_AFTER_WRITEconfiguration macro for flushing after every call toEthernetClient::write(). This may reduce TCP efficiency. - Added a W5500 driver.
- Added a new
EthernetHardwareStatus::EthernetTeensy41enum value. - New
QNETHERNET_DEFAULT_HOSTNAMEoption.
- Made it easier to add other low-level drivers.
- Redesigned the driver interface.
- Un-deprecated
EthernetClass::begin(mac, timeout)andbegin(mac, ip, dns, gateway, subnet). - Un-deprecated
EthernetClass::init(sspin)and added a driver function for setting the chip select pin. The type ofsspinwas also changed toint. - Removed dependency on
elapsedMillis. This might help with compiling for other platforms. - Made the library easier to compile for other platforms.
- Replaced all
#defineguards with#pragma once. - All
QNETHERNET_*configuration macros can now be defined in a newqnethernet_opts.hfile in addition to the project build. - Removed test dependencies on Teensy-specific things.
- Renamed t41 driver source files to use teensy41 in the name instead.
- Changed return type of
EthernetUDP::beginWithReuse()andbeginMulticastWithReuse()tobool. - Using better randomness for
LWIP_RAND(). - Changed attributes to use the C++ style.
- Changed the default hostname to "qnethernet-lwip".
- Renamed
enet_get_mac(mac)toenet_get_system_mac(mac).
- Added missing
hostByNameto keywords.txt. - Fixed
enet_output_frame()to return false if there's no output buffer. - Fixed
EthernetClient::write(buf, size)to re-check the state after a call toloop(). - Fixed
util::writeMagic()macparameter to beconst. - Fixed
test_ethernet'stearDown()to remove listeners before callingEthernet.end(). This ensures no out-of-scope variables are accessed. - Updated
StdioPrintto not useerrnobecause stdio doesn't set this.
- Added
EthernetClient::localIP(). - Added
EthernetClass::hostByName(hostname, ip)convenience function. - Added
EthernetClass::setDNSServerIP(index, ip)anddnsServerIP(index). - Added some support for Mbed TLS v2.x.x. There's four new adapter functions
for assisting integration (see src/altcp_tls_adapter.cpp), included if the
QNETHERNET_ALTCP_TLS_ADAPTERoption is set:qnethernet_altcp_is_tlsqnethernet_altcp_tls_client_certqnethernet_altcp_tls_server_cert_countqnethernet_altcp_tls_server_cert
- Added MbedTLSDemo example.
- Added printing the message size in LengthWidthServer example.
- Added
QNETHERNET_ENABLE_ALTCP_DEFAULT_FUNCTIONS-gated default implementations of the altcp interface functions. - Added
EthernetClass::macAddress()for returning a pointer to the current MAC address.
- Updated lwIP to the latest master (5e3268cf).
- Made the driver non-blocking:
- TX: if there's no available buffer descriptors (returns ERR_WOULDBLOCK)
- Link checks via MDIO
- Updated the tests:
- Added a 10s connection timeout to
test_client_addr_info() - Added SNTP retries to
test_udp() - Updated and added some messages
- Added a 10s connection timeout to
- Made
MDNSClass::Service::operator==()const. - Completely revamped PHY and pin initialization.
- Gated PHY and Ethernet shutdown in
EthernetClass::end()with a macro; the default behaviour is to not execute these blocks. This and the previous are part of the quest to figure out why performance drops off a cliff when Ethernet is restarted via first callingend(). - Changed return type of
qnethernet_get_allocatortobool. - Renamed
qnethernet_get_allocatorandqnethernet_free_allocatortoqnetheret_altcp_get_allocatorandqnethernet_altcp_free_allocator, respectively. - Changed
qnethernet_get_allocatorandqnethernet_free_allocatorallocatorparameter to be a reference. - Renamed
QNETHERNET_MEMORY_IN_RAM1toQNETHERNET_LWIP_MEMORY_IN_RAM1. - Updated the AltcpTemplate example.
- Fixed
IPAddress-related build problems with the new Teensyduino 1.54-beta4. - Updated the RawFrameMonitor example with information about how to disable DHCP.
- Disabled waiting in
EthernetClient::close()for altcp clients because it's not defined. - Changed configuration macro checks to use value instead of definedness.
- Fixed a
printfconversion specifier in the RandomNumbers example. This was causing a compile warning. - Fixed location of STATIC_INIT_DECL() for
RandomDeviceby putting it into the header. It needs to be in a place where users of the class see it. - Fixed
EthernetClass::setMACAddress()for when the interface is up.
- New "Heap memory use" section in the README that discusses memory allocation functions.
- New RandomNumbers example.
- Added a README subsection that talks about the
RandomDeviceclass. - Added
RandomDevice::instance(). - Added
EthernetClient::status()for getting the TCP connection state.
- Enabled the
MEM_LIBC_MALLOCoption by default to make use of the system- defined malloc functions instead of the lwIP-defined ones. - Moved around where the netif gets its address set.
- Changed the license to "AGPL-3.0-or-later".
- Made
RandomDeviceconstructor and destructor private. - Improved unit tests.
- Updated lwIP to v2.2.0.
- Removed the
extern qindesign::security::RandomDevice randomDeviceinstance from QNEthernet.h because the way to access the device now is via itsinstance()function (the constructor is also private now). (It had been added in v0.23.0.)
- Fixed
enet_init()to always initialize the internal MAC address on first init. - Fixed execution error when running main.cpp (
MAIN_TEST_PROGRAMmacro defined) by removingbuild_type = debugfrom platformio.ini. - Fixed static initialization order for
Ethernet,EthernetFrame, andMDNSsingletons by using the Nifty Counter idiom.
- The new
QNETHERNET_MEMORY_IN_RAM1configuration macro indicates that lwIP-declared memory should go into RAM1. - New
EthernetFrameClass::receiveQueueSize()function. - New
EthernetUDP::receiveQueueSize()andsetReceiveQueueSize(size)functions. - Enabled external definition of macros
LWIP_NETIF_LOOPBACKandLWIP_LOOPBACK_MAX_PBUFS. - Sprinkled some more
Ethernet.loop()calls where pcb and pbuf allocations fail. - Added
EthernetClass::setLinkState(flag)for manually setting the link state when a link is needed, such as when using the loopback feature. Network operations will usually fail unless there's a link. - Added more unit tests:
- test_ethernet:
- test_setLinkState
- test_udp_receive_queueing
- test_udp_receive_timestamp
- test_udp_state
- test_client_connectNoWait
- test_client_timeout
- test_client_state
- test_server_state
- test_other_state
- test_entropy:
- test_randomDevice
- test_ethernet:
- Added commented-out
LWIP_STATS_LARGEoption to lwipopts.h.
- Changed memory declaration macro,
LWIP_DECLARE_MEMORY_ALIGNED(), to use theMEM_ALIGNMENTvalue. - Now calling
shrink_to_fit()on the UDP and Ethernet frame queues when changing their size. - Add 6 to
MEMP_NUM_SYS_TIMEOUToption for mDNS instead of 5. Timeout exhaustion was still observed with 5. - There's now a single lwip_driver.h header for interfacing with the stack.
- Changed all
EthernetClass::begin(mac, ...)functions to be consistent. If the MAC address is NULL then the MAC will be set to the internal one. Also, if starting Ethernet fails, the MAC address will not be changed. - Improved Ethernet tests to do proper object destruction when tests fail. The Unity test framework makes use of longjmp for failing tests, and that doesn't work well with object destructors.
- Unit test updates.
- Made single-argument
EthernetClassandEthernetClientconstructors explicit.
- Now using the correct name when adding an mDNS service.
- Pre-reserving memory for raw frames and UDP packets prematurely exhausts the heap when a larger number of them are reserved in the queue. These buffers are no longer reserved; they only grow appropriately when data comes in.
- Fixed closing
EthernetClients to remove the connection state if not already connected. Restarting anEthernetClientvia one of theconnectXXX()functions callsclose()first. If there was no connection, then closing never removed the internal connection object, causing a leak. - Fixed
Ethernet.loop()to also poll the netif if loopback is enabled. This allows loopback to work. EthernetServer::end()now sets the port to -1.
- Added
qindesign::security::RandomDevice, a class that conforms to the UniformRandomBitGenerator C++ named requirement. This makes it a little easier to generate platform-independent entropy. EthernetUDP::receivedTimestamp()for retrieving a packet's approximate arrival time.- Added a "
writeFully()with more break conditions" subsection to the README. EthernetFrame::receivedTimestamp()for retrieving a frame's approximate arrival time.EthernetClient::connectionTimeout()for getting the current timeout value.
- Changed
EthernetUDP::localPort()to beconst. - Changed
entropy_random_range()to return zero ifEAGAIN. - Changed
entropy_random_range()to use Daniel Lemire's nearly- divisionless algorithm. - Updated lwIP to v2.2.0-rc1.
- Made
StdioPrintsingle-argument constructorexplicit. - Updated
EthernetClass::linkStatus()to returnEthernetLinkStatus::Unknownif the hardware hasn't yet been probed. - Updated
AltcpTemplateexample to print proxy information. - Updated
EthernetUDP::availableForWrite()to return the amount remaining before hitting the maximum possible payload size. - Add 5 to
MEMP_NUM_SYS_TIMEOUToption for mDNS instead of 1.
- Removed TTL concept from
MDNSClass. This enables it to compile with the latest lwIP.
- Fixed
SNTP_SET_SYSTEM_TIME_US(sec, us)definition to set the RTC directly becausesettimeofday()doesn't exist here. - Fixed
AltcpTemplateexample so that it compiles whenLWIP_ALTCPisn't set. - Handle nested
altcp_pcbs when TCP-listening with reuse.
EthernetClass::setDHCPEnabled(flag)enables or disables the DHCP client. May be called either before or after Ethernet has started.EthernetClass::isDHCPEnabled()returns whether the DHCP client is enabled. Valid whether Ethernet has been started or not.- New
LinkWatcherexample. - Added support for building for unsupported boards via a new bare lwIP driver.
- Limit the number of times
enet_proc_input()can loop to twice the ring size. - Limit UDP output size to the maximum possible (65535 - 28(total header)).
- It's now possible to know when adding or removing a MAC address filter failed.
- Make it possible to disable and exclude DHCP, DNS, IGMP, TCP, and UDP.
- Changed
EthernetClass::setMACAddress(mac)to use the built-in MAC address if the given array is NULL. - Changed
EthernetClass::begin(mac)to wait for an IP address. The default is a 60-second timeout. There's also a new, optional,timeoutparameter for specifying that timeout. This change makes the API match the Arduino Ethernet API. - Renamed
enet_getmac(mac)toenet_get_mac(mac). - Better NULL argument checking.
- Simplified
ServerWithListenersexample. - Changed
enet_init(...)to return aboolfor detecting init. failure.
- Fixed how
EthernetClientfunctions work when there's a pending connect triggered byconnectNoWait(). - Fixed how raw frame size limits are checked. Padding is already handled by the MAC.
- Fixed compilation if
LWIP_IGMPis disabled, including makingLWIP_MDNS_RESPONDERdependent onLWIP_IGMP(in addition toLWIP_UDP). - Improved
trng_is_started()by adding an additional check for the "OK to stop" bit. It now works at system startup if the clock is already running.
- Added
EthernetClass::linkIsCrossover()for checking if a crossover cable is detected. - Added entropy-based random number functions,
entropy_random()andentropy_random_range(range). The second uses an unbiased algorithm.
- Renamed TRNG tests to test_entropy.
- Added calling file, line, and function information to
LWIP_ASSERT_CORE_LOCKED(). - Un-deprecated
EthernetClass::MACAddress(mac)andsetDnsServerIP(ip). - Optimized byte-swapping by using GCC built-ins.
- Reset the PHY in a much more conservative way. Hopefully this helps with restarting Ethernet causing packets to not be received.
- Fixed dhcp struct assignment to be done each time the netif is added. This
addresses
netif_add()clearing all the client data. - Fixed
LWIP_PLATFORM_ASSERT()to flush stdout's underlyingPrintobject. This ensures all output for an assertion failure gets sent out before the call toabort(). - Fixed the link status values changing after setting the link up.
- Added
EthernetFrameClass::size(), for parity withEthernetUDP. - Added internal entropy functions to remove the Entropy library dependency.
- New
QNETHERNET_ENABLE_CUSTOM_WRITEmacro for enabling the inclusion of the expandedstdiooutput behaviour. - Added a bunch of unit tests. These use the Unity test framework from within PlatformIO.
- Added sections to the README that describe how to configure compiler options for both the Arduino IDE and PlatformIO.
- Added an
AltcpTemplateexample. - Added a
BroadcastChatexample that implements a simple chat over UDP.
- Updated
StdioPrintadapter to use errors better.errnois set for the "write error" value and the stdio error state is cleared appropriately when the functions detect that "write error" is back to zero. - Changed default
stdiooutput behaviour to use the new system default. (This exists as of Teensyduino 1.58-beta4.) See:QNETHERNET_ENABLE_CUSTOM_WRITE. - Added a timeout parameter to the callback version of
DNSClient::getHostByName(). This helps prevent any references from going out of scope before the callback is called. - Changed
EthernetUDP::send()functions back to returning a Boolean value. - There's now
Printobjects for each ofstdoutandstderr:stdoutPrintandstderrPrint. - Improved
RawFrameMonitorandSNTPClientexamples. - Changed "tcp" calls to "altcp" calls so that it's easier to add things like
TLS and proxy support. There's accompanying
qnethernet_get_allocator(...)andqnethernet_free_allocator(...)functions that need to be defined by the application code if theLWIP_ALTCPoption is enabled.
QNETHERNET_WEAK_WRITEmacro in favour of the new way to enable the library's internal_write()definition. See:QNETHERNET_ENABLE_CUSTOM_WRITE.- Removed
stdPrintin favour of the newstdoutPrintandstderrPrint. - Removed sending a DHCP INFORM message when setting a static IP. It seemed to interfere with any first subsequent DHCP requests.
- Fixed
EthernetClass::end()to callclearEvent()before detaching the event responder. - Fixed DNS client to be aware of lookup failures.
- Added set-no-address and link-down calls to
EthernetClass::end()before bringing the interface down. This ensures all the callbacks are called. - Fixed
EthernetUDP::parsePacket()to also callEthernet.loop()when there's no packet available. - Increased PHY reset pulse and reset-to-MDIO times. Hopefully this fixes slow
traffic after restarting the system via
Ethernet.end().
- Added
Ethernet.loop()calls to theEthernetClient::write()functions when the send buffer is full. - Added Ethernet hardware detection to support (well, "non-support") the Teensy 4.1 NE.
- Updated lwipopts.h to examine
LWIP_MDNS_RESPONDERwhen setting certain values. Ethernet.loop()calls are now attached/detached to/from yield inEthernet.begin(...)/end().- Improved pin configurations and comments.
- Disabled
LWIP_STATSoption by default. Saves a little memory. - Updated Arduino Ethernet API links in keywords.txt.
- Only add 1 to
MEMP_NUM_SYS_TIMEOUToption for mDNS instead of 3. - Updated examples to use both address and link state on network changes. This accommodates when a static IP is used.
- Changed UDP and TCP PCB creation to use an appropriate
ip_addr_ttype instead of the unspecified default. - Changed CRC-32 function for multicast lookup to not use a lookup table. This saves 1KiB of flash but makes the calculation about 4.7x slower but still in the microsecond range (~0.090µs -> ~0.42µs).
- Moved
EthernetClass,EthernetFrameClass, andMDNSClassconstructors and destructors toFLASHMEM(where possible). This saves a little RAM1 space. - Moved lwIP's memory pools into 4-byte aligned
DMAMEM(RAM2). This saves a lot of RAM1 space, about 27KiB with the current configuration. - Changed the promiscuous mode macro name from
QNETHERNET_PROMISCUOUS_MODEtoQNETHERNET_ENABLE_PROMISCUOUS_MODE. - Changed all the DHCP timeouts in the examples to 15 seconds.
- Changed
EthernetUDP::send()functions to return an lwIP error code instead of a 1-or-0 Boolean value. Zero (ERR_OK) means no error. This makes it easier to diagnose any problems.
- Reverted how interrupts were being cleared to use assignment instead of OR'ing the bits. This seemed to fix an apparent freeze. (See this issue: Teensy 4.1 freezing, TCP connecting during (#26))
- Fixed a signedness comparison warning in
OSCPrinterexample. - Addressed "extra" (
-Wextra) and pedantic (-Wpedantic) warnings.
- Added a "Notes on ordering and timing" section to the README.
- Added a README section that discusses
EthernetClient::connect()and its return values. - Added non-blocking TCP connection functions,
connectNoWait(), that are equivalent to theconnect()functions but don't wait for the connection to complete. - Added
EthernetUDP::beginWithReuse()andbeginMulticastWithReuse()functions to replace the corresponding begin-with-reuse-parameter versions. - Added printing the link speed and duplex in the IPerfServer example.
- Added an "Asynchronous use is not supported" section to the README.
- New
EthernetClass::onInterfaceStatus(callback)andinterfaceStatus()functions for tracking the network interface status. - Added a check to ensure lwIP isn't called from an interrupt context.
- Wrapped
LWIP_MDNS_RESPONDERoption inlwipopts.hwith#ifndefand added it to the README. - Made
EthernetClass::loop()non-static. - Changed serial output in examples to use CRLF line endings.
- Changed
EthernetClient::connect()internals to callclose()instead ofstop()so that any cleanup doesn't block. - Updated
EthernetClient::connect()to return some of the error codes defined at Ethernet - client.connect(). - Changed
EthernetServer::begin()-with-Boolean-reuse-parameters to be namedbeginWithReuse(). This avoids too many overloads with mysterious Boolean arguments. - Changed
EthernetServer::operator bool()to beconst. - Changed
EthernetServer::end()to returnvoidinstead ofbool. - Changed
MDNSClass::begin(hostname)andDNSClient::getHostByName()to treat a NULL hostname as an error; they now explicitly return false in this case. - Changed
MDNSClass::end()to returnvoidinstead ofbool. - Changed examples that use
unsigned charto useuint8_tin appropriate places. EthernetUDP::beginfunctions now callstop()if the socket is listening and the parameters have changed.MDNSClass::begin(hostname)now callsend()if the responder is running and the hostname changed.- Changed both
EthernetServerandEthernetUDPto disallow copying but allow moving. - Changed raw frame support to be excluded by default. This changed the
QNETHERNET_DISABLE_RAW_FRAME_SUPPORTmacro toQNETHERNET_ENABLE_RAW_FRAME_SUPPORT. - Changed
tcp_pcbmember accesses to use appropriate TCP API function calls. This fixes use of the altcp API.
EthernetServerandEthernetUDPbegin functions that take a Booleanreuseparameter.
EthernetUDP::beginfunctions now callstop()if there was a bind error.- Fixed
EthernetClient::setNoDelay(flag)to actually use theflagargument. The function was always setting the TCP flag, regardless of the value of the argument. - Fixed printing unknown netif name characters in some debug messages.
- Fixed
EthernetClient::connect()andclose()operations to check the internal connection object for NULL acrossyield()calls. - Fixed
lwip_strerr()buffer size to include the potential sign. - Don't close the TCP pcb on error since it's already been freed.
- The library now, by default, puts the RX and TX buffers in RAM2 (DMAMEM).
This behaviour can be overridden by defining the new
QNETHERNET_BUFFERS_IN_RAM1macro. - Added separate
stderroutput support with the newstderrPrintvariable. If set to NULL,stderrdefaults to the usualstdPrint. - Added
MDNSClass::operator bool()for determining whether mDNS has been started. - Added
MDNSClass::restart()for when a cable has been disconnected for a while and then reconnected. - Added
EthernetFrameClass::setReceiveQueueSize(size)for setting the receive queue size. This replaces theQNETHERNET_FRAME_QUEUE_SIZEmacro. - Added a way to disable raw frame support: define the new
QNETHERNET_DISABLE_RAW_FRAME_SUPPORTmacro. - Added a "Complete list of features" section to the README.
- Added
MDNSClass::hostname()for returning the hostname of the responder, if running. - Added
EthernetUDP::operator bool(). - Added an already-started check to
MDNSClass. - New section in the README: "
operator bool()andexplicit". It addresses problems that may arise withexplicit operator bool(). - Added
EthernetClient::connectionId()for identifying connections across possibly multipleEthernetClientobjects. - Added
EthernetClass::isDHCPActive().
- Improved error code messages in
lwip_strerr(err). This is used whenLWIP_DEBUGis defined. - Now shutting down mDNS too in
EthernetClass::end(). - Now using overloads instead of default arguments in
EthernetClassandEthernetUDP. - Changed
EthernetClassandMDNSClassStringfunctions to takeconst char *instead. - Made all
operator bool()functionsexplicit. See: Implicit conversions - The safe bool problem MDNSClass::removeService()now returnsfalseinstead oftrueif mDNS has not been started.- Enable definition of certain macros in
lwipopts.hfrom the command line. - Changed API uses of
unsigned chartouint8_t, for consistency.
- Removed the
QNETHERNET_FRAME_QUEUE_SIZEmacro and replaced it withEthernetFrame.setReceiveQueueSize(size).
- Disallow
stdinin_write().
EthernetUDP::size(): Returns the total size of the received packet data.- Added an optional "dns" parameter to the three-parameter Ethernet.begin() that defaults to unset. This ensures that the DNS server IP is set before the address-changed callback is called.
- Added configurable packet buffering to UDP reception with the new
EthernetUDP(queueSize)constructor. The default and minimum queue size is 1. - Added configurable frame buffering to raw frame reception with the new
QNETHERNET_FRAME_QUEUE_SIZEmacro. Its default is 1. - Added a new "Configuration macros" section to the README that summarizes all the configuration macros.
- Changed
EthernetUDP::parsePacket()to return zero for empty packets and -1 if nothing is available.
- Added a way to enable promiscuous mode: define the
QNETHERNET_PROMISCUOUS_MODEmacro. - Added a way to remove all the mDNS code: set
LWIP_MDNS_RESPONDERto0inlwipopts.h. - Added support for ".local" name lookups.
- Added the ability, in the mDNS client, to specify a service name that's different from the host name.
- Added
EthernetClient::abort()for killing connections without going through the TCP close process. - New sections in the README:
- "How to change the number of sockets", and
- "On connections that hang around after cable disconnect".
- An
EthernetServerinstance can now be created without setting the port. There are two newbegin()functions for setting the port:begin(port)begin(port, reuse)
- Moved CRC-32 lookup table to PROGMEM.
- Changed in
EthernetServer:port()returns anint32_tinstead of auint16_tso that -1 can represent an unset port; non-negative values are still 16-bit quantitiesbegin(reuse)now returns aboolinstead ofvoid, indicating success- The
EthernetServerdestructor now callsend()
- Removed some unneeded network interfaces:
- IEEE 802.1D MAC Bridge
- 6LowPAN
- PPP
- SLIP
- ZigBee Encapsulation Protocol
- Removed HTTPD options from
lwipopts.h.
- Added a
util::StdioPrintclass, aPrintdecorator for stdio output files. It routesPrintfunctions to a specificFILE*. This exists mainly to make it easy to usePrintableobjects without needing a prior call tofflush(). - Added
MDNSClass::maxServices(). - Added
operator==()andoperator!=()operators forconst IPAddress. They are in the usual namespace. These allow==to be used withconst IPAddressvalues without having to useconst_cast, and also introduce the completely missing!=operator. - Added a way to declare the
_write()function as weak via a newQNETHERNET_WEAK_WRITEmacro. Defining this macro will cause the function to be declared as weak. - Implemented
EthernetFrameClass::availableForWrite(). - Added size limiting to
EthernetFrameClasswrite functions. - New
EthernetClass::waitForLink(timeout)function that waits for a link to be detected. - Added a way to allow or disallow receiving frames addressed to specific MAC
addresses:
EthernetClass::setMACAddressAllowed(mac, flag)
- Updated
SNTPClientexample to useEthernetUDP::send()instead ofbeginPacket()/write()/endPacket(). - Updated
PixelPusherServerexample to use the frame average for the update period. - Implemented
EthernetHardwareStatusenum for the deprecatedEthernet.hardwareStatus()function. This replaces the zero return value with the new non-zeroEthernetOtherHardware. - Cleaned up how internal IP addresses are used.
- Changed
_write()(stdio) to do nothing if the requested length is zero because that's whatfwrite()is specified to do. - Updated examples to use new
operator!=()forIPAddress. - Moved lwIP's heap to RAM2 (DMAMEM) and increased
MEM_SIZEback to 24000. - Updated
EthernetFrame-related documentation to explain that the API doesn't receive any known Ethernet frame types, including IPv4, ARP, and IPv6 (if enabled). - Clarified in the examples that
Ethernet.macAddress()retrieves, not sets. - Changed
EthernetClass::setMACAddress(mac)parameter toconst. - Moved CRC-32 lookup table to RAM2 (DMAMEM).
- Made const those functions which could be made const.
- Renamed
ServerWithAddressListenerexample toServerWithListeners. - Updated examples and README to consider listeners and their relationship with a static IP and link detection.
- Fixed
EthernetUDP::send()function to take the host and port as arguments, per its description. There's now two of them: one that takes anIPAddressand another that takes achar *hostname. - Fixed
enet_output_frame()to correctly returnfalseif Ethernet is not initialized. - Fixed not being able to set the DNS server IP before starting Ethernet.
- Fixed raw frame API to consider any padding bytes.
EthernetFrameconvenience functions that also write the header:beginFrame(dstAddr, srcAddr, typeOrLen)beginVLANFrame(dstAddr, srcAddr, vlanInfo, typeOrLen)
qindesign::network::utilPrint utility functions. Thebreakffunction parameter is used as the stopping condition inwriteFully().writeFully(Print &, buf, size, breakf = nullptr)writeMagic(Print &, mac, breakf = nullptr)
enet_deinit()now gracefully stops any transmission in progress before shutting down Ethernet.EthernetClassfunctions:linkIsFullDuplex(): Returns whether the link is full duplex (true) or half duplex (false).broadcastIP(): Returns the broadcast IP address associated with the current local IP and subnet mask.
- Functions that return a pointer to the received data:
EthernetUDP::data()EthernetFrame::data()
DNSClient::getServer(index)function for retrieving a specific DNS server address.EthernetUDP::localPort(): Returns the port to which the socket is bound.- Three new examples:
IPerfServerOSCPrinterPixelPusherServer
- The
EthernetClient::writeFully()functions were changed to return the number of bytes actually written. These can break early if the connection was closed while attempting to send the bytes. - Changed
EthernetClient::writeFully()functions to use the newwriteFully()Print utility function. - Changed the
Ethernetobject to be a reference to a singleton. This matches how theEthernetFrameobject works. - Changed the
read(buf, len)functions to allow a NULL buffer so that the caller can skip data without having to read into a buffer. - Moved internal classes and structs into an "internal" namespace to avoid any potential contflicts with user declarations.
- Removed IEEE 1588 initialization and timer read.
- Fixed
EthernetClient::availableForWrite()to re-check the state after the call toEthernetClass::loop().
- Added a way to disable and enable Nagle's algorithm. The new functions are
EthernetClient::setNoDelay(flag)andisNoDelay(). - Implemented
EthernetServer::availableForWrite()as the minimum availability of all the connections, or zero if there's no connections. - New
AppWithListenersTemplateexample. - Added
EthernetClass::operator bool()for testing whether Ethernet is initialized. - Added a new way to send and receive raw Ethernet frames. There's a new
EthernetFrameinstance (ofEthernetFrameClass) that is used similarly toEthernetUDP. - New
RawFrameMonitorexample. - New
EthernetUDP::send(data, len)function for sending a packet without having to usebeginPacket()/write()/endPacket(). It causes less overhead. - Added
EthernetClass::isPromiscuousMode().
- Changed
EthernetUDP::flush()to be a no-op. - Reduced lwIP's
MEM_SIZEto 16KiB from 24000. - Split
MDNSClass::addService()into two overloaded functions: one with three arguments and one with four. No more defaulted TXT record function parameter; the three-argument version calls the four-argument version with NULL for that function. - Updated
keywords.txt. - Updated
SNTPClientexample: Removed unneeded includes, made the packet buffer a global variable, and added setting the RTC and time. - Changed
EthernetClass::mtu()tostatic size_t. It was non-static andint. - Updated
enet_output_frame(frame, len)to check if the system is initialized.
- Removed
EthernetClass::sendRaw(frame, len)because there's a newEthernetFrameAPI with asend(frame, len)function.
- Fixed the length check when sending raw Ethernet frames to exclude the FCS field. It checks that the length is in the range 60-1518 instead of 64-1522.
- Fixed
check_link_status()to check if Ethernet is initialized before trying to access the PHY.
- Implemented
EthernetClass::setMACAddress(mac). - Added
EthernetServer::maxListeners(),EthernetClient::maxSockets(), andEthernetUDP::maxSockets()so user code doesn't need to guess. These areconstexprfunctions that return the compile-time constants from the lwIP configuration. - Added
EthernetServer::port()for returning the server's port. - Added
EthernetClass::setHostname(hostname)andhostname()for setting and getting the DHCP client option 12 hostname. - Added
EthernetClass::maxMulticastGroups()constexprfunction. - Added a "Write immediacy" subsection to the README that addresses when data is sent over a connection. It's under the "How to write data to connections" section.
- Changed the default DHCP client option 12 hostname to "teensy-lwip".
- Stop the DHCP client when restarting
Ethernet(inbegin(ip, mask, gateway)andsetMACAddress(mac)) to ensure that a static IP won't get overwritten by any previously running DHCP client. This also obviates the need to callEthernet.end()before re-callingbegin.
- Added a way to send raw Ethernet frames. The new function
is
EthernetClass::sendRaw(frame, len). - Added new sections to the README:
- "Sending raw Ethernet frames", and
- "How to implement VLAN tagging".
- Added calls to
loop()inEthernetClient::connected()andoperator bool(). - Added
EthernetUDP::beginMulticast(ip, localPort, reuse), wherereusecontrols the SO_REUSEADDR socket option. - Added
EthernetClass::joinGroup(ip)andleaveGroup(ip)for joining and leaving a multicast group. - Added a "How to use multicast" section to the README.
- Changed
kMTUtype to besize_teverywhere. - Added
stdPrintas anexternvariable toQNEthernet.hand moved it to theqindesign::networknamespace. - Changed transmit data buffers to be 64-byte aligned, for
"optimal performance".
See: IMXRT1060RM_rev2.pdf, "Table 41-38. Enhanced transmit buffer descriptor field definitions", page 2186. - Updated lwIP to v2.1.3.
- Changed
EthernetUDP::beginMulticastto release resources if joining the group failed. - Increased MEMP_NUM_IGMP_GROUP to 9 to allow 8 multicast groups.
- Removed mention of the need to re-announce mDNS and adjusted the docs accordingly.
- Changed receive data buffers to be 64-byte aligned.
See: IMXRT1060RM_rev2.pdf, "Table 41-36. Receive buffer descriptor field definitions", page 2183. - Changed TA value in ENET_MMFR register to 2, per the chip docs.
- Multicast reception now works. Had to set the ENET_GAUR and ENET_GALR registers appropriately.
- Added example that uses
client.writeFully()to the "How to write data to connections" README section. - Added
EthernetClient::close()for closing a connection without waiting. It's similar tostop(). - Added
DNSClientclass for interfacing with lwIP's DNS functions. - Added a "DNS" section to the README.
- Renamed the "How to write data to clients" README section to "How to write data to connections".
- Increased the maximum number of UDP sockets to 8.
- Updated
EthernetClass,EthernetClient, andEthernetUDPto use the newDNSClientclass for DNS lookup and DNS server address setting.
- Added a check that
Entropyhas already been initialized before callingEntropy.Initialize(). - Added a "How to write data to clients" section to the README that addresses how to fully send data to clients.
- Added
EthernetClient::writeFully()functions that might help address problems with fully writing data to clients. - Added a new "Additional functions not in the Arduino API" section to the README.
- Added
EthernetClient::closeOutput()for performing a half close on the client connection.
- Updated the
ServerWithAddressListenerexample. It's more complete and could be used as a rudimentary basis for a complete server program.- Added a "Content-Type" header to the response,
- It now looks for an empty line before sending the response to the client,
- Added the ability to use a static IP,
- Added client and shutdown timeouts, and
- Added a list to the description at the top describing some additional things the program demonstrates.
- In
EthernetClass::end(), moved setting the DNS to 0 to before DHCP is released. This ensures that any address-changed events happen after this. i.e. the DNS address will be 0 when an address-changed event happens.
- The Boolean-valued link state is now
EthernetClass::linkState(). - Added a
_write()definition so thatprintfworks and sends its output toSerial. Parts of lwIP may useprintf. This directs output to a newPrint *stdPrintvariable. It has a default of NULL, so there will be no output if not set by user code. - Now powering down the PHY in
enet_deinit(). - Added calls to
loop()inEthernetServer::accept()andavailable()to help avoid having to have the caller remember to call loop() if checking connectivity in a loop. - Added a call to
end()in theQNMDNSdestructor. - Added a new externally-available
Print *stdPrintvariable forprintfoutput, both for lwIP and optionally for user code. - Added the ability to set the SO_REUSEADDR socket option when listening on a port (both TCP and UDP).
- Added four examples and a "note on the examples" section in the README.
- FixedWidthServer
- LengthWidthServer
- ServerWithAddressListener
- SNTPClient
EthernetClass::linkStatus()now returns anEthernetLinkStatusenum. The Boolean version is nowEthernetClass::linkState().- The
EthernetLinkStatusenum is no longer marked as deprecated. - Updated
EthernetClientoutput functions to flush data when the send buffer is full and to always callloop()before returning. This should obviate the need to callflush()after writes and the need to callloop()if writing in a loop. (flush()is still useful, however, when you've finished sending a "section" of data.) - Changed
EthernetUDP::parsePacket()to always callloop().
- Restarting
Ethernet(viabegin()or viaend()/begin()) now works properly. DHCP can now re-acquire an IP address. Something's weird aboutEventResponder. It doesn't look like it's possible todetach()thenattach(), or callattach()more than once. - Fixed
QNMDNSto only callmdns_resp_init()once. There's no corresponding "deinit" call.
- Added a new "survey of how connections work" section to the README.
- Added low-level link receive error stats collection.
- Now calling
EthernetClass::loop()inEthernetUDP::parsePacket()when it returns zero so that calls in a loop will move the stack forward. - Added
EthernetLinkStatusenum (marked as deprecated) for compatibility with the Arduino API. Note thatEthernetClass::linkStatus()is staying as abool; comparison with the enumerators will work correctly. - Now sending a DHCPINFORM message to the network when using a manual IP configuration.
- Changed
EthernetClass::loop()to bestatic. - Changed all the internal "
yield()to move the stack along" calls toEthernetClass::loop(). Note that the calls withinwhileloops in the external API functions were not changed.
- Fixed the driver to add and remove netif ext callback at the correct places. This solves the freeze problem when ending Ethernet, however when restarting, DHCP isn't able to get an IP address.
- Added a "Code style" section to the README.
- Added link-status and address-changed callbacks.
- New
EthernetServer::end()function to stop listening. - Disabling the PLL before disabling the clock in
enet_deinit(). This still doesn't solve the freeze problem when this function is called. - New
EthernetClass::linkSpeed()function, used asEthernet.linkSpeed(). It returns the link speed in Mbps.
- Changed all the delays to yields because
delay()just loops and callsyield()anyway. - No longer looping when checking the TCP send buffer in the client write
functions. Instead, just using an
if. - The client now takes more opportunities to set the internal connection pointer
to NULL, meaning the caller doesn't necessarily need to guarantee they call
stop()if other I/O functions are being used to check state or to write, for example. - Moved adding the netif callback to
enet_init()so that the callback still gets an address-changed notification when setting a static address.
- Fixed client functions to also check for connected status.
- Fixed client
read()andpeek()to return -1 on no connection. - Added potential flushing in
EthernetClient::availableForWrite(). This keeps things moving along if it always would return zero. - A listening server is now correctly added to the internal listening list. This
fixes
EthernetServer::operator bool().
- This CHANGELOG.
- Instructions in the README for how to use with Arduino.
- Added the ability to add TXT items to mDNS services.
- New
EthernetClass::waitForLocalIP(timeout)function that waits for a DHCP-assigned address. - Added the ability to re-announce mDNS services. This is useful to prevent the entries from disappearing.
- Added mDNS notes to the README.
- Updated lwIP to v2.1.3-rc1.
- Moved global objects (
EthernetandMDNS) into theqindesign::networknamespace.
- UDP multicast address check was checking the wrong byte.
- UDP multicast now IGMP joins the group.
- Updated lwIP to the "real" v2.1.2 release.
- The library now works with Arduino.
EthernetUDP::endPacket()was usingnullptrfor the pbuf.EthernetUDP::beginPacket()was not setting the output port.
- Small delays in
EthernetClientoutput functions to allow data to flush. This allows user programs to avoid having to callyield()themselves. - Flushing the output before closing the connection in
EthernetClient::stop(). - Global Arduino-style
MDNSobject and a rename of the class toMDNSClass. yield()calls in theEthernetClientinput functions to allow user programs to avoid having to callyield()themselves.
- Brought
Print::writefunctions into scope for Client, Server, and UDP by using ausing Print::writedirective. - New centralized connection management.
- Removed all the atomic fences.
- Fixed
EthernetClass::begin()return value; it was the opposite.
- Initial release.
Copyright (c) 2021-2026 Shawn Silverman