kopia lustrzana https://github.com/cyoung/stratux
put back Devices assignment, change type for atomic store
rodzic
cb1dbcf92f
commit
88ec861fb7
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Ładowanie…
Reference in New Issue