Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support configure() call on services and expose BluetoothScanner via APISupport SPI #50

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented Sep 15, 2024

Support configure() call on services and expose BluetoothScanner via APISupport SPI

♻️ Current situation & Problem

Currently it is not possible for a BluetoothService implementation to provide steps for configuration (e.g., set up onChange handlers). Only the BluetoothDevice has a configure() method that can be used for these use cases. This PR adds a new configure() method to BluetoothServices such that their logic can be self-contained.
Additionally, the scanNearbyDevices has really useful logic for Bluetooth Scanners that was previously (< 2.0) accessible in the public interface, but is exclusively accessible to the Bluetooth module and the BluetoothManager. This PR exposes these interfaces as the APISupport SPI. This allows other library developers to reuse the scanNearbyDevices modifier for their custom Bluetooth scanner implementations (e.g., Muse SDK in NAMS).

⚙️ Release Notes

  • Added optional configure() method to the BluetoothService protocol to allow for self-container bluetooth service implementations.
  • Allow to implement your own BluetoothScanner.

📚 Documentation

Added documentation for newly exposed symbols.

✅ Testing

--

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

Copy link

codecov bot commented Sep 15, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.98%. Comparing base (8ee8ba9) to head (a3b8174).

Files with missing lines Patch % Lines
...uetooth/CoreBluetooth/Model/DiscoverySession.swift 50.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   80.92%   80.98%   +0.06%     
==========================================
  Files         108      109       +1     
  Lines        5958     5961       +3     
==========================================
+ Hits         4821     4827       +6     
+ Misses       1137     1134       -3     
Files with missing lines Coverage Δ
Sources/SpeziBluetooth/Bluetooth.swift 88.51% <100.00%> (-0.03%) ⬇️
...peziBluetooth/CoreBluetooth/BluetoothManager.swift 82.54% <100.00%> (+0.20%) ⬆️
...ources/SpeziBluetooth/Model/BluetoothService.swift 100.00% <100.00%> (ø)
...tooth/Model/SemanticModel/SetupDeviceVisitor.swift 86.21% <100.00%> (+0.76%) ⬆️
...Bluetooth/Modifier/ScanNearbyDevicesModifier.swift 71.12% <100.00%> (ø)
...uetooth/CoreBluetooth/Model/DiscoverySession.swift 88.79% <50.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ee8ba9...a3b8174. Read the comment docs.

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.

1 participant