chirpstack_api 4.17.0

ChirpStack Protobuf / gRPC API definitions.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
syntax = "proto3";

package internal;

import "common/common.proto";
import "gw/gw.proto";
import "google/protobuf/timestamp.proto";

message DeviceSession {
  // Device address.
  bytes dev_addr = 2;

  // LoRaWAN mac-version.
  common.MacVersion mac_version = 4;

  // FNwkSIntKey.
  bytes f_nwk_s_int_key = 5;

  // SNwkSIntKey.
  bytes s_nwk_s_int_key = 6;

  // NwkSEncKey.
  bytes nwk_s_enc_key = 7;

  // AppSKey envelope.
  common.KeyEnvelope app_s_key = 8;

  // JS Session Key ID.
  bytes js_session_key_id = 42;

  // Uplink frame-counter.
  // Deprecated: This has been moved to the device record to make the
  // de-duplication more efficient.
  uint32 deprecated_f_cnt_up = 9;

  // Downlink frame-counter (ns).
  uint32 n_f_cnt_down = 10;

  // Downlink frame-counter (as).
  uint32 a_f_cnt_down = 11;

  // Frame-counter holding the last confirmed downlink frame (n_f_cnt_down or
  // a_f_cnt_down).
  uint32 conf_f_cnt = 12;

  // Skip uplink frame-counter validation.
  bool skip_f_cnt_check = 13;

  // RX1 delay.
  uint32 rx1_delay = 14;

  // RX1 data-rate offset.
  uint32 rx1_dr_offset = 15;

  // RX2 data-rate.
  uint32 rx2_dr = 16;

  // RX2 frequency.
  uint32 rx2_frequency = 17;

  // Enabled uplink channels.
  repeated uint32 enabled_uplink_channel_indices = 18;

  // Extra user-defined uplink channels.
  map<uint32, DeviceSessionChannel> extra_uplink_channels = 19;

  // Class-B ping-slot data-rate.
  uint32 class_b_ping_slot_dr = 20;

  // Class-B ping-slot frequency.
  uint32 class_b_ping_slot_freq = 21;

  // Class-B ping-slot nb.
  uint32 class_b_ping_slot_nb = 22;

  // Nb. transmissions.
  uint32 nb_trans = 23;

  // 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;

  // DR defines the (last known) data-rate at which the node is operating.
  // This value is controlled by the ADR engine.
  uint32 dr = 25;

  // ADR defines if the device has ADR enabled.
  bool adr = 26;

  // MaxSupportedTXPowerIndex defines the maximum supported tx-power index
  // by the node, or 0 when not set.
  uint32 max_supported_tx_power_index = 27;

  // MinSupportedTXPowerIndex defines the minimum supported tx-power index
  // by the node (default 0).
  uint32 min_supported_tx_power_index = 28;

  // 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;

  // Uplink history for ADR (last 20 uplink transmissions).
  // This table is reset in case one of parameters has changed:
  //   * DR
  //   * TxPower
  //   * NbTrans
  repeated UplinkAdrHistory uplink_adr_history = 30;

  // Mac-command error count.
  map<uint32, uint32> mac_command_error_count = 31;

  // Last device-status request.
  google.protobuf.Timestamp last_device_status_request = 32;

  // RejoinRequestEnabled defines if the rejoin-request is enabled on the
  // device.
  bool rejoin_request_enabled = 33;

  // RejoinRequestMaxCountN defines the 2^(C+4) uplink message interval for
  // the rejoin-request.
  uint32 rejoin_request_max_count_n = 34;

  // RejoinRequestMaxTimeN defines the 2^(T+10) time interval (seconds)
  // for the rejoin-request.
  uint32 rejoin_request_max_time_n = 35;

  // Rejoin counter (RJCount0).
  // This counter is reset to 0 after each successful join-accept.
  uint32 rejoin_count_0 = 36;

  // Uplink dwell time.
  bool uplink_dwell_time_400ms = 37;

  // Downlink dwell time.
  bool downlink_dwell_time_400ms = 38;

  // Uplink max. EIRP index.
  uint32 uplink_max_eirp_index = 39;

  // Region configuration ID.
  string region_config_id = 40;

  // Relay state.
  Relay relay = 41;

  // Pending mac-commands.
  map<uint32, bytes> mac_command_pending = 43;
}

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;

  // Join-request limit bucket size.
  uint32 join_req_limit_bucket_size = 16;

  // Notify limit bucket size.
  uint32 notify_limit_bucket_size = 17;

  // Global uplink limit bucket size.
  uint32 global_uplink_limit_bucket_size = 18;

  // 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;
}

message DeviceSessionChannel {
  // Frequency Hz.
  uint32 frequency = 1;

  // Min. data-rate.
  // Deprecated: use data_rates.
  uint32 min_dr = 2;

  // Max. data-rate.
  // Deprecated: use data_rates.
  uint32 max_dr = 3;

  // Data-rates.
  repeated uint32 data_rates = 4;
}

message DeviceGatewayRxInfo {
  // DevEUI (EUI64).
  bytes dev_eui = 1;

  // Data-rate.
  uint32 dr = 2;

  // Gateway RxInfo elements.
  repeated DeviceGatewayRxInfoItem items = 3;
}

message DeviceGatewayRxInfoItem {
  // Gateway ID (EUI64).
  bytes gateway_id = 1;

  // RSSI.
  int32 rssi = 2;

  // LoRa SNR.
  float lora_snr = 3;

  // Antenna.
  uint32 antenna = 4;

  // Board.
  uint32 board = 5;

  // 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;
}

message DownlinkFrame {
  // Downlink ID.
  uint32 downlink_id = 1;

  // DevEUI.
  bytes dev_eui = 2;

  // Device queue item ID.
  bytes device_queue_item_id = 3;

  // Multicast Group ID.
  bytes multicast_group_id = 4;

  // Multicast queue item ID.
  bytes multicast_group_queue_item_id = 5;

  // Downlink frames.
  gw.DownlinkFrame downlink_frame = 6;

  // Encrypted FOpts (LoRaWAN 1.1).
  bool encrypted_fopts = 8;

  // Network session encryption key (for FOpts and FRMPayload mac-commands).
  bytes nwk_s_enc_key = 9;

  // 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;
}

message LoraCloudGeolocBuffer {
  // Uplinks in buffer.
  repeated LoraCloudGeolocBufferUplink uplinks = 1;
}

message LoraCloudGeolocBufferUplink {
  // RxInfo set for a single uplink.
  repeated gw.UplinkRxInfo rx_info = 1;
}

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;

  // DevAddr of the device.
  bytes dev_addr = 3;

  // DevEUI of the device (optional).
  bytes dev_eui = 4;

  // LoRaWAN 1.1.
  bool lorawan_1_1 = 5;

  // LoRaWAN 1.0 NwkSKey / LoRaWAN 1.1 FNwkSIntKey.
  bytes f_nwk_s_int_key = 6;

  // Lifetime.
  google.protobuf.Timestamp lifetime = 7;

  // Uplink frame-counter.
  uint32 f_cnt_up = 8;

  // Validate MIC.
  bool validate_mic = 9;
}