Releases: ssilverman/QNEthernet
Releases · ssilverman/QNEthernet
0.35.0
Added
- 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.
Changed
- 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
- Removed from
EthernetClass(and replaced withlinkInfo()):linkSpeed()linkIsFullDuplex()linkIsCrossover()
Fixed
- 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.
0.34.0
Added
- 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.
Changed
- 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
- 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.
0.33.1
Fixed
- Added missing src/qnethernet/platforms/pgmspace.h file.
0.33.0
Added
- 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
Changed
- 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).
0.32.0
Added
- 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
- 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.
Fixed
- 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().
0.31.0
Added
- 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.
Changed
- 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.
Fixed
- 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.
0.30.1
Fixed
- Fixed wait-for-close for non-altcp connections.
0.30.0
Added
- 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.
Changed
- 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
- Removed
EthernetClass::isLinkStateDetectable()in favour of the driver capabilities. - Removed
get_uint32(ip)utility function because astatic_cast<uint32_t>()is sufficient.
Fixed
- 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.
0.29.1
Fixed
- Fixed being able to process more than one incoming frame in a row in the driver.
0.29.0
Added
- 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.
Changed
- 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
- 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.