Skip to content

Commit

Permalink
Merge pull request #220 from jpoirier/development
Browse files Browse the repository at this point in the history
dongle handling: remove misleading conflict msg, stricter string check
  • Loading branch information
cyoung committed Jan 26, 2016
2 parents 2dfe38a + e371039 commit 30a14d0
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions main/sdr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 30a14d0

Please sign in to comment.