Skip to content
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

WiFiClients.setConnectionTimeout added #8863

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

JAndrassy
Copy link
Contributor

@JAndrassy JAndrassy 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 standard WiFiClient::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

@JAndrassy JAndrassy force-pushed the wifi_client_conn_timeout branch 2 times, most recently from 862dedf to fb1668e Compare November 10, 2023 09:33
@SuGlider SuGlider self-assigned this Nov 26, 2023
@VojtechBartoska VojtechBartoska added the Area: WiFi Issue related to WiFi label Nov 28, 2023
@VojtechBartoska VojtechBartoska added the Status: Review needed Issue or PR is awaiting review label Nov 28, 2023
@VojtechBartoska VojtechBartoska added this to the 3.0.0-RC1 milestone Nov 28, 2023
@VojtechBartoska
Copy link
Collaborator

Thanks for the PR @JAndrassy.

This relates to #6676.

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

@JAndrassy
Copy link
Contributor Author

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

Copy link
Contributor

github-actions bot 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
Contributor Author

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-Y P-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.

libraries/WiFi/src/WiFiClient.cpp Outdated Show resolved Hide resolved
libraries/HTTPClient/src/HTTPClient.cpp Outdated Show resolved Hide resolved
@JAndrassy JAndrassy force-pushed the wifi_client_conn_timeout branch 2 times, most recently from ce0b2a6 to 181e546 Compare December 14, 2023 13:38
@JAndrassy JAndrassy changed the title WiFiClients - setTimeout replaced with setConnectionTimeout WiFiClients.setConnectionTimeout added Dec 14, 2023
@JAndrassy
Copy link
Contributor Author

so at the end it is just a simple setter

Copy link
Member

@P-R-O-C-H-Y P-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

TD-er commented Dec 14, 2023

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
Contributor Author

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-dev me-no-dev merged commit 6c919f4 into espressif:master Dec 14, 2023
39 checks passed
@TD-er
Copy link
Contributor

TD-er commented Dec 14, 2023

_timeout is int

What would be the interpretation of a negative timeout?

@JAndrassy JAndrassy deleted the wifi_client_conn_timeout branch December 14, 2023 15:31
@VojtechBartoska VojtechBartoska removed the Status: Review needed Issue or PR is awaiting review label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: WiFi Issue related to WiFi
Projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants