harp-tech / protocol

Description of the Harp protocol.
https://harp-tech.org/protocol/BinaryProtocol-8bit.html
MIT License
3 stars 5 forks source link

Explicitly state message type req-rply convention #9

Open bruno-f-cruz opened 8 months ago

bruno-f-cruz commented 8 months ago

We assume that for each message to request from the device, at least one message will always be returned from that register and with the same message type. This symmetry should be explicitly stated in the protocol.

Poofjunior commented 7 months ago

Possible solution:

In datasheets for digital MEMs sensors, I've seen these types of transactions disambiguated to request and reply. We could probably adopt that terminology here where:

The documentation currently just refers to these two types as just Harp Messages, which is missing key info about what makes these subtypes different.

bruno-f-cruz commented 7 months ago

I can see how this simplifies things. My question is whether we want to move into a scenario where we assume that the protocol is indeed not symmetrical. For instance, nothing prevents two harp-devices from communicating with each other at this point, using the harp protocol. That being said, I can already see how this might naively break if we move in a direction where we use timestamps of write messages to schedule operations. Under such a scenario, two devices communicating with each other would essentially end up in an infinite message loop of write messages (as the RPLY from device 1 might schedule an event in device 2, and so on...).