;;; meshtastic/telemetry.proto.lisp
;;;
;;; Generated by the protocol buffer compiler. DO NOT EDIT!

(cl:in-package #:common-lisp-user)

#+sbcl
(cl:progn
 (cl:eval-when (:compile-toplevel) (sb-ext:restrict-compiler-policy 'cl:debug 0 1))
 (cl:declaim (cl:optimize (sb-c:store-coverage-data 0))))

(cl:eval-when (:compile-toplevel :load-toplevel :execute)
  (cl:unless (cl:find-package "CL-PROTOBUFS.MESHTASTIC")
    (cl:defpackage "CL-PROTOBUFS.MESHTASTIC" (:use)
                   (:local-nicknames (#:pi #:cl-protobufs.implementation)))))

(cl:in-package "CL-PROTOBUFS.MESHTASTIC")

(cl:eval-when (:compile-toplevel :load-toplevel :execute)
(pi:define-schema 'telemetry
    :syntax :proto3

     :package "meshtastic")
)


;;; Top-Level enums

(pi:define-enum telemetry-sensor-type
    ()
  (:sensor-unset :index 0)
  (:bme280 :index 1)
  (:bme680 :index 2)
  (:mcp9808 :index 3)
  (:ina260 :index 4)
  (:ina219 :index 5)
  (:bmp280 :index 6)
  (:shtc3 :index 7)
  (:lps22 :index 8)
  (:qmc6310 :index 9)
  (:qmi8658 :index 10)
  (:qmc5883l :index 11)
  (:sht31 :index 12)
  (:pmsa003i :index 13))

;;; Top-Level messages

(pi:define-message device-metrics
    ()
  ;; Fields
  (battery-level
   :index 1 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "batteryLevel")
  (voltage
   :index 2 :type cl:float :kind :scalar :label (:optional) :json-name "voltage")
  (channel-utilization
   :index 3 :type cl:float :kind :scalar :label (:optional) :json-name "channelUtilization")
  (air-util-tx
   :index 4 :type cl:float :kind :scalar :label (:optional) :json-name "airUtilTx"))

(pi:define-message environment-metrics
    ()
  ;; Fields
  (temperature
   :index 1 :type cl:float :kind :scalar :label (:optional) :json-name "temperature")
  (relative-humidity
   :index 2 :type cl:float :kind :scalar :label (:optional) :json-name "relativeHumidity")
  (barometric-pressure
   :index 3 :type cl:float :kind :scalar :label (:optional) :json-name "barometricPressure")
  (gas-resistance
   :index 4 :type cl:float :kind :scalar :label (:optional) :json-name "gasResistance")
  (voltage
   :index 5 :type cl:float :kind :scalar :label (:optional) :json-name "voltage")
  (current
   :index 6 :type cl:float :kind :scalar :label (:optional) :json-name "current"))

(pi:define-message air-quality-metrics
    ()
  ;; Fields
  (pm10-standard
   :index 1 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "pm10Standard")
  (pm25-standard
   :index 2 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "pm25Standard")
  (pm100-standard
   :index 3 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "pm100Standard")
  (pm10-environmental
   :index 4 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "pm10Environmental")
  (pm25-environmental
   :index 5 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "pm25Environmental")
  (pm100-environmental
   :index 6 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "pm100Environmental")
  (particles-03um
   :index 7 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "particles03um")
  (particles-05um
   :index 8 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "particles05um")
  (particles-10um
   :index 9 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "particles10um")
  (particles-25um
   :index 10 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "particles25um")
  (particles-50um
   :index 11 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "particles50um")
  (particles-100um
   :index 12 :type cl-protobufs:uint32 :kind :scalar :label (:optional) :json-name "particles100um"))

(pi:define-message telemetry
    ()
  ;; Fields
  (pi:define-oneof variant ()
    (device-metrics
     :index 2 :type device-metrics :kind :message :label (:optional) :json-name "deviceMetrics")
    (environment-metrics
     :index 3 :type environment-metrics :kind :message :label (:optional) :json-name "environmentMetrics")
    (air-quality-metrics
     :index 4 :type air-quality-metrics :kind :message :label (:optional) :json-name "airQualityMetrics"))
  (time
   :index 1 :type cl-protobufs:fixed32 :kind :scalar :label (:optional) :json-name "time"))

(cl:export '(air-quality-metrics
             air-util-tx
             barometric-pressure
             battery-level
             channel-utilization
             current
             device-metrics
             environment-metrics
             gas-resistance
             particles-03um
             particles-05um
             particles-100um
             particles-10um
             particles-25um
             particles-50um
             pm10-environmental
             pm10-standard
             pm100-environmental
             pm100-standard
             pm25-environmental
             pm25-standard
             relative-humidity
             telemetry
             telemetry-sensor-type
             telemetry-sensor-type-int-to-keyword
             telemetry-sensor-type-keyword-to-int
             temperature
             time
             voltage))
