Skip to content

Commit

Permalink
hci: return service UUIDs with scan results
Browse files Browse the repository at this point in the history
Signed-off-by: deadprogram <[email protected]>
  • Loading branch information
deadprogram authored and bgould committed Jan 27, 2024
1 parent 8e8dd34 commit b6fde65
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gap_hci.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ func (a *Adapter) Scan(callback func(*Adapter, ScanResult)) error {
switch t {
case 0x02, 0x03:
// 16-bit Service Class UUID
adf.ServiceUUIDs = append(adf.ServiceUUIDs, New16BitUUID(binary.LittleEndian.Uint16(a.hci.advData.eirData[i+2:i+4])))
case 0x06, 0x07:
// 128-bit Service Class UUID
var uuid [16]byte
copy(uuid[:], a.hci.advData.eirData[i+2:i+18])
adf.ServiceUUIDs = append(adf.ServiceUUIDs, NewUUID(uuid))
case 0x08, 0x09:
if debug {
println("local name", string(a.hci.advData.eirData[i+2:i+1+l]))
Expand Down

0 comments on commit b6fde65

Please sign in to comment.