put back Devices assignment, change type for atomic store

pull/101/head
Joseph Poirier 2015-11-06 21:57:59 -06:00
rodzic cb1dbcf92f
commit 88ec861fb7
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -455,7 +455,7 @@ func cpuTempMonitor() {
globalStatus.CPUTemp = float32(tInt) // case where Temp is returned as simple integer globalStatus.CPUTemp = float32(tInt) // case where Temp is returned as simple integer
} }
} }
} }
} }
} }
@ -708,7 +708,7 @@ type settings struct {
type status struct { type status struct {
Version string Version string
Devices uint Devices uint32
Connected_Users uint Connected_Users uint
UAT_messages_last_minute uint UAT_messages_last_minute uint
uat_products_last_minute map[string]uint32 uat_products_last_minute map[string]uint32

Wyświetl plik

@ -6,6 +6,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"sync/atomic"
"time" "time"
"../godump978" "../godump978"
@ -228,6 +229,7 @@ func sdrWatcher() {
for { for {
time.Sleep(1 * time.Second) time.Sleep(1 * time.Second)
count := rtl.GetDeviceCount() count := rtl.GetDeviceCount()
atomic.StoreUint32(&globalStatus.Devices, uint32(count))
log.Println("DeviceCount...", count) log.Println("DeviceCount...", count)
// support two and only two dongles // support two and only two dongles