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.)
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:
kPending
, then it is committed to completing the operation by callingpThis->completeCommand(status)
.Note that a command might
pThis->completeCommand()
before it returnskPending
. (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.)