Compare commits

..

10 Commits

Author SHA1 Message Date
ca567ca562 Bump version to 4.0.0-rc.1 2022-08-10 12:36:43 +01:00
1a68080ac0 Fix configfile template. 2022-08-10 11:34:52 +01:00
ba7fc75ee6 Fix clippy warnings. 2022-08-10 11:34:33 +01:00
7868629533 Fix LoRaWAN 1.1 downlink fopts encryption. 2022-08-09 16:33:58 +01:00
2b1bf3b96f Only decode mac-commands for logging if in plaintext.
Please note that for LoRaWAN 1.1.x, mac-commands in the f_opts field are
encrypted. Within the context of the device we can decrypt these, but
within the context of a gateway we can only show these as raw bytes.
2022-08-09 15:29:22 +01:00
fd62076e02 Add plaintext_mac_commands field to up/down frame-log. 2022-08-09 15:28:37 +01:00
cfb4290334 Add missing isDisabled and setSkipFcntCheck switches (UI). 2022-08-09 11:07:32 +01:00
6d62cdb27c Fix generating gRPC documentation (md). 2022-08-08 15:56:01 +01:00
92a710fd1e Fix NewChannelReq for LoRaWAN 2.4GHz freqs. 2022-08-08 11:49:47 +01:00
d31113d61c Include cargo-bitbake in Dockerfile-devel. 2022-08-07 13:39:36 +01:00
36 changed files with 733 additions and 911 deletions

8
Cargo.lock generated
View File

