Skip to content

Releases: ssilverman/QNEthernet

0.30.1

23 Nov 23:30
Compare
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
Compare
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
Compare
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
Compare
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.

0.28.0

15 May 03:44
Compare
Choose a tag to compare
0.28.0 Pre-release
Pre-release

Added

  • Added raw frame loopback support and a QNETHERNET_ENABLE_RAW_FRAME_LOOPBACK macro to enable.
  • Added a fourth step to the MbedTLSDemo example instructions: modify the config.
  • New EthernetFrameClass functions: destinationMAC(), sourceMAC(), etherTypeOrLength(), and payload().
  • Consolidated all the hardware abstraction layer (HAL) functions into one place: qnethernet_hal.cpp.
  • New NullPrint and PrintDecorator utility classes in the qindesign::network::util namespace.
  • 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) and outgoingDiffServ() functions for modifying and accessing the differentiated services (DiffServ) field, respectively, in the outgoing IP header, to EthernetClient and EthernetUDP.
  • Added EthernetUDP::receivedDiffServ() for retrieving the DiffServ value of the last received packet.
  • Added EthernetFrameClass::clear() for clearing the outgoing and incoming buffers.

Changed

  • 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_WRITE to QNETHERNET_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(), and isLinkStateDetectable().
  • Updated EthernetClient::setNoDelay(flag) to return whether successful.
  • Add another 2 to MEMP_NUM_SYS_TIMEOUT option 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 an int.) This matches the new definition at Ethernet - client.connect().
  • Changed EthernetClient::connectNoWait() return types to bool.

Fixed

  • 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() implementation extern "C".
  • Fixed EthernetUDP data 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.

0.27.0

13 Mar 03:15
Compare
Choose a tag to compare
0.27.0 Pre-release
Pre-release

Added

  • New QNETHERNET_FLUSH_AFTER_WRITE configuration macro for flushing after every call to EthernetClient::write(). This may reduce TCP efficiency.
  • Added a W5500 driver.
  • Added a new EthernetHardwareStatus::EthernetTeensy41 enum value.
  • New QNETHERNET_DEFAULT_HOSTNAME option.

Changed

  • Made it easier to add other low-level drivers.
  • Redesigned the driver interface.
  • Un-deprecated EthernetClass::begin(mac, timeout) and begin(mac, ip, dns, gateway, subnet).
  • Un-deprecated EthernetClass::init(sspin) and added a driver function for setting the chip select pin. The type of sspin was also changed to int.
  • Removed dependency on elapsedMillis. This might help with compiling for other platforms.
  • Made the library easier to compile for other platforms.
  • Replaced all #define guards with #pragma once.
  • All QNETHERNET_* configuration macros can now be defined in a new qnethernet_opts.h file 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() and beginMulticastWithReuse() to bool.
  • 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) to enet_get_system_mac(mac).

Fixed

  • Added missing hostByName to 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 to loop().
  • Fixed util::writeMagic() mac parameter to be const.
  • Fixed test_ethernet's tearDown() to remove listeners before calling Ethernet.end(). This ensures no out-of-scope variables are accessed.
  • Updated StdioPrint to not use errno because stdio doesn't set this.

0.26.0

29 Dec 02:27
Compare
Choose a tag to compare
0.26.0 Pre-release
Pre-release

Added

  • Added EthernetClient::localIP().
  • Added EthernetClass::hostByName(hostname, ip) convenience function.
  • Added EthernetClass::setDNSServerIP(index, ip) and dnsServerIP(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_ADAPTER option is set:
    1. qnethernet_altcp_is_tls
    2. qnethernet_altcp_tls_client_cert
    3. qnethernet_altcp_tls_server_cert_count
    4. qnethernet_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.

Changed

  • Updated lwIP to the latest master (5e3268cf).
  • Made the driver non-blocking:
    1. TX: if there's no available buffer descriptors (returns ERR_WOULDBLOCK)
    2. 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
  • 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 calling end().
  • Changed return type of qnethernet_get_allocator to bool.
  • Renamed qnethernet_get_allocator and qnethernet_free_allocator to qnetheret_altcp_get_allocator and qnethernet_altcp_free_allocator, respectively.
  • Changed qnethernet_get_allocator and qnethernet_free_allocator allocator parameter to be a reference.
  • Renamed QNETHERNET_MEMORY_IN_RAM1 to QNETHERNET_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

  • Fixed a printf conversion specifier in the RandomNumbers example. This was causing a compile warning.
  • Fixed location of STATIC_INIT_DECL() for RandomDevice by 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.

0.25.0

26 Oct 16:48
Compare
Choose a tag to compare
0.25.0 Pre-release
Pre-release

Added

  • New "Heap memory use" section in the README that discusses memory allocation functions.
  • New RandomNumbers example.
  • Added a README subsection that talks about the RandomDevice class.
  • Added RandomDevice::instance().
  • Added EthernetClient::status() for getting the TCP connection state.

Changed

  • Enabled the MEM_LIBC_MALLOC option 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 RandomDevice constructor and destructor private.
  • Improved unit tests.
  • Updated lwIP to v2.2.0.

Removed

  • Removed the extern qindesign::security::RandomDevice randomDevice instance from QNEthernet.h because the way to access the device now is via its instance() function (the constructor is also private now). (It had been added in v0.23.0.)

Fixed

  • Fixed enet_init() to always initialize the internal MAC address on first init.
  • Fixed execution error when running main.cpp (MAIN_TEST_PROGRAM macro defined) by removing build_type = debug from platformio.ini.
  • Fixed static initialization order for Ethernet, EthernetFrame, and MDNS singletons by using the Nifty Counter idiom.

0.24.0

07 Aug 03:54
Compare
Choose a tag to compare
0.24.0 Pre-release
Pre-release

Added

  • The new QNETHERNET_MEMORY_IN_RAM1 configuration macro indicates that lwIP-declared memory should go into RAM1.
  • New EthernetFrameClass::receiveQueueSize() function.
  • New EthernetUDP::receiveQueueSize() and setReceiveQueueSize(size) functions.
  • Enabled external definition of macros LWIP_NETIF_LOOPBACK and LWIP_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
  • Added commented-out LWIP_STATS_LARGE option to lwipopts.h.

Changed

  • Changed memory declaration macro, LWIP_DECLARE_MEMORY_ALIGNED(), to use the MEM_ALIGNMENT value.
  • Now calling shrink_to_fit() on the UDP and Ethernet frame queues when changing their size.
  • Add 6 to MEMP_NUM_SYS_TIMEOUT option 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 EthernetClass and EthernetClient constructors explicit.

Fixed

  • 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 an EthernetClient via one of the connectXXX() functions calls close() 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.

0.23.0

12 Jul 22:21
Compare
Choose a tag to compare
0.23.0 Pre-release
Pre-release

Added

  • 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

  • Changed EthernetUDP::localPort() to be const.
  • Changed entropy_random_range() to return zero if EAGAIN.
  • Changed entropy_random_range() to use Daniel Lemire's nearly-divisionless algorithm.
  • Updated lwIP to v2.2.0-rc1.
  • Made StdioPrint single-argument constructor explicit.
  • Updated EthernetClass::linkStatus() to return EthernetLinkStatus::Unknown if the hardware hasn't yet been probed.
  • Updated AltcpTemplate example 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_TIMEOUT option for mDNS instead of 1.

Removed

  • Removed TTL concept from MDNSClass. This enables it to compile with the latest lwIP.

Fixed

  • Fixed SNTP_SET_SYSTEM_TIME_US(sec, us) definition to set the RTC directly because settimeofday() doesn't exist here.
  • Fixed AltcpTemplate example so that it compiles when LWIP_ALTCP isn't set.