chirpstack/api/proto/common/common.proto

239 lines
3.5 KiB
Protocol Buffer
Raw Normal View History

2022-04-06 20:18:32 +00:00
syntax = "proto3";
package common;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/common";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "CommonProto";
option csharp_namespace = "Chirpstack.Common";
2024-06-11 10:50:02 +00:00
option php_namespace = "Chirpstack\\Common";
option php_metadata_namespace = "GPBMetadata\\Chirpstack\\Common";
2022-04-06 20:18:32 +00:00
import "google/protobuf/timestamp.proto";
2022-04-06 20:18:32 +00:00
enum Modulation {
// LoRa
LORA = 0;
2022-04-06 20:18:32 +00:00
// FSK
FSK = 1;
2022-04-06 20:18:32 +00:00
// LR-FHSS
LR_FHSS = 2;
2022-04-06 20:18:32 +00:00
}
enum Region {
// EU868
EU868 = 0;
2022-04-06 20:18:32 +00:00
// US915
US915 = 2;
2022-04-06 20:18:32 +00:00
// CN779
CN779 = 3;
2022-04-06 20:18:32 +00:00
// EU433
EU433 = 4;
2022-04-06 20:18:32 +00:00
// AU915
AU915 = 5;
2022-04-06 20:18:32 +00:00
// CN470
CN470 = 6;
2022-04-06 20:18:32 +00:00
// AS923
AS923 = 7;
2022-04-06 20:18:32 +00:00
// AS923 with -1.80 MHz frequency offset
AS923_2 = 12;
2022-04-06 20:18:32 +00:00
// AS923 with -6.60 MHz frequency offset
AS923_3 = 13;
2022-04-06 20:18:32 +00:00
// (AS923 with -5.90 MHz frequency offset).
AS923_4 = 14;
2022-04-06 20:18:32 +00:00
// KR920
KR920 = 8;
2022-04-06 20:18:32 +00:00
// IN865
IN865 = 9;
2022-04-06 20:18:32 +00:00
// RU864
RU864 = 10;
2022-04-06 20:18:32 +00:00
// ISM2400 (LoRaWAN 2.4 GHz)
ISM2400 = 11;
2022-04-06 20:18:32 +00:00
}
enum MType {
// JoinRequest.
JOIN_REQUEST = 0;
2022-04-06 20:18:32 +00:00
// JoinAccept.
JOIN_ACCEPT = 1;
2022-04-06 20:18:32 +00:00
// UnconfirmedDataUp.
UNCONFIRMED_DATA_UP = 2;
2022-04-06 20:18:32 +00:00
// UnconfirmedDataDown.
UNCONFIRMED_DATA_DOWN = 3;
2022-04-06 20:18:32 +00:00
// ConfirmedDataUp.
CONFIRMED_DATA_UP = 4;
2022-04-06 20:18:32 +00:00
// ConfirmedDataDown.
CONFIRMED_DATA_DOWN = 5;
// RejoinRequest.
REJOIN_REQUEST = 6;
// Proprietary.
PROPRIETARY = 7;
2022-04-06 20:18:32 +00:00
}
enum MacVersion {
LORAWAN_1_0_0 = 0;
LORAWAN_1_0_1 = 1;
LORAWAN_1_0_2 = 2;
LORAWAN_1_0_3 = 3;
LORAWAN_1_0_4 = 4;
LORAWAN_1_1_0 = 5;
2022-04-06 20:18:32 +00:00
}
enum RegParamsRevision {
A = 0;
B = 1;
RP002_1_0_0 = 2;
RP002_1_0_1 = 3;
RP002_1_0_2 = 4;
RP002_1_0_3 = 5;
RP002_1_0_4 = 6;
2022-04-06 20:18:32 +00:00
}
enum LocationSource {
// Unknown.
UNKNOWN = 0;
2022-04-06 20:18:32 +00:00
// GPS.
GPS = 1;
2022-04-06 20:18:32 +00:00
// Manually configured.
CONFIG = 2;
2022-04-06 20:18:32 +00:00
// Geo resolver (TDOA).
GEO_RESOLVER_TDOA = 3;
2022-04-06 20:18:32 +00:00
// Geo resolver (RSSI).
GEO_RESOLVER_RSSI = 4;
2022-04-06 20:18:32 +00:00
// Geo resolver (GNSS).
GEO_RESOLVER_GNSS = 5;
2022-04-06 20:18:32 +00:00
// Geo resolver (WIFI).
GEO_RESOLVER_WIFI = 6;
2022-04-06 20:18:32 +00:00
}
enum Aggregation {
// Hour.
HOUR = 0;
// Day.
DAY = 1;
// Month.
MONTH = 2;
// Minute.
MINUTE = 3;
}
enum MetricKind {
// Incrementing counters that never decrease (these are not reset on each
// reading).
COUNTER = 0;
// Counters that do get reset upon reading.
ABSOLUTE = 1;
// E.g. a temperature value.
GAUGE = 2;
}
enum Regulation {
// Unknown.
REGULATION_UNKNOWN = 0;
// ETSI EN 300 220.
ETSI_EN_300_220 = 1;
}
2022-04-06 20:18:32 +00:00
message Location {
// Latitude.
double latitude = 1;
2022-04-06 20:18:32 +00:00
// Longitude.
double longitude = 2;
2022-04-06 20:18:32 +00:00
// Altitude.
double altitude = 3;
2022-04-06 20:18:32 +00:00
// Location source.
LocationSource source = 4;
2022-04-06 20:18:32 +00:00
// Accuracy.
float accuracy = 5;
2022-04-06 20:18:32 +00:00
}
message KeyEnvelope {
// KEK label.
string kek_label = 1;
2022-04-06 20:18:32 +00:00
// AES key (when the kek_label is set, this value must first be decrypted).
bytes aes_key = 2;
2022-04-06 20:18:32 +00:00
}
message Metric {
// Name.
string name = 1;
// Timestamps.
repeated google.protobuf.Timestamp timestamps = 2;
// Datasets.
repeated MetricDataset datasets = 3;
// Kind.
MetricKind kind = 4;
}
message MetricDataset {
// Label.
string label = 1;
// Data.
// Each value index corresponds with the same timestamp index of the Metric.
repeated float data = 2;
}
enum DeviceClass {
// Class-A.
CLASS_A = 0;
// Class-B.
CLASS_B = 1;
// Class-C.
CLASS_C = 2;
}
// Join-Server context.
message JoinServerContext {
// Session-key ID.
string session_key_id = 1;
// AppSKey envelope.
KeyEnvelope app_s_key = 2;
}