@ -635,7 +635,7 @@ dependencies = [
[[package]]
name = "backend"
version = "4.0.0-test.18"
version = "4.0.0-rc.1"
dependencies = [
"aes-kw",
"anyhow",
@ -879,7 +879,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chirpstack"
version = "4.0.0-test.18"
version = "4.0.0-rc.1"
dependencies = [
"aes 0.7.5",
"anyhow",
@ -958,7 +958,7 @@ dependencies = [
[[package]]
name = "chirpstack_api"
version = "4.0.0-test.18"
version = "4.0.0-rc.1"
dependencies = [
"hex",
"pbjson",
@ -2222,7 +2222,7 @@ dependencies = [
[[package]]
name = "lrwn"
version = "4.0.0-test.18"
version = "4.0.0-rc.1"
dependencies = [
"aes 0.7.5",
"anyhow",

View File

@ -36,5 +36,6 @@ RUN rustup target add aarch64-unknown-linux-gnu
RUN cargo install diesel_cli --version 2.0.0-rc.1 --no-default-features --features postgres
RUN cargo install cargo-deb
RUN cargo install cargo-rpm
RUN cargo install cargo-bitbake
WORKDIR $PROJECT_PATH/chirpstack

2
api/Makefile vendored
View File

@ -1,4 +1,4 @@
.PHONY: rust grpc-web go js python
.PHONY: rust grpc-web go js python md
all:
docker-compose up

View File

@ -42,6 +42,8 @@ type UplinkFrameLog struct {
DevEui string `protobuf:"bytes,6,opt,name=dev_eui,json=devEui,proto3" json:"dev_eui,omitempty"`
// Time.
Time *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=time,proto3" json:"time,omitempty"`
// Plaintext mac-commands.
PlaintextMacCommands bool `protobuf:"varint,8,opt,name=plaintext_mac_commands,json=plaintextMacCommands,proto3" json:"plaintext_mac_commands,omitempty"`
}
func (x *UplinkFrameLog) Reset() {
@ -125,6 +127,13 @@ func (x *UplinkFrameLog) GetTime() *timestamppb.Timestamp {
return nil
}
func (x *UplinkFrameLog) GetPlaintextMacCommands() bool {
if x != nil {
return x.PlaintextMacCommands
}
return false
}
type DownlinkFrameLog struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -146,6 +155,8 @@ type DownlinkFrameLog struct {
DevAddr string `protobuf:"bytes,7,opt,name=dev_addr,json=devAddr,proto3" json:"dev_addr,omitempty"`
// Device EUI (optional).
DevEui string `protobuf:"bytes,8,opt,name=dev_eui,json=devEui,proto3" json:"dev_eui,omitempty"`
// Plaintext mac-commands.
PlaintextMacCommands bool `protobuf:"varint,9,opt,name=plaintext_mac_commands,json=plaintextMacCommands,proto3" json:"plaintext_mac_commands,omitempty"`
}
func (x *DownlinkFrameLog) Reset() {
@ -236,6 +247,13 @@ func (x *DownlinkFrameLog) GetDevEui() string {
return ""
}
func (x *DownlinkFrameLog) GetPlaintextMacCommands() bool {
if x != nil {
return x.PlaintextMacCommands
}
return false
}
var File_api_frame_log_proto protoreflect.FileDescriptor
var file_api_frame_log_proto_rawDesc = []byte{
@ -244,7 +262,7 @@ var file_api_frame_log_proto_rawDesc = []byte{
0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65,
0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x63, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x0b, 0x67, 0x77, 0x2f, 0x67, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x02,
0x1a, 0x0b, 0x67, 0x77, 0x2f, 0x67, 0x77, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc7, 0x02,
0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x4c, 0x6f, 0x67,
0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x68, 0x79, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x68, 0x79, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61,
@ -262,31 +280,38 @@ var file_api_frame_log_proto_rawDesc = []byte{
0x69, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d,
0x65, 0x22, 0xaa, 0x02, 0x0a, 0x10, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x46, 0x72,
0x61, 0x6d, 0x65, 0x4c, 0x6f, 0x67, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x68, 0x79, 0x5f, 0x70, 0x61,
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x68, 0x79,
0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2b, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x69, 0x6e,
0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x77, 0x2e, 0x44, 0x6f,
0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x78, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x74, 0x78,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b,
0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x64, 0x6f, 0x77, 0x6e, 0x6c,
0x69, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79,
0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x61, 0x74, 0x65, 0x77,
0x61, 0x79, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x06, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06,
0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x54,
0x79, 0x70, 0x65, 0x52, 0x05, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x65,
0x76, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65,
0x76, 0x41, 0x64, 0x64, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x5f, 0x65, 0x75, 0x69,
0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x45, 0x75, 0x69, 0x42, 0x54,
0x0a, 0x11, 0x69, 0x6f, 0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e,
0x61, 0x70, 0x69, 0x42, 0x0d, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x4c, 0x6f, 0x67, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, 0x72,
0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x34,
0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x65, 0x12, 0x34, 0x0a, 0x16, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x6d,
0x61, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28,
0x08, 0x52, 0x14, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4d, 0x61, 0x63, 0x43,
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0xe0, 0x02, 0x0a, 0x10, 0x44, 0x6f, 0x77, 0x6e,
0x6c, 0x69, 0x6e, 0x6b, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x4c, 0x6f, 0x67, 0x12, 0x2e, 0x0a, 0x04,
0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b,
0x70, 0x68, 0x79, 0x5f, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x0a, 0x70, 0x68, 0x79, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2b, 0x0a,
0x07, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12,
0x2e, 0x67, 0x77, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x54, 0x78, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x06, 0x74, 0x78, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f,
0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x0a, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67,
0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x09, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x06, 0x6d, 0x5f,
0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x6d, 0x54, 0x79, 0x70, 0x65,
0x12, 0x19, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x07, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x64,
0x65, 0x76, 0x5f, 0x65, 0x75, 0x69, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65,
0x76, 0x45, 0x75, 0x69, 0x12, 0x34, 0x0a, 0x16, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78,
0x74, 0x5f, 0x6d, 0x61, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x09,
0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4d,
0x61, 0x63, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x42, 0x54, 0x0a, 0x11, 0x69, 0x6f,
0x2e, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x61, 0x70, 0x69, 0x42,
0x0d, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x4c, 0x6f, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x69,
0x72, 0x70, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2f, 0x63, 0x68, 0x69, 0x72, 0x70, 0x73, 0x74, 0x61,
0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x34, 0x2f, 0x61, 0x70, 0x69,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -35,6 +35,9 @@ export class UplinkFrameLog extends jspb.Message {
hasTime(): boolean;
clearTime(): UplinkFrameLog;
getPlaintextMacCommands(): boolean;
setPlaintextMacCommands(value: boolean): UplinkFrameLog;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UplinkFrameLog.AsObject;
static toObject(includeInstance: boolean, msg: UplinkFrameLog): UplinkFrameLog.AsObject;
@ -52,6 +55,7 @@ export namespace UplinkFrameLog {
devAddr: string,
devEui: string,
time?: google_protobuf_timestamp_pb.Timestamp.AsObject,
plaintextMacCommands: boolean,
}
}
@ -86,6 +90,9 @@ export class DownlinkFrameLog extends jspb.Message {
getDevEui(): string;
setDevEui(value: string): DownlinkFrameLog;
getPlaintextMacCommands(): boolean;
setPlaintextMacCommands(value: boolean): DownlinkFrameLog;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DownlinkFrameLog.AsObject;
static toObject(includeInstance: boolean, msg: DownlinkFrameLog): DownlinkFrameLog.AsObject;
@ -104,6 +111,7 @@ export namespace DownlinkFrameLog {
mType: common_common_pb.MType,
devAddr: string,
devEui: string,
plaintextMacCommands: boolean,
}
}

View File

@ -111,7 +111,8 @@ proto.api.UplinkFrameLog.toObject = function(includeInstance, msg) {
mType: jspb.Message.getFieldWithDefault(msg, 4, 0),
devAddr: jspb.Message.getFieldWithDefault(msg, 5, ""),
devEui: jspb.Message.getFieldWithDefault(msg, 6, ""),
time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
plaintextMacCommands: jspb.Message.getBooleanFieldWithDefault(msg, 8, false)
};
if (includeInstance) {
@ -179,6 +180,10 @@ proto.api.UplinkFrameLog.deserializeBinaryFromReader = function(msg, reader) {
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setTime(value);
break;
case 8:
var value = /** @type {boolean} */ (reader.readBool());
msg.setPlaintextMacCommands(value);
break;
default:
reader.skipField();
break;
@ -260,6 +265,13 @@ proto.api.UplinkFrameLog.serializeBinaryToWriter = function(message, writer) {
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getPlaintextMacCommands();
if (f) {
writer.writeBool(
8,
f
);
}
};
@ -471,6 +483,24 @@ proto.api.UplinkFrameLog.prototype.hasTime = function() {
};
/**
* optional bool plaintext_mac_commands = 8;
* @return {boolean}
*/
proto.api.UplinkFrameLog.prototype.getPlaintextMacCommands = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false));
};
/**
* @param {boolean} value
* @return {!proto.api.UplinkFrameLog} returns this
*/
proto.api.UplinkFrameLog.prototype.setPlaintextMacCommands = function(value) {
return jspb.Message.setProto3BooleanField(this, 8, value);
};
@ -510,7 +540,8 @@ proto.api.DownlinkFrameLog.toObject = function(includeInstance, msg) {
gatewayId: jspb.Message.getFieldWithDefault(msg, 5, ""),
mType: jspb.Message.getFieldWithDefault(msg, 6, 0),
devAddr: jspb.Message.getFieldWithDefault(msg, 7, ""),
devEui: jspb.Message.getFieldWithDefault(msg, 8, "")
devEui: jspb.Message.getFieldWithDefault(msg, 8, ""),
plaintextMacCommands: jspb.Message.getBooleanFieldWithDefault(msg, 9, false)
};
if (includeInstance) {
@ -581,6 +612,10 @@ proto.api.DownlinkFrameLog.deserializeBinaryFromReader = function(msg, reader) {
var value = /** @type {string} */ (reader.readString());
msg.setDevEui(value);
break;
case 9:
var value = /** @type {boolean} */ (reader.readBool());
msg.setPlaintextMacCommands(value);
break;
default:
reader.skipField();
break;
@ -668,6 +703,13 @@ proto.api.DownlinkFrameLog.serializeBinaryToWriter = function(message, writer) {
f
);
}
f = message.getPlaintextMacCommands();
if (f) {
writer.writeBool(
9,
f
);
}
};
@ -877,4 +919,22 @@ proto.api.DownlinkFrameLog.prototype.setDevEui = function(value) {
};
/**
* optional bool plaintext_mac_commands = 9;
* @return {boolean}
*/
proto.api.DownlinkFrameLog.prototype.getPlaintextMacCommands = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 9, false));
};
/**
* @param {boolean} value
* @return {!proto.api.DownlinkFrameLog} returns this
*/
proto.api.DownlinkFrameLog.prototype.setPlaintextMacCommands = function(value) {
return jspb.Message.setProto3BooleanField(this, 9, value);
};
goog.object.extend(exports, proto.api);

View File

@ -1,6 +1,6 @@
{
"name": "@chirpstack/chirpstack-api-grpc-web",
"version": "4.0.0-test.18",
"version": "4.0.0-rc.1",
"description": "Chirpstack gRPC-web API",
"license": "MIT",
"devDependencies": {

View File

@ -36,6 +36,9 @@ export class UplinkFrameLog extends jspb.Message {
getTime(): google_protobuf_timestamp_pb.Timestamp | undefined;
setTime(value?: google_protobuf_timestamp_pb.Timestamp): void;
getPlaintextMacCommands(): boolean;
setPlaintextMacCommands(value: boolean): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): UplinkFrameLog.AsObject;
static toObject(includeInstance: boolean, msg: UplinkFrameLog): UplinkFrameLog.AsObject;
@ -55,6 +58,7 @@ export namespace UplinkFrameLog {
devAddr: string,
devEui: string,
time?: google_protobuf_timestamp_pb.Timestamp.AsObject,
plaintextMacCommands: boolean,
}
}
@ -89,6 +93,9 @@ export class DownlinkFrameLog extends jspb.Message {
getDevEui(): string;
setDevEui(value: string): void;
getPlaintextMacCommands(): boolean;
setPlaintextMacCommands(value: boolean): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): DownlinkFrameLog.AsObject;
static toObject(includeInstance: boolean, msg: DownlinkFrameLog): DownlinkFrameLog.AsObject;
@ -109,6 +116,7 @@ export namespace DownlinkFrameLog {
mType: common_common_pb.MTypeMap[keyof common_common_pb.MTypeMap],
devAddr: string,
devEui: string,
plaintextMacCommands: boolean,
}
}

View File

@ -74,7 +74,8 @@ proto.api.UplinkFrameLog.toObject = function(includeInstance, msg) {
mType: msg.getMType(),
devAddr: msg.getDevAddr(),
devEui: msg.getDevEui(),
time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
plaintextMacCommands: msg.getPlaintextMacCommands()
};
if (includeInstance) {
@ -143,6 +144,10 @@ proto.api.UplinkFrameLog.deserializeBinaryFromReader = function(msg, reader) {
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setTime(value);
break;
case 8:
var value = /** @type {boolean} */ (reader.readBool());
msg.setPlaintextMacCommands(value);
break;
default:
reader.skipField();
break;
@ -233,6 +238,13 @@ proto.api.UplinkFrameLog.prototype.serializeBinaryToWriter = function (writer) {
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = this.getPlaintextMacCommands();
if (f) {
writer.writeBool(
8,
f
);
}
};
@ -412,6 +424,23 @@ proto.api.UplinkFrameLog.prototype.hasTime = function() {
};
/**
* optional bool plaintext_mac_commands = 8;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.api.UplinkFrameLog.prototype.getPlaintextMacCommands = function() {
return /** @type {boolean} */ (jspb.Message.getFieldProto3(this, 8, false));
};
/** @param {boolean} value */
proto.api.UplinkFrameLog.prototype.setPlaintextMacCommands = function(value) {
jspb.Message.setField(this, 8, value);
};
/**
* Generated by JsPbCodeGenerator.
@ -465,7 +494,8 @@ proto.api.DownlinkFrameLog.toObject = function(includeInstance, msg) {
gatewayId: msg.getGatewayId(),
mType: msg.getMType(),
devAddr: msg.getDevAddr(),
devEui: msg.getDevEui()
devEui: msg.getDevEui(),
plaintextMacCommands: msg.getPlaintextMacCommands()
};
if (includeInstance) {
@ -536,6 +566,10 @@ proto.api.DownlinkFrameLog.deserializeBinaryFromReader = function(msg, reader) {
var value = /** @type {string} */ (reader.readString());
msg.setDevEui(value);
break;
case 9:
var value = /** @type {boolean} */ (reader.readBool());
msg.setPlaintextMacCommands(value);
break;
default:
reader.skipField();
break;
@ -632,6 +666,13 @@ proto.api.DownlinkFrameLog.prototype.serializeBinaryToWriter = function (writer)
f
);
}
f = this.getPlaintextMacCommands();
if (f) {
writer.writeBool(
9,
f
);
}
};
@ -818,4 +859,21 @@ proto.api.DownlinkFrameLog.prototype.setDevEui = function(value) {
};
/**
* optional bool plaintext_mac_commands = 9;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.api.DownlinkFrameLog.prototype.getPlaintextMacCommands = function() {
return /** @type {boolean} */ (jspb.Message.getFieldProto3(this, 9, false));
};
/** @param {boolean} value */
proto.api.DownlinkFrameLog.prototype.setPlaintextMacCommands = function(value) {
jspb.Message.setField(this, 9, value);
};
goog.object.extend(exports, proto.api);

2
api/js/package.json vendored
View File

@ -1,6 +1,6 @@
{
"name": "@chirpstack/chirpstack-api",
"version": "4.0.0-test.18",
"version": "4.0.0-rc.1",
"description": "Chirpstack JS and TS API",
"license": "MIT",
"devDependencies": {

2
api/md/Makefile vendored
View File

@ -1,6 +1,6 @@
.PHONY: requirements api
all: requirements
all: requirements api
requirements:
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.5.1

562
api/md/api/api.md vendored
View File

@ -14,6 +14,7 @@
- [CreateAzureServiceBusIntegrationRequest](#api-CreateAzureServiceBusIntegrationRequest)
- [CreateGcpPubSubIntegrationRequest](#api-CreateGcpPubSubIntegrationRequest)
- [CreateHttpIntegrationRequest](#api-CreateHttpIntegrationRequest)
- [CreateIftttIntegrationRequest](#api-CreateIftttIntegrationRequest)
- [CreateInfluxDbIntegrationRequest](#api-CreateInfluxDbIntegrationRequest)
- [CreateLoraCloudIntegrationRequest](#api-CreateLoraCloudIntegrationRequest)
- [CreateMyDevicesIntegrationRequest](#api-CreateMyDevicesIntegrationRequest)
@ -24,6 +25,7 @@
- [DeleteAzureServiceBusIntegrationRequest](#api-DeleteAzureServiceBusIntegrationRequest)
- [DeleteGcpPubSubIntegrationRequest](#api-DeleteGcpPubSubIntegrationRequest)
- [DeleteHttpIntegrationRequest](#api-DeleteHttpIntegrationRequest)
- [DeleteIftttIntegrationRequest](#api-DeleteIftttIntegrationRequest)
- [DeleteInfluxDbIntegrationRequest](#api-DeleteInfluxDbIntegrationRequest)
- [DeleteLoraCloudIntegrationRequest](#api-DeleteLoraCloudIntegrationRequest)
- [DeleteMyDevicesIntegrationRequest](#api-DeleteMyDevicesIntegrationRequest)
@ -42,6 +44,8 @@
- [GetGcpPubSubIntegrationResponse](#api-GetGcpPubSubIntegrationResponse)
- [GetHttpIntegrationRequest](#api-GetHttpIntegrationRequest)
- [GetHttpIntegrationResponse](#api-GetHttpIntegrationResponse)
- [GetIftttIntegrationRequest](#api-GetIftttIntegrationRequest)
- [GetIftttIntegrationResponse](#api-GetIftttIntegrationResponse)
- [GetInfluxDbIntegrationRequest](#api-GetInfluxDbIntegrationRequest)
- [GetInfluxDbIntegrationResponse](#api-GetInfluxDbIntegrationResponse)
- [GetLoraCloudIntegrationRequest](#api-GetLoraCloudIntegrationRequest)
@ -54,6 +58,7 @@
- [GetThingsBoardIntegrationResponse](#api-GetThingsBoardIntegrationResponse)
- [HttpIntegration](#api-HttpIntegration)
- [HttpIntegration.HeadersEntry](#api-HttpIntegration-HeadersEntry)
- [IftttIntegration](#api-IftttIntegration)
- [InfluxDbIntegration](#api-InfluxDbIntegration)
- [IntegrationListItem](#api-IntegrationListItem)
- [ListApplicationsRequest](#api-ListApplicationsRequest)
@ -70,6 +75,7 @@
- [UpdateAzureServiceBusIntegrationRequest](#api-UpdateAzureServiceBusIntegrationRequest)
- [UpdateGcpPubSubIntegrationRequest](#api-UpdateGcpPubSubIntegrationRequest)
- [UpdateHttpIntegrationRequest](#api-UpdateHttpIntegrationRequest)
- [UpdateIftttIntegrationRequest](#api-UpdateIftttIntegrationRequest)
- [UpdateInfluxDbIntegrationRequest](#api-UpdateInfluxDbIntegrationRequest)
- [UpdateLoraCloudIntegrationRequest](#api-UpdateLoraCloudIntegrationRequest)
- [UpdateMyDevicesIntegrationRequest](#api-UpdateMyDevicesIntegrationRequest)
@ -97,10 +103,7 @@
- [DeviceKeys](#api-DeviceKeys)
- [DeviceListItem](#api-DeviceListItem)
- [DeviceQueueItem](#api-DeviceQueueItem)
- [DeviceStats](#api-DeviceStats)
- [DeviceStats.ErrorsEntry](#api-DeviceStats-ErrorsEntry)
- [DeviceStats.RxPacketsPerDrEntry](#api-DeviceStats-RxPacketsPerDrEntry)
- [DeviceStats.RxPacketsPerFrequencyEntry](#api-DeviceStats-RxPacketsPerFrequencyEntry)
- [DeviceState](#api-DeviceState)
- [DeviceStatus](#api-DeviceStatus)
- [EnqueueDeviceQueueItemRequest](#api-EnqueueDeviceQueueItemRequest)
- [EnqueueDeviceQueueItemResponse](#api-EnqueueDeviceQueueItemResponse)
@ -110,12 +113,16 @@
- [GetDeviceActivationResponse](#api-GetDeviceActivationResponse)
- [GetDeviceKeysRequest](#api-GetDeviceKeysRequest)
- [GetDeviceKeysResponse](#api-GetDeviceKeysResponse)
- [GetDeviceLinkMetricsRequest](#api-GetDeviceLinkMetricsRequest)
- [GetDeviceLinkMetricsResponse](#api-GetDeviceLinkMetricsResponse)
- [GetDeviceMetricsRequest](#api-GetDeviceMetricsRequest)
- [GetDeviceMetricsResponse](#api-GetDeviceMetricsResponse)
- [GetDeviceMetricsResponse.MetricsEntry](#api-GetDeviceMetricsResponse-MetricsEntry)
- [GetDeviceMetricsResponse.StatesEntry](#api-GetDeviceMetricsResponse-StatesEntry)
- [GetDeviceQueueItemsRequest](#api-GetDeviceQueueItemsRequest)
- [GetDeviceQueueItemsResponse](#api-GetDeviceQueueItemsResponse)
- [GetDeviceRequest](#api-GetDeviceRequest)
- [GetDeviceResponse](#api-GetDeviceResponse)
- [GetDeviceStatsRequest](#api-GetDeviceStatsRequest)
- [GetDeviceStatsResponse](#api-GetDeviceStatsResponse)
- [GetRandomDevAddrRequest](#api-GetRandomDevAddrRequest)
- [GetRandomDevAddrResponse](#api-GetRandomDevAddrResponse)
- [ListDevicesRequest](#api-ListDevicesRequest)
@ -131,6 +138,7 @@
- [CreateDeviceProfileResponse](#api-CreateDeviceProfileResponse)
- [DeleteDeviceProfileRequest](#api-DeleteDeviceProfileRequest)
- [DeviceProfile](#api-DeviceProfile)
- [DeviceProfile.MeasurementsEntry](#api-DeviceProfile-MeasurementsEntry)
- [DeviceProfile.TagsEntry](#api-DeviceProfile-TagsEntry)
- [DeviceProfileListItem](#api-DeviceProfileListItem)
- [GetDeviceProfileRequest](#api-GetDeviceProfileRequest)
@ -138,9 +146,11 @@
- [ListDeviceProfileAdrAlgorithmsResponse](#api-ListDeviceProfileAdrAlgorithmsResponse)
- [ListDeviceProfilesRequest](#api-ListDeviceProfilesRequest)
- [ListDeviceProfilesResponse](#api-ListDeviceProfilesResponse)
- [Measurement](#api-Measurement)
- [UpdateDeviceProfileRequest](#api-UpdateDeviceProfileRequest)
- [CodecRuntime](#api-CodecRuntime)
- [MeasurementKind](#api-MeasurementKind)
- [DeviceProfileService](#api-DeviceProfileService)
@ -156,18 +166,12 @@
- [Gateway.TagsEntry](#api-Gateway-TagsEntry)
- [GatewayListItem](#api-GatewayListItem)
- [GatewayListItem.PropertiesEntry](#api-GatewayListItem-PropertiesEntry)
- [GatewayStats](#api-GatewayStats)
- [GatewayStats.RxPacketsPerDrEntry](#api-GatewayStats-RxPacketsPerDrEntry)
- [GatewayStats.RxPacketsPerFrequencyEntry](#api-GatewayStats-RxPacketsPerFrequencyEntry)
- [GatewayStats.TxPacketsPerDrEntry](#api-GatewayStats-TxPacketsPerDrEntry)
- [GatewayStats.TxPacketsPerFrequencyEntry](#api-GatewayStats-TxPacketsPerFrequencyEntry)
- [GatewayStats.TxPacketsPerStatusEntry](#api-GatewayStats-TxPacketsPerStatusEntry)
- [GenerateGatewayClientCertificateRequest](#api-GenerateGatewayClientCertificateRequest)
- [GenerateGatewayClientCertificateResponse](#api-GenerateGatewayClientCertificateResponse)
- [GetGatewayMetricsRequest](#api-GetGatewayMetricsRequest)
- [GetGatewayMetricsResponse](#api-GetGatewayMetricsResponse)
- [GetGatewayRequest](#api-GetGatewayRequest)
- [GetGatewayResponse](#api-GetGatewayResponse)
- [GetGatewayStatsRequest](#api-GetGatewayStatsRequest)
- [GetGatewayStatsResponse](#api-GetGatewayStatsResponse)
- [ListGatewaysRequest](#api-ListGatewaysRequest)
- [ListGatewaysResponse](#api-ListGatewaysResponse)
- [UpdateGatewayRequest](#api-UpdateGatewayRequest)
@ -413,6 +417,21 @@
<a name="api-CreateIftttIntegrationRequest"></a>
### CreateIftttIntegrationRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| integration | [IftttIntegration](#api-IftttIntegration) | | Integration object. |
<a name="api-CreateInfluxDbIntegrationRequest"></a>
### CreateInfluxDbIntegrationRequest
@ -563,6 +582,21 @@
<a name="api-DeleteIftttIntegrationRequest"></a>
### DeleteIftttIntegrationRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| application_id | [string](#string) | | Application ID (UUID). |
<a name="api-DeleteInfluxDbIntegrationRequest"></a>
### DeleteInfluxDbIntegrationRequest
@ -716,6 +750,7 @@
| application | [Application](#api-Application) | | Application object. |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Created at timestamp. |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Last update timestamp. |
| measurement_keys | [string](#string) | repeated | Measurement keys. This contains the measurement keys from all the device-profiles that are used by the devices under this application. |
@ -842,6 +877,36 @@
<a name="api-GetIftttIntegrationRequest"></a>
### GetIftttIntegrationRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| application_id | [string](#string) | | Application ID (UUID). |
<a name="api-GetIftttIntegrationResponse"></a>
### GetIftttIntegrationResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| integration | [IftttIntegration](#api-IftttIntegration) | | Integration object. |
<a name="api-GetInfluxDbIntegrationRequest"></a>
### GetInfluxDbIntegrationRequest
@ -1026,6 +1091,25 @@
<a name="api-IftttIntegration"></a>
### IftttIntegration
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| application_id | [string](#string) | | Application ID (UUID). |
| key | [string](#string) | | Key. This key can be obtained from the IFTTT Webhooks documentation page. |
| uplink_values | [string](#string) | repeated | Values. Up to 2 values can be forwarded to IFTTT. These values must map to the decoded payload keys. For example: { &#34;batteryLevel&#34;: 75.3, &#34;buttons&#34;: [{&#34;pressed&#34;: false}, {&#34;pressed&#34;: true}] } You would specify the following fields: uplink_values = [&#34;batteryLevel&#34;, &#34;buttons_0_pressed&#34;]
Note: The first value is always used for the DevEUI. |
<a name="api-InfluxDbIntegration"></a>
### InfluxDbIntegration
@ -1300,6 +1384,21 @@
<a name="api-UpdateIftttIntegrationRequest"></a>
### UpdateIftttIntegrationRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| integration | [IftttIntegration](#api-IftttIntegration) | | Integration object to update. |
<a name="api-UpdateInfluxDbIntegrationRequest"></a>
### UpdateInfluxDbIntegrationRequest
@ -1434,6 +1533,7 @@
| AZURE_SERVICE_BUS | 7 | |
| PILOT_THINGS | 8 | |
| MQTT_GLOBAL | 9 | |
| IFTTT | 10 | |
@ -1490,6 +1590,10 @@ ApplicationService is the service providing API methods for managing application
| GetPilotThingsIntegration | [GetPilotThingsIntegrationRequest](#api-GetPilotThingsIntegrationRequest) | [GetPilotThingsIntegrationResponse](#api-GetPilotThingsIntegrationResponse) | Get Pilot Things integration. |
| UpdatePilotThingsIntegration | [UpdatePilotThingsIntegrationRequest](#api-UpdatePilotThingsIntegrationRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Update Pilot Things integration. |
| DeletePilotThingsIntegration | [DeletePilotThingsIntegrationRequest](#api-DeletePilotThingsIntegrationRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Delete Pilot Things integration. |
| CreateIftttIntegration | [CreateIftttIntegrationRequest](#api-CreateIftttIntegrationRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Create IFTTT integration. |
| GetIftttIntegration | [GetIftttIntegrationRequest](#api-GetIftttIntegrationRequest) | [GetIftttIntegrationResponse](#api-GetIftttIntegrationResponse) | Get IFTTT integration. |
| UpdateIftttIntegration | [UpdateIftttIntegrationRequest](#api-UpdateIftttIntegrationRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Update IFTTT integration. |
| DeleteIftttIntegration | [DeleteIftttIntegrationRequest](#api-DeleteIftttIntegrationRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Delete IFTTT integration. |
| GenerateMqttIntegrationClientCertificate | [GenerateMqttIntegrationClientCertificateRequest](#api-GenerateMqttIntegrationClientCertificateRequest) | [GenerateMqttIntegrationClientCertificateResponse](#api-GenerateMqttIntegrationClientCertificateResponse) | Generates application ID specific client-certificate. |
@ -1733,69 +1837,16 @@ ApplicationService is the service providing API methods for managing application
<a name="api-DeviceStats"></a>
<a name="api-DeviceState"></a>
### DeviceStats
### DeviceState
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Timestamp of the (aggregated) measurement. |
| rx_packets | [uint32](#uint32) | | Packets received from the device. |
| gw_rssi | [float](#float) | | Average RSSI (as reported by the gateway(s)). |
| gw_snr | [float](#float) | | Average SNR (as reported by the gateway(s)). |
| rx_packets_per_frequency | [DeviceStats.RxPacketsPerFrequencyEntry](#api-DeviceStats-RxPacketsPerFrequencyEntry) | repeated | Packets received by frequency. |
| rx_packets_per_dr | [DeviceStats.RxPacketsPerDrEntry](#api-DeviceStats-RxPacketsPerDrEntry) | repeated | Packets received by DR. |
| errors | [DeviceStats.ErrorsEntry](#api-DeviceStats-ErrorsEntry) | repeated | Error count. |
<a name="api-DeviceStats-ErrorsEntry"></a>
### DeviceStats.ErrorsEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [uint32](#uint32) | | |
<a name="api-DeviceStats-RxPacketsPerDrEntry"></a>
### DeviceStats.RxPacketsPerDrEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [uint32](#uint32) | | |
| value | [uint32](#uint32) | | |
<a name="api-DeviceStats-RxPacketsPerFrequencyEntry"></a>
### DeviceStats.RxPacketsPerFrequencyEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [uint32](#uint32) | | |
| value | [uint32](#uint32) | | |
| name | [string](#string) | | Name. |
| value | [string](#string) | | Value. |
@ -1827,7 +1878,7 @@ ApplicationService is the service providing API methods for managing application
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| item | [DeviceQueueItem](#api-DeviceQueueItem) | | |
| queue_item | [DeviceQueueItem](#api-DeviceQueueItem) | | |
@ -1941,6 +1992,110 @@ ApplicationService is the service providing API methods for managing application
<a name="api-GetDeviceLinkMetricsRequest"></a>
### GetDeviceLinkMetricsRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| dev_eui | [string](#string) | | DevEUI (EUI64). |
| start | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval start timestamp. |
| end | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval end timestamp. |
| aggregation | [common.Aggregation](#common-Aggregation) | | Aggregation. |
<a name="api-GetDeviceLinkMetricsResponse"></a>
### GetDeviceLinkMetricsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| rx_packets | [common.Metric](#common-Metric) | | Packets received from the device. |
| gw_rssi | [common.Metric](#common-Metric) | | RSSI (as reported by the gateway(s)). |
| gw_snr | [common.Metric](#common-Metric) | | SNR (as reported by the gateway(s)). |
| rx_packets_per_freq | [common.Metric](#common-Metric) | | Packets received by frequency. |
| rx_packets_per_dr | [common.Metric](#common-Metric) | | Packets received by DR. |
| errors | [common.Metric](#common-Metric) | | Errors. |
<a name="api-GetDeviceMetricsRequest"></a>
### GetDeviceMetricsRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| dev_eui | [string](#string) | | DevEUI (EUI64). |
| start | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval start timestamp. |
| end | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval end timestamp. |
| aggregation | [common.Aggregation](#common-Aggregation) | | Aggregation. |
<a name="api-GetDeviceMetricsResponse"></a>
### GetDeviceMetricsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| metrics | [GetDeviceMetricsResponse.MetricsEntry](#api-GetDeviceMetricsResponse-MetricsEntry) | repeated | |
| states | [GetDeviceMetricsResponse.StatesEntry](#api-GetDeviceMetricsResponse-StatesEntry) | repeated | |
<a name="api-GetDeviceMetricsResponse-MetricsEntry"></a>
### GetDeviceMetricsResponse.MetricsEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [common.Metric](#common-Metric) | | |
<a name="api-GetDeviceMetricsResponse-StatesEntry"></a>
### GetDeviceMetricsResponse.StatesEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [DeviceState](#api-DeviceState) | | |
<a name="api-GetDeviceQueueItemsRequest"></a>
### GetDeviceQueueItemsRequest
@ -2007,38 +2162,6 @@ ApplicationService is the service providing API methods for managing application
<a name="api-GetDeviceStatsRequest"></a>
### GetDeviceStatsRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| dev_eui | [string](#string) | | DevEUI (EUI64). |
| start | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval start timestamp. |
| end | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval end timestamp. |
<a name="api-GetDeviceStatsResponse"></a>
### GetDeviceStatsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| result | [DeviceStats](#api-DeviceStats) | repeated | |
<a name="api-GetRandomDevAddrRequest"></a>
### GetRandomDevAddrRequest
@ -2161,7 +2284,8 @@ DeviceService is the service providing API methods for managing devices.
| Deactivate | [DeactivateDeviceRequest](#api-DeactivateDeviceRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Deactivate de-activates the device. |
| GetActivation | [GetDeviceActivationRequest](#api-GetDeviceActivationRequest) | [GetDeviceActivationResponse](#api-GetDeviceActivationResponse) | GetActivation returns the current activation details of the device (OTAA or ABP). |
| GetRandomDevAddr | [GetRandomDevAddrRequest](#api-GetRandomDevAddrRequest) | [GetRandomDevAddrResponse](#api-GetRandomDevAddrResponse) | GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account. |
| GetStats | [GetDeviceStatsRequest](#api-GetDeviceStatsRequest) | [GetDeviceStatsResponse](#api-GetDeviceStatsResponse) | GetStats returns the device stats. |
| GetMetrics | [GetDeviceMetricsRequest](#api-GetDeviceMetricsRequest) | [GetDeviceMetricsResponse](#api-GetDeviceMetricsResponse) | GetMetrics returns the device metrics. Note that this requires a device-profile with codec and measurements configured. |
| GetLinkMetrics | [GetDeviceLinkMetricsRequest](#api-GetDeviceLinkMetricsRequest) | [GetDeviceLinkMetricsResponse](#api-GetDeviceLinkMetricsResponse) | GetLinkMetrics returns the device link metrics. This includes uplinks, downlinks, RSSI, SNR, etc... |
| Enqueue | [EnqueueDeviceQueueItemRequest](#api-EnqueueDeviceQueueItemRequest) | [EnqueueDeviceQueueItemResponse](#api-EnqueueDeviceQueueItemResponse) | Enqueue adds the given item to the downlink queue. |
| FlushQueue | [FlushDeviceQueueRequest](#api-FlushDeviceQueueRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | FlushQueue flushes the downlink device-queue. |
| GetQueue | [GetDeviceQueueItemsRequest](#api-GetDeviceQueueItemsRequest) | [GetDeviceQueueItemsResponse](#api-GetDeviceQueueItemsResponse) | GetQueue returns the downlink device-queue. |
@ -2249,6 +2373,7 @@ DeviceService is the service providing API methods for managing devices.
| id | [string](#string) | | Device-profile ID (UUID). Note: on create this will be automatically generated. |
| tenant_id | [string](#string) | | Tenant ID (UUID). |
| name | [string](#string) | | Name. |
| description | [string](#string) | | Description. |
| region | [common.Region](#common-Region) | | Region. |
| mac_version | [common.MacVersion](#common-MacVersion) | | LoRaWAN mac-version. |
| reg_params_revision | [common.RegParamsRevision](#common-RegParamsRevision) | | Regional parameters revision. |
@ -2271,6 +2396,23 @@ DeviceService is the service providing API methods for managing devices.
| abp_rx2_dr | [uint32](#uint32) | | RX2 DR (for ABP). |
| abp_rx2_freq | [uint32](#uint32) | | RX2 frequency (for ABP, Hz). |
| tags | [DeviceProfile.TagsEntry](#api-DeviceProfile-TagsEntry) | repeated | User defined tags. |
| measurements | [DeviceProfile.MeasurementsEntry](#api-DeviceProfile-MeasurementsEntry) | repeated | Measurements. If defined, ChirpStack will visualize these metrics in the web-interface. |
<a name="api-DeviceProfile-MeasurementsEntry"></a>
### DeviceProfile.MeasurementsEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [Measurement](#api-Measurement) | | |
@ -2399,6 +2541,22 @@ DeviceService is the service providing API methods for managing devices.
<a name="api-Measurement"></a>
### Measurement
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | Name (user defined). |
| kind | [MeasurementKind](#api-MeasurementKind) | | Kind. |
<a name="api-UpdateDeviceProfileRequest"></a>
### UpdateDeviceProfileRequest
@ -2428,6 +2586,21 @@ DeviceService is the service providing API methods for managing devices.
| JS | 2 | JavaScript. |
<a name="api-MeasurementKind"></a>
### MeasurementKind
| Name | Number | Description |
| ---- | ------ | ----------- |
| UNKNOWN | 0 | Unknown (in which case it is not tracked). |
| COUNTER | 1 | Incrementing counters that never decrease (these are not reset on each reading). |
| ABSOLUTE | 2 | Counters that do get reset upon reading. |
| GAUGE | 3 | E.g. a temperature value. |
| STRING | 4 | E.g. a firmware version, true / false value. |
@ -2474,6 +2647,7 @@ DeviceProfileService is the service providing API methods for managing device-pr
| m_type | [common.MType](#common-MType) | | Message type. |
| dev_addr | [string](#string) | | Device address (optional). |
| dev_eui | [string](#string) | | Device EUI (optional). |
| plaintext_mac_commands | [bool](#bool) | | Plaintext mac-commands. |
@ -2495,6 +2669,7 @@ DeviceProfileService is the service providing API methods for managing device-pr
| dev_addr | [string](#string) | | Device address (optional). |
| dev_eui | [string](#string) | | Device EUI (optional). |
| time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Time. |
| plaintext_mac_commands | [bool](#bool) | | Plaintext mac-commands. |
@ -2639,108 +2814,6 @@ DeviceProfileService is the service providing API methods for managing device-pr
<a name="api-GatewayStats"></a>
### GatewayStats
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Timestamp of the (aggregated) measurement. |
| rx_packets | [uint32](#uint32) | | Packets received. |
| tx_packets | [uint32](#uint32) | | Packets emitted. |
| tx_packets_per_frequency | [GatewayStats.TxPacketsPerFrequencyEntry](#api-GatewayStats-TxPacketsPerFrequencyEntry) | repeated | Tx packets per frequency. |
| rx_packets_per_frequency | [GatewayStats.RxPacketsPerFrequencyEntry](#api-GatewayStats-RxPacketsPerFrequencyEntry) | repeated | Rx packets per frequency. |
| tx_packets_per_dr | [GatewayStats.TxPacketsPerDrEntry](#api-GatewayStats-TxPacketsPerDrEntry) | repeated | Tx packets per DR. |
| rx_packets_per_dr | [GatewayStats.RxPacketsPerDrEntry](#api-GatewayStats-RxPacketsPerDrEntry) | repeated | Rx packets per DR. |
| tx_packets_per_status | [GatewayStats.TxPacketsPerStatusEntry](#api-GatewayStats-TxPacketsPerStatusEntry) | repeated | Tx packets per status. |
<a name="api-GatewayStats-RxPacketsPerDrEntry"></a>
### GatewayStats.RxPacketsPerDrEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [uint32](#uint32) | | |
| value | [uint32](#uint32) | | |
<a name="api-GatewayStats-RxPacketsPerFrequencyEntry"></a>
### GatewayStats.RxPacketsPerFrequencyEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [uint32](#uint32) | | |
| value | [uint32](#uint32) | | |
<a name="api-GatewayStats-TxPacketsPerDrEntry"></a>
### GatewayStats.TxPacketsPerDrEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [uint32](#uint32) | | |
| value | [uint32](#uint32) | | |
<a name="api-GatewayStats-TxPacketsPerFrequencyEntry"></a>
### GatewayStats.TxPacketsPerFrequencyEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [uint32](#uint32) | | |
| value | [uint32](#uint32) | | |
<a name="api-GatewayStats-TxPacketsPerStatusEntry"></a>
### GatewayStats.TxPacketsPerStatusEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [uint32](#uint32) | | |
<a name="api-GenerateGatewayClientCertificateRequest"></a>
### GenerateGatewayClientCertificateRequest
@ -2774,6 +2847,45 @@ DeviceProfileService is the service providing API methods for managing device-pr
<a name="api-GetGatewayMetricsRequest"></a>
### GetGatewayMetricsRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| gateway_id | [string](#string) | | Gateway ID (EUI64). |
| start | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval start timestamp. |
| end | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval end timestamp. |
| aggregation | [common.Aggregation](#common-Aggregation) | | Aggregation. |
<a name="api-GetGatewayMetricsResponse"></a>
### GetGatewayMetricsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| rx_packets | [common.Metric](#common-Metric) | | RX packets. |
| tx_packets | [common.Metric](#common-Metric) | | TX packets. |
| tx_packets_per_freq | [common.Metric](#common-Metric) | | TX packets / frequency. |
| rx_packets_per_freq | [common.Metric](#common-Metric) | | RX packets / frequency. |
| tx_packets_per_dr | [common.Metric](#common-Metric) | | TX packets / DR. |
| rx_packets_per_dr | [common.Metric](#common-Metric) | | RX packets / DR. |
| tx_packets_per_status | [common.Metric](#common-Metric) | | TX packets per status. |
<a name="api-GetGatewayRequest"></a>
### GetGatewayRequest
@ -2807,38 +2919,6 @@ DeviceProfileService is the service providing API methods for managing device-pr
<a name="api-GetGatewayStatsRequest"></a>
### GetGatewayStatsRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| gateway_id | [string](#string) | | Gateway ID (EUI64). |
| start | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval start timestamp. |
| end | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Interval end timestamp. |
<a name="api-GetGatewayStatsResponse"></a>
### GetGatewayStatsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| result | [GatewayStats](#api-GatewayStats) | repeated | |
<a name="api-ListGatewaysRequest"></a>
### ListGatewaysRequest
@ -2907,7 +2987,7 @@ GatewayService is the service providing API methods for managing gateways.
| Delete | [DeleteGatewayRequest](#api-DeleteGatewayRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | Delete deletes the gateway matching the given Gateway ID. |
| List | [ListGatewaysRequest](#api-ListGatewaysRequest) | [ListGatewaysResponse](#api-ListGatewaysResponse) | Get the list of gateways. |
| GenerateClientCertificate | [GenerateGatewayClientCertificateRequest](#api-GenerateGatewayClientCertificateRequest) | [GenerateGatewayClientCertificateResponse](#api-GenerateGatewayClientCertificateResponse) | Generate client-certificate for the gateway. |
| GetStats | [GetGatewayStatsRequest](#api-GetGatewayStatsRequest) | [GetGatewayStatsResponse](#api-GetGatewayStatsResponse) | GetStats returns the gateway stats. |
| GetMetrics | [GetGatewayMetricsRequest](#api-GetGatewayMetricsRequest) | [GetGatewayMetricsResponse](#api-GetGatewayMetricsResponse) | GetMetrics returns the gateway metrics. |
@ -2989,7 +3069,7 @@ GatewayService is the service providing API methods for managing gateways.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| multicast_group_queue_item | [MulticastGroupQueueItem](#api-MulticastGroupQueueItem) | | Multicast queue-item to enqueue. |
| queue_item | [MulticastGroupQueueItem](#api-MulticastGroupQueueItem) | | Multicast queue-item to enqueue. |

544
api/md/api/internal.md vendored
View File

@ -1,544 +0,0 @@
# Protocol Documentation
<a name="top"></a>
## Table of Contents
- [api/internal.proto](#api_internal-proto)
- [ApiKey](#api-ApiKey)
- [CreateApiKeyRequest](#api-CreateApiKeyRequest)
- [CreateApiKeyResponse](#api-CreateApiKeyResponse)
- [DeleteApiKeyRequest](#api-DeleteApiKeyRequest)
- [GetDevicesSummaryRequest](#api-GetDevicesSummaryRequest)
- [GetDevicesSummaryResponse](#api-GetDevicesSummaryResponse)
- [GetDevicesSummaryResponse.DrCountEntry](#api-GetDevicesSummaryResponse-DrCountEntry)
- [GetGatewaysSummaryRequest](#api-GetGatewaysSummaryRequest)
- [GetGatewaysSummaryResponse](#api-GetGatewaysSummaryResponse)
- [GlobalSearchRequest](#api-GlobalSearchRequest)
- [GlobalSearchResponse](#api-GlobalSearchResponse)
- [GlobalSearchResult](#api-GlobalSearchResult)
- [ListApiKeysRequest](#api-ListApiKeysRequest)
- [ListApiKeysResponse](#api-ListApiKeysResponse)
- [LogItem](#api-LogItem)
- [LogItem.PropertiesEntry](#api-LogItem-PropertiesEntry)
- [LoginRequest](#api-LoginRequest)
- [LoginResponse](#api-LoginResponse)
- [OpenIdConnect](#api-OpenIdConnect)
- [OpenIdConnectLoginRequest](#api-OpenIdConnectLoginRequest)
- [OpenIdConnectLoginResponse](#api-OpenIdConnectLoginResponse)
- [ProfileResponse](#api-ProfileResponse)
- [SettingsResponse](#api-SettingsResponse)
- [StreamDeviceEventsRequest](#api-StreamDeviceEventsRequest)
- [StreamDeviceFramesRequest](#api-StreamDeviceFramesRequest)
- [StreamGatewayFramesRequest](#api-StreamGatewayFramesRequest)
- [UserTenantLink](#api-UserTenantLink)
- [InternalService](#api-InternalService)
- [Scalar Value Types](#scalar-value-types)
<a name="api_internal-proto"></a>
<p align="right"><a href="#top">Top</a></p>
## api/internal.proto
<a name="api-ApiKey"></a>
### ApiKey
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | API key ID. This value will be automatically generated on create. |
| name | [string](#string) | | Name. |
| is_admin | [bool](#bool) | | Is global admin key. |
| tenant_id | [string](#string) | | Tenant ID. In case the API key is intended to manage resources under a single tenant. |
<a name="api-CreateApiKeyRequest"></a>
### CreateApiKeyRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| api_key | [ApiKey](#api-ApiKey) | | The API key to create. |
<a name="api-CreateApiKeyResponse"></a>
### CreateApiKeyResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | API key ID. |
| token | [string](#string) | | API token for authentication API requests. |
<a name="api-DeleteApiKeyRequest"></a>
### DeleteApiKeyRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | API key ID. |
<a name="api-GetDevicesSummaryRequest"></a>
### GetDevicesSummaryRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| tenant_id | [string](#string) | | Tenant ID (UUID). |
<a name="api-GetDevicesSummaryResponse"></a>
### GetDevicesSummaryResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| active_count | [uint32](#uint32) | | Active count. |
| inactive_count | [uint32](#uint32) | | Inactive count. |
| dr_count | [GetDevicesSummaryResponse.DrCountEntry](#api-GetDevicesSummaryResponse-DrCountEntry) | repeated | per data-rate count. Devices that have never been seen are excluded. |
| never_seen_count | [uint32](#uint32) | | Never seen count. |
<a name="api-GetDevicesSummaryResponse-DrCountEntry"></a>
### GetDevicesSummaryResponse.DrCountEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [uint32](#uint32) | | |
| value | [uint32](#uint32) | | |
<a name="api-GetGatewaysSummaryRequest"></a>
### GetGatewaysSummaryRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| tenant_id | [string](#string) | | Tenant ID (UUID). |
<a name="api-GetGatewaysSummaryResponse"></a>
### GetGatewaysSummaryResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| active_count | [uint32](#uint32) | | Active count. |
| inactive_count | [uint32](#uint32) | | Inactive count. |
| never_seen_count | [uint32](#uint32) | | Never seen count. |
<a name="api-GlobalSearchRequest"></a>
### GlobalSearchRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| search | [string](#string) | | Search query. |
| limit | [int64](#int64) | | Max number of results to return. |
| offset | [int64](#int64) | | Offset offset of the result-set (for pagination). |
<a name="api-GlobalSearchResponse"></a>
### GlobalSearchResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| result | [GlobalSearchResult](#api-GlobalSearchResult) | repeated | |
<a name="api-GlobalSearchResult"></a>
### GlobalSearchResult
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| kind | [string](#string) | | Record kind. |
| score | [float](#float) | | Search score. |
| tenant_id | [string](#string) | | Organization id. |
| tenant_name | [string](#string) | | Organization name. |
| application_id | [string](#string) | | Application id. |
| application_name | [string](#string) | | Application name. |
| device_dev_eui | [string](#string) | | Device DevEUI (hex encoded). |
| device_name | [string](#string) | | Device name. |
| gateway_id | [string](#string) | | Gateway MAC (hex encoded). |
| gateway_name | [string](#string) | | Gateway name. |
<a name="api-ListApiKeysRequest"></a>
### ListApiKeysRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| limit | [uint32](#uint32) | | Max number of items to return. |
| offset | [uint32](#uint32) | | Offset in the result-set (for pagination). |
| is_admin | [bool](#bool) | | Return only admin keys. |
| tenant_id | [string](#string) | | Filter on tenant ID. |
<a name="api-ListApiKeysResponse"></a>
### ListApiKeysResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total_count | [uint32](#uint32) | | Total number of API keys. |
| result | [ApiKey](#api-ApiKey) | repeated | |
<a name="api-LogItem"></a>
### LogItem
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [string](#string) | | ID. |
| time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Timestamp. |
| description | [string](#string) | | Message. |
| body | [string](#string) | | Body. |
| properties | [LogItem.PropertiesEntry](#api-LogItem-PropertiesEntry) | repeated | Properties. |
<a name="api-LogItem-PropertiesEntry"></a>
### LogItem.PropertiesEntry
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [string](#string) | | |
| value | [string](#string) | | |
<a name="api-LoginRequest"></a>
### LoginRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| email | [string](#string) | | Email of the user. |
| password | [string](#string) | | Password of the user. |
<a name="api-LoginResponse"></a>
### LoginResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| jwt | [string](#string) | | The JWT tag to be used to access chirpstack-application-server interfaces. |
<a name="api-OpenIdConnect"></a>
### OpenIdConnect
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| enabled | [bool](#bool) | | Enable OpenId Connect authentication. |
| login_url | [string](#string) | | Login url. |
| login_label | [string](#string) | | Login label. |
| logout_url | [string](#string) | | Logout url. |
<a name="api-OpenIdConnectLoginRequest"></a>
### OpenIdConnectLoginRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| code | [string](#string) | | OpenId Connect callback code. |
| state | [string](#string) | | OpenId Connect callback state. |
<a name="api-OpenIdConnectLoginResponse"></a>
### OpenIdConnectLoginResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| token | [string](#string) | | Token to use for authentication. |
<a name="api-ProfileResponse"></a>
### ProfileResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| user | [User](#api-User) | | User object. |
| tenants | [UserTenantLink](#api-UserTenantLink) | repeated | Tenants to which the user is associated. |
<a name="api-SettingsResponse"></a>
### SettingsResponse
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| openid_connect | [OpenIdConnect](#api-OpenIdConnect) | | OpenId Connect settings. |
<a name="api-StreamDeviceEventsRequest"></a>
### StreamDeviceEventsRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| dev_eui | [string](#string) | | Device EUI. |
<a name="api-StreamDeviceFramesRequest"></a>
### StreamDeviceFramesRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| dev_eui | [string](#string) | | Device EUI. |
<a name="api-StreamGatewayFramesRequest"></a>
### StreamGatewayFramesRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| gateway_id | [string](#string) | | Gateway ID (EUI64). |
<a name="api-UserTenantLink"></a>
### UserTenantLink
Defines a tenant to which the user is associated.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Created at timestamp. |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | Last update timestamp. |
| tenant_id | [string](#string) | | Tenant ID. |
| is_admin | [bool](#bool) | | User is admin within the context of this tenant. There is no need to set the is_device_admin and is_gateway_admin flags. |
| is_device_admin | [bool](#bool) | | User is able to modify device related resources (applications, device-profiles, devices, multicast-groups). |
| is_gateway_admin | [bool](#bool) | | User is able to modify gateways. |
<a name="api-InternalService"></a>
### InternalService
InternalService is the service providing API endpoints for internal usage.
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| Login | [LoginRequest](#api-LoginRequest) | [LoginResponse](#api-LoginResponse) | Log in a user |
| Profile | [.google.protobuf.Empty](#google-protobuf-Empty) | [ProfileResponse](#api-ProfileResponse) | Get the current user&#39;s profile |
| GlobalSearch | [GlobalSearchRequest](#api-GlobalSearchRequest) | [GlobalSearchResponse](#api-GlobalSearchResponse) | Perform a global search. |
| CreateApiKey | [CreateApiKeyRequest](#api-CreateApiKeyRequest) | [CreateApiKeyResponse](#api-CreateApiKeyResponse) | CreateApiKey creates the given API key. |
| DeleteApiKey | [DeleteApiKeyRequest](#api-DeleteApiKeyRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | DeleteApiKey deletes the API key. |
| ListApiKeys | [ListApiKeysRequest](#api-ListApiKeysRequest) | [ListApiKeysResponse](#api-ListApiKeysResponse) | ListApiKeys lists the available API keys. |
| Settings | [.google.protobuf.Empty](#google-protobuf-Empty) | [SettingsResponse](#api-SettingsResponse) | Get the global settings. |
| OpenIdConnectLogin | [OpenIdConnectLoginRequest](#api-OpenIdConnectLoginRequest) | [OpenIdConnectLoginResponse](#api-OpenIdConnectLoginResponse) | OpenId Connect login. |
| GetDevicesSummary | [GetDevicesSummaryRequest](#api-GetDevicesSummaryRequest) | [GetDevicesSummaryResponse](#api-GetDevicesSummaryResponse) | GetDevicesSummary returns an aggregated summary of the devices. |
| GetGatewaysSummary | [GetGatewaysSummaryRequest](#api-GetGatewaysSummaryRequest) | [GetGatewaysSummaryResponse](#api-GetGatewaysSummaryResponse) | GetGatewaysSummary returns an aggregated summary of the gateways. |
| StreamGatewayFrames | [StreamGatewayFramesRequest](#api-StreamGatewayFramesRequest) | [LogItem](#api-LogItem) stream | Stream frame for the given Gateway ID. |
| StreamDeviceFrames | [StreamDeviceFramesRequest](#api-StreamDeviceFramesRequest) | [LogItem](#api-LogItem) stream | Stream frames for the given Device EUI. |
| StreamDeviceEvents | [StreamDeviceEventsRequest](#api-StreamDeviceEventsRequest) | [LogItem](#api-LogItem) stream | Stream events for the given Device EUI. |
## Scalar Value Types
| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- |
| <a name="double" /> double | | double | double | float | float64 | double | float | Float |
| <a name="float" /> float | | float | float | float | float32 | float | float | Float |
| <a name="int32" /> int32 | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="int64" /> int64 | Uses variable-length encoding. Inefficient for encoding negative numbers if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="uint32" /> uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="uint64" /> uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
| <a name="sint32" /> sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sint64" /> sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="fixed32" /> fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
| <a name="fixed64" /> fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
| <a name="sfixed32" /> sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
| <a name="sfixed64" /> sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
| <a name="bool" /> bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
| <a name="string" /> string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
| <a name="bytes" /> bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |

View File

@ -32,6 +32,9 @@ message UplinkFrameLog {
// Time.
google.protobuf.Timestamp time = 7;
// Plaintext mac-commands.
bool plaintext_mac_commands = 8;
}
message DownlinkFrameLog {
@ -58,4 +61,7 @@ message DownlinkFrameLog {
// Device EUI (optional).
string dev_eui = 8;
// Plaintext mac-commands.
bool plaintext_mac_commands = 9;
}

View File

@ -32,6 +32,9 @@ message UplinkFrameLog {
// Time.
google.protobuf.Timestamp time = 7;
// Plaintext mac-commands.
bool plaintext_mac_commands = 8;
}
message DownlinkFrameLog {
@ -58,4 +61,7 @@ message DownlinkFrameLog {
// Device EUI (optional).
string dev_eui = 8;
// Plaintext mac-commands.
bool plaintext_mac_commands = 9;
}

View File

@ -17,7 +17,7 @@ from chirpstack_api.common import common_pb2 as chirpstack__api_dot_common_dot_c
from chirpstack_api.gw import gw_pb2 as chirpstack__api_dot_gw_dot_gw__pb2
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"chirpstack-api/api/frame_log.proto\x12\x03\x61pi\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\"chirpstack-api/common/common.proto\x1a\x1a\x63hirpstack-api/gw/gw.proto\"\xd7\x01\n\x0eUplinkFrameLog\x12\x13\n\x0bphy_payload\x18\x01 \x01(\x0c\x12!\n\x07tx_info\x18\x02 \x01(\x0b\x32\x10.gw.UplinkTxInfo\x12!\n\x07rx_info\x18\x03 \x03(\x0b\x32\x10.gw.UplinkRxInfo\x12\x1d\n\x06m_type\x18\x04 \x01(\x0e\x32\r.common.MType\x12\x10\n\x08\x64\x65v_addr\x18\x05 \x01(\t\x12\x0f\n\x07\x64\x65v_eui\x18\x06 \x01(\t\x12(\n\x04time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe1\x01\n\x10\x44ownlinkFrameLog\x12(\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0bphy_payload\x18\x02 \x01(\x0c\x12#\n\x07tx_info\x18\x03 \x01(\x0b\x32\x12.gw.DownlinkTxInfo\x12\x13\n\x0b\x64ownlink_id\x18\x04 \x01(\r\x12\x12\n\ngateway_id\x18\x05 \x01(\t\x12\x1d\n\x06m_type\x18\x06 \x01(\x0e\x32\r.common.MType\x12\x10\n\x08\x64\x65v_addr\x18\x07 \x01(\t\x12\x0f\n\x07\x64\x65v_eui\x18\x08 \x01(\tBT\n\x11io.chirpstack.apiB\rFrameLogProtoP\x01Z.github.com/chirpstack/chirpstack/api/go/v4/apib\x06proto3')
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"chirpstack-api/api/frame_log.proto\x12\x03\x61pi\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\"chirpstack-api/common/common.proto\x1a\x1a\x63hirpstack-api/gw/gw.proto\"\xf7\x01\n\x0eUplinkFrameLog\x12\x13\n\x0bphy_payload\x18\x01 \x01(\x0c\x12!\n\x07tx_info\x18\x02 \x01(\x0b\x32\x10.gw.UplinkTxInfo\x12!\n\x07rx_info\x18\x03 \x03(\x0b\x32\x10.gw.UplinkRxInfo\x12\x1d\n\x06m_type\x18\x04 \x01(\x0e\x32\r.common.MType\x12\x10\n\x08\x64\x65v_addr\x18\x05 \x01(\t\x12\x0f\n\x07\x64\x65v_eui\x18\x06 \x01(\t\x12(\n\x04time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1e\n\x16plaintext_mac_commands\x18\x08 \x01(\x08\"\x81\x02\n\x10\x44ownlinkFrameLog\x12(\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0bphy_payload\x18\x02 \x01(\x0c\x12#\n\x07tx_info\x18\x03 \x01(\x0b\x32\x12.gw.DownlinkTxInfo\x12\x13\n\x0b\x64ownlink_id\x18\x04 \x01(\r\x12\x12\n\ngateway_id\x18\x05 \x01(\t\x12\x1d\n\x06m_type\x18\x06 \x01(\x0e\x32\r.common.MType\x12\x10\n\x08\x64\x65v_addr\x18\x07 \x01(\t\x12\x0f\n\x07\x64\x65v_eui\x18\x08 \x01(\t\x12\x1e\n\x16plaintext_mac_commands\x18\t \x01(\x08\x42T\n\x11io.chirpstack.apiB\rFrameLogProtoP\x01Z.github.com/chirpstack/chirpstack/api/go/v4/apib\x06proto3')
@ -42,7 +42,7 @@ if _descriptor._USE_C_DESCRIPTORS == False:
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\021io.chirpstack.apiB\rFrameLogProtoP\001Z.github.com/chirpstack/chirpstack/api/go/v4/api'
_UPLINKFRAMELOG._serialized_start=141
_UPLINKFRAMELOG._serialized_end=356
_DOWNLINKFRAMELOG._serialized_start=359
_DOWNLINKFRAMELOG._serialized_end=584
_UPLINKFRAMELOG._serialized_end=388
_DOWNLINKFRAMELOG._serialized_start=391
_DOWNLINKFRAMELOG._serialized_end=648
# @@protoc_insertion_point(module_scope)

View File

@ -18,7 +18,7 @@ CLASSIFIERS = [
setup(
name='chirpstack-api',
version = "4.0.0-test.18",
version = "4.0.0-rc.1",
url='https://github.com/brocaar/chirpstack-api',
author='Orne Brocaar',
author_email='info@brocaar.com',

2
api/rust/Cargo.lock generated vendored
View File

@ -121,7 +121,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chirpstack_api"
version = "4.0.0-test.17"
version = "4.0.0-test.18"
dependencies = [
"hex",
"pbjson",

2
api/rust/Cargo.toml vendored
View File

@ -1,7 +1,7 @@
[package]
name = "chirpstack_api"
description = "ChirpStack Protobuf / gRPC API definitions."
version = "4.0.0-test.18"
version = "4.0.0-rc.1"
authors = ["Orne Brocaar <info@brocaar.com>"]
license = "MIT"
homepage = "https://www.chirpstack.io"

View File

@ -32,6 +32,9 @@ message UplinkFrameLog {
// Time.
google.protobuf.Timestamp time = 7;
// Plaintext mac-commands.
bool plaintext_mac_commands = 8;
}
message DownlinkFrameLog {
@ -58,4 +61,7 @@ message DownlinkFrameLog {
// Device EUI (optional).
string dev_eui = 8;
// Plaintext mac-commands.
bool plaintext_mac_commands = 9;
}

View File

@ -1,6 +1,6 @@
[package]
name = "backend"
version = "4.0.0-test.18"
version = "4.0.0-rc.1"
authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2018"
publish = false

View File

@ -3,7 +3,7 @@ name = "chirpstack"
description = "ChirpStack is an open-source LoRaWAN(TM) Network Server"
repository = "https://github.com/chirpstack/chirpstack"
homepage="https://www.chirpstack.io/"
version = "4.0.0-test.18"
version = "4.0.0-rc.1"
authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2021"
publish = false

View File

@ -667,7 +667,8 @@ impl DeviceService for Device {
kind: match v.kind {
fields::MeasurementKind::COUNTER => common::MetricKind::Counter,
fields::MeasurementKind::ABSOLUTE => common::MetricKind::Absolute,
fields::MeasurementKind::GAUGE | _ => common::MetricKind::Gauge,
fields::MeasurementKind::GAUGE => common::MetricKind::Gauge,
_ => common::MetricKind::Gauge,
}
.into(),
},

View File

@ -96,13 +96,13 @@ pub fn run() {
# will generate client certificates which can be used by the gateway for
# authentication and authorization. The Common Name of the certificate will
# be set to the Gateway ID.
client_cert_lifetime="{{ gateway.client_cert_lifetime }}"
ca_key="{{ gateway.ca_key }}"
ca_cert="{{ gateway.ca_cert }}"
# Certificate lifetime.
#
# This defines how long (after generating) the certificate remains valid.
ca_key="{{ gateway.ca_key }}"
client_cert_lifetime="{{ gateway.client_cert_lifetime }}"
# Network related configuration.
@ -334,6 +334,24 @@ pub fn run() {
tls_key="{{ integration.mqtt.tls_key }}"
# Configuration for MQTT clients.
[integration.mqtt.client]
# CA certificate and key file (optional).
#
# If setting the CA certificate and key file options, ChirpStack
# will generate client certificates which can be used by the MQTT clients for
# authentication and authorization. The Common Name of the certificate will
# be set to the ID of the application.
ca_key="{{ integration.mqtt.ca_key }}"
ca_cert="{{ integration.mqtt.ca_cert }}"
# Certificate lifetime.
#
# This defines how long (after generating) the certificate remains valid.
client_cert_lifetime="{{ integration.mqtt.client_cert_lifetime }}"
# PostgreSQL integration configuration.
[integration.postgresql]

View File

@ -557,6 +557,19 @@ impl Data {
}
}
// Encrypt f_opts mac-commands (LoRaWAN 1.1)
if !self
.device_session
.mac_version()
.to_string()
.starts_with("1.0")
{
phy.encrypt_f_opts(&lrwn::AES128Key::from_slice(
&self.device_session.nwk_s_enc_key,
)?)
.context("Encrypt f_opts")?;
}
// Set MIC.
// If this is an ACK, then FCntUp has already been incremented by one. If
// this is not an ACK, then DownlinkDataMIC will zero out ConfFCnt.

View File

@ -415,6 +415,7 @@ impl TxAck {
"".to_string()
}
},
plaintext_mac_commands: false,
};
// Log for gateway (with potentially encrypted mac-commands).
@ -451,6 +452,7 @@ impl TxAck {
m_type: dfl.m_type,
dev_addr: dfl.dev_addr.clone(),
dev_eui: dfl.dev_eui.clone(),
plaintext_mac_commands: true,
};
// Log for device.

View File

@ -40,6 +40,7 @@ pub async fn log_uplink_for_gateways(ufl: &api::UplinkFrameLog) -> Result<()> {
dev_addr: ufl.dev_addr.clone(),
dev_eui: ufl.dev_eui.clone(),
time: ufl.time.clone(),
plaintext_mac_commands: ufl.plaintext_mac_commands,
};
let b = ufl_copy.encode_to_vec();
@ -268,71 +269,90 @@ pub async fn get_frame_logs(
for stream_id in &stream_key.ids {
last_id = stream_id.id.clone();
for (k, v) in &stream_id.map {
match k.as_ref() {
"up" => {
trace!(key = %k, id = %last_id, "Frame-log received from stream");
if let redis::Value::Data(b) = v {
let pl = api::UplinkFrameLog::decode(&mut Cursor::new(b))?;
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
phy.decode_f_opts_to_mac_commands()?;
let res = || -> Result<()> {
match k.as_ref() {
"up" => {
trace!(key = %k, id = %last_id, "Frame-log received from stream");
if let redis::Value::Data(b) = v {
let pl = api::UplinkFrameLog::decode(&mut Cursor::new(b))?;
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
if pl.plaintext_mac_commands {
phy.decode_f_opts_to_mac_commands()?;
}
let pl = api::LogItem {
id: stream_id.id.clone(),
time: pl.time.clone(),
description: pl.m_type().into(),
body: json!({
"phy_payload": phy,
"tx_info": pl.tx_info,
"rx_info": pl.rx_info,
})
.to_string(),
properties: [
("DevAddr".to_string(), pl.dev_addr),
("DevEUI".to_string(), pl.dev_eui),
]
.iter()
.cloned()
.collect(),
};
if channel.blocking_send(pl).is_err() {
return Err(anyhow!("Channel send error"));
let pl = api::LogItem {
id: stream_id.id.clone(),
time: pl.time.clone(),
description: pl.m_type().into(),
body: json!({
"phy_payload": phy,
"tx_info": pl.tx_info,
"rx_info": pl.rx_info,
})
.to_string(),
properties: [
("DevAddr".to_string(), pl.dev_addr),
("DevEUI".to_string(), pl.dev_eui),
]
.iter()
.cloned()
.collect(),
};
if let Err(e) = channel.blocking_send(pl) {
return Err(anyhow::Error::new(e));
}
}
}
}
"down" => {
trace!(key = %k, id = %last_id, "frame-log received from stream");
if let redis::Value::Data(b) = v {
let pl = api::DownlinkFrameLog::decode(&mut Cursor::new(b))?;
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
phy.decode_f_opts_to_mac_commands()?;
"down" => {
trace!(key = %k, id = %last_id, "frame-log received from stream");
if let redis::Value::Data(b) = v {
let pl = api::DownlinkFrameLog::decode(&mut Cursor::new(b))?;
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
if pl.plaintext_mac_commands {
phy.decode_f_opts_to_mac_commands()?;
}
let pl = api::LogItem {
id: stream_id.id.clone(),
time: pl.time.clone(),
description: pl.m_type().into(),
body: json!({
"phy_payload": phy,
"tx_info": pl.tx_info,
})
.to_string(),
properties: [
("DevAddr".to_string(), pl.dev_addr),
("DevEUI".to_string(), pl.dev_eui),
("Gateway ID".to_string(), pl.gateway_id),
]
.iter()
.cloned()
.collect(),
};
let pl = api::LogItem {
id: stream_id.id.clone(),
time: pl.time.clone(),
description: pl.m_type().into(),
body: json!({
"phy_payload": phy,
"tx_info": pl.tx_info,
})
.to_string(),
properties: [
("DevAddr".to_string(), pl.dev_addr),
("DevEUI".to_string(), pl.dev_eui),
("Gateway ID".to_string(), pl.gateway_id),
]
.iter()
.cloned()
.collect(),
};
if channel.blocking_send(pl).is_err() {
return Err(anyhow!("Channel send error"));
if let Err(e) = channel.blocking_send(pl) {
return Err(anyhow::Error::new(e));
}
}
}
_ => {
error!(key = %k, "Unexpected key in frame-log stream");
}
}
_ => {
error!(key = %k, "Unexpected key in frame-log stream");
Ok(())
}();
if let Err(e) = res {
// Return in case of channel error, in any other case we just log
// the error.
if e.downcast_ref::<mpsc::error::SendError<api::LogItem>>().is_some() {
return Err(e);
}
error!(key = %k, error = %e, "Parsing frame-log error");
}
}
}

View File

@ -311,7 +311,7 @@ async fn message_callback(region_name: &str, region_common_name: CommonName, msg
return Ok(());
}
let json = payload_is_json(&b);
let json = payload_is_json(b);
info!(
region_name = region_name,
@ -328,7 +328,7 @@ async fn message_callback(region_name: &str, region_common_name: CommonName, msg
})
.inc();
let mut event = match json {
true => serde_json::from_slice(&b)?,
true => serde_json::from_slice(b)?,
false => chirpstack_api::gw::UplinkFrame::decode(&mut Cursor::new(b))?,
};
event.v4_migrate();
@ -347,7 +347,7 @@ async fn message_callback(region_name: &str, region_common_name: CommonName, msg
})
.inc();
let mut event = match json {
true => serde_json::from_slice(&b)?,
true => serde_json::from_slice(b)?,
false => chirpstack_api::gw::GatewayStats::decode(&mut Cursor::new(b))?,
};
event.v4_migrate();
@ -367,7 +367,7 @@ async fn message_callback(region_name: &str, region_common_name: CommonName, msg
})
.inc();
let mut event = match json {
true => serde_json::from_slice(&b)?,
true => serde_json::from_slice(b)?,
false => chirpstack_api::gw::DownlinkTxAck::decode(&mut Cursor::new(b))?,
};
event.v4_migrate();

View File

@ -2393,14 +2393,14 @@ async fn test_lorawan_11_mac_commands() {
..Default::default()
},
f_opts: lrwn::MACCommandSet::new(vec![lrwn::MACCommand::Raw(vec![
2, 20, 1,
85, 88, 242,
])]),
..Default::default()
},
f_port: None,
frm_payload: None,
}),
mic: Some([119, 74, 235, 162]),
mic: Some([124, 101, 247, 223]),
},
lrwn::PhyPayload {
mhdr: lrwn::MHDR {
@ -2417,14 +2417,14 @@ async fn test_lorawan_11_mac_commands() {
..Default::default()
},
f_opts: lrwn::MACCommandSet::new(vec![lrwn::MACCommand::Raw(vec![
2, 20, 1,
85, 88, 242,
])]),
..Default::default()
},
f_port: None,
frm_payload: None,
}),
mic: Some([119, 74, 235, 162]),
mic: Some([124, 101, 247, 223]),
},
]),
],
@ -3329,14 +3329,14 @@ async fn test_lorawan_11_device_queue() {
..Default::default()
},
f_opts: lrwn::MACCommandSet::new(vec![
lrwn::MACCommand::Raw(vec![2,20,1]),
lrwn::MACCommand::Raw(vec![85, 88, 242]),
]),
..Default::default()
},
f_port: None,
frm_payload: None,
}),
mic: Some([183, 102, 104, 194]),
mic: Some([227, 104, 50, 163]),
},
lrwn::PhyPayload {
mhdr: lrwn::MHDR {
@ -3355,14 +3355,14 @@ async fn test_lorawan_11_device_queue() {
..Default::default()
},
f_opts: lrwn::MACCommandSet::new(vec![
lrwn::MACCommand::Raw(vec![2,20,1]),
lrwn::MACCommand::Raw(vec![85, 88, 242]),
]),
..Default::default()
},
f_port: None,
frm_payload: None,
}),
mic: Some([183, 102, 104, 194]),
mic: Some([227, 104, 50, 163]),
},
]),
],

View File

@ -442,6 +442,7 @@ impl Data {
trace!("Logging uplink frame-set");
let mut ufl: api::UplinkFrameLog = (&self.uplink_frame_set).try_into()?;
ufl.dev_eui = self.device.as_ref().unwrap().dev_eui.to_string();
ufl.plaintext_mac_commands = true;
framelog::log_uplink_for_device(&ufl).await?;
Ok(())
}

View File

@ -74,6 +74,7 @@ impl TryFrom<&UplinkFrameSet> for api::UplinkFrameLog {
_ => "".to_string(),
},
time: None, // is set below
plaintext_mac_commands: false,
};
for rx_info in &ufl.rx_info {

View File

@ -3,7 +3,7 @@ name = "lrwn"
description = "Library for encoding / decoding LoRaWAN frames."
homepage = "https://www.chirpstack.io"
license = "MIT"
version = "4.0.0-test.18"
version = "4.0.0-rc.1"
authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2018"
repository = "https://github.com/chirpstack/chirpstack"

View File

@ -1131,7 +1131,14 @@ impl NewChannelReqPayload {
freq: {
let mut freq_b: [u8; 4] = [0; 4];
freq_b[0..3].copy_from_slice(&b[1..4]);
u32::from_le_bytes(freq_b) * 100
let freq = u32::from_le_bytes(freq_b);
if freq >= 12000000 {
// 2.4GHz frequency
freq * 200
} else {
freq * 100
}
},
min_dr: b[4] & 0x0f,
max_dr: (b[4] & 0xf0) >> 4,
@ -1139,10 +1146,19 @@ impl NewChannelReqPayload {
}
pub fn to_bytes(&self) -> Result<[u8; Self::SIZE]> {
if self.freq / 100 >= (1 << 24) {
let mut freq = self.freq;
// Support LoRaWAN 2.4GHz, in which case the stepping is 200Hz:
// See Frequency Encoding in MAC Commands
// https://lora-developers.semtech.com/documentation/tech-papers-and-guides/physical-layer-proposal-2.4ghz/
if freq >= 2400000000 {
freq = freq / 2;
}
if freq / 100 >= (1 << 24) {
return Err(anyhow!("max freq value is 2^24 - 1"));
}
if self.freq % 100 != 0 {
if freq % 100 != 0 {
return Err(anyhow!("freq must be multiple of 100"));
}
if self.min_dr > 15 {
@ -1154,7 +1170,7 @@ impl NewChannelReqPayload {
let mut b: [u8; Self::SIZE] = [0; Self::SIZE];
b[0] = self.ch_index;
b[1..5].copy_from_slice(&(self.freq / 100).to_le_bytes());
b[1..5].copy_from_slice(&(freq / 100).to_le_bytes());
b[4] = self.min_dr | (self.max_dr << 4);
Ok(b)
@ -2005,6 +2021,18 @@ mod test {
)]),
bytes: vec![0x07, 0x03, 0x01, 0x02, 0x04, 0x5a],
},
MACTest {
uplink: false,
maccommand_set: MACCommandSet::new(vec![MACCommand::NewChannelReq(
NewChannelReqPayload {
ch_index: 3,
freq: 2410_000_000,
max_dr: 5,
min_dr: 0,
},
)]),
bytes: vec![7, 3, 80, 222, 183, 80],
},
MACTest {
uplink: true,
maccommand_set: MACCommandSet::new(vec![MACCommand::NewChannelAns(

View File

@ -1,6 +1,6 @@
{
"name": "chirpstack-ui",
"version": "4.0.0-test.18",
"version": "4.0.0-rc.1",
"private": true,
"dependencies": {
"@ant-design/colors": "^6.0.0",

View File

@ -1,6 +1,6 @@
import React, { Component } from "react";
import { Form, Input, Row, Col, Button, Tabs } from "antd";
import { Form, Input, Row, Col, Button, Tabs, Switch } from "antd";
import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
import { Tenant } from "@chirpstack/chirpstack-api-grpc-web/api/tenant_pb";
@ -36,6 +36,8 @@ class DeviceForm extends Component<IProps> {
d.setDescription(v.description);
d.setDevEui(v.devEui);
d.setDeviceProfileId(v.deviceProfileId);
d.setIsDisabled(v.isDisabled);
d.setSkipFcntCheck(v.skipFcntCheck);
// tags
for (const elm of v.tagsMap) {
@ -108,6 +110,28 @@ class DeviceForm extends Component<IProps> {
getOptions={this.getDeviceProfileOptions}
required
/>
<Row gutter={24}>
<Col span={12}>
<Form.Item
label="Device is disabled"
name="isDisabled"
valuePropName="checked"
tooltip="Received uplink frames and join-requests will be ignored."
>
<Switch />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="Disable frame-counter validation"
name="skipFcntCheck"
valuePropName="checked"
tooltip="You must re-activate your device before this setting becomes effective. Note that disabling the frame-counter validation will compromise security as it allows replay-attacks."
>
<Switch />
</Form.Item>
</Col>
</Row>
</Tabs.TabPane>
<Tabs.TabPane tab="Tags" key="2">
<Form.List name="tagsMap">

View File

@ -1881,7 +1881,7 @@
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@chirpstack/chirpstack-api-grpc-web@file:../api/grpc-web":
version "4.0.0-test.15"
version "4.0.0-rc.1"
dependencies:
"@types/google-protobuf" "^3.15.2"
google-protobuf "^3.17.3"