mirror of
https://github.com/jwetzell/free-d-go.git
synced 2026-07-26 10:28:43 +00:00
23 lines
450 B
Go
23 lines
450 B
Go
package main
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
freeD "github.com/jwetzell/free-d-go"
|
|
)
|
|
|
|
func main() {
|
|
|
|
messageBytes := [29]byte{0xd1, 0x01, 0x5a, 0x00, 0x00, 0x2d, 0x00, 0x00, 0xa6, 0x00, 0x00, 0x7f, 0xff, 0x40, 0x7f, 0xff, 0x80, 0x7f, 0xff,
|
|
0xc0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00, 50,
|
|
}
|
|
|
|
decoded, err := freeD.Decode(messageBytes)
|
|
if err != nil {
|
|
slog.Error("error decoding", "err", err)
|
|
}
|
|
|
|
slog.Info("decoded", "message", decoded)
|
|
|
|
}
|