Scheduled Messages #14
Replies: 2 comments
-
Here's a proposed specification based on our previous discussions to date: Proposed SpecPC-to-device messages that include a timestamp are interpreted by the device as messages to be executed no earlier than that specified time. If the message can be queued, no reply is issued to these PC-to-device messages until the message has been handled, in which case, a Harp reply message is issued. If the message cannot be queued, a Harp reply message is issued immediately indicating an error attempting to queue the message. This behavior is added to the existing protocol. Devices that support it indicate that they do so by means of a specific register or a spec for a particular device that exists a priori. Attempting to send timestamped messages to a device that does not support scheduled messages results in undefined behavior for that device. Handling edge cases
DownsidesAccording to the above spec, there's no way to throttle the flow rate of queued messages other than sending messages until you get an error. At that point, you can simply retry sending messages starting from the message that failed. AccommodationsThe required changes are: PC Side
Harp Device Side
|
Beta Was this translation helpful? Give feedback.
-
Cancelling Messages Cancelling Everything |
Beta Was this translation helpful? Give feedback.
-
Migrating discussion from Harp-Core-RP2040 repo.
Currently, the protocol does not support scheduled behavior, i.e: "do-this-at-some-future-time-X." Generally, having this behavior opens the door to simultaneous actions to occur across devices on the Harp clock, and it lets us perform certain device behaviors at specific times without PC-to-device communication latency.
One implementation would be to interpret a PC-to-device read/write message that includes the timestamp as a scheduled message to be executed at the specified time. Numerous events could be queued up on the device this way such that the device can perform certain tasks on exact times.
Here are some high-level specification details and edge-cases to keep in mind that we discussed at a recent meeting:
I'll chime in with my thoughts after this message.
Beta Was this translation helpful? Give feedback.
All reactions