Skip to content

Releases: ssilverman/QNEthernet

0.35.0

08 Mar 22:15

Choose a tag to compare

0.35.0 Pre-release
Pre-release

Added

  • Added a ping call to the main program.
  • Added qindesign::network::util::steady_clock_ms and qindesign::network::util::arm_high_resolution_clock classes that conform to the Clock C++ named requirement. These can be used with the std::chrono API. The first provides a wrapper for qnethernet_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 to elapsedMillis, but uses a std::chrono Clock.
  • 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 all Print-like classes.
  • New ChronoClocks example that demonstrates how to use the new Clocks and std::chrono features.
  • Added EthernetClass::linkInfo() to replace linkSpeed(), linkIsFullDuplex(), and linkIsCrossover().
  • 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:
    • isAutoNegotiationSettable
    • isPHYResettable
  • Added call to qnethernet_hal_deinit_entropy() in RandomDevice destructor.
  • Added RandomDevice::entropy() to match std::random_device::entropy().
  • Added qindesign::security::random_device to mimic std::random_device.
  • New ElapsedTime example that shows how to use the new elapsedTime utility.

Changed

  • Improved Ping example by always sending, even if a send fails. It was stopping on error.
  • Changed some sizes to size_t instead of int:
    • writeFully(client, data, len) example in the Readme
    • EthernetClass::kMACAddrSize
    • EthernetClass::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 to bool from int.
  • 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 MDNSClass to use std::string instead of the Arduino String.
  • Updated examples to be more consistent with each other.
  • Changed drivers to always loop until a frame can be sent instead of returning ERR_WOULDBLOCK or 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 LinkSettings and LinkInfo structs.
  • 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_SEND on by default.
  • Updated SNTPClient example to use settimeofday() to set the time.
  • Updated RandomNumbers example to use new qindesign::security::random_device class.

Removed

  • Removed from EthernetClass (and replaced with linkInfo()):
    • 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 DNSClient to 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() of EthernetUDP and EthernetFrameClass.
  • 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.
  • DNSClient no 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 EthernetServer and EthernetUDP docs that the beginXXX() functions are non-transactional in that they call end() or stop() 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

29 Jan 23:09

Choose a tag to compare

0.34.0 Pre-release
Pre-release

Added

  • Added tests for some of the print utility functions and classes.
  • Added the QNETHERNET_ENABLE_PING_REPLY macro to disable ICMP echo replies.
  • Added a "Requirements" section listing some library requirements to the README.
  • Added a QNETHERNET_PROVIDE_GNU_VERBOSE_TERMINATE_HANDLER configuration option for including our own version of __gnu_cxx::__verbose_terminate_handler for space-saving reasons.
  • New StreamDecorator class that also does printf checking.
  • 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() return INT_MAX instead of zero.
  • Changed EthernetUDP::stop() to not clear the current packet.
  • Changed DNSClient::hostByName() functions to use a default value of QNETHERNET_DEFAULT_DNS_LOOKUP_TIMEOUT for the timeout parameter.
  • Improved SimplePing example to catch DNS lookup errors.
  • Changed ping send enable macro to QNETHERNET_ENABLE_PING_SEND from QNETHERNET_ENABLE_PING.
  • Updated to support C++11 and C11 compilers.
  • Improved setting of errno.
  • Added printf checking to PrintDecorator.
  • Replaced function-like-macros with static inline C functions.
  • Renamed QNETHERNET_ENABLE_ALTCP_DEFAULT_FUNCTIONS macro to QNETHERNET_PROVIDE_ALTCP_DEFAULT_FUNCTIONS.
  • EthernetUDP and EthernetFrame now share some common circular buffer code in an internal utility class.
  • Replaced macros in EthernetClient with inline functions.

Fixed

  • Fixed EthernetUDP internal 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 elapsedMillis to unsigned long plus calculations.
  • Fixed ConnectionManager::iterateConnections() calls to not call Ethernet.loop() in the callback because that could potentially invalidate the iterator. Also added notes about potential iteration invalidation to the iterateConnections() and iterateListeners() docs.
  • Fixed EthernetClient read() and peek() to return the correct value if not connected.

0.33.1

06 Nov 01:20

Choose a tag to compare

0.33.1 Pre-release
Pre-release

Fixed

  • Added missing src/qnethernet/platforms/pgmspace.h file.

0.33.0

05 Nov 22:27

Choose a tag to compare

0.33.0 Pre-release
Pre-release

Added

  • Added a way to iterate over the internal TCP connection PCBs.
  • Added calls to Ethernet.loop() in more places.
  • Added setting errno to ENETDOWN in EthernetClass in more places where network initialization is checked.
  • Added setting errno to ENOSYS when 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_PING
    • QNETHERNET_DEFAULT_PING_ID
    • QNETHERNET_DEFAULT_PING_TIMEOUT
    • QNETHERNET_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 errno value in EthernetClass::joinGroup(ip) if network is not initialized to ENETDOWN from ENOTCONN.
  • Updated lwIP to latest master (4599f551).

