aboutsummaryrefslogtreecommitdiff
path: root/protocol.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-12-29 21:52:52 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-12-29 21:52:52 +0100
commit8085261f5e086f1bbb091a4ca9ec4042e62c47a5 (patch)
treefb16d27ae17be4580cbd7846f70824003d078acb /protocol.go
parentfc3669937463b329a815f148106241883020388e (diff)
Works for me
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