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

Register WRITE Reply Behavior for Slow Routines #58

Open
1 of 4 tasks
Poofjunior opened this issue Nov 1, 2024 · 1 comment
Open
1 of 4 tasks

Register WRITE Reply Behavior for Slow Routines #58

Poofjunior opened this issue Nov 1, 2024 · 1 comment
Labels
proposal Request for a new feature

Comments

@Poofjunior
Copy link

  • Proposed
  • Prototype: Not Started
  • Implementation: Not Started
  • Specification: Not Started

Summary

Make explicit that the Harp Protocol does not specify whether a device WRITE reply occurs before or after the write's intended behavior has taken effect. Suggest example reply design patterns for uses cases where WRITE messages trigger (1) behavior that happens instantaneously vs (2) behavior that takes a long-period of time to complete.

Motivation

As is, Harp protocol does not specify when a register write reply should be issued. For behaviors that take a negligible amount of time, issuing a reply before or after the write's value has triggered the desired behavior is irrelevant. But for WRITEs that trigger behavior that will take a non-negligible time to complete, a WRITE reply does not make explicit whether the device has started or finished executing the desired behavior.

Detailed Design

The Harp protocol should mention this edge case in describing the behavior of WRITE replies that cannot be handled instantaneously and take a non-negligible time to complete.

The current spec lets developers issues device WRITE replies to indicate either the task start or the task end.

In cases where both the start and end convey meaningful information to the end-user, the spec should suggest: issue a WRITE reply message upon task-start and a follow-up EVENT message upon task completion.

Drawbacks

Leaving this unspecified without suggesting a design pattern makes the spec more difficult to adopt externally as this case will show up in more complicated real-world device use cases.

Alternatives

The current spec leaves this unspecified and does not mention how to handle this case.

Unresolved Questions

  • In the device yaml, should we create an optional field per-register indicating whether a register write reply indicates the start or end of a task?
@Poofjunior Poofjunior added the proposal Request for a new feature label Nov 1, 2024
@Poofjunior Poofjunior changed the title Register Reply Behavior for Slow Routines Register WRITE Reply Behavior for Slow Routines Nov 1, 2024
@bruno-f-cruz
Copy link
Member

I agree with this. We have discussed this before and it should be added under "best practices".
I would say that the "unspoken standard" of having a 1:1 match between write request and reply simplifies a lot of control and analysis. Having every other side-effect conveyed via Event messages makes sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants