mirror of
https://github.com/jwetzell/free-d-go.git
synced 2026-08-20 22:29:01 +00:00
add example
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
|
||||
freeD "github.com/jwetzell/free-d-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
messageBytes := []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)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user