From e371039cd104a6d69b8209a654c7378363de9a6e Mon Sep 17 00:00:00 2001 From: Joseph Poirier Date: Mon, 25 Jan 2016 23:33:19 -0600 Subject: [PATCH] dongle handling: remove misleading conflict msg, stricter string check --- main/sdr.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/main/sdr.go b/main/sdr.go index 3ba22e210..615ddb5b9 100644 --- a/main/sdr.go +++ b/main/sdr.go @@ -377,17 +377,11 @@ func sdrWatcher() { } if UATDev == nil { - // log.Println("\tUATDev == nil") - // preference check based on stratux - // hardware serial when it exists. - // manufact, product, serial, err _, _, serial, err := rtl.GetDeviceUsbStrings(id) if err != nil { serial = "" } - if strings.HasPrefix(serial, "stratux:1090") { - log.Println("Settings conflict: 978UAT set via WebUI but hardware serial says stratux:1090") - } else { + if strings.Compare(serial, "stratux:1090") != 0 { UATDev = &UAT{indexID: id, serial: serial} if err := UATDev.sdrConfig(); err != nil { log.Printf("UATDev = &UAT{indexID: id} failed: %s\n", err) @@ -425,17 +419,11 @@ func sdrWatcher() { } if ESDev == nil { - // log.Println("\tESDev == nil") - // preference check based on stratux - // hardware serial when it exists. - // manufact, product, serial, err _, _, serial, err := rtl.GetDeviceUsbStrings(id) if err != nil { serial = "" } - if strings.HasPrefix(serial, "stratux:978") { - log.Println("Settings conflict: 1090ES set via WebUI but hardware serial says stratux:978") - } else { + if strings.Compare(serial, "stratux:978") != 0 { ESDev = &ES{indexID: id, serial: serial} if err := ESDev.sdrConfig(); err != nil { log.Printf("ESDev = &ES{indexID: id} failed: %s\n", err)