Skip to content

Commit b6fde65

Browse files
deadprogrambgould
authored andcommitted
hci: return service UUIDs with scan results
Signed-off-by: deadprogram <[email protected]>
1 parent 8e8dd34 commit b6fde65

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gap_hci.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ func (a *Adapter) Scan(callback func(*Adapter, ScanResult)) error {
6565
switch t {
6666
case 0x02, 0x03:
6767
// 16-bit Service Class UUID
68+
adf.ServiceUUIDs = append(adf.ServiceUUIDs, New16BitUUID(binary.LittleEndian.Uint16(a.hci.advData.eirData[i+2:i+4])))
6869
case 0x06, 0x07:
6970
// 128-bit Service Class UUID
71+
var uuid [16]byte
72+
copy(uuid[:], a.hci.advData.eirData[i+2:i+18])
73+
adf.ServiceUUIDs = append(adf.ServiceUUIDs, NewUUID(uuid))
7074
case 0x08, 0x09:
7175
if debug {
7276
println("local name", string(a.hci.advData.eirData[i+2:i+1+l]))

0 commit comments

Comments
 (0)