aboutsummaryrefslogtreecommitdiff
path: root/protocol.go
diff options
context:
space:
mode:
Diffstat (limited to 'protocol.go')
-rw-r--r--protocol.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/protocol.go b/protocol.go
index 5c39db4..e23143c 100644
--- a/protocol.go
+++ b/protocol.go
@@ -79,6 +79,11 @@ func Encode(v interface{}) []byte {
return z
}
+func Decode(b []byte, v interface{}) {
+ buf := bytes.NewBuffer(b)
+ binary.Read(buf, binary.LittleEndian, v)
+}
+
type VehicleMsgVersionResponse struct {
Size uint8
MsgID ID