feat: mqtt receive.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,190 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package whgw_hr;
|
||||
|
||||
option go_package = "hr_receiver/proto;whgw_hrpb";
|
||||
|
||||
enum HrConfidence {
|
||||
ZERO = 0;
|
||||
LOW = 1;
|
||||
MEDIUM = 2;
|
||||
HIGH = 3;
|
||||
}
|
||||
|
||||
enum LoRaBW {
|
||||
BW_NONE = 0;
|
||||
BW_10_4 = 0x08;
|
||||
BW_15_6 = 0x01;
|
||||
BW_20_8 = 0x09;
|
||||
BW_31_25 = 0x02;
|
||||
BW_41_7 = 0x0A;
|
||||
BW_62_5 = 0x03;
|
||||
BW_125_0 = 0x04;
|
||||
BW_250_0 = 0x05;
|
||||
BW_500_0 = 0x06;
|
||||
}
|
||||
|
||||
message LoRaParameters {
|
||||
LoRaBW bw = 1;
|
||||
uint32 sf = 2;
|
||||
float frequency_mhz = 3;
|
||||
}
|
||||
|
||||
message StatusFlag {
|
||||
HrConfidence hr_confidence = 1;
|
||||
bool is_active = 2;
|
||||
bool is_on_skin = 3;
|
||||
uint32 battery = 4;
|
||||
}
|
||||
|
||||
message HrPacket {
|
||||
StatusFlag status = 1;
|
||||
uint32 id = 2;
|
||||
uint32 packet_num = 3;
|
||||
uint32 hr = 4;
|
||||
}
|
||||
|
||||
message StepCountPacket {
|
||||
uint32 id = 1;
|
||||
uint32 packet_num = 2;
|
||||
uint32 step_count = 3;
|
||||
}
|
||||
|
||||
message RawPacketStatus {
|
||||
uint32 signal_rssi_x2_neg = 1;
|
||||
int32 snr_pkt_x4 = 2;
|
||||
}
|
||||
|
||||
message PacketStatus {
|
||||
float signal_rssi_neg = 1;
|
||||
float snr_pkt = 2;
|
||||
}
|
||||
|
||||
message HubInfo {
|
||||
uint32 bus_id = 1;
|
||||
uint32 sub_dev_id = 2;
|
||||
LoRaParameters radio_parameters = 3;
|
||||
}
|
||||
|
||||
message RadioData {
|
||||
HubInfo hub_info = 1;
|
||||
RawPacketStatus raw_packet_status = 2;
|
||||
bytes data = 3;
|
||||
}
|
||||
|
||||
enum PacketKind {
|
||||
NTF = 0;
|
||||
SIG = 1;
|
||||
INF = 2;
|
||||
CNF = 3;
|
||||
REQ = 4;
|
||||
RSP = 5;
|
||||
}
|
||||
|
||||
message GatewayStateReport {
|
||||
bool network_has_connection = 1;
|
||||
bool network_has_ip = 2;
|
||||
bool network_has_mqtt_connection = 3;
|
||||
bool bluetooth_has_connect = 4;
|
||||
uint32 error_code = 5;
|
||||
}
|
||||
|
||||
message HubSlaveOutGatewayMasterInMsg {
|
||||
oneof choice {
|
||||
RadioData ntf_radio_data = 1;
|
||||
BatteryInfo ntf_battery_info = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message GatewayMasterOutHubSlaveInMsg {
|
||||
oneof choice {
|
||||
GatewayStateReport sig_gateway_state_report = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message GatewaySlaveOutCloudMasterInMsg {
|
||||
oneof choice {
|
||||
HrMeasurement ntf_hr_measurement = 1;
|
||||
GatewayStatus ntf_gateway_status = 2;
|
||||
StepCountMeasurement ntf_step_count_measurement = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message BatteryInfo {
|
||||
uint32 voltage_mv = 1;
|
||||
uint32 soc_percentage = 2;
|
||||
sint32 charging_rate_percentage = 3;
|
||||
}
|
||||
|
||||
message GatewayInfo {
|
||||
uint32 region_id = 1;
|
||||
bytes gateway_mac = 2;
|
||||
}
|
||||
|
||||
message IPacketStatus {
|
||||
oneof choice {
|
||||
RawPacketStatus raw = 1;
|
||||
PacketStatus parsed = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message HrMeasurement {
|
||||
HrPacket hr_packet = 1;
|
||||
IPacketStatus packet_status = 2;
|
||||
GatewayInfo gateway_info = 3;
|
||||
HubInfo hub_info = 4;
|
||||
}
|
||||
|
||||
message StepCountMeasurement {
|
||||
StepCountPacket step_count_packet = 1;
|
||||
IPacketStatus packet_status = 2;
|
||||
GatewayInfo gateway_info = 3;
|
||||
HubInfo hub_info = 4;
|
||||
}
|
||||
|
||||
message GatewayStatistic {
|
||||
uint32 boot_count = 1;
|
||||
uint32 uptime_ms = 2;
|
||||
uint32 duration_ms_since_last_packet = 3;
|
||||
uint32 rx_count = 4;
|
||||
BatteryInfo battery_info = 5;
|
||||
}
|
||||
|
||||
message GatewayStatus {
|
||||
GatewayInfo info = 1;
|
||||
GatewayStatistic stat = 2;
|
||||
}
|
||||
|
||||
message Status {
|
||||
int32 code = 1;
|
||||
string message = 2;
|
||||
}
|
||||
|
||||
enum GatewayConfigEntryKind {
|
||||
REGION_ID = 0;
|
||||
WIFI_SSID = 1;
|
||||
WIFI_PASSWORD = 2;
|
||||
}
|
||||
|
||||
message GatewayConfigEntry {
|
||||
oneof choice {
|
||||
uint32 region_id = 1;
|
||||
string wifi_ssid = 2;
|
||||
string wifi_password = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message GatewayConfigMasterOutSlaveInMsg {
|
||||
oneof choice {
|
||||
GatewayConfigEntry cnf_get_entry = 1;
|
||||
Status cnf_get_failure = 2;
|
||||
Status cnf_set_entry = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message GatewayConfigMasterInSlaveOutMsg {
|
||||
oneof choice {
|
||||
GatewayConfigEntryKind inf_get_entry = 1;
|
||||
GatewayConfigEntry inf_set_entry = 2;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user