syntax = "proto3";
package api;
option go_package = "github.com/brocaar/chirpstack-api/go/v3/as/external/api";
option java_package = "io.chirpstack.api.as.external.api";
option java_multiple_files = true;
option java_outer_classname = "ProfilesProto";
import "google/protobuf/duration.proto";
enum RatePolicy {
// Drop
DROP = 0;
// Mark
MARK = 1;
}
message ServiceProfile {
// Service-profile ID (UUID string).
// This will be automatically set on create.
string id = 1;
// Service-profile name.
string name = 21;
// Organization ID to which the service-profile is assigned.
int64 organization_id = 22 [json_name = "organizationID"];
// Network-server ID on which the service-profile is provisioned.
int64 network_server_id = 23 [json_name = "networkServerID"];
// Token bucket filling rate, including ACKs (packet/h).
uint32 ul_rate = 2;
// Token bucket burst size.
uint32 ul_bucket_size = 3;
// Drop or mark when exceeding ULRate.
RatePolicy ul_rate_policy = 4;
// Token bucket filling rate, including ACKs (packet/h).
uint32 dl_rate = 5;
// Token bucket burst size.
uint32 dl_bucket_size = 6;
// Drop or mark when exceeding DLRate.
RatePolicy dl_rate_policy = 7;
// GW metadata (RSSI, SNR, GW geoloc., etc.) are added to the packet sent to AS.
bool add_gw_metadata = 8 [json_name = "addGWMetaData"];
// Frequency to initiate an End-Device status request (request/day).
uint32 dev_status_req_freq = 9;
// Report End-Device battery level to AS.
bool report_dev_status_battery = 10;
// Report End-Device margin to AS.
bool report_dev_status_margin = 11;
// Minimum allowed data rate. Used for ADR.
uint32 dr_min = 12;
// Maximum allowed data rate. Used for ADR.
uint32 dr_max = 13;
// Channel mask. sNS does not have to obey (i.e., informative).
bytes channel_mask = 14;
// Passive Roaming allowed.
bool pr_allowed = 15;
// Handover Roaming allowed.
bool hr_allowed = 16;
// Roaming Activation allowed.
bool ra_allowed = 17;
// Enable network geolocation service.
bool nwk_geo_loc = 18;
// Target Packet Error Rate.
uint32 target_per = 19 [json_name = "targetPER"];
// Minimum number of receiving GWs (informative).
uint32 min_gw_diversity = 20 [json_name = "minGWDiversity"];
// Gateways under this service-profile are private.
// This means that these gateways can only be used by devices under the
// same service-profile.
bool gws_private = 24 [json_name = "gwsPrivate"];
}
message DeviceProfile {
// Device-profile ID (UUID string).
string id = 1;
// Device-profile name.
string name = 21;
// Organization ID to which the service-profile is assigned.
int64 organization_id = 22 [json_name = "organizationID"];
// Network-server ID on which the service-profile is provisioned.
int64 network_server_id = 23 [json_name = "networkServerID"];
// End-Device supports Class B.
bool supports_class_b = 2;
// Maximum delay for the End-Device to answer a MAC request or a confirmed DL frame (mandatory if class B mode supported).
uint32 class_b_timeout = 3;
// Mandatory if class B mode supported.
uint32 ping_slot_period = 4;
// Mandatory if class B mode supported.
uint32 ping_slot_dr = 5 [json_name = "pingSlotDR"];
// Mandatory if class B mode supported.
uint32 ping_slot_freq = 6;
// End-Device supports Class C.
bool supports_class_c = 7;
// Maximum delay for the End-Device to answer a MAC request or a confirmed DL frame (mandatory if class C mode supported).
uint32 class_c_timeout = 8;
// Version of the LoRaWAN supported by the End-Device.
string mac_version = 9;
// Revision of the Regional Parameters document supported by the End-Device.
string reg_params_revision = 10;
// Class A RX1 delay (mandatory for ABP).
uint32 rx_delay_1 = 11;
// RX1 data rate offset (mandatory for ABP).
uint32 rx_dr_offset_1 = 12 [json_name = "rxDROffset1"];
// RX2 data rate (mandatory for ABP).
uint32 rx_datarate_2 = 13 [json_name = "rxDataRate2"];
// RX2 channel frequency (mandatory for ABP).
uint32 rx_freq_2 = 14;
// List of factory-preset frequencies (mandatory for ABP).
repeated uint32 factory_preset_freqs = 15;
// Maximum EIRP supported by the End-Device.
uint32 max_eirp = 16 [json_name = "maxEIRP"];
// Maximum duty cycle supported by the End-Device.
uint32 max_duty_cycle = 17;
// End-Device supports Join (OTAA) or not (ABP).
bool supports_join = 18;
// RF region name.
string rf_region = 19;
// End-Device uses 32bit FCnt (mandatory for LoRaWAN 1.0 End-Device).
bool supports_32bit_f_cnt = 20 [json_name = "supports32BitFCnt"];
// Payload codec.
// Leave blank to disable the codec feature.
string payload_codec = 24;
// Payload encoder script.
// Depending the codec, it is possible to provide a script which implements
// the encoder function.
string payload_encoder_script = 25;
// Payload decoder script.
// Depending the codec, it is possible to provide a script which implements
// the decoder function.
string payload_decoder_script = 26;
// Geolocation buffer TTL (in seconds).
// When > 0, uplink RX meta-data will be stored in a buffer so that
// the meta-data of multiple uplinks can be used for geolocation.
uint32 geoloc_buffer_ttl = 27 [json_name = "geolocBufferTTL"];
// Geolocation minimum buffer size.
// When > 0, geolocation will only be performed when the buffer has
// at least the given size.
uint32 geoloc_min_buffer_size = 28;
// User defined tags.
map<string, string> tags = 29;
// Uplink interval.
// This defines the expected uplink interval which the device uses for
// communication. When the uplink interval has expired and no uplink has
// been received, the device is considered inactive.
google.protobuf.Duration uplink_interval = 30;
// ADR algorithm ID.
// In case this is left blank, or is configured to a non-existing ADR
// algorithm (plugin), then it falls back to 'default'.
string adr_algorithm_id = 31 [json_name = "adrAlgorithmID"];
}