From 54231905c5a04533c53485ef4c099cbfe251ebf8 Mon Sep 17 00:00:00 2001 From: Christopher Young Date: Tue, 22 Dec 2015 17:37:39 -0500 Subject: [PATCH] Use build string as a hex value instead of characters. --- main/gen_gdl90.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main/gen_gdl90.go b/main/gen_gdl90.go index d7561b0d..1f936d37 100644 --- a/main/gen_gdl90.go +++ b/main/gen_gdl90.go @@ -362,10 +362,13 @@ func makeSXHeartbeat() []byte { msg[3] = 1 // "message version". // Firmware version. First 4 bytes of build. - msg[4] = byte(stratuxBuild[0]) - msg[5] = byte(stratuxBuild[1]) - msg[6] = byte(stratuxBuild[2]) - msg[7] = byte(stratuxBuild[3]) + build_byte := make([]byte, hex.DecodedLen(len(stratuxBuild))) + hex.Decode(build_byte, []byte(stratuxBuild)) + + msg[4] = build_byte[0] + msg[5] = build_byte[1] + msg[6] = build_byte[2] + msg[7] = build_byte[3] //TODO: Hardware revision. msg[8] = 0xFF