Skip to content

Conversation

@kragacles
Copy link

When the corebluetooth subsystem emits the didModifyServices event the peripheral services become unusable until service discovery is performed again: https://developer.apple.com/documentation/corebluetooth/cbperipheraldelegate/peripheral(_:didmodifyservices:)?language=objc

This PR adds awareness of the didModifyServices event up through to the API layer so that service discovery may be performed again by the user. It also clears discovered services on the corebluetooth platform. While technically only the modified services are unusable after this event, practical testing showed that the peripheral in general is not functional until a full service discovery is performed again.

While adding this support I realized issue: #343 made it impossible to re-discover services without reconnecting to the device. So, this PR also resolves #343 by splitting service discovery off of connection on corebluetooth and moving it to the standalone discover_services() function.

@qwandor qwandor changed the base branch from master to dev January 22, 2026 15:55
@qwandor qwandor added the corebluetooth (macos/ios) Issues related to the MacOS/iOS CoreBluetooth impl label Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

corebluetooth (macos/ios) Issues related to the MacOS/iOS CoreBluetooth impl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CoreBluetooth should do service discovery like other platforms

2 participants