code: func Scan(ctx context.Context, allowDup bool, h AdvHandler, f AdvFilter) error {
  	if defaultDevice == nil {
  		return ErrDefaultDevice
  	}
  	defer untrap(trap(ctx))
  
  	if f == nil {
  		return defaultDevice.Scan(ctx, allowDup, h)
  	}
  
  	h2 := func(a Advertisement) {
  		if f(a) {
  			h(a)
  		}
  	}
  	return defaultDevice.Scan(ctx, allowDup, h2)
  }
docs: // Scan starts scanning. Duplicated advertisements will be filtered out if allowDup is set to false.