diff --git a/pdu/pdu.go b/pdu/pdu.go index b91f046..9a51c00 100644 --- a/pdu/pdu.go +++ b/pdu/pdu.go @@ -63,3 +63,6 @@ func (p *PDU_HEADER) Decode(data []uint8) error { } return nil } +func (p *PDU_HEADER) Size() uint32 { + return 16 +} \ No newline at end of file diff --git a/pdu/pdu_test.go b/pdu/pdu_test.go index 1e13a53..207b30f 100644 --- a/pdu/pdu_test.go +++ b/pdu/pdu_test.go @@ -441,3 +441,11 @@ func TestDecodeHandlesByteSlicesWithMinimumUint32Values(t *testing.T) { t.Errorf("Expected command_id to be 0, got %d", p.command_id) } } + +// region size +func TestSizeReturns16(t *testing.T) { + var p PDU_HEADER + if p.Size() != 16 { + t.Errorf("Expected size to be 16, got %d", p.Size()) + } +} \ No newline at end of file