Skip to content

Explicitly define the payload field requirements for Read request messages #212

@bruno-f-cruz

Description

@bruno-f-cruz

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:

protocol/Device.md

Lines 130 to 134 in 302d387

#### 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)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions