Skip to content

Could we get rid of the ArduinoOTA.handle() ? #1613

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

Closed
mangelajo opened this issue Feb 9, 2016 · 5 comments
Closed

Could we get rid of the ArduinoOTA.handle() ? #1613

mangelajo opened this issue Feb 9, 2016 · 5 comments

Comments

@mangelajo
Copy link
Contributor

Looking at this,
https://github.com/esp8266/Arduino/blob/master/libraries/ArduinoOTA/ArduinoOTA.cpp#L317

we could leave an empty .handle() for backwards compatibility,
and then handle updates also in the _Rx event.

Or allow/disallow such thing via a setting.

Any feedback on why this could be/not be a good idea?.

@igrr
Copy link
Member

igrr commented Feb 9, 2016

ArduinoOTA::_onRx is called from the network task. Since we can't use blocking functions (i.e. WiFiClient::read and WiFiClient::write) in any task other than the main task, calling _runUpdate from _onRx is not possible.

@mangelajo
Copy link
Contributor Author

Ahh, ok @igrr , understood.

Thanks for the feedback. I guess the only way to do such thing then, would be to keep a list of transparent loop callbacks to be called on every "loop" call, and having the ArduinoOTA.begin() register such callback.

But not sure how reasonable that would be.

@igrr
Copy link
Member

igrr commented Feb 9, 2016

Yeah, that would work. We have an issue opened for that: #1064.

@igrr
Copy link
Member

igrr commented Feb 9, 2016

Actually, this won't work if one does all the work inside setup method and never reaches loop.

@mangelajo
Copy link
Contributor Author

Oh, right, but, ok, we can still allow people to use .handle in setup if they need to do such thing. I'd consider that a corner case, I'm closing this in favour of #1064.

Thanks!

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

No branches or pull requests

2 participants