Skip to content

Fix immediate command polling when the device sends timeout 0 - #20

Open
Itay-Sharoni wants to merge 1 commit into
ExpressLRS:unified-lua-lspfrom
Itay-Sharoni:command-timeout-zero
Open

Fix immediate command polling when the device sends timeout 0#20
Itay-Sharoni wants to merge 1 commit into
ExpressLRS:unified-lua-lspfrom
Itay-Sharoni:command-timeout-zero

Conversation

@Itay-Sharoni

Copy link
Copy Markdown

Fixes #16

The next poll of a running command is armed with
getTime() + (field.timeout or 100). In Lua 0 is truthy, so a device that
sends timeout = 0 never gets the 1 s fallback from 6af955a: the POLL goes
out on the next run() pass and on every pass after it, and can reach the
device before its answer to the START write is back. Details in #16.

Treat 0 like a missing timeout and wait the default before polling.
Polling itself stays - some devices only report completion in the answer
to a POLL.

ELRS modules always send 200 (2 s), not affected either way. Checked
against the CRSFSimulator with the Bind command set to timeout 0: before,
its four progress polls go out within 0.25 s, one every other run() pass;
after, one per second. With timeout 50 nothing changes. No device with
timeout 0 here - @wimalopaan, can you verify on yours?

@wimalopaan

Copy link
Copy Markdown

Will do when I'm back at the bench again.

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