controller

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2020 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HCI

type HCI struct {
	sync.Mutex
	// contains filtered or unexported fields
}

HCI ...

func NewHCI

func NewHCI(smp hci.SmpManagerFactory, cf hci.ConnectionFactory, opts ...ble.Option) (*HCI, error)

NewHCI returns a hci device.

func (*HCI) Accept

func (h *HCI) Accept() (ble.Conn, error)

Accept starts advertising and accepts connection.

func (*HCI) Addr

func (h *HCI) Addr() ble.Addr

func (*HCI) Advertise

func (h *HCI) Advertise() error

Advertise starts advertising.

func (*HCI) AdvertiseAdv

func (h *HCI) AdvertiseAdv(a ble.Advertisement) error

AdvertiseAdv advertises a given Advertisement

func (*HCI) AdvertiseIBeacon

func (h *HCI) AdvertiseIBeacon(u ble.UUID, major, minor uint16, pwr int8) error

AdvertiseIBeacon advertises iBeacon with specified parameters.

func (*HCI) AdvertiseIBeaconData

func (h *HCI) AdvertiseIBeaconData(md []byte) error

AdvertiseIBeaconData advertise iBeacon with given manufacturer data.

func (*HCI) AdvertiseMfgData

func (h *HCI) AdvertiseMfgData(id uint16, md []byte) error

AdvertiseMfgData avertises the given manufacturer data.

func (*HCI) AdvertiseNameAndServices

func (h *HCI) AdvertiseNameAndServices(name string, uuids ...ble.UUID) error

AdvertiseNameAndServices advertises device name, and specified service UUIDs. It tries to fit the UUIDs in the advertising data as much as possible. If name doesn't fit in the advertising data, it will be put in scan response.

func (*HCI) AdvertiseServiceData16

func (h *HCI) AdvertiseServiceData16(id uint16, b []byte) error

AdvertiseServiceData16 advertises data associated with a 16bit service uuid

func (*HCI) Bytes

func (h *HCI) Bytes() []byte

Addr ...

func (*HCI) Close

func (h *HCI) Close() error

Close ...

func (*HCI) CloseConnection

func (h *HCI) CloseConnection(handle uint16) error

func (*HCI) Context

func (h *HCI) Context() context.Context

func (*HCI) Dial

func (h *HCI) Dial(ctx context.Context, a ble.Addr) (ble.Client, error)

Dial ...

func (*HCI) DispatchError

func (h *HCI) DispatchError(e error)

func (*HCI) EnableSecurity

func (h *HCI) EnableSecurity(bm interface{}) error

func (*HCI) Error

func (h *HCI) Error() error

Error ...

func (*HCI) Init

func (h *HCI) Init() error

Init ...

func (*HCI) Option

func (h *HCI) Option(opts ...ble.Option) error

Option sets the options specified.

func (*HCI) RequestBufferPool

func (h *HCI) RequestBufferPool() hci.BufferPool

func (*HCI) RequestSmpManager

func (h *HCI) RequestSmpManager(cfg hci.SmpConfig) (hci.SmpManager, error)

func (*HCI) Scan

func (h *HCI) Scan(allowDup bool) error

Scan starts scanning.

func (*HCI) Send

func (h *HCI) Send(c hci.Command, r hci.CommandRP) error

Send ...

func (*HCI) SetAdvHandler

func (h *HCI) SetAdvHandler(ah ble.AdvHandler) error

SetAdvHandler ...

func (*HCI) SetAdvHandlerSync

func (h *HCI) SetAdvHandlerSync(sync bool) error

SetAdvHandlerSync overrides default advertising handler behavior (async)

func (*HCI) SetAdvParams

func (h *HCI) SetAdvParams(param cmd.LESetAdvertisingParameters) error

SetAdvParams overrides default advertising parameters.

func (*HCI) SetAdvertisement

func (h *HCI) SetAdvertisement(ad []byte, sr []byte) error

SetAdvertisement sets advertising data and scanResp.

func (*HCI) SetCentralRole

func (h *HCI) SetCentralRole() error

SetCentralRole is not supported

func (*HCI) SetConnParams

func (h *HCI) SetConnParams(param cmd.LECreateConnection) error

SetConnParams overrides default connection parameters.

func (*HCI) SetDeviceID

func (h *HCI) SetDeviceID(id int) error

SetDeviceID sets HCI device ID.

func (*HCI) SetDialerTimeout

func (h *HCI) SetDialerTimeout(d time.Duration) error

SetDialerTimeout sets dialing timeout for Dialer.

func (*HCI) SetErrorHandler

func (h *HCI) SetErrorHandler(handler func(error)) error

SetErrorHandler ...

func (*HCI) SetListenerTimeout

func (h *HCI) SetListenerTimeout(d time.Duration) error

SetListenerTimeout sets dialing timeout for Listener.

func (*HCI) SetPeripheralRole

func (h *HCI) SetPeripheralRole() error

SetPeripheralRole is not supported

func (*HCI) SetScanParams

func (h *HCI) SetScanParams(param cmd.LESetScanParameters) error

SetScanParams overrides default scanning parameters.

func (*HCI) SocketWrite

func (h *HCI) SocketWrite(b []byte) (int, error)

func (*HCI) StopAdvertising

func (h *HCI) StopAdvertising() error

StopAdvertising stops advertising.

func (*HCI) StopScanning

func (h *HCI) StopScanning() error

StopScanning stops scanning.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL