Skip to content

Commit

Permalink
Make sure we clear the disconnection event before starting a new conn…
Browse files Browse the repository at this point in the history
…ection
  • Loading branch information
ignisf committed Feb 28, 2023
1 parent 3819116 commit e38798e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```
Expand Down Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion src/sbm69/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

__author__ = "Petko Bordjukov <bordjukov+p@gmail.com>"
__version__ = "0.2.0"
__version__ = "0.3.0"

from sbm69.connection import *

Expand Down
2 changes: 2 additions & 0 deletions src/sbm69/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e38798e

Please sign in to comment.