Skip to content

Commit add0328

Browse files
xudongzhengdeadprogram
authored andcommitted
hci: store local address as MACAddress
Signed-off-by: Xudong Zheng <[email protected]>
1 parent 31e1365 commit add0328

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

adapter_hci.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (a *hciAdapter) Address() (MACAddress, error) {
5454
return MACAddress{}, err
5555
}
5656

57-
return MACAddress{MAC: makeAddress(a.hci.address)}, nil
57+
return a.hci.address, nil
5858
}
5959

6060
func newBLEStack(port hciTransport) (*hci, *att) {

hci.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ type hci struct {
140140
pos int
141141
end int
142142
writebuf []byte
143-
address [6]byte
143+
address MACAddress
144144
cmdCompleteOpcode uint16
145145
cmdCompleteStatus uint8
146146
cmdResponse []byte
@@ -318,7 +318,7 @@ func (h *hci) readBdAddr() error {
318318
return err
319319
}
320320

321-
copy(h.address[:], h.cmdResponse[:7])
321+
copy(h.address.MAC[:], h.cmdResponse[:7])
322322

323323
return nil
324324
}

0 commit comments

Comments
 (0)