File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ func btWorker(done chan bool) {
44
44
}
45
45
ble .SetDefaultDevice (d )
46
46
47
+ log .Printf ("searching for PM5..." )
48
+ rower , err := pm5 .NewClient ()
49
+
50
+ if err != nil {
51
+ log .Printf ("PM5 error: %s" , err )
52
+ continue
53
+ }
54
+
47
55
sensors := peripheral.Sensors {
48
56
peripheral .NewCyclePower (deviceName ),
49
57
peripheral .NewRunningSpeed (deviceName ),
@@ -52,15 +60,6 @@ func btWorker(done chan bool) {
52
60
53
61
log .Println ("advertising sensor services" )
54
62
go ble .AdvertiseNameAndServices (context .Background (), deviceName , sensors .UUIDs ()... )
55
- <- done
56
-
57
- log .Printf ("searching for PM5..." )
58
- rower , err := pm5 .NewClient ()
59
-
60
- if err != nil {
61
- log .Printf ("PM5 error: %s" , err )
62
- continue
63
- }
64
63
65
64
for data := range rower .StatusCh {
66
65
for _ , s := range sensors {
You can’t perform that action at this time.
0 commit comments