You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of the app register's functionality that has been implemented to date relies on an assumption that, as far as I can tell, is not described in the protocol. Each register, regardless of the message type (i.e. READ, WRITE, EVENT) always returns the same "data", ideally the latest value kept in said register. This is essential from the host side as returns from the device can simply be interpreted as "READS" (i.e. WRITE messages are reads after setting a value, EVENT and READ are reads of a register without/with a requests, respectively) and piped through the same pipeline and parsed using the interface.
Motivation
A couple of edge cases that violate this assumption have surfaced and I think we should either 1: accept them or 2: make sure the protocol/standard is explicit on this behavior.
Detailed Design
My proposal is to actively discourage this polymorphic behavior by adding the following language to the protocol:
"Every payload returned from a given register must have the same datatype, length and always return the value of that register, regardless of the message type being returned. If a computation is required to be made on top of the register value for a specific message type. that will not be kept in the register's value, this event should be implemented in a second register"
Drawbacks
If we indeed want to allow polymorphic behavior per register this would effectively make that impossible
Alternatives
Not doing this will make users learn more app-specific edge cases and might break the automatically generated interfaces for some devices
Unresolved Questions
N\A
Design Meetings
TBD
The text was updated successfully, but these errors were encountered:
bruno-f-cruz
changed the title
Discourage register polymorphic behavior contingent on message type
Discourage register polymorphic behavior
Dec 21, 2023
Additionally, although obvious, we should make it very clear that registers not only share the same "function" or "behavior" but also payload structure (e.g. data type, payload size, etc...).
Add to the protocol:
Examples of what to do (use frequency/period as an example) / what not to do (use camera frequency set and possible)
Concept of "units" or "quantity" the thing they represent
Make sure to add that register have the same data type and length regardless of message type
Summary
Most of the app register's functionality that has been implemented to date relies on an assumption that, as far as I can tell, is not described in the protocol. Each register, regardless of the message type (i.e.
READ
,WRITE
,EVENT
) always returns the same "data", ideally the latest value kept in said register. This is essential from the host side as returns from the device can simply be interpreted as "READS" (i.e. WRITE messages are reads after setting a value, EVENT and READ are reads of a register without/with a requests, respectively) and piped through the same pipeline and parsed using the interface.Motivation
A couple of edge cases that violate this assumption have surfaced and I think we should either 1: accept them or 2: make sure the protocol/standard is explicit on this behavior.
Detailed Design
My proposal is to actively discourage this polymorphic behavior by adding the following language to the protocol:
"Every payload returned from a given register must have the same datatype, length and always return the value of that register, regardless of the message type being returned. If a computation is required to be made on top of the register value for a specific message type. that will not be kept in the register's value, this event should be implemented in a second register"
Drawbacks
If we indeed want to allow polymorphic behavior per register this would effectively make that impossible
Alternatives
Not doing this will make users learn more app-specific edge cases and might break the automatically generated interfaces for some devices
Unresolved Questions
N\A
Design Meetings
TBD
The text was updated successfully, but these errors were encountered: