Arduino_ConnectionHandler icon indicating copy to clipboard operation
Arduino_ConnectionHandler copied to clipboard

Add support for custom Ethernet timeouts

Open manchoz opened this issue 2 years ago • 1 comments

This PR adds support for specifying custom timeouts on Ethernet connections.

Combined with the ArduinoIoTCloud library, this PR allows writing sketches that don't block for 15s in the loop() if the Ethernet cable is not connected or there is no link-layer connectivity.

To be used as:

EthernetConnectionHandler ArduinoIoTPreferredConnection(IP, DNS, GATEWAY, NETMASK, 1000);
  auto connStatus = ArduinoIoTPreferredConnection.check();

  if (connStatus == NetworkConnectionState::CONNECTED)
    ArduinoCloud.update();

manchoz avatar Dec 13 '23 12:12 manchoz

Memory usage change @ 36aa0080e9ecd699e8fc53157f9ea00e2c957639

Board flash % RAM for global variables %
arduino:esp32:nano_nora 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed:envie_m7 N/A N/A N/A N/A
arduino:mbed_edge:edge_control 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_giga:giga 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nicla:nicla_vision 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_opta:opta :small_red_triangle: +160 - +160 +0.01 - +0.01 :small_red_triangle: +32 - +32 +0.01 - +0.01
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 :small_red_triangle: +136 - +136 +0.01 - +0.01 :small_red_triangle: +32 - +32 +0.01 - +0.01
arduino:renesas_uno:unor4wifi 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ConnectionHandlerDemo
flash
% examples/ConnectionHandlerDemo
RAM for global variables
%
arduino:esp32:nano_nora 0 0.0 0 0.0
arduino:mbed:envie_m7 N/A N/A N/A N/A
arduino:mbed_edge:edge_control 0 0.0 0 0.0
arduino:mbed_giga:giga 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 0 0.0 0 0.0
arduino:mbed_nicla:nicla_vision 0 0.0 0 0.0
arduino:mbed_opta:opta 160 0.01 32 0.01
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 136 0.01 32 0.01
arduino:renesas_uno:unor4wifi 0 0.0 0 0.0
arduino:samd:mkr1000 0 0.0 0 0.0
arduino:samd:mkrgsm1400 0 0.0 0 0.0
arduino:samd:mkrnb1500 0 0.0 0 0.0
arduino:samd:mkrwan1300 0 0.0 0 0.0
arduino:samd:mkrwan1310 0 0.0 0 0.0
arduino:samd:mkrwifi1010 0 0.0 0 0.0
arduino:samd:nano_33_iot 0 0.0 0 0.0
esp32:esp32:esp32 0 0.0 0 0.0
esp8266:esp8266:huzzah 0 0.0 0 0.0
Click for full report CSV
Board,examples/ConnectionHandlerDemo<br>flash,%,examples/ConnectionHandlerDemo<br>RAM for global variables,%
arduino:esp32:nano_nora,0,0.0,0,0.0
arduino:mbed:envie_m7,N/A,N/A,N/A,N/A
arduino:mbed_edge:edge_control,0,0.0,0,0.0
arduino:mbed_giga:giga,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0
arduino:mbed_nicla:nicla_vision,0,0.0,0,0.0
arduino:mbed_opta:opta,160,0.01,32,0.01
arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A
arduino:renesas_portenta:portenta_c33,136,0.01,32,0.01
arduino:renesas_uno:unor4wifi,0,0.0,0,0.0
arduino:samd:mkr1000,0,0.0,0,0.0
arduino:samd:mkrgsm1400,0,0.0,0,0.0
arduino:samd:mkrnb1500,0,0.0,0,0.0
arduino:samd:mkrwan1300,0,0.0,0,0.0
arduino:samd:mkrwan1310,0,0.0,0,0.0
arduino:samd:mkrwifi1010,0,0.0,0,0.0
arduino:samd:nano_33_iot,0,0.0,0,0.0
esp32:esp32:esp32,0,0.0,0,0.0
esp8266:esp8266:huzzah,0,0.0,0,0.0

github-actions[bot] avatar Dec 13 '23 12:12 github-actions[bot]