Exemplo n.º 1
0
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()
	}
}
Exemplo n.º 2
0
Arquivo: main.go Projeto: carlware/mio
func onStateChanged(d gatt.Device, s gatt.State) {
	log.Println("State of BT:", s)
	switch s {
	case gatt.StatePoweredOn:
		log.Println("Scanning for ID:", baseDeviceId)
		d.Scan([]gatt.UUID{}, false)
		return
	default:
		d.StopScanning()
	}
}