chirpstack/api/proto/internal/internal.proto

410 lines
8.9 KiB
Protocol Buffer
Raw Normal View History

2022-04-06 20:18:32 +00:00
syntax = "proto3";
package internal;
import "common/common.proto";
import "gw/gw.proto";
import "google/protobuf/timestamp.proto";
message DeviceSession {
// Device EUI.
bytes dev_eui = 1;
2022-04-06 20:18:32 +00:00
// Device address.
bytes dev_addr = 2;
2022-04-06 20:18:32 +00:00
// Join EUI.
bytes join_eui = 3;
2022-04-06 20:18:32 +00:00
// LoRaWAN mac-version.
common.MacVersion mac_version = 4;
2022-04-06 20:18:32 +00:00
// FNwkSIntKey.
bytes f_nwk_s_int_key = 5;
2022-04-06 20:18:32 +00:00
// SNwkSIntKey.
bytes s_nwk_s_int_key = 6;
2022-04-06 20:18:32 +00:00
// NwkSEncKey.
bytes nwk_s_enc_key = 7;
2022-04-06 20:18:32 +00:00
// AppSKey envelope.
common.KeyEnvelope app_s_key = 8;
2022-04-06 20:18:32 +00:00
// Uplink frame-counter.
uint32 f_cnt_up = 9;
2022-04-06 20:18:32 +00:00
// Downlink frame-counter (ns).
uint32 n_f_cnt_down = 10;
2022-04-06 20:18:32 +00:00
// Downlink frame-counter (as).
uint32 a_f_cnt_down = 11;
2022-04-06 20:18:32 +00:00
// Frame-counter holding the last confirmed downlink frame (n_f_cnt_down or
// a_f_cnt_down).
uint32 conf_f_cnt = 12;
2022-04-06 20:18:32 +00:00
// Skip uplink frame-counter validation.
bool skip_f_cnt_check = 13;
2022-04-06 20:18:32 +00:00
// RX1 delay.
uint32 rx1_delay = 14;
2022-04-06 20:18:32 +00:00
// RX1 data-rate offset.
uint32 rx1_dr_offset = 15;
2022-04-06 20:18:32 +00:00
// RX2 data-rate.
uint32 rx2_dr = 16;
2022-04-06 20:18:32 +00:00
// RX2 frequency.
uint32 rx2_frequency = 17;
2022-04-06 20:18:32 +00:00
// Enabled uplink channels.
repeated uint32 enabled_uplink_channel_indices = 18;
2022-04-06 20:18:32 +00:00
// Extra user-defined uplink channels.
map<uint32, DeviceSessionChannel> extra_uplink_channels = 19;
2022-04-06 20:18:32 +00:00
// Class-B ping-slot data-rate.
uint32 class_b_ping_slot_dr = 20;
2022-04-06 20:18:32 +00:00
// Class-B ping-slot frequency.
uint32 class_b_ping_slot_freq = 21;
2022-04-06 20:18:32 +00:00
// Class-B ping-slot nb.
uint32 class_b_ping_slot_nb = 22;
2022-04-06 20:18:32 +00:00
// Nb. transmissions.
uint32 nb_trans = 23;
2022-04-06 20:18:32 +00:00
// TXPowerIndex which the node is using. The possible values are defined
// by the lorawan/band package and are region specific. By default it is
// assumed that the node is using TXPower 0. This value is controlled by
// the ADR engine.
uint32 tx_power_index = 24;
2022-04-06 20:18:32 +00:00
// DR defines the (last known) data-rate at which the node is operating.
// This value is controlled by the ADR engine.
uint32 dr = 25;
2022-04-06 20:18:32 +00:00
// ADR defines if the device has ADR enabled.
bool adr = 26;
2022-04-06 20:18:32 +00:00
// MaxSupportedTXPowerIndex defines the maximum supported tx-power index
// by the node, or 0 when not set.
uint32 max_supported_tx_power_index = 27;
2022-04-06 20:18:32 +00:00
// MinSupportedTXPowerIndex defines the minimum supported tx-power index
// by the node (default 0).
uint32 min_supported_tx_power_index = 28;
2022-04-06 20:18:32 +00:00
// Pending rejoin device-session contains a device-session which has not
// yet been activated by the device (by sending a first uplink).
DeviceSession pending_rejoin_device_session = 29;
2022-04-06 20:18:32 +00:00
// Uplink history for ADR (last 20 uplink transmissions).
repeated UplinkAdrHistory uplink_adr_history = 30;
2022-04-06 20:18:32 +00:00
// Mac-command error count.
map<uint32, uint32> mac_command_error_count = 31;
2022-04-06 20:18:32 +00:00
// Last device-status request.
google.protobuf.Timestamp last_device_status_request = 32;
2022-04-06 20:18:32 +00:00
// RejoinRequestEnabled defines if the rejoin-request is enabled on the
// device.
bool rejoin_request_enabled = 33;
2022-04-06 20:18:32 +00:00
// RejoinRequestMaxCountN defines the 2^(C+4) uplink message interval for
// the rejoin-request.
uint32 rejoin_request_max_count_n = 34;
2022-04-06 20:18:32 +00:00
// RejoinRequestMaxTimeN defines the 2^(T+10) time interval (seconds)
// for the rejoin-request.
uint32 rejoin_request_max_time_n = 35;
2022-04-06 20:18:32 +00:00
// Rejoin counter (RJCount0).
// This counter is reset to 0 after each successful join-accept.
uint32 rejoin_count_0 = 36;
2022-04-06 20:18:32 +00:00
// Uplink dwell time.
bool uplink_dwell_time_400ms = 37;
2022-04-06 20:18:32 +00:00
// Downlink dwell time.
bool downlink_dwell_time_400ms = 38;
2022-04-06 20:18:32 +00:00
// Uplink max. EIRP index.
uint32 uplink_max_eirp_index = 39;
2022-04-06 20:18:32 +00:00
// Region configuration ID.
string region_config_id = 40;
// Relay state.
Relay relay = 41;
2022-04-06 20:18:32 +00:00
}
message UplinkAdrHistory {
// Uplink frame-counter.
uint32 f_cnt = 1;
// Max SNR (of deduplicated frames received by one or multiple gateways).
float max_snr = 2;
// Max RSSI.
int32 max_rssi = 5;
// TX Power (as known by the network-server).
uint32 tx_power_index = 3;
// Number of receiving gateways.
uint32 gateway_count = 4;
}
message Relay {
// Devices provisioned on the relay.
repeated RelayDevice devices = 1;
// Filter list.
repeated RelayFilter filters = 2;
// Relay is enabled.
bool enabled = 3;
// CAD periodicity.
uint32 cad_periodicity = 4;
// Default channel index.
uint32 default_channel_index = 5;
// Second channel freq.
uint32 second_channel_freq = 6;
// Second channel DR.
uint32 second_channel_dr = 7;
// Second channel ACK offset.
uint32 second_channel_ack_offset = 8;
// End-device activation mode.
uint32 ed_activation_mode = 9;
// End-device smart-enable level.
uint32 ed_smart_enable_level = 10;
// End-device back-off.
uint32 ed_back_off = 11;
// Join-request limit reload rate.
uint32 join_req_limit_reload_rate = 12;
// Notify limit reload rate.
uint32 notify_limit_reload_rate = 13;
// Global uplink limit reload rate.
uint32 global_uplink_limit_reload_rate = 14;
// Overall limit reload rate.
uint32 overall_limit_reload_rate = 15;
2022-04-06 20:18:32 +00:00
// Join-request limit bucket size.
uint32 join_req_limit_bucket_size = 16;
2022-04-06 20:18:32 +00:00
// Notify limit bucket size.
uint32 notify_limit_bucket_size = 17;
2022-04-06 20:18:32 +00:00
// Global uplink limit bucket size.
uint32 global_uplink_limit_bucket_size = 18;
2022-04-06 20:18:32 +00:00
// Overall limit bucket size.
uint32 overall_limit_bucket_size = 19;
// End-device must communicate through relay only.
// This is stored in the device-session as we need to validate on retrieving
// the device-session.
bool ed_relay_only = 20;
// End-device WFCnt.
// This holds the last known WFCnt value. ChirpStack will periodically read
// this value from the Relay.
uint32 w_f_cnt = 21;
}
message RelayDevice {
// Index (used for filter and uplink filters).
// This must be between 0 - 15.
uint32 index = 1;
// JoinEUI (EUI64).
bytes join_eui = 2;
// DevEUI (EUI64).
bytes dev_eui = 3;
// DevAddr.
bytes dev_addr = 4;
// RootWorSKey.
bytes root_wor_s_key = 5;
// Provisioned.
bool provisioned = 6;
// Uplink limit bucket size.
uint32 uplink_limit_bucket_size = 7;
// Uplink limit reload rate.
uint32 uplink_limit_reload_rate = 8;
// Timestamp of the last WFCnt request.
// Note that ChirpStack periodically requests the WFCnt from the relay.
google.protobuf.Timestamp w_f_cnt_last_request = 9;
}
message RelayFilter {
// Index.
// This must be between 0 - 15.
uint32 index = 1;
// Action.
// * 0: No Rule
// * 1: Forward
// * 2: Filter
uint32 action = 2;
// DevEUI (EUI64).
bytes dev_eui = 3;
// JoinEUI (EUI64).
bytes join_eui = 4;
// Provisioned.
bool provisioned = 5;
2022-04-06 20:18:32 +00:00
}
message DeviceSessionChannel {
// Frequency Hz.
uint32 frequency = 1;
2022-04-06 20:18:32 +00:00
// Min. data-rate.
uint32 min_dr = 2;
2022-04-06 20:18:32 +00:00
// Max. data-rate.
uint32 max_dr = 3;
2022-04-06 20:18:32 +00:00
}
message DeviceGatewayRxInfo {
// DevEUI (EUI64).
bytes dev_eui = 1;
2022-04-06 20:18:32 +00:00
// Data-rate.
uint32 dr = 2;
2022-04-06 20:18:32 +00:00
// Gateway RxInfo elements.
repeated DeviceGatewayRxInfoItem items = 3;
2022-04-06 20:18:32 +00:00
}
message DeviceGatewayRxInfoItem {
// Gateway ID (EUI64).
bytes gateway_id = 1;
2022-04-06 20:18:32 +00:00
// RSSI.
int32 rssi = 2;
2022-04-06 20:18:32 +00:00
// LoRa SNR.
float lora_snr = 3;
2022-04-06 20:18:32 +00:00
// Antenna.
uint32 antenna = 4;
2022-04-06 20:18:32 +00:00
// Board.
uint32 board = 5;
2022-04-06 20:18:32 +00:00
// Context blob.
bytes context = 6;
// Gateway is private (uplink).
bool is_private_up = 7;
// Gateway is private (downlink).
bool is_private_down = 8;
// Tenant ID (UUID).
bytes tenant_id = 9;
2022-04-06 20:18:32 +00:00
}
message DownlinkFrame {
// Downlink ID.
uint32 downlink_id = 1;
// DevEUI.
bytes dev_eui = 2;
2022-04-06 20:18:32 +00:00
// Device queue item ID.
bytes device_queue_item_id = 3;
2022-04-06 20:18:32 +00:00
// Multicast Group ID.
bytes multicast_group_id = 4;
2022-04-06 20:18:32 +00:00
// Multicast queue item ID.
bytes multicast_group_queue_item_id = 5;
2022-04-06 20:18:32 +00:00
// Downlink frames.
gw.DownlinkFrame downlink_frame = 6;
2022-04-06 20:18:32 +00:00
// Encrypted FOpts (LoRaWAN 1.1).
bool encrypted_fopts = 8;
2022-04-06 20:18:32 +00:00
// Network session encryption key (for FOpts and FRMPayload mac-commands).
bytes nwk_s_enc_key = 9;
2022-04-06 20:18:32 +00:00
// NFCntDown (for decrypting mac-commands).
uint32 n_f_cnt_down = 10;
// AFCntDown (for decrypting FRMPayload in case of Relay).
uint32 a_f_cnt_down = 11;
// DevEUI of relayed device.
bytes dev_eui_relayed = 12;
2022-04-06 20:18:32 +00:00
}
message LoraCloudGeolocBuffer {
// Uplinks in buffer.
repeated LoraCloudGeolocBufferUplink uplinks = 1;
2022-04-06 20:18:32 +00:00
}
message LoraCloudGeolocBufferUplink {
// RxInfo set for a single uplink.
repeated gw.UplinkRxInfo rx_info = 1;
2022-04-06 20:18:32 +00:00
}
2022-06-30 10:11:21 +00:00
message PassiveRoamingDeviceSession {
// Session ID (UUID).
// Unfortunately we can not use the DevEUI as unique identifier
// as the PRStartAns DevEUI field is optional.
bytes session_id = 1;
// NetID of the hNS.
bytes net_id = 2;
2022-06-30 10:11:21 +00:00
// DevAddr of the device.
bytes dev_addr = 3;
2022-06-30 10:11:21 +00:00
// DevEUI of the device (optional).
bytes dev_eui = 4;
2022-06-30 10:11:21 +00:00
// LoRaWAN 1.1.
bool lorawan_1_1 = 5;
2022-06-30 10:11:21 +00:00
// LoRaWAN 1.0 NwkSKey / LoRaWAN 1.1 FNwkSIntKey.
bytes f_nwk_s_int_key = 6;
2022-06-30 10:11:21 +00:00
// Lifetime.
google.protobuf.Timestamp lifetime = 7;
2022-06-30 10:11:21 +00:00
// Uplink frame-counter.
uint32 f_cnt_up = 8;
2022-06-30 10:11:21 +00:00
// Validate MIC.
bool validate_mic = 9;
2022-06-30 10:11:21 +00:00
}