While dealing with a procedual generator of harp messages that, for each register in a collection, attempts to grab the content of every register via a read message, a question came up:
Can requests for READ messages contain a null payload?
From the protocol's side, this doesnt seem to be an issue, since there is no minimum length for the payload (in theory can just be 0):
|
### Payload (? bytes) |
|
|
|
The contents of the Harp message. |
Moreover, current examples even highlight this use:
|
#### Read Message |
|
|
|
- [REQ] **Controller**: `1` `4` `Address` `Port` `PayloadType` `Checksum` |
|
- [REP] **Device**: `1` `Length` `Address` `Port` `PayloadType` `Timestamp` `Payload` `Checksum` OK |
|
- [REP] **Device**: `9` `10` `Address` `Port` `PayloadType` `Timestamp` `Payload` `Checksum` ERROR |
I propose we make this explicit by:
1 - Explicitly noting, in the message protocol, that the payload size can be 0
2 - Explicitly add/describe the 0-length message case to the example in the device documentation (https://github.com/harp-tech/protocol/blob/main/Device.md#read-message)
While dealing with a procedual generator of harp messages that, for each register in a collection, attempts to grab the content of every register via a read message, a question came up:
Can requests for READ messages contain a null payload?From the protocol's side, this doesnt seem to be an issue, since there is no minimum length for the payload (in theory can just be 0):
protocol/BinaryProtocol-8bit.md
Lines 164 to 166 in 302d387
Moreover, current examples even highlight this use:
protocol/Device.md
Lines 130 to 134 in 302d387
I propose we make this explicit by:
1 - Explicitly noting, in the message protocol, that the payload size can be 0
2 - Explicitly add/describe the 0-length message case to the example in the device documentation (https://github.com/harp-tech/protocol/blob/main/Device.md#read-message)