Skip to content

Commit

Permalink
fix(tagsl): port 4 now accepts optional size fields
Browse files Browse the repository at this point in the history
  • Loading branch information
simylein committed Jan 20, 2025
1 parent 6ee46d1 commit 9c0db50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/decoder/tagsl/v1/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func (t TagSLv1Decoder) getConfig(port int16) (decoder.PayloadConfig, error) {
{Name: "HardwareVersionType", Start: 22, Length: 1},
{Name: "HardwareVersionRevision", Start: 23, Length: 1},
{Name: "BatteryKeepAliveMessageInterval", Start: 24, Length: 4},
{Name: "BatchSize", Start: 28, Length: 2, Optional: true},
{Name: "BufferSize", Start: 30, Length: 2, Optional: true},
},
TargetType: reflect.TypeOf(Port4Payload{}),
}, nil
Expand Down
2 changes: 2 additions & 0 deletions pkg/decoder/tagsl/v1/port4.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ type Port4Payload struct {
HardwareVersionType uint8 `json:"hardwareVersionType"`
HardwareVersionRevision uint8 `json:"hardwareVersionRevision"`
BatteryKeepAliveMessageInterval uint32 `json:"batteryKeepAliveMessageInterval"`
BatchSize uint16 `json:"batchSize" validate:"lte=50"`
BufferSize uint16 `json:"bufferSize" validate:"gte=128,lte=8128"`
}

0 comments on commit 9c0db50

Please sign in to comment.