mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-05-05 02:23:08 +00:00
Add enabled class to DeviceInfo in events.
This commit is contained in:
parent
d6d735cb03
commit
6480b3bbd5
13
api/proto/api/device.proto
vendored
13
api/proto/api/device.proto
vendored
@ -167,17 +167,6 @@ service DeviceService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum DeviceClass {
|
|
||||||
// Class-A.
|
|
||||||
A = 0;
|
|
||||||
|
|
||||||
// Class-B.
|
|
||||||
B = 1;
|
|
||||||
|
|
||||||
// Class-C.
|
|
||||||
C = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Device {
|
message Device {
|
||||||
// DevEUI (EUI64).
|
// DevEUI (EUI64).
|
||||||
string dev_eui = 1;
|
string dev_eui = 1;
|
||||||
@ -302,7 +291,7 @@ message GetDeviceResponse {
|
|||||||
DeviceStatus device_status = 5;
|
DeviceStatus device_status = 5;
|
||||||
|
|
||||||
// Enabled class.
|
// Enabled class.
|
||||||
DeviceClass enabled_class = 6;
|
common.DeviceClass enabled_class = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UpdateDeviceRequest {
|
message UpdateDeviceRequest {
|
||||||
|
242
api/proto/common/common.proto
vendored
242
api/proto/common/common.proto
vendored
@ -11,193 +11,205 @@ option csharp_namespace = "Chirpstack.Common";
|
|||||||
import "google/protobuf/timestamp.proto";
|
import "google/protobuf/timestamp.proto";
|
||||||
|
|
||||||
enum Modulation {
|
enum Modulation {
|
||||||
// LoRa
|
// LoRa
|
||||||
LORA = 0;
|
LORA = 0;
|
||||||
|
|
||||||
// FSK
|
// FSK
|
||||||
FSK = 1;
|
FSK = 1;
|
||||||
|
|
||||||
// LR-FHSS
|
// LR-FHSS
|
||||||
LR_FHSS = 2;
|
LR_FHSS = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Region {
|
enum Region {
|
||||||
// EU868
|
// EU868
|
||||||
EU868 = 0;
|
EU868 = 0;
|
||||||
|
|
||||||
// US915
|
// US915
|
||||||
US915 = 2;
|
US915 = 2;
|
||||||
|
|
||||||
// CN779
|
// CN779
|
||||||
CN779 = 3;
|
CN779 = 3;
|
||||||
|
|
||||||
// EU433
|
// EU433
|
||||||
EU433 = 4;
|
EU433 = 4;
|
||||||
|
|
||||||
// AU915
|
// AU915
|
||||||
AU915 = 5;
|
AU915 = 5;
|
||||||
|
|
||||||
// CN470
|
// CN470
|
||||||
CN470 = 6;
|
CN470 = 6;
|
||||||
|
|
||||||
// AS923
|
// AS923
|
||||||
AS923 = 7;
|
AS923 = 7;
|
||||||
|
|
||||||
// AS923 with -1.80 MHz frequency offset
|
// AS923 with -1.80 MHz frequency offset
|
||||||
AS923_2 = 12;
|
AS923_2 = 12;
|
||||||
|
|
||||||
// AS923 with -6.60 MHz frequency offset
|
// AS923 with -6.60 MHz frequency offset
|
||||||
AS923_3 = 13;
|
AS923_3 = 13;
|
||||||
|
|
||||||
// (AS923 with -5.90 MHz frequency offset).
|
// (AS923 with -5.90 MHz frequency offset).
|
||||||
AS923_4 = 14;
|
AS923_4 = 14;
|
||||||
|
|
||||||
// KR920
|
// KR920
|
||||||
KR920 = 8;
|
KR920 = 8;
|
||||||
|
|
||||||
// IN865
|
// IN865
|
||||||
IN865 = 9;
|
IN865 = 9;
|
||||||
|
|
||||||
// RU864
|
// RU864
|
||||||
RU864 = 10;
|
RU864 = 10;
|
||||||
|
|
||||||
// ISM2400 (LoRaWAN 2.4 GHz)
|
// ISM2400 (LoRaWAN 2.4 GHz)
|
||||||
ISM2400 = 11;
|
ISM2400 = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MType {
|
enum MType {
|
||||||
// JoinRequest.
|
// JoinRequest.
|
||||||
JOIN_REQUEST = 0;
|
JOIN_REQUEST = 0;
|
||||||
|
|
||||||
// JoinAccept.
|
// JoinAccept.
|
||||||
JOIN_ACCEPT = 1;
|
JOIN_ACCEPT = 1;
|
||||||
|
|
||||||
// UnconfirmedDataUp.
|
// UnconfirmedDataUp.
|
||||||
UNCONFIRMED_DATA_UP = 2;
|
UNCONFIRMED_DATA_UP = 2;
|
||||||
|
|
||||||
// UnconfirmedDataDown.
|
// UnconfirmedDataDown.
|
||||||
UNCONFIRMED_DATA_DOWN = 3;
|
UNCONFIRMED_DATA_DOWN = 3;
|
||||||
|
|
||||||
// ConfirmedDataUp.
|
// ConfirmedDataUp.
|
||||||
CONFIRMED_DATA_UP = 4;
|
CONFIRMED_DATA_UP = 4;
|
||||||
|
|
||||||
// ConfirmedDataDown.
|
// ConfirmedDataDown.
|
||||||
CONFIRMED_DATA_DOWN = 5;
|
CONFIRMED_DATA_DOWN = 5;
|
||||||
|
|
||||||
// RejoinRequest.
|
// RejoinRequest.
|
||||||
REJOIN_REQUEST = 6;
|
REJOIN_REQUEST = 6;
|
||||||
|
|
||||||
// Proprietary.
|
// Proprietary.
|
||||||
PROPRIETARY = 7;
|
PROPRIETARY = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MacVersion {
|
enum MacVersion {
|
||||||
LORAWAN_1_0_0 = 0;
|
LORAWAN_1_0_0 = 0;
|
||||||
LORAWAN_1_0_1 = 1;
|
LORAWAN_1_0_1 = 1;
|
||||||
LORAWAN_1_0_2 = 2;
|
LORAWAN_1_0_2 = 2;
|
||||||
LORAWAN_1_0_3 = 3;
|
LORAWAN_1_0_3 = 3;
|
||||||
LORAWAN_1_0_4 = 4;
|
LORAWAN_1_0_4 = 4;
|
||||||
LORAWAN_1_1_0 = 5;
|
LORAWAN_1_1_0 = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum RegParamsRevision {
|
enum RegParamsRevision {
|
||||||
A = 0;
|
A = 0;
|
||||||
B = 1;
|
B = 1;
|
||||||
RP002_1_0_0 = 2;
|
RP002_1_0_0 = 2;
|
||||||
RP002_1_0_1 = 3;
|
RP002_1_0_1 = 3;
|
||||||
RP002_1_0_2 = 4;
|
RP002_1_0_2 = 4;
|
||||||
RP002_1_0_3 = 5;
|
RP002_1_0_3 = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum LocationSource {
|
enum LocationSource {
|
||||||
// Unknown.
|
// Unknown.
|
||||||
UNKNOWN = 0;
|
UNKNOWN = 0;
|
||||||
|
|
||||||
// GPS.
|
// GPS.
|
||||||
GPS = 1;
|
GPS = 1;
|
||||||
|
|
||||||
// Manually configured.
|
// Manually configured.
|
||||||
CONFIG = 2;
|
CONFIG = 2;
|
||||||
|
|
||||||
// Geo resolver (TDOA).
|
// Geo resolver (TDOA).
|
||||||
GEO_RESOLVER_TDOA = 3;
|
GEO_RESOLVER_TDOA = 3;
|
||||||
|
|
||||||
// Geo resolver (RSSI).
|
// Geo resolver (RSSI).
|
||||||
GEO_RESOLVER_RSSI = 4;
|
GEO_RESOLVER_RSSI = 4;
|
||||||
|
|
||||||
// Geo resolver (GNSS).
|
// Geo resolver (GNSS).
|
||||||
GEO_RESOLVER_GNSS = 5;
|
GEO_RESOLVER_GNSS = 5;
|
||||||
|
|
||||||
// Geo resolver (WIFI).
|
// Geo resolver (WIFI).
|
||||||
GEO_RESOLVER_WIFI = 6;
|
GEO_RESOLVER_WIFI = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Aggregation {
|
enum Aggregation {
|
||||||
// Hour.
|
// Hour.
|
||||||
HOUR = 0;
|
HOUR = 0;
|
||||||
|
|
||||||
// Day.
|
// Day.
|
||||||
DAY = 1;
|
DAY = 1;
|
||||||
|
|
||||||
// Month.
|
// Month.
|
||||||
MONTH = 2;
|
MONTH = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MetricKind {
|
enum MetricKind {
|
||||||
// Incrementing counters that never decrease (these are not reset on each reading).
|
// Incrementing counters that never decrease (these are not reset on each
|
||||||
COUNTER = 0;
|
// reading).
|
||||||
|
COUNTER = 0;
|
||||||
|
|
||||||
// Counters that do get reset upon reading.
|
// Counters that do get reset upon reading.
|
||||||
ABSOLUTE = 1;
|
ABSOLUTE = 1;
|
||||||
|
|
||||||
// E.g. a temperature value.
|
// E.g. a temperature value.
|
||||||
GAUGE = 2;
|
GAUGE = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Location {
|
message Location {
|
||||||
// Latitude.
|
// Latitude.
|
||||||
double latitude = 1;
|
double latitude = 1;
|
||||||
|
|
||||||
// Longitude.
|
// Longitude.
|
||||||
double longitude = 2;
|
double longitude = 2;
|
||||||
|
|
||||||
// Altitude.
|
// Altitude.
|
||||||
double altitude = 3;
|
double altitude = 3;
|
||||||
|
|
||||||
// Location source.
|
// Location source.
|
||||||
LocationSource source = 4;
|
LocationSource source = 4;
|
||||||
|
|
||||||
// Accuracy.
|
// Accuracy.
|
||||||
float accuracy = 5;
|
float accuracy = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message KeyEnvelope {
|
message KeyEnvelope {
|
||||||
// KEK label.
|
// KEK label.
|
||||||
string kek_label = 1;
|
string kek_label = 1;
|
||||||
|
|
||||||
// AES key (when the kek_label is set, this value must first be decrypted).
|
// AES key (when the kek_label is set, this value must first be decrypted).
|
||||||
bytes aes_key = 2;
|
bytes aes_key = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Metric {
|
message Metric {
|
||||||
// Name.
|
// Name.
|
||||||
string name = 1;
|
string name = 1;
|
||||||
|
|
||||||
// Timestamps.
|
// Timestamps.
|
||||||
repeated google.protobuf.Timestamp timestamps = 2;
|
repeated google.protobuf.Timestamp timestamps = 2;
|
||||||
|
|
||||||
// Datasets.
|
// Datasets.
|
||||||
repeated MetricDataset datasets = 3;
|
repeated MetricDataset datasets = 3;
|
||||||
|
|
||||||
// Kind.
|
// Kind.
|
||||||
MetricKind kind = 4;
|
MetricKind kind = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MetricDataset {
|
message MetricDataset {
|
||||||
// Label.
|
// Label.
|
||||||
string label = 1;
|
string label = 1;
|
||||||
|
|
||||||
// Data.
|
// Data.
|
||||||
// Each value index corresponds with the same timestamp index of the Metric.
|
// Each value index corresponds with the same timestamp index of the Metric.
|
||||||
repeated float data = 2;
|
repeated float data = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DeviceClass {
|
||||||
|
// Class-A.
|
||||||
|
CLASS_A = 0;
|
||||||
|
|
||||||
|
// Class-B.
|
||||||
|
CLASS_B = 1;
|
||||||
|
|
||||||
|
// Class-C.
|
||||||
|
CLASS_C = 2;
|
||||||
}
|
}
|
||||||
|
3
api/proto/integration/integration.proto
vendored
3
api/proto/integration/integration.proto
vendored
@ -83,6 +83,9 @@ message DeviceInfo {
|
|||||||
// Device EUI.
|
// Device EUI.
|
||||||
string dev_eui = 8;
|
string dev_eui = 8;
|
||||||
|
|
||||||
|
// Device class.
|
||||||
|
common.DeviceClass device_enabled_class = 10;
|
||||||
|
|
||||||
// Device-profile and device tags.
|
// Device-profile and device tags.
|
||||||
map<string, string> tags = 9;
|
map<string, string> tags = 9;
|
||||||
}
|
}
|
||||||
|
13
api/rust/proto/chirpstack/api/device.proto
vendored
13
api/rust/proto/chirpstack/api/device.proto
vendored
@ -167,17 +167,6 @@ service DeviceService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum DeviceClass {
|
|
||||||
// Class-A.
|
|
||||||
A = 0;
|
|
||||||
|
|
||||||
// Class-B.
|
|
||||||
B = 1;
|
|
||||||
|
|
||||||
// Class-C.
|
|
||||||
C = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Device {
|
message Device {
|
||||||
// DevEUI (EUI64).
|
// DevEUI (EUI64).
|
||||||
string dev_eui = 1;
|
string dev_eui = 1;
|
||||||
@ -302,7 +291,7 @@ message GetDeviceResponse {
|
|||||||
DeviceStatus device_status = 5;
|
DeviceStatus device_status = 5;
|
||||||
|
|
||||||
// Enabled class.
|
// Enabled class.
|
||||||
DeviceClass enabled_class = 6;
|
common.DeviceClass enabled_class = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UpdateDeviceRequest {
|
message UpdateDeviceRequest {
|
||||||
|
242
api/rust/proto/chirpstack/common/common.proto
vendored
242
api/rust/proto/chirpstack/common/common.proto
vendored
@ -11,193 +11,205 @@ option csharp_namespace = "Chirpstack.Common";
|
|||||||
import "google/protobuf/timestamp.proto";
|
import "google/protobuf/timestamp.proto";
|
||||||
|
|
||||||
enum Modulation {
|
enum Modulation {
|
||||||
// LoRa
|
// LoRa
|
||||||
LORA = 0;
|
LORA = 0;
|
||||||
|
|
||||||
// FSK
|
// FSK
|
||||||
FSK = 1;
|
FSK = 1;
|
||||||
|
|
||||||
// LR-FHSS
|
// LR-FHSS
|
||||||
LR_FHSS = 2;
|
LR_FHSS = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Region {
|
enum Region {
|
||||||
// EU868
|
// EU868
|
||||||
EU868 = 0;
|
EU868 = 0;
|
||||||
|
|
||||||
// US915
|
// US915
|
||||||
US915 = 2;
|
US915 = 2;
|
||||||
|
|
||||||
// CN779
|
// CN779
|
||||||
CN779 = 3;
|
CN779 = 3;
|
||||||
|
|
||||||
// EU433
|
// EU433
|
||||||
EU433 = 4;
|
EU433 = 4;
|
||||||
|
|
||||||
// AU915
|
// AU915
|
||||||
AU915 = 5;
|
AU915 = 5;
|
||||||
|
|
||||||
// CN470
|
// CN470
|
||||||
CN470 = 6;
|
CN470 = 6;
|
||||||
|
|
||||||
// AS923
|
// AS923
|
||||||
AS923 = 7;
|
AS923 = 7;
|
||||||
|
|
||||||
// AS923 with -1.80 MHz frequency offset
|
// AS923 with -1.80 MHz frequency offset
|
||||||
AS923_2 = 12;
|
AS923_2 = 12;
|
||||||
|
|
||||||
// AS923 with -6.60 MHz frequency offset
|
// AS923 with -6.60 MHz frequency offset
|
||||||
AS923_3 = 13;
|
AS923_3 = 13;
|
||||||
|
|
||||||
// (AS923 with -5.90 MHz frequency offset).
|
// (AS923 with -5.90 MHz frequency offset).
|
||||||
AS923_4 = 14;
|
AS923_4 = 14;
|
||||||
|
|
||||||
// KR920
|
// KR920
|
||||||
KR920 = 8;
|
KR920 = 8;
|
||||||
|
|
||||||
// IN865
|
// IN865
|
||||||
IN865 = 9;
|
IN865 = 9;
|
||||||
|
|
||||||
// RU864
|
// RU864
|
||||||
RU864 = 10;
|
RU864 = 10;
|
||||||
|
|
||||||
// ISM2400 (LoRaWAN 2.4 GHz)
|
// ISM2400 (LoRaWAN 2.4 GHz)
|
||||||
ISM2400 = 11;
|
ISM2400 = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MType {
|
enum MType {
|
||||||
// JoinRequest.
|
// JoinRequest.
|
||||||
JOIN_REQUEST = 0;
|
JOIN_REQUEST = 0;
|
||||||
|
|
||||||
// JoinAccept.
|
// JoinAccept.
|
||||||
JOIN_ACCEPT = 1;
|
JOIN_ACCEPT = 1;
|
||||||
|
|
||||||
// UnconfirmedDataUp.
|
// UnconfirmedDataUp.
|
||||||
UNCONFIRMED_DATA_UP = 2;
|
UNCONFIRMED_DATA_UP = 2;
|
||||||
|
|
||||||
// UnconfirmedDataDown.
|
// UnconfirmedDataDown.
|
||||||
UNCONFIRMED_DATA_DOWN = 3;
|
UNCONFIRMED_DATA_DOWN = 3;
|
||||||
|
|
||||||
// ConfirmedDataUp.
|
// ConfirmedDataUp.
|
||||||
CONFIRMED_DATA_UP = 4;
|
CONFIRMED_DATA_UP = 4;
|
||||||
|
|
||||||
// ConfirmedDataDown.
|
// ConfirmedDataDown.
|
||||||
CONFIRMED_DATA_DOWN = 5;
|
CONFIRMED_DATA_DOWN = 5;
|
||||||
|
|
||||||
// RejoinRequest.
|
// RejoinRequest.
|
||||||
REJOIN_REQUEST = 6;
|
REJOIN_REQUEST = 6;
|
||||||
|
|
||||||
// Proprietary.
|
// Proprietary.
|
||||||
PROPRIETARY = 7;
|
PROPRIETARY = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MacVersion {
|
enum MacVersion {
|
||||||
LORAWAN_1_0_0 = 0;
|
LORAWAN_1_0_0 = 0;
|
||||||
LORAWAN_1_0_1 = 1;
|
LORAWAN_1_0_1 = 1;
|
||||||
LORAWAN_1_0_2 = 2;
|
LORAWAN_1_0_2 = 2;
|
||||||
LORAWAN_1_0_3 = 3;
|
LORAWAN_1_0_3 = 3;
|
||||||
LORAWAN_1_0_4 = 4;
|
LORAWAN_1_0_4 = 4;
|
||||||
LORAWAN_1_1_0 = 5;
|
LORAWAN_1_1_0 = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum RegParamsRevision {
|
enum RegParamsRevision {
|
||||||
A = 0;
|
A = 0;
|
||||||
B = 1;
|
B = 1;
|
||||||
RP002_1_0_0 = 2;
|
RP002_1_0_0 = 2;
|
||||||
RP002_1_0_1 = 3;
|
RP002_1_0_1 = 3;
|
||||||
RP002_1_0_2 = 4;
|
RP002_1_0_2 = 4;
|
||||||
RP002_1_0_3 = 5;
|
RP002_1_0_3 = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum LocationSource {
|
enum LocationSource {
|
||||||
// Unknown.
|
// Unknown.
|
||||||
UNKNOWN = 0;
|
UNKNOWN = 0;
|
||||||
|
|
||||||
// GPS.
|
// GPS.
|
||||||
GPS = 1;
|
GPS = 1;
|
||||||
|
|
||||||
// Manually configured.
|
// Manually configured.
|
||||||
CONFIG = 2;
|
CONFIG = 2;
|
||||||
|
|
||||||
// Geo resolver (TDOA).
|
// Geo resolver (TDOA).
|
||||||
GEO_RESOLVER_TDOA = 3;
|
GEO_RESOLVER_TDOA = 3;
|
||||||
|
|
||||||
// Geo resolver (RSSI).
|
// Geo resolver (RSSI).
|
||||||
GEO_RESOLVER_RSSI = 4;
|
GEO_RESOLVER_RSSI = 4;
|
||||||
|
|
||||||
// Geo resolver (GNSS).
|
// Geo resolver (GNSS).
|
||||||
GEO_RESOLVER_GNSS = 5;
|
GEO_RESOLVER_GNSS = 5;
|
||||||
|
|
||||||
// Geo resolver (WIFI).
|
// Geo resolver (WIFI).
|
||||||
GEO_RESOLVER_WIFI = 6;
|
GEO_RESOLVER_WIFI = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Aggregation {
|
enum Aggregation {
|
||||||
// Hour.
|
// Hour.
|
||||||
HOUR = 0;
|
HOUR = 0;
|
||||||
|
|
||||||
// Day.
|
// Day.
|
||||||
DAY = 1;
|
DAY = 1;
|
||||||
|
|
||||||
// Month.
|
// Month.
|
||||||
MONTH = 2;
|
MONTH = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum MetricKind {
|
enum MetricKind {
|
||||||
// Incrementing counters that never decrease (these are not reset on each reading).
|
// Incrementing counters that never decrease (these are not reset on each
|
||||||
COUNTER = 0;
|
// reading).
|
||||||
|
COUNTER = 0;
|
||||||
|
|
||||||
// Counters that do get reset upon reading.
|
// Counters that do get reset upon reading.
|
||||||
ABSOLUTE = 1;
|
ABSOLUTE = 1;
|
||||||
|
|
||||||
// E.g. a temperature value.
|
// E.g. a temperature value.
|
||||||
GAUGE = 2;
|
GAUGE = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Location {
|
message Location {
|
||||||
// Latitude.
|
// Latitude.
|
||||||
double latitude = 1;
|
double latitude = 1;
|
||||||
|
|
||||||
// Longitude.
|
// Longitude.
|
||||||
double longitude = 2;
|
double longitude = 2;
|
||||||
|
|
||||||
// Altitude.
|
// Altitude.
|
||||||
double altitude = 3;
|
double altitude = 3;
|
||||||
|
|
||||||
// Location source.
|
// Location source.
|
||||||
LocationSource source = 4;
|
LocationSource source = 4;
|
||||||
|
|
||||||
// Accuracy.
|
// Accuracy.
|
||||||
float accuracy = 5;
|
float accuracy = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message KeyEnvelope {
|
message KeyEnvelope {
|
||||||
// KEK label.
|
// KEK label.
|
||||||
string kek_label = 1;
|
string kek_label = 1;
|
||||||
|
|
||||||
// AES key (when the kek_label is set, this value must first be decrypted).
|
// AES key (when the kek_label is set, this value must first be decrypted).
|
||||||
bytes aes_key = 2;
|
bytes aes_key = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Metric {
|
message Metric {
|
||||||
// Name.
|
// Name.
|
||||||
string name = 1;
|
string name = 1;
|
||||||
|
|
||||||
// Timestamps.
|
// Timestamps.
|
||||||
repeated google.protobuf.Timestamp timestamps = 2;
|
repeated google.protobuf.Timestamp timestamps = 2;
|
||||||
|
|
||||||
// Datasets.
|
// Datasets.
|
||||||
repeated MetricDataset datasets = 3;
|
repeated MetricDataset datasets = 3;
|
||||||
|
|
||||||
// Kind.
|
// Kind.
|
||||||
MetricKind kind = 4;
|
MetricKind kind = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message MetricDataset {
|
message MetricDataset {
|
||||||
// Label.
|
// Label.
|
||||||
string label = 1;
|
string label = 1;
|
||||||
|
|
||||||
// Data.
|
// Data.
|
||||||
// Each value index corresponds with the same timestamp index of the Metric.
|
// Each value index corresponds with the same timestamp index of the Metric.
|
||||||
repeated float data = 2;
|
repeated float data = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum DeviceClass {
|
||||||
|
// Class-A.
|
||||||
|
CLASS_A = 0;
|
||||||
|
|
||||||
|
// Class-B.
|
||||||
|
CLASS_B = 1;
|
||||||
|
|
||||||
|
// Class-C.
|
||||||
|
CLASS_C = 2;
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,9 @@ message DeviceInfo {
|
|||||||
// Device EUI.
|
// Device EUI.
|
||||||
string dev_eui = 8;
|
string dev_eui = 8;
|
||||||
|
|
||||||
|
// Device class.
|
||||||
|
common.DeviceClass device_enabled_class = 10;
|
||||||
|
|
||||||
// Device-profile and device tags.
|
// Device-profile and device tags.
|
||||||
map<string, string> tags = 9;
|
map<string, string> tags = 9;
|
||||||
}
|
}
|
||||||
|
@ -249,12 +249,12 @@ impl FromProto<lrwn::RelayModeActivation> for api::RelayModeActivation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToProto<api::DeviceClass> for DeviceClass {
|
impl ToProto<common::DeviceClass> for DeviceClass {
|
||||||
fn to_proto(self) -> api::DeviceClass {
|
fn to_proto(self) -> common::DeviceClass {
|
||||||
match self {
|
match self {
|
||||||
DeviceClass::A => api::DeviceClass::A,
|
DeviceClass::A => common::DeviceClass::ClassA,
|
||||||
DeviceClass::B => api::DeviceClass::B,
|
DeviceClass::B => common::DeviceClass::ClassB,
|
||||||
DeviceClass::C => api::DeviceClass::C,
|
DeviceClass::C => common::DeviceClass::ClassC,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ use rand::Rng;
|
|||||||
use tracing::{error, span, trace, warn, Instrument, Level};
|
use tracing::{error, span, trace, warn, Instrument, Level};
|
||||||
|
|
||||||
use crate::api::backend::get_async_receiver;
|
use crate::api::backend::get_async_receiver;
|
||||||
use crate::api::helpers::FromProto;
|
use crate::api::helpers::{FromProto, ToProto};
|
||||||
use crate::backend::roaming;
|
use crate::backend::roaming;
|
||||||
use crate::downlink::{classb, helpers, tx_ack};
|
use crate::downlink::{classb, helpers, tx_ack};
|
||||||
use crate::gpstime::{ToDateTime, ToGpsTime};
|
use crate::gpstime::{ToDateTime, ToGpsTime};
|
||||||
@ -431,6 +431,7 @@ impl Data {
|
|||||||
device_profile_id: self.device_profile.id.to_string(),
|
device_profile_id: self.device_profile.id.to_string(),
|
||||||
device_profile_name: self.device_profile.name.clone(),
|
device_profile_name: self.device_profile.name.clone(),
|
||||||
device_name: self.device.name.clone(),
|
device_name: self.device.name.clone(),
|
||||||
|
device_enabled_class: self.device.enabled_class.to_proto().into(),
|
||||||
dev_eui: self.device.dev_eui.to_string(),
|
dev_eui: self.device.dev_eui.to_string(),
|
||||||
tags: {
|
tags: {
|
||||||
let mut tags = (*self.device_profile.tags).clone();
|
let mut tags = (*self.device_profile.tags).clone();
|
||||||
|
@ -454,6 +454,7 @@ impl TxAck {
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: dp.name.clone(),
|
device_profile_name: dp.name.clone(),
|
||||||
device_name: dev.name.clone(),
|
device_name: dev.name.clone(),
|
||||||
|
device_enabled_class: dev.enabled_class.to_proto().into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags,
|
tags,
|
||||||
}),
|
}),
|
||||||
@ -502,6 +503,7 @@ impl TxAck {
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: dp.name.clone(),
|
device_profile_name: dp.name.clone(),
|
||||||
device_name: dev.name.clone(),
|
device_name: dev.name.clone(),
|
||||||
|
device_enabled_class: dev.enabled_class.to_proto().into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags,
|
tags,
|
||||||
}),
|
}),
|
||||||
@ -550,6 +552,7 @@ impl TxAck {
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: dp.name.clone(),
|
device_profile_name: dp.name.clone(),
|
||||||
device_name: dev.name.clone(),
|
device_name: dev.name.clone(),
|
||||||
|
device_enabled_class: dev.enabled_class.to_proto().into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags,
|
tags,
|
||||||
}),
|
}),
|
||||||
|
@ -3,6 +3,7 @@ use bigdecimal::BigDecimal;
|
|||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
|
|
||||||
|
use crate::api::helpers::ToProto;
|
||||||
use crate::integration;
|
use crate::integration;
|
||||||
use crate::storage::{application, device, device_profile, tenant};
|
use crate::storage::{application, device, device_profile, tenant};
|
||||||
use crate::uplink::{helpers, UplinkFrameSet};
|
use crate::uplink::{helpers, UplinkFrameSet};
|
||||||
@ -62,6 +63,7 @@ pub async fn handle(
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: dp.name.clone(),
|
device_profile_name: dp.name.clone(),
|
||||||
device_name: dev.name.clone(),
|
device_name: dev.name.clone(),
|
||||||
|
device_enabled_class: dev.enabled_class.to_proto().into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags,
|
tags,
|
||||||
}),
|
}),
|
||||||
|
@ -2,6 +2,7 @@ use anyhow::Result;
|
|||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
|
|
||||||
|
use crate::api::helpers::ToProto;
|
||||||
use crate::integration;
|
use crate::integration;
|
||||||
use crate::storage::{application, device, device_profile, tenant};
|
use crate::storage::{application, device, device_profile, tenant};
|
||||||
use chirpstack_api::integration as integration_pb;
|
use chirpstack_api::integration as integration_pb;
|
||||||
@ -32,6 +33,7 @@ pub async fn handle(
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: dp.name.clone(),
|
device_profile_name: dp.name.clone(),
|
||||||
device_name: dev.name.clone(),
|
device_name: dev.name.clone(),
|
||||||
|
device_enabled_class: dev.enabled_class.to_proto().into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags: {
|
tags: {
|
||||||
let mut tags = (*dp.tags).clone();
|
let mut tags = (*dp.tags).clone();
|
||||||
@ -74,6 +76,8 @@ mod test {
|
|||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
|
use chirpstack_api::common;
|
||||||
|
|
||||||
use crate::storage::fields;
|
use crate::storage::fields;
|
||||||
use crate::test;
|
use crate::test;
|
||||||
|
|
||||||
@ -148,6 +152,7 @@ mod test {
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: "dp".to_string(),
|
device_profile_name: "dp".to_string(),
|
||||||
device_name: "dev".to_string(),
|
device_name: "dev".to_string(),
|
||||||
|
device_enabled_class: common::DeviceClass::ClassA.into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags: [
|
tags: [
|
||||||
("dp_tag".to_string(), "dp_value".to_string()),
|
("dp_tag".to_string(), "dp_value".to_string()),
|
||||||
|
@ -400,6 +400,7 @@ impl Data {
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: dp.name.clone(),
|
device_profile_name: dp.name.clone(),
|
||||||
device_name: dev.name.clone(),
|
device_name: dev.name.clone(),
|
||||||
|
device_enabled_class: dev.enabled_class.to_proto().into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags,
|
tags,
|
||||||
});
|
});
|
||||||
@ -1152,6 +1153,7 @@ impl Data {
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: dp.name.clone(),
|
device_profile_name: dp.name.clone(),
|
||||||
device_name: dev.name.clone(),
|
device_name: dev.name.clone(),
|
||||||
|
device_enabled_class: dev.enabled_class.to_proto().into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags,
|
tags,
|
||||||
}),
|
}),
|
||||||
|
@ -16,7 +16,8 @@ use super::{
|
|||||||
filter_rx_info_by_region_config_id, filter_rx_info_by_tenant_id, helpers, RelayContext,
|
filter_rx_info_by_region_config_id, filter_rx_info_by_tenant_id, helpers, RelayContext,
|
||||||
UplinkFrameSet,
|
UplinkFrameSet,
|
||||||
};
|
};
|
||||||
use crate::api::backend::get_async_receiver;
|
|
||||||
|
use crate::api::{backend::get_async_receiver, helpers::ToProto};
|
||||||
use crate::backend::{joinserver, keywrap, roaming};
|
use crate::backend::{joinserver, keywrap, roaming};
|
||||||
use crate::storage::device_session;
|
use crate::storage::device_session;
|
||||||
use crate::storage::{
|
use crate::storage::{
|
||||||
@ -316,6 +317,7 @@ impl JoinRequest {
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: dp.name.clone(),
|
device_profile_name: dp.name.clone(),
|
||||||
device_name: dev.name.clone(),
|
device_name: dev.name.clone(),
|
||||||
|
device_enabled_class: dev.enabled_class.to_proto().into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags,
|
tags,
|
||||||
});
|
});
|
||||||
|
@ -5,6 +5,7 @@ use chrono::{DateTime, Local, Utc};
|
|||||||
use tracing::{span, trace, Instrument, Level};
|
use tracing::{span, trace, Instrument, Level};
|
||||||
|
|
||||||
use super::{helpers, UplinkFrameSet};
|
use super::{helpers, UplinkFrameSet};
|
||||||
|
use crate::api::helpers::ToProto;
|
||||||
use crate::backend::{joinserver, keywrap, roaming};
|
use crate::backend::{joinserver, keywrap, roaming};
|
||||||
use crate::storage::{
|
use crate::storage::{
|
||||||
application,
|
application,
|
||||||
@ -184,6 +185,7 @@ impl JoinRequest {
|
|||||||
device_profile_id: dp.id.to_string(),
|
device_profile_id: dp.id.to_string(),
|
||||||
device_profile_name: dp.name.clone(),
|
device_profile_name: dp.name.clone(),
|
||||||
device_name: dev.name.clone(),
|
device_name: dev.name.clone(),
|
||||||
|
device_enabled_class: dev.enabled_class.to_proto().into(),
|
||||||
dev_eui: dev.dev_eui.to_string(),
|
dev_eui: dev.dev_eui.to_string(),
|
||||||
tags,
|
tags,
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user