Files
hr_visualize/app/proto/hr_packet/__init__.py
2025-06-10 16:26:23 +08:00

97 lines
2.6 KiB
Python

# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: hr_packet.proto
# plugin: python-betterproto
# This file has been @generated
from dataclasses import dataclass
from typing import List
import betterproto
class HrConfidence(betterproto.Enum):
ZERO = 0
"""[0,25)"""
LOW = 1
"""[25,50)"""
MEDIUM = 2
"""[50,75]"""
HIGH = 3
"""(75,100]"""
class LoRaBw(betterproto.Enum):
BW_NONE = 0
BW_10_4 = 8
"""
nobody is using 7.8 kHz bandwidth
so to satisfy protobuf, we use NONE for zero value
"""
BW_15_6 = 1
BW_20_8 = 9
BW_31_25 = 2
BW_41_7 = 10
BW_62_5 = 3
BW_125_0 = 4
BW_250_0 = 5
BW_500_0 = 6
@dataclass(eq=False, repr=False)
class LoRaParameters(betterproto.Message):
bw: "LoRaBw" = betterproto.enum_field(1)
sf: int = betterproto.int32_field(2)
frequency: float = betterproto.float_field(3)
@dataclass(eq=False, repr=False)
class StatusFlag(betterproto.Message):
hr_confidence: "HrConfidence" = betterproto.enum_field(1)
is_active: bool = betterproto.bool_field(2)
is_on_skin: bool = betterproto.bool_field(3)
battery: int = betterproto.uint32_field(4)
@dataclass(eq=False, repr=False)
class HrOnlyPacket(betterproto.Message):
status: "StatusFlag" = betterproto.message_field(1)
id: int = betterproto.uint32_field(2)
packet_num: int = betterproto.uint32_field(3)
hr: int = betterproto.uint32_field(4)
@dataclass(eq=False, repr=False)
class HrPpgPacket(betterproto.Message):
status: "StatusFlag" = betterproto.message_field(1)
id: int = betterproto.uint32_field(2)
packet_num: int = betterproto.uint32_field(3)
hr: int = betterproto.uint32_field(4)
ppg_data: List[int] = betterproto.uint32_field(5)
@dataclass(eq=False, repr=False)
class PacketStatus(betterproto.Message):
signal_rssi_pkt: int = betterproto.sint32_field(1)
"""
Estimation of RSSI of the LoRa® signal (after despreading) on last packet received.
"""
@dataclass(eq=False, repr=False)
class GatewayInfo(betterproto.Message):
region_id: int = betterproto.uint32_field(1)
gateway_mac: bytes = betterproto.bytes_field(2)
radio_parameters: "LoRaParameters" = betterproto.message_field(3)
@dataclass(eq=False, repr=False)
class HrPacket(betterproto.Message):
gateway_info: "GatewayInfo" = betterproto.message_field(1)
hr_only_packet: "HrOnlyPacket" = betterproto.message_field(2, group="packet")
hr_ppg_packet: "HrPpgPacket" = betterproto.message_field(3, group="packet")
packet_status: "PacketStatus" = betterproto.message_field(4)