0.32.0

28 Apr 01:47

Choose a tag to compare

0.32.0 Pre-release
Pre-release

Added

  • Added qnethernet_hal_micros().
  • Added secure TCP initial sequence numbers (ISNs), enabled with the new QNETHERNET_ENABLE_SECURE_TCP_ISN macro. The default is enabled.

Changed

  • Changed some functions to take a void* instead of a uint8_t*.
  • Changed definition of TCP_MSS to be based on MTU instead of being a constant.
  • Updated LinkWatcher example to only print detectable details.

Fixed

  • Restored automatic entropy initialization when including qnethernet/security/RandomDevice.h. Calling qnethernet_hal_entropy() or qnethernet_hal_fill_entropy() will generate random values again without a prior call to qnethernet_hal_init_entropy() or RandomDevice::instance(). This also affects lwIP's internal LWIP_RAND().

0.31.0

13 Feb 08:46

Choose a tag to compare

0.31.0 Pre-release
Pre-release

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 to connect(...) and stop(). This supersedes calls to connectNoWait(...) and close(). Also added isConnectionTimeoutEnabled().
  • Added templated versions of util::writeFully() and util::writeMagic() that use a break function that static_casts a given object to a bool.
  • 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 String from MDNSClass and 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 IPAddress to a uint32_t or for equality-comparing them.
  • Replaced EthernetClient::writeFully(const char *, size_t) and writeFully(const uint8_t *, size_t) with writeFully(const void *, size_t).
  • Updated the file structure to put most sources underneath src/qnethernet/.
  • Changed EthernetClient::setConnectionTimeout(timeout) and connectionTimeout() to use 32-bit values.
  • Renamed qnethernet_hal_rand() and qnethernet_hal_init_rand() to qnethernet_hal_entropy() and qnethernet_hal_init_entropy(), respectively.
  • Changed the non-entropy version of the entropy functions in the HAL to use std::minstd_rand instead of std::rand() and std::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's driver_init(void) parameters to be empty.

0.30.1

23 Nov 23:30

Choose a tag to compare

0.30.1 Pre-release
Pre-release

Fixed

  • Fixed wait-for-close for non-altcp connections.

0.30.0

21 Nov 17:06

Choose a tag to compare

0.30.0 Pre-release
Pre-release

Added

  • Added a SimpleHTTPClient example.
  • Added a way to get the driver capabilities: EthernetClass::driverCapabilities() and driver_get_capabilities(dc).
  • Added a way to get the library version: EthernetClass::libraryVersion().
  • New QNETHERNET_DO_LOOP_IN_YIELD configuration macro for indicating that the library should attempt to hook into or override yield() to call Ethernet.loop().
  • New version of receiveQueueSize() in EthernetUDP and EthernetFrame that returns the number of unprocessed packets or frames.
  • Added droppedReceiveCount() and totalReceiveCount() to EthernetUDP and EthernetFrame.
  • Added driver_set_link_speed(speed) and driver_set_link_full_duplex(flag).
  • Added EthernetClass::renewDHCP().
  • Added EthernetClass::interfaceName().
  • Added setOutgoingTTL(ttl) and outgoingTTL() functions for modifying and accessing the TTL field, respectively, in the outgoing IP header, to EthernetClient and EthernetUDP.
  • 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 any yield()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) to setReceiveQueueCapacity(capacity) and receiveQueueSize() to receiveQueueCapacity() in both EthernetUDP and EthernetFrame.
  • Updated QNETHERNET_ENABLE_RAW_FRAME_LOOPBACK behaviour to also check for the broadcast MAC addresses.
  • Added FLASHMEM to some driver functions.
  • Changed EthernetClass and MDNSClass hostname() function to return a const char * instead of a String.
  • 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 a static_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

09 Aug 16:12

Choose a tag to compare

0.29.1 Pre-release
Pre-release

Fixed

  • Fixed being able to process more than one incoming frame in a row in the driver.

0.29.0

05 Aug 03:30

Choose a tag to compare

0.29.0 Pre-release
Pre-release

Added

  • Added protected access to the internal std::FILE* stream in the StdioPrint utility class.
  • Added more unit tests:
    • test_ethernet:
      • test_server_zero_port
      • test_server_accept
      • test_server_construct_int_port
  • Added printf format string checking for Print-derived classes. As of this writing, Teensyduino (1.59) and other platforms don't do compiler checking for Print::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's driver_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 Ethernet constructor. This change should make it easier to initialze a MAC address from a custom driver.
  • Changed Arduino-API non-DHCP begin(...) functions to return bool.
  • Improved driver logic so that lwIP options can be included in the driver headers.
  • Improved OSCPrinter example to use the UDP data directly.
  • Renamed driver_set_mac_address_allowed() to driver_set_incoming_mac_address_allowed().
  • Changed driver_proc_input(netif) to return a pbuf*.

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() and peek() 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.