chirpstack_api 3.8.1

ChirpStack Protobuf / gRPC API definitions.
Documentation
syntax = "proto3";

package integration;

option go_package = "github.com/brocaar/chirpstack-api/go/v3/as/integration";
option java_package = "io.chirpstack.api.as.integration";

import "common/common.proto";
import "gw/gw.proto";

enum ErrorType {
    // Unknown type.
    UNKNOWN = 0;

    // Error related to the downlink payload size.
    // Usually seen when the payload exceeded the maximum allowed payload size.
    DOWNLINK_PAYLOAD_SIZE = 1;

    // Error related to the downlink frame-counter.
    // Usually seen when the frame-counter has already been used.
    DOWNLINK_FCNT = 2;

    // Uplink codec error.
    UPLINK_CODEC = 3;

    // Downlink codec error.
    DOWNLINK_CODEC = 4;

    // OTAA error.
    OTAA = 5;

    // Uplink frame-counter was reset.
    UPLINK_FCNT_RESET = 6;

    // Uplink MIC error.
    UPLINK_MIC = 7;

    // Uplink frame-counter retransmission.
    UPLINK_FCNT_RETRANSMISSION = 8;

    // Downlink gateway error.
    DOWNLINK_GATEWAY = 9;
}

// UplinkEvent is the message sent when an uplink payload has been received.
message UplinkEvent {
    // Application ID.
    uint64 application_id = 1 [json_name = "applicationID"];

    // Application name.
    string application_name = 2;

    // Device name.
    string device_name = 3;

    // Device EUI.
    bytes dev_eui = 4 [json_name = "devEUI"];

    // Receiving gateway RX info.
    repeated gw.UplinkRXInfo rx_info = 5;

    // TX info.
    gw.UplinkTXInfo tx_info = 6;

    // Device has ADR bit set.
    bool adr = 7;

    // Data-rate.
    uint32 dr = 8;

    // Frame counter.
    uint32 f_cnt = 9;

    // Frame port.
    uint32 f_port = 10;

    // FRMPayload data.
    bytes data = 11;

    // JSON string containing the decoded object.
    // Note that this is only set when a codec is configured in the Device Profile.
    string object_json = 12 [json_name = "objectJSON"];

    // User-defined device tags.
    map<string, string> tags = 13;

    // Uplink was of type confirmed.
    bool confirmed_uplink = 14;

    // Device address.
    bytes dev_addr = 15;
}

// JoinEvent is the message sent when a device joined the network.
// Note that this is only sent after the first received uplink after the
// device (re)activation.
message JoinEvent {
    // Application ID.
    uint64 application_id = 1 [json_name = "applicationID"];

    // Application name.
    string application_name = 2;

    // Device name.
    string device_name = 3;

    // Device EUI.
    bytes dev_eui = 4 [json_name = "devEUI"];

    // Device address.
    bytes dev_addr = 5;

    // Receiving gateway RX info.
    repeated gw.UplinkRXInfo rx_info = 6;

    // TX info.
    gw.UplinkTXInfo tx_info = 7;

    // Data-rate.
    uint32 dr = 8;

    // User-defined device tags.
    map<string, string> tags = 9;
}

// AckEvent is the message sent when a confirmation on a confirmed downlink
// has been received -or- when the downlink timed out.
message AckEvent {
    // Application ID.
    uint64 application_id = 1 [json_name = "applicationID"];

    // Application name.
    string application_name = 2;

    // Device name.
    string device_name = 3;

    // Device EUI.
    bytes dev_eui = 4 [json_name = "devEUI"];

    // Frame was acknowledged.
    bool acknowledged = 5;

    // Downlink frame counter to which the acknowledgement relates.
    uint32 f_cnt = 6;

    // User-defined device tags.
    map<string, string> tags = 7;
}

// 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.
message TxAckEvent {
    // Application ID.
    uint64 application_id = 1 [json_name = "applicationID"];

    // Application name.
    string application_name = 2;

    // Device name.
    string device_name = 3;

    // Device EUI.
    bytes dev_eui = 4 [json_name = "devEUI"];

    // Downlink frame-counter.
    uint32 f_cnt = 5;

    // User-defined device tags.
    map<string, string> tags = 6;
}

// ErrorEvent is the message sent when an error occurred.
message ErrorEvent {
    // Application ID.
    uint64 application_id = 1 [json_name = "applicationID"];

    // Application name.
    string application_name = 2;

    // Device name.
    string device_name = 3;

    // Device EUI.
    bytes dev_eui = 4 [json_name = "devEUI"];

    // Error type.
    ErrorType type = 5;

    // Error message.
    string error = 6;

    // Downlink frame-counter (in case the downlink is related to a scheduled downlink).
    uint32 f_cnt = 7;

    // User-defined device tags.
    map<string, string> tags = 8;
}

// StatusEvent is the message sent when a device-status mac-command was sent
// by the device.
message StatusEvent {
    // Application ID.
    uint64 application_id = 1 [json_name = "applicationID"];

    // Application name.
    string application_name = 2;

    // Device name.
    string device_name = 3;

    // Device EUI.
    bytes dev_eui = 4 [json_name = "devEUI"];

    // The demodulation signal-to-noise ratio in dB for the last successfully
    // received device-status request by the Network Server.
    int32 margin = 5;

    // Device is connected to an external power source.
    bool external_power_source = 6;

    // Battery level is not available.
    bool battery_level_unavailable = 7;

    // Battery level.
    float battery_level = 8;

    // User-defined device tags.
    map<string, string> tags = 9;
}

// LocationEvent is the message sent when a geolocation resolve was returned.
message LocationEvent {
    // Application ID.
    uint64 application_id = 1 [json_name = "applicationID"];

    // Application name.
    string application_name = 2;

    // Device name.
    string device_name = 3;

    // Device EUI.
    bytes dev_eui = 4 [json_name = "devEUI"];

    // Location.
    common.Location location = 5;

    // User-defined device tags.
    map<string, string> tags = 6;

    // Uplink IDs used for geolocation.
    // This is set in case the geolocation is based on the uplink meta-data.
    repeated bytes uplink_ids = 7 [json_name = "uplinkIDs"];

    // Frame counter (in case the geolocation is based on the payload).
    // This is set in case the geolocation is based on the uplink payload content.
    uint32 f_cnt = 8;
}

// 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 {
    // Application ID.
    uint64 application_id = 1 [json_name = "applicationID"];

    // Application name.
    string application_name = 2;

    // Device name.
    string device_name = 3;

    // Device EUI.
    bytes dev_eui = 4 [json_name = "devEUI"];

    // User-defined device tags.
    map<string, string> tags = 5;

    // Integration name.
    string integration_name = 6;

    // Event type.
    string event_type = 7;

    // JSON string containing the event object.
    string object_json = 8 [json_name = "objectJSON"];
}