From c60519182ade977506e87dbbde396ba9daeb08d5 Mon Sep 17 00:00:00 2001 From: Greg Date: Wed, 23 Oct 2019 19:29:41 -0400 Subject: [PATCH] Manually call ble.DiscoverSerices(). --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index cf7f16c..ac41da8 100644 --- a/main.go +++ b/main.go @@ -92,9 +92,10 @@ func eventloop() { th.Button(periphs[i].Name).Layout(gtx, btns[i]) if btns[i].Clicked(gtx) { periph = periphs[i] - page = connpage b.StopScan() b.Connect(periph) + page = connpage + w.Invalidate() } }) }) @@ -153,8 +154,11 @@ func eventloop() { b.Connect(e.Peripheral) } case ble.ConnectEvent: + fmt.Printf("Connect event\n") state = "connected" + ble.DiscoverServices(e.Peripheral) page = hrpage + w.Invalidate() } case <- tick.C: w.Invalidate()