code: func (d *Device) Scan(ctx context.Context, allowDup bool, h ble.AdvHandler) error {
  	if err := d.HCI.SetAdvHandler(h); err != nil {
  		return err
  	}
  	if err := d.HCI.Scan(allowDup); err != nil {
  		return err
  	}
  	<-ctx.Done()
  	d.HCI.StopScanning()
  	return ctx.Err()
  }
docs: // Scan starts scanning. Duplicated advertisements will be filtered out if allowDup is set to false.