@@ -39,7 +39,7 @@ import (
3939 "github.com/skytracker/skytracker-device/internal/wifi"
4040)
4141
42- const version = "0.9.2 "
42+ const version = "0.9.3 "
4343
4444func main () {
4545 var (
@@ -615,8 +615,7 @@ func main() {
615615 return
616616 case frame := <- uatDecoder .Frames ():
617617 frameType := uat .ClassifyFrame (frame )
618- switch frameType {
619- case "adsb" :
618+ if frameType == "adsb" {
620619 if a , ok := uat .ParseFrame (frame ); ok {
621620 // Update or add aircraft by hex.
622621 found := false
@@ -631,21 +630,22 @@ func main() {
631630 aircraft = append (aircraft , a )
632631 }
633632 }
634- case "uplink" :
635- if cfg . Omni . UAT . FISB . Enabled {
636- products , _ , err := uat . ParseUplinkProducts ( frame )
637- if err != nil {
638- log . Printf ( "[uat] uplink parse error: %v" , err )
639- continue
640- }
641- for _ , p := range products {
642- select {
643- case fisbChan <- p :
644- default :
645- log . Printf ( "[uat] fisb channel full, dropping product" )
646- }
633+ }
634+ case rawUplink := <- uatDecoder . UplinkFrames ():
635+ if cfg . Omni . UAT . FISB . Enabled {
636+ products , err := uat . DecodeRawUplink ( rawUplink . Line )
637+ if err != nil {
638+ log . Printf ( "[uat] uplink decode error: %v" , err )
639+ continue
640+ }
641+ for _ , p := range products {
642+ select {
643+ case fisbChan <- p :
644+ default :
645+ log . Printf ( "[uat] fisb channel full, dropping product" )
647646 }
648- // Update FIS-B stats on the real decoder.
647+ }
648+ if len (products ) > 0 {
649649 if d , ok := uatDecoder .(* uat.UATDecoder ); ok {
650650 d .IncrementFISBStats (len (products ))
651651 }
@@ -1201,6 +1201,7 @@ type acarsDecoderIface interface {
12011201// uatDecoderIface abstracts over uat.UATDecoder and uat.MockUATDecoder.
12021202type uatDecoderIface interface {
12031203 Frames () <- chan uat.RawFrame
1204+ UplinkFrames () <- chan uat.RawFrame
12041205 Stats () uat.DecoderStats
12051206 IsRunning () bool
12061207}
0 commit comments