Skip to content

Commit

Permalink
test(tagsl): corrected port 4 overflowing example
Browse files Browse the repository at this point in the history
  • Loading branch information
simylein committed Jan 20, 2025
1 parent 2982a51 commit 7acb0fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkg/decoder/tagsl/v1/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func TestDecode(t *testing.T) {
},
},
{
payload: "0000003c0000012c000151800078012c05dc02020100010200005460deadbeef",
payload: "0000003c0000012c000151800078012c05dc02020100010200005460000a1000",
port: 4,
autoPadding: false,
skipValidation: true,
Expand All @@ -191,6 +191,8 @@ func TestDecode(t *testing.T) {
HardwareVersionType: 1,
HardwareVersionRevision: 2,
BatteryKeepAliveMessageInterval: 21600,
BatchSize: 10,
BufferSize: 4096,
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions pkg/decoder/tagsl/v1/port4.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ type Port4Payload struct {
FirmwareVersionMinor uint8 `json:"firmwareVersionMinor"`
FirmwareVersionPatch uint8 `json:"firmwareVersionPatch"`
HardwareVersionType uint8 `json:"hardwareVersionType"`
HardwareVersionRevision uint8 `json:"hardwareVersionRevision" validate:"gte=300,lte=604800"`
BatteryKeepAliveMessageInterval uint32 `json:"batteryKeepAliveMessageInterval"`
HardwareVersionRevision uint8 `json:"hardwareVersionRevision"`
BatteryKeepAliveMessageInterval uint32 `json:"batteryKeepAliveMessageInterval" validate:"gte=300,lte=604800"`
BatchSize uint16 `json:"batchSize" validate:"lte=50"`
BufferSize uint16 `json:"bufferSize" validate:"gte=128,lte=8128"`
}

0 comments on commit 7acb0fe

Please sign in to comment.