func OptAdvParams(param cmd.LESetAdvertisingParameters) Option {
	return func(opt DeviceOption) error {
		opt.SetAdvParams(param)
		return nil
	}
}
OptAdvParams overrides default advertising parameters.
package ble
import (
	"time"
	"github.com/rigado/ble/linux/hci/cmd"
)
type DeviceOption interface {
	SetDialerTimeout(time.Duration) error
	SetListenerTimeout(time.Duration) error
	SetConnParams(cmd.LECreateConnection) error
	SetScanParams(cmd.LESetScanParameters) error
	SetAdvParams(cmd.LESetAdvertisingParameters) error
	SetPeripheralRole() error
	SetCentralRole() error
	SetAdvHandlerSync(bool) error
	SetErrorHandler(handler func(error)) error
	EnableSecurity(interface{}) error
	SetTransportHCISocket(id int) error
	SetTransportH4Socket(addr string, timeout time.Duration) error
	SetTransportH4Uart(path string, baud int) error
	SetGattCacheFile(filename string)
}
type Option func(DeviceOption) error
func OptDeviceID(id int) Option {
	return OptTransportHCISocket(id)
}
func OptDialerTimeout(d time.Duration) Option {
	return func(opt DeviceOption) error {
		opt.SetDialerTimeout(d)
		return nil
	}
}
func OptListenerTimeout(d time.Duration) Option {
	return func(opt DeviceOption) error {
		opt.SetListenerTimeout(d)
		return nil
	}
}
func OptConnParams(param cmd.LECreateConnection) Option {
	return func(opt DeviceOption) error {
		opt.SetConnParams(param)
		return nil
	}
}
func OptScanParams(param cmd.LESetScanParameters) Option {
	return func(opt DeviceOption) error {
		opt.SetScanParams(param)
		return nil
	}
}