blob: 87bc318dd849ee8e47b5b0fa8e3683ad0ad1e9ed [file] [log] [blame]
// Copyright 2024 The Pigweed Authors
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
syntax = "proto3";
package air_sensor;
import "pw_protobuf_protos/common.proto";
service AirSensor {
rpc Measure(pw.protobuf.Empty) returns (Measurement);
rpc MeasureStream(MeasureStreamRequest) returns (stream Measurement);
rpc LogMetrics(pw.protobuf.Empty) returns (pw.protobuf.Empty);
}
message Measurement {
// Ambient air temperature.
float temperature = 1;
// Barometic pressure.
float pressure = 2;
// Relative humidity.
float humidity = 3;
// Electrical resistance, in ohms.
float gas_resistance = 4;
// Air quality score, ranging from 0 (terrible) to 1023 (excellent).
uint32 score = 5;
}
message MeasureStreamRequest {
// The interval at which to sample the temperature sensor. Minimum 500ms.
uint32 sample_interval_ms = 1;
}