Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions gattc_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ import (
// Passing a nil slice of UUIDs will return a complete list of
// services.
func (d Device) DiscoverServices(uuids []UUID) ([]DeviceService, error) {
d.prph.DiscoverServices([]cbgo.UUID{})
cbuuids := make([]cbgo.UUID, len(uuids))
for i, u := range uuids {
cbuuid, err := cbgo.ParseUUID(u.String())
if err != nil {
return nil, err
}
cbuuids[i] = cbuuid
}

d.prph.DiscoverServices(cbuuids)

// clear cache of services
d.services = make(map[UUID]DeviceService)
Expand Down Expand Up @@ -106,7 +115,14 @@ func (s DeviceService) UUID() UUID {
// Passing a nil slice of UUIDs will return a complete list of
// characteristics.
func (s DeviceService) DiscoverCharacteristics(uuids []UUID) ([]DeviceCharacteristic, error) {
cbuuids := []cbgo.UUID{}
cbuuids := make([]cbgo.UUID, len(uuids))
for i, u := range uuids {
cbuuid, err := cbgo.ParseUUID(u.String())
if err != nil {
return nil, err
}
cbuuids[i] = cbuuid
}

s.device.prph.DiscoverCharacteristics(cbuuids, s.service)

Expand Down
Loading