Skip to content

fix(darwin): Device.DiscoverServices() filters discovered services#428

Merged
deadprogram merged 2 commits intotinygo-org:devfrom
acouvreur:filter-services-on-discovery
Mar 24, 2026
Merged

fix(darwin): Device.DiscoverServices() filters discovered services#428
deadprogram merged 2 commits intotinygo-org:devfrom
acouvreur:filter-services-on-discovery

Conversation

@acouvreur
Copy link
Copy Markdown
Contributor

@acouvreur acouvreur commented Mar 21, 2026

Currently, even if you pass a slice of services to discover. CoreBluetooth still discover ALL services which is slow.

As per the CoreBluetooth documentation:

If the servicesUUIDs parameter is nil, this method returns all of the peripheral’s available services. This is much slower than providing an array of service UUIDs to search for.


Edit: also added the same fix for DiscoverCharacteristics

Currently, even if you pass a slice of services to discover. CoreBluetooth still discover ALL services.

As per the CoreBluetooth documentation: "If the servicesUUIDs parameter is nil, this method returns all of the peripheral’s available services. This is much slower than providing an array of service UUIDs to search for."
…acteristics

Currently, even if you pass a slice of characteristics to discover. CoreBluetooth still discover ALL characteristics.

As per the CoreBluetooth documentation: " If the characteristicUUIDs parameter is nil, this method returns all of the service’s characteristics. This is much slower than providing an array of characteristic UUIDs to search for."
@deadprogram
Copy link
Copy Markdown
Member

Thank you very much for the fix here @acouvreur now squash/merging.

@deadprogram deadprogram merged commit fbd688e into tinygo-org:dev Mar 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants