Documentation
¶
Index ¶
- type Device
- func (d *Device) AddService(svc *ble.Service) error
- func (d *Device) Address() ble.Addr
- func (d *Device) Advertise(ctx context.Context, adv ble.Advertisement) error
- func (d *Device) AdvertiseIBeacon(ctx context.Context, u ble.UUID, major, minor uint16, pwr int8) error
- func (d *Device) AdvertiseIBeaconData(ctx context.Context, b []byte) error
- func (d *Device) AdvertiseMfgData(ctx context.Context, id uint16, b []byte) error
- func (d *Device) AdvertiseNameAndServices(ctx context.Context, name string, uuids ...ble.UUID) error
- func (d *Device) AdvertiseRaw(ad, sr []byte, params ble.AdvertisingParameters) error
- func (d *Device) AdvertiseServiceData16(ctx context.Context, id uint16, b []byte) error
- func (d *Device) Dial(ctx context.Context, a ble.Addr) (ble.Client, error)
- func (d *Device) NonblockingScan(allowDup bool, h ble.AdvHandler) error
- func (d *Device) RemoveAllServices() error
- func (d *Device) Scan(ctx context.Context, allowDup bool, h ble.AdvHandler) error
- func (d *Device) SendVendorSpecificCommand(opcode uint16, length uint8, v interface{}) error
- func (d *Device) SetServices(svcs []*ble.Service) error
- func (d *Device) Stop() error
- func (d *Device) StopAdvertising() error
- func (d *Device) StopScan() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
Device ...
func NewDeviceWithName ¶
NewDeviceWithName returns the default HCI device.
func (*Device) AddService ¶
AddService adds a service to database.
func (*Device) AdvertiseIBeacon ¶
func (d *Device) AdvertiseIBeacon(ctx context.Context, u ble.UUID, major, minor uint16, pwr int8) error
AdvertiseIBeacon advertises iBeacon with specified parameters.
func (*Device) AdvertiseIBeaconData ¶
AdvertiseIBeaconData advertise iBeacon with given manufacturer data.
func (*Device) AdvertiseMfgData ¶
AdvertiseMfgData avertises the given manufacturer data.
func (*Device) AdvertiseNameAndServices ¶
func (d *Device) AdvertiseNameAndServices(ctx context.Context, name string, uuids ...ble.UUID) error
AdvertiseNameAndServices advertises device name, and specified service UUIDs. It tres to fit the UUIDs in the advertising packet as much as possible. If name doesn't fit in the advertising packet, it will be put in scan response.
func (*Device) AdvertiseRaw ¶ added in v0.6.16
func (d *Device) AdvertiseRaw(ad, sr []byte, params ble.AdvertisingParameters) error
func (*Device) AdvertiseServiceData16 ¶
AdvertiseServiceData16 advertises data associated with a 16bit service uuid
func (*Device) NonblockingScan ¶ added in v0.6.12
func (d *Device) NonblockingScan(allowDup bool, h ble.AdvHandler) error
func (*Device) RemoveAllServices ¶
RemoveAllServices removes all services that are currently in the database.
func (*Device) SendVendorSpecificCommand ¶ added in v0.6.3
func (*Device) SetServices ¶
SetServices set the specified service to the database. It removes all currently added services, if any.