Actually parsing packets

This commit is contained in:
Ian Gulliver
2016-03-10 17:59:24 -08:00
parent 31392f48b9
commit d5da4fd9d6

View File

@@ -5,6 +5,8 @@ import (
"errors" "errors"
"log" "log"
"os" "os"
"github.com/adsb-tools/sinks/adsb-ws/proto"
) )
func decodeVarint(r *bufio.Reader) (n uint64, err error) { func decodeVarint(r *bufio.Reader) (n uint64, err error) {
@@ -53,7 +55,13 @@ func readInput() {
log.Printf("short read") log.Printf("short read")
break break
} }
log.Println(buf) packet := new(adsb.Adsb)
err = packet.Unmarshal(buf)
if err != nil {
log.Printf("error: %v", err)
break
}
log.Println(packet)
} }
os.Exit(1) os.Exit(1)
} }