Skip to content

Commit

Permalink
Update BatteryLevel using conditional fields
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrixEditor committed Jan 23, 2024
1 parent b18a630 commit 338e516
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions oralb/blesdk/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,19 @@ class State(enum.IntEnum):
@struct(order=LittleEndian, kw_only=False)
class BatteryLevel:
level: uint8
seconds_left: uint16 // (ctx._root.protocol >= 6)
milli_volts: be + uint16 // (ctx._root.protocol >= 8) = 0
milli_amperes: uint16 // (ctx._root.protocol >= 8) = 0
temperature: int8 // (ctx._root.protocol >= 8) = 0
avail_soc: uint8 // (ctx._root.protocol >= 8) = 0
# dischargeCapacityMilliAmpereSeconds
dcmas: be + uint32 // (ctx._root.protocol >= 8) = 0
# currentConditionRemainingCapacityMilliAmpereSeconds
rcmas: be + uint32 // (ctx._root.protocol >= 8) = 0
soc_state: uint8 // (ctx._root.protocol >= 8) = 0
with ctx._root.protocol >= 6:
seconds_left: uint16

with ctx._root.protocol >= 8:
milli_volts: uint16
milli_amperes: uint16
temperature: int8
avail_soc: uint8
# dischargeCapacityMilliAmpereSeconds
dcmas: uint32
# currentConditionRemainingCapacityMilliAmpereSeconds
rcmas: uint32
soc_state: uint8


# default GATT characteristics
Expand Down

0 comments on commit 338e516

Please sign in to comment.