diff --git a/README.md b/README.md index a291860..528a060 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # sbm69 This project provides a library and a CLI to export blood pressure measurements -as CSV from Hans Dinslage GmbH/Silvercrest SBM69 Bluetooth Blood Pressure -Monitor devices. +from SilverCrest® SBM69 Bluetooth Blood Pressure Monitor devices. ## Installation @@ -16,15 +15,17 @@ Just clone the repo and then execute: For example: - $ sbm69 + $ sbm69 > john-doe-blood-pressure-`date +%F`.csv ## Before first use The device requires a one-time pairing in order to provide access to its stored -blood pressure measurements. Before the first connection attempt. In order to do -this, perform the following: +blood pressure measurements. Before the first connection attempt, perform the +following: -1. On Linux, start a terminal and run `bluetoothctl`. +### On Linux + +1. Start a terminal and run `bluetoothctl`. 2. In a second terminal issue the `sbm69` command without any arguments. 3. Press the `M` button on the SBM69 device. 4. In the second terminal you will see output similar to this: @@ -42,12 +43,25 @@ this, perform the following: [CHG] Device B8:B7:7D:XX:XX:XX ServicesResolved: yes [CHG] Device B8:B7:7D:XX:XX:XX Trusted: yes Request passkey - [agent] Enter passkey (number in 0-999999): + [agent] Enter passkey (number in 0-999999): ``` 6. Enter the passkey displayed on the SBM69 device's display before it disappears. +### On macos + +1. Start a terminal that [can request Bluetooth access](https://github.com/hbldh/bleak/issues/761). + Macos' default terminal should do. +2. Call the `sbm69` command. +3. You will be presented with a 'XXX.app would like to use Bluetooth' message. + Click OK. +4. Call the `sbm69` command again. +5. Press the `M` button of your SBM69 device. +6. You will be presented with a dialogue window asking you to enter a + passcode. +7. Enter the passcode displayed on the SBM69 device before it disappears. + ## On the protocol The device uses a protocol based on but not compliant to the Blood Pressure @@ -95,7 +109,7 @@ The `Blood Pressure Feature` characteristic seems to provide incorrect data. It indicates that the device only supports 'Pulse Rate Range Detection Support', which is not the case. -The `Intermedia Cuff Pressure` characteristic is not usable because the device +The `Intermediate Cuff Pressure` characteristic is not usable because the device does not activate Bluetooth during a measurement. The `Blood Pressure Measurement` characteristic is used for transferring the @@ -168,7 +182,6 @@ BloodPressureMeasurement bpm @ 0x00; Note that the `medfloat16` fields from the HDP profile specification have been replaced with `uint16` fields. - ### Further reading: * https://www.bluetooth.com/specifications/specs/gatt-specification-supplement/ diff --git a/pyproject.toml b/pyproject.toml index a3d1287..6994638 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ dependencies = [ "construct >=2.10.68", "inflection >=0.5.1" ] -description = "A library to retrieve blood pressure measurements from the Hans Dinslage GmbH/Silvercrest SBM69 Bluetooth Blood Pressure Monitor" +description = "A library to retrieve blood pressure measurements from the SilverCrest® SBM69 Bluetooth Blood Pressure Monitor" readme = "README.md" classifiers = [ "Development Status :: 3 - Alpha", diff --git a/src/sbm69/__init__.py b/src/sbm69/__init__.py index 04341d0..38a0e96 100644 --- a/src/sbm69/__init__.py +++ b/src/sbm69/__init__.py @@ -1,7 +1,7 @@ from __future__ import annotations __author__ = "Petko Bordjukov " -__version__ = "0.3.0" +__version__ = "0.4.1" from sbm69.connection import * diff --git a/src/sbm69/connection.py b/src/sbm69/connection.py index 6d67351..823c628 100644 --- a/src/sbm69/connection.py +++ b/src/sbm69/connection.py @@ -39,7 +39,11 @@ async def fetch_data(self) -> dict[str, str | construct.Container]: max_attempts=2, use_services_cache=True, ) - await connection.pair() + + try: + await connection.pair() + except NotImplementedError: + pass result["manufacturer_name"] = self._bytearray_as_string( await connection.read_gatt_char(MANUFACTURER_NAME_CHAR_UUID)