Skip to content

Support commands that don't complete instantly #161

Closed
@terrillmoore

Description

@terrillmoore

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.)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions