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 Control Point Characteristics and implement Record Access Control Point #29

Merged
merged 16 commits into from
Jun 10, 2024

Conversation

Supereg
Copy link
Member

@Supereg Supereg commented May 17, 2024

Support Control Point Characteristics and implement Record Access Control Point

♻️ Current situation & Problem

The Record Access Control Point characteristic is a standardized Bluetooth characteristic to model service-specific procedures for management of a set of data records. While the exact format is specific to the service specification using it, both the Glucose Monitor service and Enhanced Blood Pressure service define a similar format for the Record Access Control Point characteristic. Similar, Omron defines a custom service for their Blood Pressure Cuffs with a similar implementation of the Record Access Control Point characteristic.
This PR implements a Record Access Control Point characteristic that is generic an can be instantiated with the respective service specification. Further, it instantiates it using the GenericOperand that is common to services like the Glucose Monitor and the Enhanced Blood Pressure service. An instantiation of the Omron option service is done in StanfordSpezi/SpeziDevices#1.

To better support control point characteristics, this PR also adds a new ControlPointCharacteristic marker protocol that allows to access native support to sending requests and receiving the response to and from a control point characteristic (one async call instead of writing a value and waiting for the notification).

⚙️ Release Notes

  • Add new ControlPointCharacteristic marker protocol and a sendRequest(_:timeout:) accessor.
  • Add support for the RecordAccessControlPoint characteristic.

📚 Documentation

Documentation catalog was updated to include those new symbols and new symbols were documented accordingly.

✅ Testing

The new characteristic was fully unit tested. We added additional support within the TestingSupport SPI to make unit testing of control point characteristics easier.
Functionality was validated against a Omron Bluetooth device for real-world testing.

📝 Code of Conduct & Contributing Guidelines

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

@Supereg Supereg force-pushed the feature/record-control-point branch 2 times, most recently from 97e2671 to 2a1cc6b Compare May 21, 2024 22:05
Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 68.81720% with 145 lines in your changes missing coverage. Please review.

Project coverage is 75.23%. Comparing base (f3b8cc8) to head (7abfc69).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
- Coverage   76.57%   75.23%   -1.33%     
==========================================
  Files          84       99      +15     
  Lines        4041     4505     +464     
==========================================
+ Hits         3094     3389     +295     
- Misses        947     1116     +169     
Files Coverage Δ
...rdAccess/RecordAccessControlPoint+Operations.swift 100.00% <100.00%> (ø)
...cs/RecordAccess/RecordAccessOperationContent.swift 100.00% <100.00%> (ø)
...RecordAccess/RecordAccessResponseFormatError.swift 100.00% <100.00%> (ø)
...etoothServices/Characteristics/Time/DateTime.swift 92.86% <ø> (ø)
...toothServices/Characteristics/Time/DayOfWeek.swift 91.67% <ø> (ø)
...hServices/Characteristics/WeightScaleFeature.swift 90.52% <ø> (ø)
...luetoothServices/Services/CurrentTimeService.swift 94.12% <100.00%> (ø)
...eziBluetooth/Model/Properties/Characteristic.swift 88.74% <ø> (ø)
...d/CharacteristicAccessor+GenericRecordAccess.swift 98.60% <98.60%> (ø)
...Access/GenericOperand/RecordAccessFilterType.swift 91.67% <91.67%> (ø)
... and 14 more

... 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 f3b8cc8...7abfc69. Read the comment docs.

@Supereg Supereg changed the title Support the Record Access Control Point characteristic Support Control Point Characteristics and implement Record Access Control Point May 21, 2024
@Supereg Supereg force-pushed the feature/record-control-point branch from 2a1cc6b to 06337e5 Compare June 7, 2024 11:09
@Supereg Supereg marked this pull request as ready for review June 9, 2024 18:28
@Supereg Supereg requested a review from PSchmiedmayer June 9, 2024 18:28
Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all the work that went into the PR and record access functionality @Supereg!

@Supereg Supereg merged commit a6f0b1e into main Jun 10, 2024
9 checks passed
@Supereg Supereg deleted the feature/record-control-point branch June 10, 2024 13:57
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