Add legit test for pdu encoding
This commit is contained in:
@@ -12,6 +12,7 @@ type (
|
||||
Decode(*bytes.Buffer) error
|
||||
// Size in bytes
|
||||
Size() int
|
||||
UpdateSize()
|
||||
}
|
||||
|
||||
PDU_HEADER struct {
|
||||
@@ -80,3 +81,6 @@ func (p *PDU_HEADER) Decode(buf *bytes.Buffer) error {
|
||||
func (p *PDU_HEADER) Size() int {
|
||||
return 16
|
||||
}
|
||||
func (p *PDU_HEADER) UpdateSize() {
|
||||
p.command_length = uint32(p.Size())
|
||||
}
|
||||
Reference in New Issue
Block a user