File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,12 @@ func (mac MACAddress) SetRandom(val bool) {
3030}
3131
3232// Set the address
33- func (mac MACAddress ) Set (val interface {}) {
34- m := val .(MAC )
33+ func (mac MACAddress ) Set (val string ) {
34+ m , err := ParseMAC (val )
35+ if err != nil {
36+ return
37+ }
38+
3539 mac .MAC = m
3640}
3741
@@ -72,7 +76,7 @@ type Addresser interface {
7276 String () string
7377
7478 // Set the address
75- Set (val interface {} )
79+ Set (val string )
7680
7781 // Is this address a random address?
7882 // Bluetooth addresses are roughly split in two kinds: public
Original file line number Diff line number Diff line change @@ -24,8 +24,12 @@ func (ad Address) SetRandom(val bool) {
2424}
2525
2626// Set the address
27- func (ad Address ) Set (val interface {}) {
28- ad .UUID = val .(UUID )
27+ func (ad Address ) Set (val string ) {
28+ uuid , err := ParseUUID (val )
29+ if err != nil {
30+ return
31+ }
32+ ad .UUID = uuid
2933}
3034
3135// Scan starts a BLE scan. It is stopped by a call to StopScan. A common pattern
You can’t perform that action at this time.
0 commit comments