chirpstack/api/python/proto/chirpstack-api/integration/integration.proto

336 lines
6.8 KiB
Protocol Buffer
Raw Normal View History

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:57:06 +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";
option csharp_namespace = "Chirpstack.Integration";
2022-04-06 20:18:32 +00:00
import "chirpstack-api/common/common.proto";
import "chirpstack-api/gw/gw.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/struct.proto";
enum LogLevel {
// Info.
INFO = 0;
2022-04-06 20:18:32 +00:00
// Warning.
WARNING = 1;
2022-04-06 20:18:32 +00:00
// Error.
ERROR = 2;
2022-04-06 20:18:32 +00:00
}
enum LogCode {
// Unknown type.
UNKNOWN = 0;
2022-04-06 20:18:32 +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
// Uplink codec error.
UPLINK_CODEC = 2;
2022-04-06 20:18:32 +00:00
// Downlink codec error.
DOWNLINK_CODEC = 3;
2022-04-06 20:18:32 +00:00
// OTAA error.
OTAA = 4;
2022-04-06 20:18:32 +00:00
// Uplink frame-counter was reset.
UPLINK_F_CNT_RESET = 5;
2022-04-06 20:18:32 +00:00
// Uplink MIC error.
UPLINK_MIC = 6;
2022-04-06 20:18:32 +00:00
// Uplink frame-counter retransmission.
UPLINK_F_CNT_RETRANSMISSION = 7;
2022-04-06 20:18:32 +00:00
// Downlink gateway error.
DOWNLINK_GATEWAY = 8;
// Relay new end-device.
RELAY_NEW_END_DEVICE = 9;
2022-04-06 20:18:32 +00:00
}
// Device information.
message DeviceInfo {
// 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
// Device-profile name.
string device_profile_name = 6;
2022-04-06 20:18:32 +00:00
// Device name.
string device_name = 7;
2022-04-06 20:18:32 +00:00
// Device EUI.
string dev_eui = 8;
2022-04-06 20:18:32 +00:00
2023-06-14 12:11:46 +00:00
// Device class.
common.DeviceClass device_class_enabled = 10;
// 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
// Data-rate.
uint32 dr = 3;
2022-04-06 20:18:32 +00:00
// SNR.
int32 snr = 4;
2022-04-06 20:18:32 +00:00
// RSSI.
int32 rssi = 5;
2022-04-06 20:18:32 +00:00
// WOR channel.
uint32 wor_channel = 6;
2022-04-06 20:18:32 +00:00
}
// UplinkEvent is the message sent when an uplink payload has been received.
message UplinkEvent {
// Deduplication ID (UUID).
string deduplication_id = 1;
2022-04-06 20:18:32 +00:00
// Timestamp.
google.protobuf.Timestamp time = 2;
2022-04-06 20:18:32 +00:00
// Device information.
DeviceInfo device_info = 3;
2022-04-06 20:18:32 +00:00
// Device address.
string dev_addr = 4;
2022-04-06 20:18:32 +00:00
// Device has ADR bit set.
bool adr = 5;
2022-04-06 20:18:32 +00:00
// Data-rate.
uint32 dr = 6;
2022-04-06 20:18:32 +00:00
// Frame counter.
uint32 f_cnt = 7;
2022-04-06 20:18:32 +00:00
// Frame port.
uint32 f_port = 8;
2022-04-06 20:18:32 +00:00
// Uplink was of type confirmed.
bool confirmed = 9;
2022-04-06 20:18:32 +00:00
// FRMPayload data.
bytes data = 10;
2022-04-06 20:18:32 +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
// Receiving gateway RX info.
repeated gw.UplinkRxInfo rx_info = 12;
2022-04-06 20:18:32 +00:00
// TX info.
gw.UplinkTxInfo tx_info = 13;
// Relay info.
UplinkRelayRxInfo relay_rx_info = 14;
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 {
// Deduplication ID (UUID).
string deduplication_id = 1;
// Timestamp.
google.protobuf.Timestamp time = 2;
2022-04-06 20:18:32 +00:00
// Device info.
DeviceInfo device_info = 3;
2022-04-06 20:18:32 +00:00
// Device address.
string dev_addr = 4;
2022-04-06 20:18:32 +00:00
// Relay info.
UplinkRelayRxInfo relay_rx_info = 5;
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 {
// Deduplication ID (UUID).
string deduplication_id = 1;
2022-04-06 20:18:32 +00:00
// Timestamp.
google.protobuf.Timestamp time = 2;
2022-04-06 20:18:32 +00:00
// Device info.
DeviceInfo device_info = 3;
2022-04-06 20:18:32 +00:00
// Downlink queue item ID (UUID).
string queue_item_id = 4;
2022-04-06 20:18:32 +00:00
// Frame was acknowledged.
bool acknowledged = 5;
2022-04-06 20:18:32 +00:00
// Downlink frame counter to which the acknowledgement relates.
uint32 f_cnt_down = 6;
2022-04-06 20:18:32 +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 {
// Downlink ID.
uint32 downlink_id = 1;
2022-04-06 20:18:32 +00:00
// Timestamp.
google.protobuf.Timestamp time = 2;
2022-04-06 20:18:32 +00:00
// Device info.
DeviceInfo device_info = 3;
2022-04-06 20:18:32 +00:00
// Downlink queue item ID (UUID).
string queue_item_id = 4;
2022-04-06 20:18:32 +00:00
// Downlink frame-counter.
uint32 f_cnt_down = 5;
2022-04-06 20:18:32 +00:00
// Gateway ID.
string gateway_id = 6;
2022-04-06 20:18:32 +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 {
// Timestamp.
google.protobuf.Timestamp time = 1;
2022-04-06 20:18:32 +00:00
// Device info.
DeviceInfo device_info = 2;
2022-04-06 20:18:32 +00:00
// Log level.
LogLevel level = 3;
2022-04-06 20:18:32 +00:00
// Log code.
LogCode code = 4;
2022-04-06 20:18:32 +00:00
// Description message.
string description = 5;
2022-04-06 20:18:32 +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 {
// Deduplication ID (UUID).
string deduplication_id = 1;
2022-04-06 20:18:32 +00:00
// Timestamp.
google.protobuf.Timestamp time = 2;
2022-04-06 20:18:32 +00:00
// Device info.
DeviceInfo device_info = 3;
2022-04-06 20:18:32 +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
// Device is connected to an external power source.
bool external_power_source = 6;
2022-04-06 20:18:32 +00:00
// Battery level is not available.
bool battery_level_unavailable = 7;
2022-04-06 20:18:32 +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 {
// Deduplication ID (UUID).
string deduplication_id = 1;
2022-04-06 20:18:32 +00:00
// Timestamp.
google.protobuf.Timestamp time = 2;
2022-04-06 20:18:32 +00:00
// Device info.
DeviceInfo device_info = 3;
2022-04-06 20:18:32 +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 {
// Deduplication ID (UUID).
string deduplication_id = 1;
2022-04-06 20:18:32 +00:00
// Timestamp.
google.protobuf.Timestamp time = 2;
2022-04-06 20:18:32 +00:00
// Device info.
DeviceInfo device_info = 3;
2022-04-06 20:18:32 +00:00
// Integration name.
string integration_name = 4;
2022-04-06 20:18:32 +00:00
// Event type.
string event_type = 5;
2022-04-06 20:18:32 +00:00
// Struct containing the event object.
google.protobuf.Struct object = 6;
2022-04-06 20:18:32 +00:00
}
2022-07-18 13:14:28 +00:00
// DownlinkCommand is the command to enqueue a downlink payload for the given
// device.
message DownlinkCommand {
// ID (UUID).
// If left blank, a random UUID will be generated.
string id = 1;
2022-07-18 13:14:28 +00:00
// Device EUI (EUI64).
string dev_eui = 2;
2022-07-18 13:14:28 +00:00
// Confirmed.
bool confirmed = 3;
2022-07-18 13:14:28 +00:00
// FPort (must be > 0).
uint32 f_port = 4;
2022-07-18 13:14:28 +00:00
// Data.
// Or use the json_object field when a codec has been configured.
bytes data = 5;
2022-07-18 13:14:28 +00:00
// Only use this when a codec has been configured that can encode this
// object to bytes.
google.protobuf.Struct object = 6;
2022-07-18 13:14:28 +00:00
}