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

Support commands that don't complete instantly #161

Closed
terrillmoore opened this issue Apr 20, 2019 · 0 comments
Closed

Support commands that don't complete instantly #161

terrillmoore opened this issue Apr 20, 2019 · 0 comments
Assignees

Comments

@terrillmoore
Copy link
Member

The command parser currently works well, but it doesn't support commands that do things like "read Modbus registers" -- this is an asynchronous operation that completes "later".

High-level summary:

  • Add a kPending code to the list of command statuses.
  • When a command routine returns kPending, then it is committed to completing the operation by calling pThis->completeCommand(status).
  • Change the command dispatcher not to print results and queue status until a completion occurs.

Note that a command might pThis->completeCommand() before it returns kPending. (This is useful when handling completion routines that might call back during the downcall if there's an immediate failure -- they can just call completeCommand no matter when the callback occurs.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant