Manually call ble.DiscoverSerices().
This commit is contained in:
parent
bda132266d
commit
c60519182a
6
main.go
6
main.go
|
@ -92,9 +92,10 @@ func eventloop() {
|
||||||
th.Button(periphs[i].Name).Layout(gtx, btns[i])
|
th.Button(periphs[i].Name).Layout(gtx, btns[i])
|
||||||
if btns[i].Clicked(gtx) {
|
if btns[i].Clicked(gtx) {
|
||||||
periph = periphs[i]
|
periph = periphs[i]
|
||||||
page = connpage
|
|
||||||
b.StopScan()
|
b.StopScan()
|
||||||
b.Connect(periph)
|
b.Connect(periph)
|
||||||
|
page = connpage
|
||||||
|
w.Invalidate()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -153,8 +154,11 @@ func eventloop() {
|
||||||
b.Connect(e.Peripheral)
|
b.Connect(e.Peripheral)
|
||||||
}
|
}
|
||||||
case ble.ConnectEvent:
|
case ble.ConnectEvent:
|
||||||
|
fmt.Printf("Connect event\n")
|
||||||
state = "connected"
|
state = "connected"
|
||||||
|
ble.DiscoverServices(e.Peripheral)
|
||||||
page = hrpage
|
page = hrpage
|
||||||
|
w.Invalidate()
|
||||||
}
|
}
|
||||||
case <- tick.C:
|
case <- tick.C:
|
||||||
w.Invalidate()
|
w.Invalidate()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user