Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use repeated fields in EnvironmentMetrics #400

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion meshtastic/telemetry.options
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# options for nanopb
# https://jpa.kapsi.fi/nanopb/docs/reference.html#proto-file-options


*EnvironmentMetrics.weather max_count:8
*EnvironmentMetrics.power max_count:8
54 changes: 52 additions & 2 deletions meshtastic/telemetry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,51 @@ message DeviceMetrics {
* Weather station or other environmental metrics
*/
message EnvironmentMetrics {
/*
* Temperature measured
*/
float temperature = 1 [deprecated = true];

/*
* Relative humidity percent measured
*/
float relative_humidity = 2 [deprecated = true];

/*
* Barometric pressure in hPA measured
*/
float barometric_pressure = 3 [deprecated = true];

/*
* Gas resistance in MOhm measured
*/
float gas_resistance = 4 [deprecated = true];

/*
* Voltage measured
*/
float voltage = 5 [deprecated = true];

/*
* Current measured
*/
float current = 6 [deprecated = true];

/*
* WeatherMetric readings
*/
repeated WeatherMetric weather = 7;

/*
* PowerMetric readings
*/
repeated PowerMetric power = 8;
}

/*
* Weather metrics
*/
message WeatherMetric {
/*
* Temperature measured
*/
Expand All @@ -56,16 +101,21 @@ message EnvironmentMetrics {
* Gas resistance in MOhm measured
*/
float gas_resistance = 4;
}

/*
* Power metrics
*/
message PowerMetric {
/*
* Voltage measured
*/
float voltage = 5;
float voltage = 1;

/*
* Current measured
*/
float current = 6;
float current = 2;
}

/*
Expand Down