2022-04-06 20:18:32 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package integration;
|
|
|
|
|
|
|
|
option go_package = "github.com/brocaar/chirpstack/api/go/v4/integration";
|
2023-01-10 15:46:04 +00:00
|
|
|
option java_package = "io.chirpstack.api.integration";
|
2022-04-06 20:18:32 +00:00
|
|
|
option java_multiple_files = true;
|
|
|
|
option java_outer_classname = "IntegrationProto";
|
2023-01-31 18:29:21 +00:00
|
|
|
option csharp_namespace = "Chirpstack.Integration";
|
2022-04-06 20:18:32 +00:00
|
|
|
|
|
|
|
import "common/common.proto";
|
|
|
|
import "gw/gw.proto";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
import "google/protobuf/struct.proto";
|
|
|
|
|
|
|
|
enum LogLevel {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Info.
|
|
|
|
INFO = 0;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Warning.
|
|
|
|
WARNING = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Error.
|
|
|
|
ERROR = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum LogCode {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Unknown type.
|
|
|
|
UNKNOWN = 0;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Error related to the downlink payload size.
|
|
|
|
// Usually seen when the payload exceeded the maximum allowed payload size.
|
|
|
|
DOWNLINK_PAYLOAD_SIZE = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Uplink codec error.
|
|
|
|
UPLINK_CODEC = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Downlink codec error.
|
|
|
|
DOWNLINK_CODEC = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// OTAA error.
|
|
|
|
OTAA = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Uplink frame-counter was reset.
|
|
|
|
UPLINK_F_CNT_RESET = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Uplink MIC error.
|
|
|
|
UPLINK_MIC = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Uplink frame-counter retransmission.
|
|
|
|
UPLINK_F_CNT_RETRANSMISSION = 7;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Downlink gateway error.
|
|
|
|
DOWNLINK_GATEWAY = 8;
|
|
|
|
|
|
|
|
// Relay new end-device.
|
|
|
|
RELAY_NEW_END_DEVICE = 9;
|
2023-10-05 12:05:53 +00:00
|
|
|
|
|
|
|
// Downlink frame-counter.
|
|
|
|
F_CNT_DOWN = 10;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Device information.
|
|
|
|
message DeviceInfo {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Tenant ID (UUID).
|
|
|
|
string tenant_id = 1;
|
|
|
|
|
|
|
|
// Tenant name.
|
|
|
|
string tenant_name = 2;
|
|
|
|
|
|
|
|
// Application ID (UUID).
|
|
|
|
string application_id = 3;
|
|
|
|
|
|
|
|
// Application name.
|
|
|
|
string application_name = 4;
|
|
|
|
|
|
|
|
// Device-profile ID (UUID).
|
|
|
|
string device_profile_id = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device-profile name.
|
|
|
|
string device_profile_name = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device name.
|
|
|
|
string device_name = 7;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device EUI.
|
|
|
|
string dev_eui = 8;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-06-14 11:51:08 +00:00
|
|
|
// Device class.
|
2023-06-14 12:07:09 +00:00
|
|
|
common.DeviceClass device_class_enabled = 10;
|
2023-06-14 11:51:08 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device-profile and device tags.
|
|
|
|
map<string, string> tags = 9;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Uplink relay RX information.
|
|
|
|
message UplinkRelayRxInfo {
|
|
|
|
// Relay DevEUI.
|
|
|
|
string dev_eui = 1;
|
|
|
|
|
|
|
|
// Frequency.
|
|
|
|
uint32 frequency = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Data-rate.
|
|
|
|
uint32 dr = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// SNR.
|
|
|
|
int32 snr = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// RSSI.
|
|
|
|
int32 rssi = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// WOR channel.
|
|
|
|
uint32 wor_channel = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
2023-10-05 12:05:53 +00:00
|
|
|
// Join-Server context.
|
|
|
|
message JoinServerContext {
|
|
|
|
// Session-key ID.
|
|
|
|
string session_key_id = 1;
|
|
|
|
|
|
|
|
// AppSKey envelope.
|
|
|
|
common.KeyEnvelope app_s_key = 2;
|
|
|
|
}
|
|
|
|
|
2022-04-06 20:18:32 +00:00
|
|
|
// UplinkEvent is the message sent when an uplink payload has been received.
|
|
|
|
message UplinkEvent {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Deduplication ID (UUID).
|
|
|
|
string deduplication_id = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Timestamp.
|
|
|
|
google.protobuf.Timestamp time = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device information.
|
|
|
|
DeviceInfo device_info = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device address.
|
|
|
|
string dev_addr = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device has ADR bit set.
|
|
|
|
bool adr = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Data-rate.
|
|
|
|
uint32 dr = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Frame counter.
|
|
|
|
uint32 f_cnt = 7;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Frame port.
|
|
|
|
uint32 f_port = 8;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Uplink was of type confirmed.
|
|
|
|
bool confirmed = 9;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// FRMPayload data.
|
|
|
|
bytes data = 10;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Note that this is only set when a codec is configured in the Device
|
|
|
|
// Profile.
|
|
|
|
google.protobuf.Struct object = 11;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Receiving gateway RX info.
|
|
|
|
repeated gw.UplinkRxInfo rx_info = 12;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// TX info.
|
|
|
|
gw.UplinkTxInfo tx_info = 13;
|
|
|
|
|
|
|
|
// Relay info.
|
|
|
|
UplinkRelayRxInfo relay_rx_info = 14;
|
2023-10-05 12:05:53 +00:00
|
|
|
|
|
|
|
// Join-Server context.
|
|
|
|
// A non-empty value indicatest that ChirpStack does not have access to
|
|
|
|
// the AppSKey and that the encryption / decryption of the payloads is
|
|
|
|
// the responsibility of the end-application.
|
|
|
|
JoinServerContext join_server_context = 15;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// JoinEvent is the message sent when a device joined the network.
|
|
|
|
// Note: this event is sent at the first uplink after OTAA.
|
|
|
|
message JoinEvent {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Deduplication ID (UUID).
|
|
|
|
string deduplication_id = 1;
|
|
|
|
|
|
|
|
// Timestamp.
|
|
|
|
google.protobuf.Timestamp time = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device info.
|
|
|
|
DeviceInfo device_info = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device address.
|
|
|
|
string dev_addr = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Relay info.
|
|
|
|
UplinkRelayRxInfo relay_rx_info = 5;
|
2023-10-05 12:05:53 +00:00
|
|
|
|
|
|
|
// Join-Server context.
|
|
|
|
// A non-empty value indicatest that ChirpStack does not have access to
|
|
|
|
// the AppSKey and that the encryption / decryption of the payloads is
|
|
|
|
// the responsibility of the end-application.
|
|
|
|
JoinServerContext join_server_context = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// AckEvent is the message sent when a confirmation on a confirmed downlink
|
|
|
|
// has been received -or- when the downlink timed out.
|
|
|
|
message AckEvent {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Deduplication ID (UUID).
|
|
|
|
string deduplication_id = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Timestamp.
|
|
|
|
google.protobuf.Timestamp time = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device info.
|
|
|
|
DeviceInfo device_info = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Downlink queue item ID (UUID).
|
|
|
|
string queue_item_id = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Frame was acknowledged.
|
|
|
|
bool acknowledged = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Downlink frame counter to which the acknowledgement relates.
|
|
|
|
uint32 f_cnt_down = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// TxAckEvent is the message sent when a downlink was acknowledged by the
|
|
|
|
// gateway for transmission. As a downlink can be scheduled in the future, this
|
|
|
|
// event does not confirm that the message has already been transmitted.
|
2022-04-06 20:18:32 +00:00
|
|
|
message TxAckEvent {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Downlink ID.
|
|
|
|
uint32 downlink_id = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Timestamp.
|
|
|
|
google.protobuf.Timestamp time = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device info.
|
|
|
|
DeviceInfo device_info = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Downlink queue item ID (UUID).
|
|
|
|
string queue_item_id = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Downlink frame-counter.
|
|
|
|
uint32 f_cnt_down = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Gateway ID.
|
|
|
|
string gateway_id = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// TX info.
|
|
|
|
gw.DownlinkTxInfo tx_info = 7;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// LogEvent is the message sent when a device-related log was sent.
|
|
|
|
message LogEvent {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Timestamp.
|
|
|
|
google.protobuf.Timestamp time = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device info.
|
|
|
|
DeviceInfo device_info = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Log level.
|
|
|
|
LogLevel level = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Log code.
|
|
|
|
LogCode code = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Description message.
|
|
|
|
string description = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Context map.
|
|
|
|
map<string, string> context = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// StatusEvent is the message sent when a device-status mac-command was sent
|
|
|
|
// by the device.
|
|
|
|
message StatusEvent {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Deduplication ID (UUID).
|
|
|
|
string deduplication_id = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Timestamp.
|
|
|
|
google.protobuf.Timestamp time = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device info.
|
|
|
|
DeviceInfo device_info = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// The demodulation signal-to-noise ratio in dB for the last successfully
|
|
|
|
// received device-status request by the Network Server.
|
|
|
|
int32 margin = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device is connected to an external power source.
|
|
|
|
bool external_power_source = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Battery level is not available.
|
|
|
|
bool battery_level_unavailable = 7;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Battery level.
|
|
|
|
float battery_level = 8;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// LocationEvent is the message sent when a geolocation resolve was returned.
|
|
|
|
message LocationEvent {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Deduplication ID (UUID).
|
|
|
|
string deduplication_id = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Timestamp.
|
|
|
|
google.protobuf.Timestamp time = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device info.
|
|
|
|
DeviceInfo device_info = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Location.
|
|
|
|
common.Location location = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// IntegrationEvent is the message that can be sent by an integration.
|
|
|
|
// It allows for sending events which are provided by an external integration
|
|
|
|
// which are "not native" to ChirpStack.
|
|
|
|
message IntegrationEvent {
|
2023-05-22 10:04:13 +00:00
|
|
|
// Deduplication ID (UUID).
|
|
|
|
string deduplication_id = 1;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Timestamp.
|
|
|
|
google.protobuf.Timestamp time = 2;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device info.
|
|
|
|
DeviceInfo device_info = 3;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Integration name.
|
|
|
|
string integration_name = 4;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Event type.
|
|
|
|
string event_type = 5;
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Struct containing the event object.
|
|
|
|
google.protobuf.Struct object = 6;
|
2022-04-06 20:18:32 +00:00
|
|
|
}
|
2022-04-28 14:41:54 +00:00
|
|
|
|
|
|
|
// DownlinkCommand is the command to enqueue a downlink payload for the given
|
|
|
|
// device.
|
|
|
|
message DownlinkCommand {
|
2023-05-22 10:04:13 +00:00
|
|
|
// ID (UUID).
|
|
|
|
// If left blank, a random UUID will be generated.
|
|
|
|
string id = 1;
|
2022-04-28 14:41:54 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Device EUI (EUI64).
|
|
|
|
string dev_eui = 2;
|
2022-04-28 14:41:54 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Confirmed.
|
|
|
|
bool confirmed = 3;
|
2022-04-28 14:41:54 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// FPort (must be > 0).
|
|
|
|
uint32 f_port = 4;
|
2022-04-28 14:41:54 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Data.
|
|
|
|
// Or use the json_object field when a codec has been configured.
|
|
|
|
bytes data = 5;
|
2022-04-28 14:41:54 +00:00
|
|
|
|
2023-05-22 10:04:13 +00:00
|
|
|
// Only use this when a codec has been configured that can encode this
|
|
|
|
// object to bytes.
|
|
|
|
google.protobuf.Struct object = 6;
|
2022-04-28 14:41:54 +00:00
|
|
|
}
|