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";
|
2023-01-31 18:29:21 +00:00
|
|
|
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
|
|
|
|
2022-06-28 14:05:42 +00:00
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
|
2022-04-06 20:18:32 +00:00
|
|
|
enum Modulation {
|
2023-06-14 11:51:08 +00:00
|
|
|
// LoRa
|
|
|
|
LORA = 0;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// FSK
|
|
|
|
FSK = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// LR-FHSS
|
|
|
|
LR_FHSS = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum Region {
|
2023-06-14 11:51:08 +00:00
|
|
|
// EU868
|
|
|
|
EU868 = 0;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// US915
|
|
|
|
US915 = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// CN779
|
|
|
|
CN779 = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// EU433
|
|
|
|
EU433 = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// AU915
|
|
|
|
AU915 = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// CN470
|
|
|
|
CN470 = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// AS923
|
|
|
|
AS923 = 7;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// AS923 with -1.80 MHz frequency offset
|
|
|
|
AS923_2 = 12;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// AS923 with -6.60 MHz frequency offset
|
|
|
|
AS923_3 = 13;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// (AS923 with -5.90 MHz frequency offset).
|
|
|
|
AS923_4 = 14;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// KR920
|
|
|
|
KR920 = 8;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// IN865
|
|
|
|
IN865 = 9;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// RU864
|
|
|
|
RU864 = 10;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// ISM2400 (LoRaWAN 2.4 GHz)
|
|
|
|
ISM2400 = 11;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum MType {
|
2023-06-14 11:51:08 +00:00
|
|
|
// JoinRequest.
|
|
|
|
JOIN_REQUEST = 0;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// JoinAccept.
|
|
|
|
JOIN_ACCEPT = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// UnconfirmedDataUp.
|
|
|
|
UNCONFIRMED_DATA_UP = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// UnconfirmedDataDown.
|
|
|
|
UNCONFIRMED_DATA_DOWN = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// ConfirmedDataUp.
|
|
|
|
CONFIRMED_DATA_UP = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// ConfirmedDataDown.
|
|
|
|
CONFIRMED_DATA_DOWN = 5;
|
|
|
|
|
|
|
|
// RejoinRequest.
|
|
|
|
REJOIN_REQUEST = 6;
|
|
|
|
|
|
|
|
// Proprietary.
|
|
|
|
PROPRIETARY = 7;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum MacVersion {
|
2023-06-14 11:51:08 +00:00
|
|
|
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 {
|
2023-06-14 11:51:08 +00:00
|
|
|
A = 0;
|
|
|
|
B = 1;
|
|
|
|
RP002_1_0_0 = 2;
|
|
|
|
RP002_1_0_1 = 3;
|
|
|
|
RP002_1_0_2 = 4;
|
|
|
|
RP002_1_0_3 = 5;
|
2024-05-08 14:05:14 +00:00
|
|
|
RP002_1_0_4 = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum LocationSource {
|
2023-06-14 11:51:08 +00:00
|
|
|
// Unknown.
|
|
|
|
UNKNOWN = 0;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// GPS.
|
|
|
|
GPS = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Manually configured.
|
|
|
|
CONFIG = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Geo resolver (TDOA).
|
|
|
|
GEO_RESOLVER_TDOA = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Geo resolver (RSSI).
|
|
|
|
GEO_RESOLVER_RSSI = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Geo resolver (GNSS).
|
|
|
|
GEO_RESOLVER_GNSS = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Geo resolver (WIFI).
|
|
|
|
GEO_RESOLVER_WIFI = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
2022-06-28 14:05:42 +00:00
|
|
|
enum Aggregation {
|
2023-06-14 11:51:08 +00:00
|
|
|
// Hour.
|
|
|
|
HOUR = 0;
|
2022-06-28 14:05:42 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Day.
|
|
|
|
DAY = 1;
|
2022-06-28 14:05:42 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Month.
|
|
|
|
MONTH = 2;
|
2024-04-17 13:34:11 +00:00
|
|
|
|
|
|
|
// Minute.
|
|
|
|
MINUTE = 3;
|
2022-06-28 14:05:42 +00:00
|
|
|
}
|
|
|
|
|
2022-07-31 12:10:16 +00:00
|
|
|
enum MetricKind {
|
2023-06-14 11:51:08 +00:00
|
|
|
// Incrementing counters that never decrease (these are not reset on each
|
|
|
|
// reading).
|
|
|
|
COUNTER = 0;
|
2022-07-31 12:10:16 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Counters that do get reset upon reading.
|
|
|
|
ABSOLUTE = 1;
|
2022-07-31 12:10:16 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// E.g. a temperature value.
|
|
|
|
GAUGE = 2;
|
2022-07-31 12:10:16 +00:00
|
|
|
}
|
|
|
|
|
2024-04-03 08:52:00 +00:00
|
|
|
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 {
|
2023-06-14 11:51:08 +00:00
|
|
|
// Latitude.
|
|
|
|
double latitude = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Longitude.
|
|
|
|
double longitude = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Altitude.
|
|
|
|
double altitude = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Location source.
|
|
|
|
LocationSource source = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Accuracy.
|
|
|
|
float accuracy = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message KeyEnvelope {
|
2023-06-14 11:51:08 +00:00
|
|
|
// KEK label.
|
|
|
|
string kek_label = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +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
|
|
|
}
|
2022-06-28 14:05:42 +00:00
|
|
|
|
|
|
|
message Metric {
|
2023-06-14 11:51:08 +00:00
|
|
|
// Name.
|
|
|
|
string name = 1;
|
2022-06-28 14:05:42 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Timestamps.
|
|
|
|
repeated google.protobuf.Timestamp timestamps = 2;
|
2022-06-28 14:05:42 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Datasets.
|
|
|
|
repeated MetricDataset datasets = 3;
|
2022-07-31 12:10:16 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Kind.
|
|
|
|
MetricKind kind = 4;
|
2022-06-28 14:05:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message MetricDataset {
|
2023-06-14 11:51:08 +00:00
|
|
|
// 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;
|
2022-06-28 14:05:42 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Class-C.
|
|
|
|
CLASS_C = 2;
|
2022-06-28 14:05:42 +00:00
|
|
|
}
|
2024-02-06 13:16:26 +00:00
|
|
|
|
|
|
|
// Join-Server context.
|
|
|
|
message JoinServerContext {
|
|
|
|
// Session-key ID.
|
|
|
|
string session_key_id = 1;
|
|
|
|
|
|
|
|
// AppSKey envelope.
|
|
|
|
KeyEnvelope app_s_key = 2;
|
2024-04-03 08:52:00 +00:00
|
|
|
}
|