Skip to content

Use timeout duration of connection attempt according to connection type #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fabik111
Copy link
Collaborator

@fabik111 fabik111 commented Jul 17, 2025

Set the timeout duration of a connection attempt according to the configured connectivity type

Copy link

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.15%. Comparing base (bd82bd6) to head (7df59d7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #17   +/-   ##
=======================================
  Coverage   90.15%   90.15%           
=======================================
  Files           7        7           
  Lines         691      691           
  Branches       83       83           
=======================================
  Hits          623      623           
  Misses         68       68           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Memory usage change @ 7df59d7

Board flash % RAM for global variables %
arduino:mbed_giga:giga 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 🔺 +6 - +6 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 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 🔺 +32 - +32 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:renesas_uno:unor4wifi 🔺 +16 - +16 +0.01 - +0.01 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 +8 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 🔺 +8 - +8 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/NetworkConfiguratorDemo
flash
% examples/NetworkConfiguratorDemo
RAM for global variables
%
arduino:mbed_giga:giga 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect 6 0.0 0 0.0
arduino:mbed_nicla:nicla_vision 0 0.0 0 0.0
arduino:mbed_opta:opta 0 0.0 0 0.0
arduino:mbed_portenta:envie_m7 N/A N/A N/A N/A
arduino:renesas_portenta:portenta_c33 32 0.0 0 0.0
arduino:renesas_uno:unor4wifi 16 0.01 0 0.0
arduino:samd:mkrwifi1010 8 0.0 0 0.0
arduino:samd:nano_33_iot 8 0.0 0 0.0
Click for full report CSV
Board,examples/NetworkConfiguratorDemo<br>flash,%,examples/NetworkConfiguratorDemo<br>RAM for global variables,%
arduino:mbed_giga:giga,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,6,0.0,0,0.0
arduino:mbed_nicla:nicla_vision,0,0.0,0,0.0
arduino:mbed_opta:opta,0,0.0,0,0.0
arduino:mbed_portenta:envie_m7,N/A,N/A,N/A,N/A
arduino:renesas_portenta:portenta_c33,32,0.0,0,0.0
arduino:renesas_uno:unor4wifi,16,0.01,0,0.0
arduino:samd:mkrwifi1010,8,0.0,0,0.0
arduino:samd:nano_33_iot,8,0.0,0,0.0

@fabik111 fabik111 marked this pull request as ready for review July 17, 2025 16:03
@fabik111 fabik111 changed the title Set timeout according connection type Use timeout duration of connection attempt according to connection type Jul 17, 2025
switch (_networkSetting.type) {
#if defined(BOARD_HAS_WIFI)
case NetworkAdapter::WIFI:
timeout = 15000; // 15 seconds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timeout = 15000; // 15 seconds
timeout = NC_CONNECTION_TIMEOUT_ms; // 15 seconds


#if defined(BOARD_HAS_ETHERNET)
case NetworkAdapter::ETHERNET:
timeout = 15000; // 15 seconds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timeout = 15000; // 15 seconds
timeout = NC_CONNECTION_TIMEOUT_ms; // 15 seconds


#if defined(BOARD_HAS_LORA)
case NetworkAdapter::LORA:
timeout 15000; // 15 seconds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timeout 15000; // 15 seconds
timeout NC_CONNECTION_TIMEOUT_ms; // 15 seconds

break;
#endif
default:
timeout = 15000; // Default to 15 seconds for other adapters
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timeout = 15000; // Default to 15 seconds for other adapters
timeout = NC_CONNECTION_TIMEOUT_ms; // Default to 15 seconds for other adapters


#if defined(BOARD_HAS_CELLULAR)
case NetworkAdapter::CELL:
timeout = 30000; // 30 seconds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timeout = 30000; // 30 seconds
timeout = 2 * NC_CONNECTION_TIMEOUT_ms; // 30 seconds


#if defined(BOARD_HAS_CATM1_NBIOT)
case NetworkAdapter::CATM1:
timeout = 30000; // 30 seconds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timeout = 30000; // 30 seconds
timeout = 2 * NC_CONNECTION_TIMEOUT_ms; // 30 seconds


#if defined(BOARD_HAS_GSM)
case NetworkAdapter::GSM:
timeout = 30000; // 30 seconds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timeout = 30000; // 30 seconds
timeout = 2 * NC_CONNECTION_TIMEOUT_ms; // 30 seconds


#if defined(BOARD_HAS_NB)
case NetworkAdapter::NB:
timeout = 30000; // 30 seconds
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
timeout = 30000; // 30 seconds
timeout = 2 * NC_CONNECTION_TIMEOUT_ms; // 30 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants