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

ports/esp32: Make LAN.active(bool) idempotent. #15101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elvis-epx
Copy link
Contributor

@elvis-epx elvis-epx commented May 22, 2024

Do not raise an exception when LAN.active(False) is called but LAN is already inactive, or LAN.active(True) is called but LAN is already active.

Aligns this LAN API with with WLAN.active(bool), which is already idempotent.

Within ESP-IDF, it can be seen at [1] and [2] that esp_eth_start() and esp_eth_stop() return ESP_ERR_INVALID_STATE only when the state contradicts the intention, not for any actual error.

[1] https://github.com/espressif/esp-idf/blob/master/components/esp_eth/src/esp_eth.c#L278
[2] https://github.com/espressif/esp-idf/blob/master/components/esp_eth/src/esp_eth.c#L301

@elvis-epx elvis-epx changed the title Make LAN.active(bool) idempotent ports/esp32: Make LAN.active(bool) idempotent. May 22, 2024
Signed-off-by: Elvis Pfutzenreuter <epxx@epxx.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants