func (b *BLEClientAdaptor) StateChangeHandler(d gatt.Device, s gatt.State) { fmt.Println("State:", s) switch s { case gatt.StatePoweredOn: fmt.Println("scanning...") d.Scan([]gatt.UUID{}, false) return default: d.StopScanning() } }
func onStateChanged(d gatt.Device, s gatt.State) { fmt.Println("State:", s) switch s { case gatt.StatePoweredOn: fmt.Println("scanning...") d.Scan([]gatt.UUID{}, false) return default: d.StopScanning() } }