From 8085261f5e086f1bbb091a4ca9ec4042e62c47a5 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 29 Dec 2016 21:52:52 +0100 Subject: Works for me --- protocol.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'protocol.go') 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 -- cgit v1.2.3