Use build string as a hex value instead of characters.

pull/148/merge
Christopher Young 2015-12-22 17:37:39 -05:00
rodzic 01919b3ab9
commit 54231905c5
1 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -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