Skip to content

Conversation

@JAndrassy
Copy link
Contributor

@JAndrassyJAndrassy commented Nov 10, 2023

WiFiClient::setTimeout now shadows Stream::setTimeout which has a different purpose and the unit of the parameter is different. Related issue.

The solution is to rename WiFiClient::setTimeout to Arduino standardWiFiClient::setConnectionTimeout.

EDIT: at the end most of this PR was done in #6676 and #8998

overview of Client API in Arduino networking libraries:
https://github.com/JAndrassy/Arduino-Networking-API/blob/main/ArduinoNetAPILibs.md#client-getters-and-setters

@JAndrassyJAndrassyforce-pushed the wifi_client_conn_timeout branch 2 times, most recently from 862dedf to fb1668eCompareNovember 10, 2023 09:33
@SuGliderSuGlider self-assigned this Nov 26, 2023
@VojtechBartoskaVojtechBartoska added the Area: WiFi Issue related to WiFi label Nov 28, 2023
@VojtechBartoskaVojtechBartoska added the Status: Review needed Issue or PR is awaiting review label Nov 28, 2023
@VojtechBartoskaVojtechBartoska added this to the 3.0.0-RC1 milestone Nov 28, 2023
@VojtechBartoska
Copy link
Contributor

Thanks for the PR @JAndrassy.

This relates to #6676.

@P-R-O-C-H-Y PTAL

@JAndrassy
Copy link
ContributorAuthor

the difference is that #6676 doesn't define setConnectioniTimeout (the standard name in Arduino networking API)

@github-actions
Copy link
Contributor

github-actionsbot commented Dec 13, 2023

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "WiFiClients.setConnectionTimeout added":
    • summary looks empty
    • type/action looks empty

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

👋 Hello JAndrassy, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 45abe3d

@JAndrassy
Copy link
ContributorAuthor

after #6676 was merged WiFiClient.setConnectionTimeut now looks here like a new method, but it just the old setTimeout modified (same way this PR does for WiFiClientSecure)

@me-no-dev
Copy link
Member

Please revert any changes to WiFiClientSecure. It will inherit those methods from WiFiClient. That was the point of the previous PR that we merged.

@me-no-dev
Copy link
Member

@P-R-O-C-H-Y PTAL if this makes sense now :)

Copy link
Member

@P-R-O-C-H-YP-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

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

@me-no-dev@JAndrassy please take a look on my comment, if it makes sense to you as well.

@JAndrassyJAndrassyforce-pushed the wifi_client_conn_timeout branch 2 times, most recently from ce0b2a6 to 181e546CompareDecember 14, 2023 13:38
@JAndrassyJAndrassy changed the title WiFiClients - setTimeout replaced with setConnectionTimeoutWiFiClients.setConnectionTimeout addedDec 14, 2023
@JAndrassyJAndrassyforce-pushed the wifi_client_conn_timeout branch from 181e546 to 45abe3dCompareDecember 14, 2023 13:48
@JAndrassy
Copy link
ContributorAuthor

so at the end it is just a simple setter

Copy link
Member

@P-R-O-C-H-YP-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

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

Just simple like that :) side question: Arduino API seems to be unit16_t, should we align or better will be to go with uint32_t as @JAndrassy did.
@me-no-dev?

@TD-er
Copy link
Contributor

It isn't unthinkable someone wants to set it to >65 seconds.
Also it doesn't require a reference value, so existing code expecting uint16_t will still compile.

@JAndrassy
Copy link
ContributorAuthor

JAndrassy commented Dec 14, 2023

the uint32_t is a leftover from rename from int setTimeout(uint32_t seconds);
_timeout is int
int WiFiClient::connect(IPAddress ip, uint16_t port, int32_t timeout_ms)

@me-no-devme-no-dev merged commit 6c919f4 into espressif:masterDec 14, 2023
@TD-er
Copy link
Contributor

TD-er commented Dec 14, 2023

_timeout is int

What would be the interpretation of a negative timeout?

@JAndrassyJAndrassy deleted the wifi_client_conn_timeout branch December 14, 2023 15:31
@VojtechBartoskaVojtechBartoska removed the Status: Review needed Issue or PR is awaiting review label Dec 15, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: WiFiIssue related to WiFi

Projects

Development

Successfully merging this pull request may close these issues.

6 participants

@JAndrassy@VojtechBartoska@me-no-dev@TD-er@P-R-O-C-H-Y@SuGlider