Documentation ¶
Index ¶
- Constants
- type Beacon
- func CreateEddystoneTLM(batt uint16, temp float32, advCnt, secCnt uint32) (*Beacon, error)
- func CreateEddystoneUID(namespace, instance string, txPwr int) (*Beacon, error)
- func CreateEddystoneURL(url string, txPower int) (*Beacon, error)
- func CreateIBeacon(uuid string, major uint16, minor uint16, measuredPower uint16) (*Beacon, error)
- func NewBeacon(dev *device.Device1) (Beacon, error)
- func (b *Beacon) Expose(adapterID string, timeout uint16) (func(), error)
- func (b *Beacon) GetEddystone() BeaconEddystone
- func (b *Beacon) GetFrames() []byte
- func (b *Beacon) GetIBeacon() BeaconIBeacon
- func (b *Beacon) IsEddystone() bool
- func (b *Beacon) IsIBeacon() bool
- func (b *Beacon) Parse() bool
- func (b *Beacon) ParseEddystone(frames []byte) BeaconEddystone
- func (b *Beacon) ParseIBeacon(frames []uint8) BeaconIBeacon
- func (b *Beacon) UnwatchDeviceChanges() error
- func (b *Beacon) WatchDeviceChanges(ctx context.Context) (chan bool, error)
- type BeaconEddystone
- type BeaconIBeacon
- type BeaconType
Constants ¶
const ( BeaconTypeEddystone = "eddystone" BeaconTypeIBeacon = "ibeacon" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Beacon ¶
type Beacon struct { Name string Type BeaconType Device *device.Device1 // contains filtered or unexported fields }
func CreateEddystoneTLM ¶
CreateEddystoneTLM create an eddystone beacon frame with tlm
func CreateEddystoneUID ¶
CreateEddystoneUID create an eddystone beacon frame with uid
func CreateEddystoneURL ¶
CreateEddystoneURL create an eddystone beacon frame with url
func CreateIBeacon ¶
CreateIBeacon Create a beacon in the IBeacon format
func (*Beacon) GetEddystone ¶
func (b *Beacon) GetEddystone() BeaconEddystone
GetEddystone return eddystone beacon information
func (*Beacon) GetIBeacon ¶
func (b *Beacon) GetIBeacon() BeaconIBeacon
GetIBeacon return if the type of beacon is ibeacon
func (*Beacon) IsEddystone ¶
IsEddystone return if the type of beacon is eddystone
func (*Beacon) ParseEddystone ¶
func (b *Beacon) ParseEddystone(frames []byte) BeaconEddystone
func (*Beacon) ParseIBeacon ¶
func (b *Beacon) ParseIBeacon(frames []uint8) BeaconIBeacon
From Apple specifications Byte(s) Name Value Notes 0 Flags[0] 0x02 See Bluetooth 4.0 Core Specification , Volume 3, Appendix C, 18.1. 1 Flags[1] 0x01 See Bluetooth 4.0 Core Specification , Volume 3, Appendix C, 18.1. 2 Flags[2] 0x06 See Bluetooth 4.0 Core Specification , Volume 3, Appendix C, 18.1. 3 Length 0x1A See Bluetooth 4.0 Core Specification 4 Type 0xFF See Bluetooth 4.0 Core Specification 5 Company ID[0] 0x4C Must not be used for any purposes not specified by Apple. 6 Company ID[1] 0x00 Must not be used for any purposes not specified by Apple. ---- Bluez data starts here ---- 7 Beacon Type[0] 0x02 Must be set to 0x02 for all Proximity Beacons 8 Beacon Type[1] 0x15 Must be set to 0x15 for all Proximity Beacons 9-24 Proximity UUID 0xnn..nn See CLBeaconRegion class in iOS Developer Library. Must not be set to all 0s. 25-26 Major 0xnnnn See CLBeaconRegion class in iOS Developer Library. 0x0000 = unset. 27-28 Minor 0xnnnn See CLBeaconRegion class in iOS Developer Library. 0x0000 = unset. 29 Measured Power 0xnn See Measured Power (page 7)
func (*Beacon) UnwatchDeviceChanges ¶
type BeaconEddystone ¶
type BeaconIBeacon ¶
type BeaconType ¶
type BeaconType string