stop bluetooth advertisment on connection to save more energy
This commit is contained in:
parent
7494b18d71
commit
ac8737bc42
@ -58,9 +58,11 @@ func main() {
|
|||||||
adapter.SetConnectHandler(func(device bluetooth.Device, connected bool) {
|
adapter.SetConnectHandler(func(device bluetooth.Device, connected bool) {
|
||||||
if connected {
|
if connected {
|
||||||
isBleConnected = true
|
isBleConnected = true
|
||||||
|
adv.Stop()
|
||||||
} else {
|
} else {
|
||||||
isBleConnected = false
|
isBleConnected = false
|
||||||
isCapturing = false
|
isCapturing = false
|
||||||
|
adv.Start()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user