From e38798eb40e49a76e641cebe534251354fb9e8d3 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Tue, 28 Feb 2023 22:57:01 +0200 Subject: [PATCH] Make sure we clear the disconnection event before starting a new connection --- README.md | 6 +++++- src/sbm69/__init__.py | 2 +- src/sbm69/connection.py | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a5cb71f..a291860 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ this, perform the following: ## On the protocol -The device uses a protocol based on but not compliant to the Blood Measurement +The device uses a protocol based on but not compliant to the Blood Pressure Profile HDP. It exposes the following BLE services and characteristics: ``` @@ -165,6 +165,10 @@ struct BloodPressureMeasurement { 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/src/sbm69/__init__.py b/src/sbm69/__init__.py index 3ef492b..04341d0 100644 --- a/src/sbm69/__init__.py +++ b/src/sbm69/__init__.py @@ -1,7 +1,7 @@ from __future__ import annotations __author__ = "Petko Bordjukov " -__version__ = "0.2.0" +__version__ = "0.3.0" from sbm69.connection import * diff --git a/src/sbm69/connection.py b/src/sbm69/connection.py index 0e735e4..6d67351 100644 --- a/src/sbm69/connection.py +++ b/src/sbm69/connection.py @@ -29,6 +29,8 @@ async def fetch_data(self) -> dict[str, str | construct.Container]: result = {} async with self._connection_lock: + self._disconnected_event.clear() + connection = await establish_connection( client_class=BleakClient, device=self._ble_device,