syntax = "proto3";

package meshtastic;

option csharp_namespace = "Meshtastic.Protobufs";
option go_package = "github.com/meshtastic/go/generated";
option java_outer_classname = "InterdeviceProtos";
option java_package = "com.geeksville.mesh";
option swift_prefix = "";

// encapsulate up to 1k of NMEA string data

enum MessageType {
  ACK = 0;
  COLLECT_INTERVAL = 160; // in ms
  BEEP_ON = 161; // duration ms
  BEEP_OFF = 162; // cancel prematurely
  SHUTDOWN = 163;
  POWER_ON = 164;
  SCD41_TEMP = 176;
  SCD41_HUMIDITY = 177;
  SCD41_CO2 = 178;
  AHT20_TEMP = 179;
  AHT20_HUMIDITY = 180;
  TVOC_INDEX = 181;
}

message SensorData {
  // The message type
  MessageType type = 1;
  // The sensor data, either as a float or an uint32
  oneof data {
    float float_value = 2;
    uint32 uint32_value = 3;
  }
}

message InterdeviceMessage {
  // The message data
  oneof data {
    string nmea = 1;
    SensorData sensor = 2;
  }
}
