Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions device.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import "context"

// Device ...
type Device interface {
// MAC address of the local device.
Address() Addr

// AddService adds a service to database.
AddService(svc *Service) error

Expand All @@ -14,24 +17,24 @@ type Device interface {
// It removes all currently added services, if any.
SetServices(svcs []*Service) error

// Stop detatch the GATT server from a peripheral device.
// Stop detaches the GATT server from a peripheral device.
Stop() error

// Advertise advertises a given Advertisement
// Advertise advertises a given Advertisement.
Advertise(ctx context.Context, adv Advertisement) error

// AdvertiseNameAndServices advertises device name, and specified service UUIDs.
// It tres to fit the UUIDs in the advertising packet as much as possi
// If name doesn't fit in the advertising packet, it will be put in scan response.
AdvertiseNameAndServices(ctx context.Context, name string, uuids ...UUID) error

// AdvertiseMfgData avertises the given manufacturer data.
// AdvertiseMfgData advertises the given manufacturer data.
AdvertiseMfgData(ctx context.Context, id uint16, b []byte) error

// AdvertiseServiceData16 advertises data associated with a 16bit service uuid
// AdvertiseServiceData16 advertises data associated with a 16bit service uuid.
AdvertiseServiceData16(ctx context.Context, id uint16, b []byte) error

// AdvertiseIBeaconData advertise iBeacon with given manufacturer data.
// AdvertiseIBeaconData advertises iBeacon with given manufacturer data.
AdvertiseIBeaconData(ctx context.Context, b []byte) error

// AdvertiseIBeacon advertises iBeacon with specified parameters.
Expand Down