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 {
|
||||
// MAC address of the Bluetooth device.
|
||||
MAC
|
||||
|
||||
isRandom bool
|
||||
}
|
||||
|
||||
|
@ -30,7 +31,8 @@ func (mac MACAddress) SetRandom(val bool) {
|
|||
|
||||
// Set the address
|
||||
func (mac MACAddress) Set(val interface{}) {
|
||||
mac.MAC = val.(MAC)
|
||||
m := val.(MAC)
|
||||
mac.MAC = m
|
||||
}
|
||||
|
||||
// AdvertisementOptions configures an advertisement instance. More options may
|
||||
|
|
|
@ -219,8 +219,7 @@ func makeScanResult(props *device.Device1Properties) ScanResult {
|
|||
serviceUUIDs = append(serviceUUIDs, parsedUUID)
|
||||
}
|
||||
|
||||
a := Address{}
|
||||
a.Set(addr)
|
||||
a := &Address{MACAddress{MAC: addr}}
|
||||
a.SetRandom(props.AddressType == "random")
|
||||
|
||||
return ScanResult{
|
||||
|
|
Loading…
Reference in a new issue