Make lastSentCommand member of DHB #253
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have seen in the LIS3 code that the last command is cached to easily identify the response.
I think it would be nice to have this as a member which is set automatically by the DeviceHandlerBase.
If you think of remebering only the CommandId: DHB does provide a feature to know which commands are sent. LastCommand is not available for the reason that multiple different commands might be executing at the same time, this makes this feature request special to "one command at a time" Devices. But even in those cases we know which command is still in state "isExecuting" and therefore the last sent command.
If you think of remembering the full command, this might be a little bit more difficult. In the "one command at a time" Device, it might still be in its commandBuffer.
But in any case, a user implementation can have that "last command". This might be the safest way to use this because in the more general way it will not be clear when to clear the last command. Especially, if you can sent another command (with a different CommandId) before the last reply was received.
From #299:
returns the last pending command from the cookie info. For DHBs with only one pending command this is equal to the feature you want.