gap: correct use of Address on Linux platform
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
95cabe86a1
commit
8bb26c24e6
2 changed files with 4 additions and 3 deletions
4
gap.go
4
gap.go
|
@ -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
|
||||||
|
|
|
@ -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{
|
||||||
|
|
Loading…
Reference in a new issue