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";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
// DeviceQueueService is the service managing the downlink data queue.
service DeviceQueueService {
// Enqueue adds the given item to the device-queue.
rpc Enqueue(EnqueueDeviceQueueItemRequest) returns (EnqueueDeviceQueueItemResponse) {
option(google.api.http) = {
post: "/api/devices/{device_queue_item.dev_eui}/queue"
body: "*"
};
}
// Flush flushes the downlink device-queue.
rpc Flush(FlushDeviceQueueRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}/queue"
};
}
// List lists the items in the device-queue.
rpc List(ListDeviceQueueItemsRequest) returns (ListDeviceQueueItemsResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/queue"
};
}
}
message DeviceQueueItem {
// Device EUI (HEX encoded).
string dev_eui = 1 [json_name = "devEUI"];
// Set this to true when an acknowledgement from the device is required.
// Please note that this must not be used to guarantee a delivery.
bool confirmed = 2;
// Downlink frame-counter.
// This will be automatically set on enquue.
uint32 f_cnt = 6;
// FPort used (must be > 0)
uint32 f_port = 3;
// Base64 encoded data.
// Or use the json_object field when an application codec has been configured.
bytes data = 4;
// JSON object (string).
// Only use this when an application codec has been configured that can convert
// this object into binary form.
string json_object = 5;
}
message EnqueueDeviceQueueItemRequest {
// Queue-item object to enqueue.
DeviceQueueItem device_queue_item = 1;
}
message EnqueueDeviceQueueItemResponse {
// Frame-counter for the enqueued payload.
uint32 f_cnt = 1;
}
message FlushDeviceQueueRequest {
// Device EUI (HEX encoded).
string dev_eui = 1 [json_name = "devEUI"];
}
message ListDeviceQueueItemsRequest {
// Device EUI (HEX encoded).
string dev_eui = 1 [json_name = "devEUI"];
// Return only the count, not the result-set.
bool count_only = 2;
}
message ListDeviceQueueItemsResponse {
// The device queue items.
repeated DeviceQueueItem device_queue_items = 1;
// Total number of items in the queue.
uint32 total_count = 2;
}