gap: correct use of Address on Linux platform

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2020-08-30 14:53:17 +02:00 committed by Ron Evans
parent 95cabe86a1
commit 8bb26c24e6
2 changed files with 4 additions and 3 deletions

4
gap.go
View file

@ -15,6 +15,7 @@ var (
type MACAddress struct { type MACAddress struct {
// MAC address of the Bluetooth device. // MAC address of the Bluetooth device.
MAC MAC
isRandom bool isRandom bool
} }
@ -30,7 +31,8 @@ func (mac MACAddress) SetRandom(val bool) {
// Set the address // Set the address
func (mac MACAddress) Set(val interface{}) { func (mac MACAddress) Set(val interface{}) {
mac.MAC = val.(MAC) m := val.(MAC)
mac.MAC = m
} }
// AdvertisementOptions configures an advertisement instance. More options may // AdvertisementOptions configures an advertisement instance. More options may

View file

@ -219,8 +219,7 @@ func makeScanResult(props *device.Device1Properties) ScanResult {
serviceUUIDs = append(serviceUUIDs, parsedUUID) serviceUUIDs = append(serviceUUIDs, parsedUUID)
} }
a := Address{} a := &Address{MACAddress{MAC: addr}}
a.Set(addr)
a.SetRandom(props.AddressType == "random") a.SetRandom(props.AddressType == "random")
return ScanResult{ return ScanResult{