Skip to content

Commit

Permalink
hci: store local address as MACAddress
Browse files Browse the repository at this point in the history
Signed-off-by: Xudong Zheng <[email protected]>
  • Loading branch information
xudongzheng committed Jan 28, 2024
1 parent 7e312b3 commit 393949d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion adapter_hci.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (a *hciAdapter) Address() (MACAddress, error) {
return MACAddress{}, err
}

return MACAddress{MAC: makeAddress(a.hci.address)}, nil
return a.hci.address, nil
}

func (a *Adapter) SetRandomAddress(mac MAC) error {
Expand Down
4 changes: 2 additions & 2 deletions hci.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ type hci struct {
att *att
l2cap *l2cap
buf []byte
address [6]byte
address MACAddress
cmdCompleteOpcode uint16
cmdCompleteStatus uint8
cmdResponse []byte
Expand Down Expand Up @@ -256,7 +256,7 @@ func (h *hci) readBdAddr() error {
return err
}

copy(h.address[:], h.cmdResponse[:7])
copy(h.address.MAC[:], h.cmdResponse[:7])

return nil
}
Expand Down

0 comments on commit 393949d

Please sign in to comment.