From b6fde65fd67470702d4821e7ad5d40df296b792c Mon Sep 17 00:00:00 2001 From: deadprogram Date: Thu, 25 Jan 2024 18:29:08 +0100 Subject: [PATCH] hci: return service UUIDs with scan results Signed-off-by: deadprogram --- gap_hci.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gap_hci.go b/gap_hci.go index 8364bfb..04716a2 100644 --- a/gap_hci.go +++ b/gap_hci.go @@ -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]))