stop bluetooth advertisment on connection to save more energy
Some checks failed
xiao_pet_tracker / semantic-pull-request (push) Failing after 1s
xiao_pet_tracker / build (push) Failing after 1s
xiao_pet_tracker / spell-check (push) Failing after 2s

This commit is contained in:
baldeau 2024-11-14 11:10:04 +01:00
parent 7494b18d71
commit ac8737bc42

View File

@ -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()
} }
}) })
// //