Fix the rest of pdu tests
This commit is contained in:
@@ -3,6 +3,7 @@ package pdu
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -64,6 +65,9 @@ func (p *PDU_HEADER) Encode(buf *bytes.Buffer) error {
|
||||
return nil
|
||||
}
|
||||
func (p *PDU_HEADER) Decode(buf *bytes.Buffer) error {
|
||||
if buf == nil {
|
||||
return fmt.Errorf("cannot decode nil buffer")
|
||||
}
|
||||
binary.Read(buf, binary.BigEndian, &p.command_length)
|
||||
binary.Read(buf, binary.BigEndian, &p.command_id)
|
||||
binary.Read(buf, binary.BigEndian, &p.command_status)
|
||||
|
||||
Reference in New Issue
Block a user