Update Python SDK.

This commit is contained in:
Orne Brocaar
2022-07-18 14:14:28 +01:00
parent 626af4fadc
commit 038614b44d
42 changed files with 2884 additions and 1179 deletions

View File

@ -2,144 +2,367 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "ApplicationProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
// ApplicationService is the service providing API methods for managing applications.
service ApplicationService {
// Create creates the given application.
rpc Create(CreateApplicationRequest) returns (CreateApplicationResponse) {}
rpc Create(CreateApplicationRequest) returns (CreateApplicationResponse) {
option(google.api.http) = {
post: "/api/applications"
body: "*"
};
}
// Get the application for the given ID.
rpc Get(GetApplicationRequest) returns (GetApplicationResponse) {}
rpc Get(GetApplicationRequest) returns (GetApplicationResponse) {
option(google.api.http) = {
get: "/api/applications/{id}"
};
}
// Update updates the given application.
rpc Update(UpdateApplicationRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateApplicationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{application.id}"
body: "*"
};
}
// Delete the application for the given ID.
rpc Delete(DeleteApplicationRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteApplicationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{id}"
};
}
// Get the list of applications.
rpc List(ListApplicationsRequest) returns (ListApplicationsResponse) {}
rpc List(ListApplicationsRequest) returns (ListApplicationsResponse) {
option(google.api.http) = {
get: "/api/applications"
};
}
// List all configured integrations.
rpc ListIntegrations(ListIntegrationsRequest) returns (ListIntegrationsResponse) {}
rpc ListIntegrations(ListIntegrationsRequest) returns (ListIntegrationsResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations"
};
}
// Create HTTP integration.
rpc CreateHttpIntegration(CreateHttpIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateHttpIntegration(CreateHttpIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/http"
body: "*"
};
}
// Get the configured HTTP integration.
rpc GetHttpIntegration(GetHttpIntegrationRequest) returns (GetHttpIntegrationResponse) {}
rpc GetHttpIntegration(GetHttpIntegrationRequest) returns (GetHttpIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/http"
};
}
// Update the HTTP integration.
rpc UpdateHttpIntegration(UpdateHttpIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateHttpIntegration(UpdateHttpIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/http"
body: "*"
};
}
// Delete the HTTP integration.
rpc DeleteHttpIntegration(DeleteHttpIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteHttpIntegration(DeleteHttpIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/http"
};
}
// Create InfluxDb integration.
rpc CreateInfluxDbIntegration(CreateInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateInfluxDbIntegration(CreateInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/influxdb"
body: "*"
};
}
// Get InfluxDb integration.
rpc GetInfluxDbIntegration(GetInfluxDbIntegrationRequest) returns (GetInfluxDbIntegrationResponse) {}
rpc GetInfluxDbIntegration(GetInfluxDbIntegrationRequest) returns (GetInfluxDbIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/influxdb"
};
}
// Update InfluxDb integration.
rpc UpdateInfluxDbIntegration(UpdateInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateInfluxDbIntegration(UpdateInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/influxdb"
body: "*"
};
}
// Delete InfluxDb integration.
rpc DeleteInfluxDbIntegration(DeleteInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteInfluxDbIntegration(DeleteInfluxDbIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/influxdb"
};
}
// Create ThingsBoard integration.
rpc CreateThingsBoardIntegration(CreateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateThingsBoardIntegration(CreateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/thingsboard"
body: "*"
};
}
// Get ThingsBoard integration.
rpc GetThingsBoardIntegration(GetThingsBoardIntegrationRequest) returns (GetThingsBoardIntegrationResponse) {}
rpc GetThingsBoardIntegration(GetThingsBoardIntegrationRequest) returns (GetThingsBoardIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/thingsboard"
};
}
// Update ThingsBoard integration.
rpc UpdateThingsBoardIntegration(UpdateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateThingsBoardIntegration(UpdateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/thingsboard"
body: "*"
};
}
// Delete ThingsBoard integration.
rpc DeleteThingsBoardIntegration(DeleteThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteThingsBoardIntegration(DeleteThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/thingsboard"
};
}
// Create myDevices integration.
rpc CreateMyDevicesIntegration(CreateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateMyDevicesIntegration(CreateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/mydevices"
body: "*"
};
}
// Get myDevices integration.
rpc GetMyDevicesIntegration(GetMyDevicesIntegrationRequest) returns (GetMyDevicesIntegrationResponse) {}
rpc GetMyDevicesIntegration(GetMyDevicesIntegrationRequest) returns (GetMyDevicesIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/mydevices"
};
}
// Update myDevices integration.
rpc UpdateMyDevicesIntegration(UpdateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateMyDevicesIntegration(UpdateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/mydevices"
body: "*"
};
}
// Delete myDevices integration.
rpc DeleteMyDevicesIntegration(DeleteMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteMyDevicesIntegration(DeleteMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/mydevices"
};
}
// Create LoRaCloud integration.
rpc CreateLoraCloudIntegration(CreateLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateLoraCloudIntegration(CreateLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/loracloud"
body: "*"
};
}
// Get LoRaCloud integration.
rpc GetLoraCloudIntegration(GetLoraCloudIntegrationRequest) returns (GetLoraCloudIntegrationResponse) {}
rpc GetLoraCloudIntegration(GetLoraCloudIntegrationRequest) returns (GetLoraCloudIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/loracloud"
};
}
// Update LoRaCloud integration.
rpc UpdateLoraCloudIntegration(UpdateLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateLoraCloudIntegration(UpdateLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/loracloud"
body: "*"
};
}
// Delete LoRaCloud integration.
rpc DeleteLoraCloudIntegration(DeleteLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteLoraCloudIntegration(DeleteLoraCloudIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/loracloud"
};
}
// Create GCP Pub/Sub integration.
rpc CreateGcpPubSubIntegration(CreateGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateGcpPubSubIntegration(CreateGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/gcp-pub-sub"
body: "*"
};
}
// Get GCP Pub/Sub integration.
rpc GetGcpPubSubIntegration(GetGcpPubSubIntegrationRequest) returns (GetGcpPubSubIntegrationResponse) {}
rpc GetGcpPubSubIntegration(GetGcpPubSubIntegrationRequest) returns (GetGcpPubSubIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/gcp-pub-sub"
};
}
// Update GCP Pub/Sub integration.
rpc UpdateGcpPubSubIntegration(UpdateGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateGcpPubSubIntegration(UpdateGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/gcp-pub-sub"
body: "*"
};
}
// Delete GCP Pub/Sub integration.
rpc DeleteGcpPubSubIntegration(DeleteGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteGcpPubSubIntegration(DeleteGcpPubSubIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/gcp-pub-sub"
};
}
// Create AWS SNS integration.
rpc CreateAwsSnsIntegration(CreateAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateAwsSnsIntegration(CreateAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/aws-sns"
body: "*"
};
}
// Get AWS SNS integration.
rpc GetAwsSnsIntegration(GetAwsSnsIntegrationRequest) returns (GetAwsSnsIntegrationResponse) {}
rpc GetAwsSnsIntegration(GetAwsSnsIntegrationRequest) returns (GetAwsSnsIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/aws-sns"
};
}
// Update AWS SNS integration.
rpc UpdateAwsSnsIntegration(UpdateAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateAwsSnsIntegration(UpdateAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/aws-sns"
body: "*"
};
}
// Delete AWS SNS integration.
rpc DeleteAwsSnsIntegration(DeleteAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteAwsSnsIntegration(DeleteAwsSnsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/aws-sns"
};
}
// Create Azure Service-Bus integration.
rpc CreateAzureServiceBusIntegration(CreateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreateAzureServiceBusIntegration(CreateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/azure-service-bus"
body: "*"
};
}
// Get Azure Service-Bus integration.
rpc GetAzureServiceBusIntegration(GetAzureServiceBusIntegrationRequest) returns (GetAzureServiceBusIntegrationResponse) {}
rpc GetAzureServiceBusIntegration(GetAzureServiceBusIntegrationRequest) returns (GetAzureServiceBusIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/azure-service-bus"
};
}
// Update Azure Service-Bus integration.
rpc UpdateAzureServiceBusIntegration(UpdateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdateAzureServiceBusIntegration(UpdateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/azure-service-bus"
body: "*"
};
}
// Delete Azure Service-Bus integration.
rpc DeleteAzureServiceBusIntegration(DeleteAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeleteAzureServiceBusIntegration(DeleteAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/azure-service-bus"
};
}
// Create Pilot Things integration.
rpc CreatePilotThingsIntegration(CreatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc CreatePilotThingsIntegration(CreatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/pilot-things"
body: "*"
};
}
// Get Pilot Things integration.
rpc GetPilotThingsIntegration(GetPilotThingsIntegrationRequest) returns (GetPilotThingsIntegrationResponse) {}
rpc GetPilotThingsIntegration(GetPilotThingsIntegrationRequest) returns (GetPilotThingsIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/pilot-things"
};
}
// Update Pilot Things integration.
rpc UpdatePilotThingsIntegration(UpdatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc UpdatePilotThingsIntegration(UpdatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/pilot-things"
body: "*"
};
}
// Delete Pilot Things integration.
rpc DeletePilotThingsIntegration(DeletePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {}
rpc DeletePilotThingsIntegration(DeletePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/pilot-things"
};
}
// Create IFTTT integration.
rpc CreateIftttIntegration(CreateIftttIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/applications/{integration.application_id}/integrations/ifttt"
body: "*"
};
}
// Get IFTTT integration.
rpc GetIftttIntegration(GetIftttIntegrationRequest) returns (GetIftttIntegrationResponse) {
option(google.api.http) = {
get: "/api/applications/{application_id}/integrations/ifttt"
};
}
// Update IFTTT integration.
rpc UpdateIftttIntegration(UpdateIftttIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/applications/{integration.application_id}/integrations/ifttt"
body: "*"
};
}
// Delete IFTTT integration.
rpc DeleteIftttIntegration(DeleteIftttIntegrationRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/applications/{application_id}/integrations/ifttt"
};
}
// Generates application ID specific client-certificate.
rpc GenerateMqttIntegrationClientCertificate(GenerateMqttIntegrationClientCertificateRequest) returns (GenerateMqttIntegrationClientCertificateResponse) {}
rpc GenerateMqttIntegrationClientCertificate(GenerateMqttIntegrationClientCertificateRequest) returns (GenerateMqttIntegrationClientCertificateResponse) {
option(google.api.http) = {
post: "/api/applications/{application_id}/integrations/mqtt/certificate"
};
}
}
enum Encoding {
@ -158,6 +381,7 @@ enum IntegrationKind {
AZURE_SERVICE_BUS = 7;
PILOT_THINGS = 8;
MQTT_GLOBAL = 9;
IFTTT = 10;
}
message Application {
@ -216,6 +440,11 @@ message GetApplicationResponse {
// Last update timestamp.
google.protobuf.Timestamp updated_at = 3;
// Measurement keys.
// This contains the measurement keys from all the device-profiles that
// are used by the devices under this application.
repeated string measurement_keys = 4;
}
message UpdateApplicationRequest {
@ -718,6 +947,53 @@ message DeletePilotThingsIntegrationRequest {
string application_id = 1;
}
message IftttIntegration {
// Application ID (UUID).
string application_id = 1;
// Key.
// This key can be obtained from the IFTTT Webhooks documentation page.
string key = 2;
// Values.
// Up to 2 values can be forwarded to IFTTT. These values must map to the
// decoded payload keys. For example:
// {
// "batteryLevel": 75.3,
// "buttons": [{"pressed": false}, {"pressed": true}]
// }
// You would specify the following fields:
// uplink_values = ["batteryLevel", "buttons_0_pressed"]
//
// Note: The first value is always used for the DevEUI.
repeated string uplink_values = 3;
}
message CreateIftttIntegrationRequest {
// Integration object.
IftttIntegration integration = 1;
}
message GetIftttIntegrationRequest {
// Application ID (UUID).
string application_id = 1;
}
message GetIftttIntegrationResponse {
// Integration object.
IftttIntegration integration = 1;
}
message UpdateIftttIntegrationRequest {
// Integration object to update.
IftttIntegration integration = 1;
}
message DeleteIftttIntegrationRequest {
// Application ID (UUID).
string application_id = 1;
}
message GenerateMqttIntegrationClientCertificateRequest {
// Application ID (UUID).
string application_id = 1;

View File

@ -2,11 +2,13 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "DeviceProto";
import "chirpstack-api/common/common.proto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/empty.proto";
@ -14,58 +16,145 @@ import "google/protobuf/empty.proto";
// DeviceService is the service providing API methods for managing devices.
service DeviceService {
// Create the given device.
rpc Create(CreateDeviceRequest) returns (google.protobuf.Empty) {}
rpc Create(CreateDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/devices"
body: "*"
};
}
// Get returns the device for the given DevEUI.
rpc Get(GetDeviceRequest) returns (GetDeviceResponse) {}
rpc Get(GetDeviceRequest) returns (GetDeviceResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}"
};
}
// Update the given device.
rpc Update(UpdateDeviceRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/devices/{device.dev_eui}"
body: "*"
};
}
// Delete the device with the given DevEUI.
rpc Delete(DeleteDeviceRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}"
};
}
// Get the list of devices.
rpc List(ListDevicesRequest) returns (ListDevicesResponse) {}
rpc List(ListDevicesRequest) returns (ListDevicesResponse) {
option(google.api.http) = {
get: "/api/devices"
};
}
// Create the given device-keys.
rpc CreateKeys(CreateDeviceKeysRequest) returns (google.protobuf.Empty) {}
rpc CreateKeys(CreateDeviceKeysRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/devices/{device_keys.dev_eui}/keys"
body: "*"
};
}
// Get the device-keys for the given DevEUI.
rpc GetKeys(GetDeviceKeysRequest) returns (GetDeviceKeysResponse) {}
rpc GetKeys(GetDeviceKeysRequest) returns (GetDeviceKeysResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/keys"
};
}
// Update the given device-keys.
rpc UpdateKeys(UpdateDeviceKeysRequest) returns (google.protobuf.Empty) {}
rpc UpdateKeys(UpdateDeviceKeysRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/devices/{device_keys.dev_eui}/keys"
body: "*"
};
}
// Delete the device-keys for the given DevEUI.
rpc DeleteKeys(DeleteDeviceKeysRequest) returns (google.protobuf.Empty) {}
rpc DeleteKeys(DeleteDeviceKeysRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}/keys"
};
}
// FlushDevNonces flushes the OTAA device nonces.
rpc FlushDevNonces(FlushDevNoncesRequest) returns (google.protobuf.Empty) {}
rpc FlushDevNonces(FlushDevNoncesRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}/dev-nonces"
};
}
// Activate (re)activates the device with the given parameters (for ABP or for importing OTAA activations).
rpc Activate(ActivateDeviceRequest) returns (google.protobuf.Empty) {}
rpc Activate(ActivateDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/devices/{device_activation.dev_eui}/activate"
body: "*"
};
}
// Deactivate de-activates the device.
rpc Deactivate(DeactivateDeviceRequest) returns (google.protobuf.Empty) {}
rpc Deactivate(DeactivateDeviceRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}/activation"
};
}
// GetActivation returns the current activation details of the device (OTAA or ABP).
rpc GetActivation(GetDeviceActivationRequest) returns (GetDeviceActivationResponse) {}
rpc GetActivation(GetDeviceActivationRequest) returns (GetDeviceActivationResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/activation"
};
}
// GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account.
rpc GetRandomDevAddr(GetRandomDevAddrRequest) returns (GetRandomDevAddrResponse) {}
rpc GetRandomDevAddr(GetRandomDevAddrRequest) returns (GetRandomDevAddrResponse) {
option(google.api.http) = {
post: "/api/devices/{dev_eui}/get-random-dev-addr"
};
}
// GetStats returns the device stats.
rpc GetStats(GetDeviceStatsRequest) returns (GetDeviceStatsResponse) {}
// GetMetrics returns the device metrics.
// Note that this requires a device-profile with codec and measurements configured.
rpc GetMetrics(GetDeviceMetricsRequest) returns (GetDeviceMetricsResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/metrics"
};
}
// GetLinkMetrics returns the device link metrics.
// This includes uplinks, downlinks, RSSI, SNR, etc...
rpc GetLinkMetrics(GetDeviceLinkMetricsRequest) returns (GetDeviceLinkMetricsResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/link-metrics"
};
}
// Enqueue adds the given item to the downlink queue.
rpc Enqueue(EnqueueDeviceQueueItemRequest) returns (EnqueueDeviceQueueItemResponse) {}
rpc Enqueue(EnqueueDeviceQueueItemRequest) returns (EnqueueDeviceQueueItemResponse) {
option(google.api.http) = {
post: "/api/devices/{queue_item.dev_eui}/queue"
body: "*"
};
}
// FlushQueue flushes the downlink device-queue.
rpc FlushQueue(FlushDeviceQueueRequest) returns (google.protobuf.Empty) {}
rpc FlushQueue(FlushDeviceQueueRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/devices/{dev_eui}/queue"
};
}
// GetQueue returns the downlink device-queue.
rpc GetQueue(GetDeviceQueueItemsRequest) returns (GetDeviceQueueItemsResponse) {}
rpc GetQueue(GetDeviceQueueItemsRequest) returns (GetDeviceQueueItemsResponse) {
option(google.api.http) = {
get: "/api/devices/{dev_eui}/queue"
};
}
}
message Device {
@ -309,7 +398,7 @@ message GetRandomDevAddrResponse {
string dev_addr = 1;
}
message GetDeviceStatsRequest {
message GetDeviceMetricsRequest {
// DevEUI (EUI64).
string dev_eui = 1;
@ -318,33 +407,57 @@ message GetDeviceStatsRequest {
// Interval end timestamp.
google.protobuf.Timestamp end = 3;
// Aggregation.
common.Aggregation aggregation = 4;
}
message GetDeviceStatsResponse {
repeated DeviceStats result = 1;
message GetDeviceMetricsResponse {
map<string, common.Metric> metrics = 1;
map<string, DeviceState> states = 2;
}
message DeviceStats {
// Timestamp of the (aggregated) measurement.
google.protobuf.Timestamp time = 1;
message DeviceState {
// Name.
string name = 2;
// Value.
string value = 3;
}
message GetDeviceLinkMetricsRequest {
// DevEUI (EUI64).
string dev_eui = 1;
// Interval start timestamp.
google.protobuf.Timestamp start = 2;
// Interval end timestamp.
google.protobuf.Timestamp end = 3;
// Aggregation.
common.Aggregation aggregation = 4;
}
message GetDeviceLinkMetricsResponse {
// Packets received from the device.
uint32 rx_packets = 2;
common.Metric rx_packets = 1;
// Average RSSI (as reported by the gateway(s)).
float gw_rssi = 3;
// RSSI (as reported by the gateway(s)).
common.Metric gw_rssi = 2;
// Average SNR (as reported by the gateway(s)).
float gw_snr = 4;
// SNR (as reported by the gateway(s)).
common.Metric gw_snr = 3;
// Packets received by frequency.
map<uint32, uint32> rx_packets_per_frequency = 5;
common.Metric rx_packets_per_freq = 4;
// Packets received by DR.
map<uint32, uint32> rx_packets_per_dr = 6;
common.Metric rx_packets_per_dr = 5;
// Error count.
map<string, uint32> errors = 7;
// Errors.
common.Metric errors = 6;
}
message DeviceQueueItem {
@ -379,7 +492,7 @@ message DeviceQueueItem {
}
message EnqueueDeviceQueueItemRequest {
DeviceQueueItem item = 1;
DeviceQueueItem queue_item = 1;
}
message EnqueueDeviceQueueItemResponse {

View File

@ -2,11 +2,12 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "DeviceProfileProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "chirpstack-api/common/common.proto";
@ -22,25 +23,68 @@ enum CodecRuntime {
JS = 2;
}
enum MeasurementKind {
// Unknown (in which case it is not tracked).
UNKNOWN = 0;
// Incrementing counters that never decrease (these are not reset on each reading).
COUNTER = 1;
// Counters that do get reset upon reading.
ABSOLUTE = 2;
// E.g. a temperature value.
GAUGE = 3;
// E.g. a firmware version, true / false value.
STRING = 4;
}
// DeviceProfileService is the service providing API methods for managing device-profiles.
service DeviceProfileService {
// Create the given device-profile.
rpc Create(CreateDeviceProfileRequest) returns (CreateDeviceProfileResponse) {}
rpc Create(CreateDeviceProfileRequest) returns (CreateDeviceProfileResponse) {
option(google.api.http) = {
post: "/api/device-profiles"
body: "*"
};
}
// Get the device-profile for the given ID.
rpc Get(GetDeviceProfileRequest) returns (GetDeviceProfileResponse) {}
rpc Get(GetDeviceProfileRequest) returns (GetDeviceProfileResponse) {
option(google.api.http) = {
get: "/api/device-profiles/{id}"
};
}
// Update the given device-profile.
rpc Update(UpdateDeviceProfileRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateDeviceProfileRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/device-profiles/{device_profile.id}"
body: "*"
};
}
// Delete the device-profile with the given ID.
rpc Delete(DeleteDeviceProfileRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteDeviceProfileRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/device-profiles/{id}"
};
}
// List the available device-profiles.
rpc List(ListDeviceProfilesRequest) returns (ListDeviceProfilesResponse) {}
rpc List(ListDeviceProfilesRequest) returns (ListDeviceProfilesResponse) {
option(google.api.http) = {
get: "/api/device-profiles"
};
}
// List available ADR algorithms.
rpc ListAdrAlgorithms(google.protobuf.Empty) returns (ListDeviceProfileAdrAlgorithmsResponse) {}
rpc ListAdrAlgorithms(google.protobuf.Empty) returns (ListDeviceProfileAdrAlgorithmsResponse) {
option(google.api.http) = {
get: "/api/device-profiles/adr-algorithms"
};
}
}
message DeviceProfile {
@ -54,6 +98,9 @@ message DeviceProfile {
// Name.
string name = 3;
// Description.
string description = 26;
// Region.
common.Region region = 4;
@ -69,11 +116,11 @@ message DeviceProfile {
// Payload codec runtime.
CodecRuntime payload_codec_runtime = 8;
// Payload codec encoder config.
string payload_encoder_config = 9;
// Payload codec script.
string payload_codec_script = 9;
// Payload codec decoder config.
string payload_decoder_config = 10;
// Flush queue on device activation.
bool flush_queue_on_activate = 10;
// Uplink interval (seconds).
// This defines the expected uplink interval which the device uses for
@ -126,6 +173,18 @@ message DeviceProfile {
// User defined tags.
map<string, string> tags = 25;
// Measurements.
// If defined, ChirpStack will visualize these metrics in the web-interface.
map<string, Measurement> measurements = 27;
}
message Measurement {
// Name (user defined).
string name = 2;
// Kind.
MeasurementKind kind = 3;
}
message DeviceProfileListItem {

View File

@ -0,0 +1,234 @@
syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "DeviceProfileTemplateProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "chirpstack-api/common/common.proto";
import "chirpstack-api/api/device_profile.proto";
// DeviceProfileTemplateService is the service providing API methods for managing device-profile templates.
service DeviceProfileTemplateService {
// Create the given device-profile template.
rpc Create(CreateDeviceProfileTemplateRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/device-profile-templates"
body: "*"
};
}
// Get the device-profile template for the given ID.
rpc Get(GetDeviceProfileTemplateRequest) returns (GetDeviceProfileTemplateResponse) {
option(google.api.http) = {
get: "/api/device-profile-templates/{id}"
};
}
// Update the given device-profile template.
rpc Update(UpdateDeviceProfileTemplateRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/device-profile-templates/{device_profile_template.id}"
body: "*"
};
}
// Delete the device-profile template with the given ID.
rpc Delete(DeleteDeviceProfileTemplateRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/device-profile-templates/{id}"
};
}
// List the available device-profile templates.
rpc List(ListDeviceProfileTemplatesRequest) returns (ListDeviceProfileTemplatesResponse) {
option(google.api.http) = {
get: "/api/device-profile-templates"
};
}
}
message DeviceProfileTemplate {
// Device-profile template ID.
string id = 1;
// Name.
string name = 2;
// Description.
string description = 3;
// Vendor.
string vendor = 4;
// Firmware.
string firmware = 5;
// Region.
common.Region region = 6;
// LoRaWAN mac-version.
common.MacVersion mac_version = 7;
// Regional parameters revision.
common.RegParamsRevision reg_params_revision = 8;
// ADR algorithm ID.
string adr_algorithm_id = 9;
// Payload codec runtime.
CodecRuntime payload_codec_runtime = 10;
// Payload codec script.
string payload_codec_script = 11;
// Flush queue on device activation.
bool flush_queue_on_activate = 12;
// Uplink interval (seconds).
// This defines the expected uplink interval which the device uses for
// communication. When the uplink interval has expired and no uplink has
// been received, the device is considered inactive.
uint32 uplink_interval = 13;
// Device-status request interval (times / day).
// This defines the times per day that ChirpStack will request the device-status
// from the device.
uint32 device_status_req_interval = 14;
// Supports OTAA.
bool supports_otaa = 15;
// Supports Class B.
bool supports_class_b = 16;
// Supports Class-C.
bool supports_class_c = 17;
// Class-B timeout (seconds).
// This is the maximum time ChirpStack will wait to receive an acknowledgement from the device (if requested).
uint32 class_b_timeout = 18;
// Class-B ping-slot periodicity.
uint32 class_b_ping_slot_period = 19;
// Class-B ping-slot DR.
uint32 class_b_ping_slot_dr = 20;
// Class-B ping-slot freq (Hz).
uint32 class_b_ping_slot_freq = 21;
// Class-C timeout (seconds).
// This is the maximum time ChirpStack will wait to receive an acknowledgement from the device (if requested).
uint32 class_c_timeout = 22;
// RX1 delay (for ABP).
uint32 abp_rx1_delay = 23;
// RX1 DR offset (for ABP).
uint32 abp_rx1_dr_offset = 24;
// RX2 DR (for ABP).
uint32 abp_rx2_dr = 25;
// RX2 frequency (for ABP, Hz).
uint32 abp_rx2_freq = 26;
// User defined tags.
map<string, string> tags = 27;
// Measurements.
// If defined, ChirpStack will visualize these metrics in the web-interface.
map<string, Measurement> measurements = 28;
}
message DeviceProfileTemplateListItem {
// Device-profile template ID.
string id = 1;
// Created at timestamp.
google.protobuf.Timestamp created_at = 2;
// Last update timestamp.
google.protobuf.Timestamp updated_at = 3;
// Name.
string name = 4;
// Vendor.
string vendor = 5;
// Firmware.
string firmware = 6;
// Region.
common.Region region = 7;
// LoRaWAN mac-version.
common.MacVersion mac_version = 8;
// Regional parameters revision.
common.RegParamsRevision reg_params_revision = 9;
// Supports OTAA.
bool supports_otaa = 10;
// Supports Class-B.
bool supports_class_b = 11;
// Supports Class-C.
bool supports_class_c = 12;
}
message CreateDeviceProfileTemplateRequest {
// Object to create.
DeviceProfileTemplate device_profile_template = 1;
}
message GetDeviceProfileTemplateRequest {
// ID.
string id = 1;
}
message GetDeviceProfileTemplateResponse {
// Device-profile template object.
DeviceProfileTemplate device_profile_template = 1;
// Created at timestamp.
google.protobuf.Timestamp created_at = 2;
// Last update timestamp.
google.protobuf.Timestamp updated_at = 3;
}
message UpdateDeviceProfileTemplateRequest {
// Object to update.
DeviceProfileTemplate device_profile_template = 1;
}
message DeleteDeviceProfileTemplateRequest {
// ID.
string id = 1;
}
message ListDeviceProfileTemplatesRequest {
// Max number of device-profile templates to return in the result-set.
uint32 limit = 1;
// Offset in the result-set (for pagination).
uint32 offset = 2;
}
message ListDeviceProfileTemplatesResponse {
// Total number of device-profile templates.
uint32 total_count = 1;
// Result-set.
repeated DeviceProfileTemplateListItem result = 2;
}

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "FrameLogProto";
@ -16,10 +16,10 @@ message UplinkFrameLog {
bytes phy_payload = 1;
// TX meta-data.
gw.UplinkTXInfo tx_info = 2;
gw.UplinkTxInfo tx_info = 2;
// RX meta-data.
repeated gw.UplinkRXInfo rx_info = 3;
repeated gw.UplinkRxInfo rx_info = 3;
// Message type.
common.MType m_type = 4;
@ -42,10 +42,10 @@ message DownlinkFrameLog {
bytes phy_payload = 2;
// TX meta-data.
gw.DownlinkTXInfo tx_info = 3;
gw.DownlinkTxInfo tx_info = 3;
// Downlink ID (UUID).
string downlink_id = 4;
// Downlink ID.
uint32 downlink_id = 4;
// Gateway ID (EUI64).
string gateway_id = 5;

View File

@ -2,37 +2,68 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "GatewayProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "chirpstack-api/common/common.proto";
// GatewayService is the service providing API methods for managing gateways.
service GatewayService {
// Create creates the given gateway.
rpc Create(CreateGatewayRequest) returns (google.protobuf.Empty) {}
// Create creates the given gateway.
rpc Create(CreateGatewayRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/gateways"
body: "*"
};
}
// Get returns the gateway for the given Gateway ID.
rpc Get(GetGatewayRequest) returns (GetGatewayResponse) {}
// Get returns the gateway for the given Gateway ID.
rpc Get(GetGatewayRequest) returns (GetGatewayResponse) {
option(google.api.http) = {
get: "/api/gateways/{gateway_id}"
};
}
// Update updates the given gateway.
rpc Update(UpdateGatewayRequest) returns (google.protobuf.Empty) {}
// Update updates the given gateway.
rpc Update(UpdateGatewayRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/gateways/{gateway.gateway_id}"
body: "*"
};
}
// Delete deletes the gateway matching the given Gateway ID.
rpc Delete(DeleteGatewayRequest) returns (google.protobuf.Empty) {}
// Delete deletes the gateway matching the given Gateway ID.
rpc Delete(DeleteGatewayRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/gateways/{gateway_id}"
};
}
// Get the list of gateways.
rpc List(ListGatewaysRequest) returns (ListGatewaysResponse) {}
// Get the list of gateways.
rpc List(ListGatewaysRequest) returns (ListGatewaysResponse) {
option(google.api.http) = {
get: "/api/gateways"
};
}
// Generate client-certificate for the gateway.
rpc GenerateClientCertificate(GenerateGatewayClientCertificateRequest) returns (GenerateGatewayClientCertificateResponse) {}
// Generate client-certificate for the gateway.
rpc GenerateClientCertificate(GenerateGatewayClientCertificateRequest) returns (GenerateGatewayClientCertificateResponse) {
option(google.api.http) = {
post: "/api/gateways/{gateway_id}/generate-certificate"
};
}
// GetStats returns the gateway stats.
rpc GetStats(GetGatewayStatsRequest) returns (GetGatewayStatsResponse) {}
// GetMetrics returns the gateway metrics.
rpc GetMetrics(GetGatewayMetricsRequest) returns (GetGatewayMetricsResponse) {
option(google.api.http) = {
get: "/api/gateways/{gateway_id}/metrics"
};
}
}
message Gateway {
@ -163,7 +194,7 @@ message GenerateGatewayClientCertificateResponse {
google.protobuf.Timestamp expires_at = 4;
}
message GetGatewayStatsRequest {
message GetGatewayMetricsRequest {
// Gateway ID (EUI64).
string gateway_id = 1;
@ -172,34 +203,30 @@ message GetGatewayStatsRequest {
// Interval end timestamp.
google.protobuf.Timestamp end = 3;
// Aggregation.
common.Aggregation aggregation = 4;
}
message GetGatewayStatsResponse {
repeated GatewayStats result = 1;
}
message GatewayStats {
// Timestamp of the (aggregated) measurement.
google.protobuf.Timestamp time = 1;
// Packets received.
uint32 rx_packets = 2;
// Packets emitted.
uint32 tx_packets = 3;
// Tx packets per frequency.
map<uint32, uint32> tx_packets_per_frequency = 4;
// Rx packets per frequency.
map<uint32, uint32> rx_packets_per_frequency = 5;
// Tx packets per DR.
map<uint32, uint32> tx_packets_per_dr = 6;
// Rx packets per DR.
map<uint32, uint32> rx_packets_per_dr = 7;
// Tx packets per status.
map<string, uint32> tx_packets_per_status = 8;
message GetGatewayMetricsResponse {
// RX packets.
common.Metric rx_packets = 1;
// TX packets.
common.Metric tx_packets = 2;
// TX packets / frequency.
common.Metric tx_packets_per_freq = 3;
// RX packets / frequency.
common.Metric rx_packets_per_freq = 4;
// TX packets / DR.
common.Metric tx_packets_per_dr = 5;
// RX packets / DR.
common.Metric rx_packets_per_dr = 6;
// TX packets per status.
common.Metric tx_packets_per_status = 7;
}

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "InternalProto";

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "MulticastGroupProto";
@ -16,34 +16,78 @@ import "chirpstack-api/common/common.proto";
// MulticastGroupService is the service managing multicast-groups.
service MulticastGroupService {
// Create the given multicast group.
rpc Create(CreateMulticastGroupRequest) returns (CreateMulticastGroupResponse) {}
rpc Create(CreateMulticastGroupRequest) returns (CreateMulticastGroupResponse) {
option(google.api.http) = {
post: "/api/multicast-groups"
body: "*"
};
}
// Get returns the multicast group for the given ID.
rpc Get(GetMulticastGroupRequest) returns (GetMulticastGroupResponse) {}
rpc Get(GetMulticastGroupRequest) returns (GetMulticastGroupResponse) {
option(google.api.http) = {
get: "/api/multicast-groups/{id}"
};
}
// Update the given multicast group.
rpc Update(UpdateMulticastGroupRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateMulticastGroupRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/multicast-groups/{multicast_group.id}"
body: "*"
};
}
// Delete the multicast-group with the given ID.
rpc Delete(DeleteMulticastGroupRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteMulticastGroupRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/multicast-groups/{id}"
};
}
// List the available multicast groups.
rpc List(ListMulticastGroupsRequest) returns (ListMulticastGroupsResponse) {}
rpc List(ListMulticastGroupsRequest) returns (ListMulticastGroupsResponse) {
option(google.api.http) = {
get: "/api/multicast-groups"
};
}
// Add a device to the multicast group.
rpc AddDevice(AddDeviceToMulticastGroupRequest) returns (google.protobuf.Empty) {}
rpc AddDevice(AddDeviceToMulticastGroupRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/multicast-groups/{multicast_group_id}/devices"
body: "*"
};
}
// Remove a device from the multicast group.
rpc RemoveDevice(RemoveDeviceFromMulticastGroupRequest) returns (google.protobuf.Empty) {}
rpc RemoveDevice(RemoveDeviceFromMulticastGroupRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/multicast-groups/{multicast_group_id}/devices/{dev_eui}"
};
}
// Add the given item to the multcast group queue.
rpc Enqueue(EnqueueMulticastGroupQueueItemRequest) returns (EnqueueMulticastGroupQueueItemResponse) {}
rpc Enqueue(EnqueueMulticastGroupQueueItemRequest) returns (EnqueueMulticastGroupQueueItemResponse) {
option(google.api.http) = {
post: "/api/multcast-groups/{queue_item.multicast_group_id}/queue"
body: "*"
};
}
// Flush the queue for the given multicast group.
rpc FlushQueue(FlushMulticastGroupQueueRequest) returns (google.protobuf.Empty) {}
rpc FlushQueue(FlushMulticastGroupQueueRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/multicast-groups/{multicast_group_id}/queue"
};
}
// List the items in the multicast group queue.
rpc ListQueue(ListMulticastGroupQueueRequest) returns (ListMulticastGroupQueueResponse) {}
rpc ListQueue(ListMulticastGroupQueueRequest) returns (ListMulticastGroupQueueResponse) {
option(google.api.http) = {
get: "/api/multicast-groups/{multicast_group_id}/queue"
};
}
}
enum MulticastGroupType {
@ -205,7 +249,7 @@ message MulticastGroupQueueItem {
message EnqueueMulticastGroupQueueItemRequest {
// Multicast queue-item to enqueue.
MulticastGroupQueueItem multicast_group_queue_item = 1;
MulticastGroupQueueItem queue_item = 1;
}
message EnqueueMulticastGroupQueueItemResponse {

View File

@ -2,46 +2,91 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "InternalProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
// TenantService is the service providing API methods for managing tenants.
service TenantService {
// Create a new tenant.
rpc Create(CreateTenantRequest) returns (CreateTenantResponse) {}
rpc Create(CreateTenantRequest) returns (CreateTenantResponse) {
option(google.api.http) = {
post: "/api/tenants"
body: "*"
};
}
// Get the tenant for the given ID.
rpc Get(GetTenantRequest) returns (GetTenantResponse) {}
rpc Get(GetTenantRequest) returns (GetTenantResponse) {
option(google.api.http) = {
get: "/api/tenants/{id}"
};
}
// Update the given tenant.
rpc Update(UpdateTenantRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateTenantRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/tenants/{tenant.id}"
body: "*"
};
}
// Delete the tenant with the given ID.
rpc Delete(DeleteTenantRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteTenantRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/tenants/{id}"
};
}
// Get the list of tenants.
rpc List(ListTenantsRequest) returns (ListTenantsResponse) {}
rpc List(ListTenantsRequest) returns (ListTenantsResponse) {
option(google.api.http) = {
get: "/api/tenants"
};
}
// Add an user to the tenant.
// Note: the user must already exist.
rpc AddUser(AddTenantUserRequest) returns (google.protobuf.Empty) {}
rpc AddUser(AddTenantUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/tenants/{tenant_user.tenant_id}/users"
body: "*"
};
}
// Get the the tenant user for the given tenant and user IDs.
rpc GetUser(GetTenantUserRequest) returns (GetTenantUserResponse) {}
rpc GetUser(GetTenantUserRequest) returns (GetTenantUserResponse) {
option(google.api.http) = {
get: "/api/tenants/{tenant_id}/users/{user_id}"
};
}
// Update the given tenant user.
rpc UpdateUser(UpdateTenantUserRequest) returns (google.protobuf.Empty) {}
rpc UpdateUser(UpdateTenantUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/tenants/{tenant_user.tenant_id}/users/{tenant_user.user_id}"
body: "*"
};
}
// Delete the given tenant user.
rpc DeleteUser(DeleteTenantUserRequest) returns (google.protobuf.Empty) {}
rpc DeleteUser(DeleteTenantUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/tenants/{tenant_id}/users/{user_id}"
};
}
// Get the list of tenant users.
rpc ListUsers(ListTenantUsersRequest) returns (ListTenantUsersResponse) {}
rpc ListUsers(ListTenantUsersRequest) returns (ListTenantUsersResponse) {
option(google.api.http) = {
get: "/api/tenants/{tenant_id}/users"
};
}
}
message Tenant {

View File

@ -2,11 +2,12 @@ syntax = "proto3";
package api;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "UserProto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
@ -14,22 +15,49 @@ import "google/protobuf/empty.proto";
// UserService is the service providing API methods for managing users.
service UserService {
// Create a new user.
rpc Create(CreateUserRequest) returns (CreateUserResponse) {}
rpc Create(CreateUserRequest) returns (CreateUserResponse) {
option(google.api.http) = {
post: "/api/users"
body: "*"
};
}
// Get the user for the given ID.
rpc Get(GetUserRequest) returns (GetUserResponse) {}
rpc Get(GetUserRequest) returns (GetUserResponse) {
option(google.api.http) = {
get: "/api/users/{id}"
};
}
// Update the given user.
rpc Update(UpdateUserRequest) returns (google.protobuf.Empty) {}
rpc Update(UpdateUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
put: "/api/users/{user.id}"
body: "*"
};
}
// Delete the user with the given ID.
rpc Delete(DeleteUserRequest) returns (google.protobuf.Empty) {}
rpc Delete(DeleteUserRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
delete: "/api/users/{id}"
};
}
// Get the list of users.
rpc List(ListUsersRequest) returns (ListUsersResponse) {}
rpc List(ListUsersRequest) returns (ListUsersResponse) {
option(google.api.http) = {
get: "/api/users"
};
}
// Update the password for the given user.
rpc UpdatePassword(UpdateUserPasswordRequest) returns (google.protobuf.Empty) {}
rpc UpdatePassword(UpdateUserPasswordRequest) returns (google.protobuf.Empty) {
option(google.api.http) = {
post: "/api/users/{user_id}/password"
body: "*"
};
}
}
message User {

View File

@ -7,6 +7,8 @@ option java_package = "io.chirpstack.api";
option java_multiple_files = true;
option java_outer_classname = "CommonProto";
import "google/protobuf/timestamp.proto";
enum Modulation {
// LoRa
LORA = 0;
@ -129,6 +131,17 @@ enum LocationSource {
GEO_RESOLVER_WIFI = 6;
}
enum Aggregation {
// Hour.
HOUR = 0;
// Day.
DAY = 1;
// Month.
MONTH = 2;
}
message Location {
// Latitude.
double latitude = 1;
@ -153,3 +166,23 @@ message KeyEnvelope {
// AES key (when the kek_label is set, this value must first be decrypted).
bytes aes_key = 2;
}
message Metric {
// Name.
string name = 1;
// Timestamps.
repeated google.protobuf.Timestamp timestamps = 2;
// Datasets.
repeated MetricDataset datasets = 3;
}
message MetricDataset {
// Label.
string label = 1;
// Data.
// Each value index corresponds with the same timestamp index of the Metric.
repeated float data = 2;
}

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package gw;
option go_package = "github.com/chirpstack/chirpstack-api/go/v4/gw";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/gw";
option java_package = "io.chirpstack.api.gw";
option java_multiple_files = true;
option java_outer_classname = "GatewayProto";
@ -10,8 +10,17 @@ option java_outer_classname = "GatewayProto";
import "chirpstack-api/common/common.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
enum CodeRate {
CR_UNDEFINED = 0;
CR_4_5 = 1;
CR_4_6 = 2;
CR_4_7 = 3;
CR_4_8 = 4;
}
enum DownlinkTiming {
// Send the downlink immediately.
IMMEDIATELY = 0;
@ -23,7 +32,6 @@ enum DownlinkTiming {
GPS_EPOCH = 2;
}
enum FineTimestampType {
// No fine-timestamp available.
NONE = 0;
@ -84,17 +92,17 @@ enum TxAckStatus {
message Modulation {
oneof parameters {
// LoRa modulation information.
LoRaModulationInfo lora = 3 [json_name = "loRa"];
LoraModulationInfo lora = 3;
// FSK modulation information.
FSKModulationInfo fsk = 4;
FskModulationInfo fsk = 4;
// LR-FHSS modulation information.
LRFHSSModulationInfo lr_fhss = 5 [json_name = "lrFHSS"];
LrFhssModulationInfo lr_fhss = 5;
}
}
message UplinkTXInfo {
message UplinkTxInfoLegacy {
// Frequency (Hz).
uint32 frequency = 1;
@ -103,17 +111,25 @@ message UplinkTXInfo {
oneof modulation_info {
// LoRa modulation information.
LoRaModulationInfo lora_modulation_info = 3 [json_name = "loRaModulationInfo"];
LoraModulationInfo lora_modulation_info = 3;
// FSK modulation information.
FSKModulationInfo fsk_modulation_info = 4;
FskModulationInfo fsk_modulation_info = 4;
// LR-FHSS modulation information.
LRFHSSModulationInfo lr_fhss_modulation_info = 5 [json_name = "lrFHSSModulationInfo"];
LrFhssModulationInfo lr_fhss_modulation_info = 5;
}
}
message LoRaModulationInfo {
message UplinkTxInfo {
// Frequency (Hz).
uint32 frequency = 1;
// Modulation.
Modulation modulation = 2;
}
message LoraModulationInfo {
// Bandwidth.
uint32 bandwidth = 1;
@ -121,13 +137,16 @@ message LoRaModulationInfo {
uint32 spreading_factor = 2;
// Code-rate.
string code_rate = 3;
string code_rate_legacy = 3;
// Code-rate.
CodeRate code_rate = 5;
// Polarization inversion.
bool polarization_inversion = 4;
}
message FSKModulationInfo {
message FskModulationInfo {
// Frequency deviation.
uint32 frequency_deviation = 1;
@ -135,7 +154,7 @@ message FSKModulationInfo {
uint32 datarate = 2;
}
message LRFHSSModulationInfo {
message LrFhssModulationInfo {
// Operating channel width (OCW) in Hz.
uint32 operating_channel_width = 1;
@ -151,10 +170,10 @@ message EncryptedFineTimestamp {
uint32 aes_key_index = 1;
// Encrypted 'main' fine-timestamp (ns precision part of the timestamp).
bytes encrypted_ns = 2 [json_name = "encryptedNS"];
bytes encrypted_ns = 2;
// FPGA ID.
bytes fpga_id = 3 [json_name = "fpgaID"];
bytes fpga_id = 3;
}
message PlainFineTimestamp {
@ -164,7 +183,7 @@ message PlainFineTimestamp {
message GatewayStats {
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
bytes gateway_id = 1;
// Gateway IP.
string ip = 9;
@ -183,7 +202,7 @@ message GatewayStats {
uint32 rx_packets_received = 5;
// Number of radio packets received with valid PHY CRC.
uint32 rx_packets_received_ok = 6 [json_name = "rxPacketsReceivedOK"];
uint32 rx_packets_received_ok = 6;
// Number of downlink packets received for transmission.
uint32 tx_packets_received = 7;
@ -196,7 +215,7 @@ message GatewayStats {
// Stats ID (UUID).
// Unique identifier for the gateway stats.
bytes stats_id = 11 [json_name = "statsID"];
bytes stats_id = 11;
// Tx packets per frequency.
map<uint32, uint32> tx_packets_per_frequency = 12;
@ -222,21 +241,21 @@ message PerModulationCount {
uint32 count = 2;
}
message UplinkRXInfo {
message UplinkRxInfoLegacy {
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
bytes gateway_id = 1;
// RX time (only set when the gateway has a GPS module).
google.protobuf.Timestamp time = 2;
// RX time since GPS epoch (only set when the gateway has a GPS module).
google.protobuf.Duration time_since_gps_epoch = 3 [json_name = "timeSinceGPSEpoch"];
google.protobuf.Duration time_since_gps_epoch = 3;
// RSSI.
int32 rssi = 5;
// LoRa SNR.
double lora_snr = 6 [json_name = "loRaSNR"];
double lora_snr = 6;
// Channel.
uint32 channel = 7;
@ -270,19 +289,60 @@ message UplinkRXInfo {
// Uplink ID (UUID bytes).
// Unique and random ID which can be used to correlate the uplink across multiple logs.
bytes uplink_id = 16 [json_name = "uplinkID"];
bytes uplink_id = 16;
// CRC status.
CRCStatus crc_status = 17 [json_name = "crcStatus"];
CRCStatus crc_status = 17;
// Optional meta-data map.
map<string, string> metadata = 18;
}
message DownlinkTXInfo {
message UplinkRxInfo {
// Gateway ID.
string gateway_id = 1;
// Uplink ID.
uint32 uplink_id = 2;
// RX time (only set when the gateway has a GPS module).
google.protobuf.Timestamp time = 3;
// RX time since GPS epoch (only set when the gateway has a GPS module).
google.protobuf.Duration time_since_gps_epoch = 4;
// Fine-timestamp.
// This timestamp can be used for TDOA based geolocation.
google.protobuf.Duration fine_time_since_gps_epoch = 5;
// RSSI.
int32 rssi = 6;
// SNR.
// Note: only available for LoRa modulation.
float snr = 7;
// Board.
uint32 board = 8;
// Antenna.
uint32 antenna = 9;
// Location.
common.Location location = 10;
// Gateway specific context.
// This value must be returned to the gateway on (Class-A) downlink.
bytes context = 11;
// Properties.
google.protobuf.Struct metadata = 12;
}
message DownlinkTxInfoLegacy {
// Gateway ID.
// Deprecated: replaced by gateway_id in DownlinkFrame.
bytes gateway_id = 1 [json_name = "gatewayID"];
bytes gateway_id = 1;
// TX frequency (in Hz).
uint32 frequency = 5;
@ -295,10 +355,10 @@ message DownlinkTXInfo {
oneof modulation_info {
// LoRa modulation information.
LoRaModulationInfo lora_modulation_info = 8 [json_name = "loRaModulationInfo"];
LoraModulationInfo lora_modulation_info = 8;
// FSK modulation information.
FSKModulationInfo fsk_modulation_info = 9;
FskModulationInfo fsk_modulation_info = 9;
}
// The board identifier for emitting the frame.
@ -326,6 +386,43 @@ message DownlinkTXInfo {
bytes context = 16;
}
message DownlinkTxInfo {
// TX frequency (in Hz).
uint32 frequency = 1;
// TX power (in dBm).
int32 power = 2;
// Modulation.
Modulation modulation = 3;
// The board identifier for emitting the frame.
uint32 board = 4;
// The antenna identifier for emitting the frame.
uint32 antenna = 5;
// Timing.
Timing timing = 6;
// Gateway specific context.
// In case of a Class-A downlink, this contains a copy of the uplink context.
bytes context = 7;
}
message Timing {
oneof parameters {
// Immediately timing information.
ImmediatelyTimingInfo immediately = 1;
// Context based delay timing information.
DelayTimingInfo delay = 2;
// GPS Epoch timing information.
GPSEpochTimingInfo gps_epoch = 3;
}
}
message ImmediatelyTimingInfo {
// Not implemented yet.
}
@ -339,18 +436,24 @@ message DelayTimingInfo {
message GPSEpochTimingInfo {
// Duration since GPS Epoch.
google.protobuf.Duration time_since_gps_epoch = 1 [json_name = "timeSinceGPSEpoch"];
google.protobuf.Duration time_since_gps_epoch = 1;
}
message UplinkFrame {
// PHYPayload.
bytes phy_payload = 1;
// TX meta-data.
UplinkTXInfo tx_info = 2;
// TX meta-data (deprecated).
UplinkTxInfoLegacy tx_info_legacy = 2;
// RX meta-data.
UplinkRXInfo rx_info = 3;
// RX meta-data (deprecated).
UplinkRxInfoLegacy rx_info_legacy = 3;
// Tx meta-data.
UplinkTxInfo tx_info = 4;
// Rx meta-data.
UplinkRxInfo rx_info = 5;
}
message UplinkFrameSet {
@ -358,27 +461,19 @@ message UplinkFrameSet {
bytes phy_payload = 1;
// TX meta-data.
UplinkTXInfo tx_info = 2;
UplinkTxInfo tx_info = 2;
// RX meta-data set.
repeated UplinkRXInfo rx_info = 3;
repeated UplinkRxInfo rx_info = 3;
}
message DownlinkFrame {
// PHYPayload.
// Deprecated: replaced by items.
bytes phy_payload = 1;
// TX meta-data.
// Deprecated: replaced by items.
DownlinkTXInfo tx_info = 2;
// Token (uint16 value).
// Deprecated: replaced by downlink_id.
uint32 token = 3;
// Downlink ID.
uint32 downlink_id = 3;
// Downlink ID (UUID).
bytes downlink_id = 4 [json_name = "downlinkID"];
// Deprecated: use downlink_id.
bytes downlink_id_legacy = 4;
// Downlink frame items.
// This makes it possible to send multiple downlink opportunities to the
@ -388,47 +483,52 @@ message DownlinkFrame {
repeated DownlinkFrameItem items = 5;
// Gateway ID.
bytes gateway_id = 6 [json_name = "gatewayID"];
// Deprecated: use gateway_id
bytes gateway_id_legacy = 6;
// Gateway ID.
string gateway_id = 7;
}
message DownlinkFrameItem {
// PHYPayload.
bytes phy_payload = 1;
// TX meta-data.
DownlinkTXInfo tx_info = 2;
// TX meta-data (deprecated).
DownlinkTxInfoLegacy tx_info_legacy = 2;
// Tx meta-data.
DownlinkTxInfo tx_info = 3;
}
message DownlinkTXAck {
message DownlinkTxAck {
// Gateway ID (deprecated).
bytes gateway_id_legacy = 1;
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
string gateway_id = 6;
// Token (uint16 value).
// Deprecated: replaced by downlink_id.
uint32 token = 2;
// Downlink ID.
uint32 downlink_id = 2;
// Error.
// Deprecated: replaced by items.
string error = 3;
// Downlink ID (UUID).
bytes downlink_id = 4 [json_name = "downlinkID"];
// Downlink ID (deprecated).
bytes downlink_id_legacy = 4;
// Downlink frame items.
// This list has the same length as the request and indicates which
// downlink frame has been emitted of the requested list (or why it failed).
// Note that at most one item has a positive acknowledgement.
repeated DownlinkTXAckItem items = 5;
repeated DownlinkTxAckItem items = 5;
}
message DownlinkTXAckItem {
message DownlinkTxAckItem {
// The Ack status of this item.
TxAckStatus status = 1;
}
message GatewayConfiguration {
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
bytes gateway_id = 1;
// Configuration version.
string version = 2;
@ -449,7 +549,7 @@ message ChannelConfiguration {
oneof modulation_config {
// LoRa modulation config.
LoRaModulationConfig lora_modulation_config = 3 [json_name = "loRaModulationConfig"];
LoRaModulationConfig lora_modulation_config = 3;
// FSK modulation config.
FSKModulationConfig fsk_modulation_config = 4;
@ -480,7 +580,7 @@ message FSKModulationConfig {
message GatewayCommandExecRequest {
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
bytes gateway_id = 1;
// Command to execute.
// This command must be pre-configured in the LoRa Gateway Bridge configuration.
@ -489,7 +589,7 @@ message GatewayCommandExecRequest {
// Execution request ID (UUID).
// The same token will be returned when the execution of the command has
// completed.
bytes ExecId = 3 [json_name = "execID"];
bytes ExecId = 3;
// Standard input.
bytes stdin = 4;
@ -500,10 +600,10 @@ message GatewayCommandExecRequest {
message GatewayCommandExecResponse {
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
bytes gateway_id = 1;
// Execution request ID (UUID).
bytes exec_id = 2 [json_name = "execID"];
bytes exec_id = 2;
// Standard output.
bytes stdout = 3;
@ -520,10 +620,10 @@ message GatewayCommandExecResponse {
// integrated with the ChirpStack Gateway Bridge.
message RawPacketForwarderEvent {
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
bytes gateway_id = 1;
// Raw ID (UUID).
bytes raw_id = 2 [json_name = "rawID"];
bytes raw_id = 2;
// Payload contains the raw payload.
bytes payload = 3;
@ -534,10 +634,10 @@ message RawPacketForwarderEvent {
// integrated with the ChirpStack Gateway Bridge.
message RawPacketForwarderCommand {
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
bytes gateway_id = 1;
// Raw ID (UUID).
bytes raw_id = 2 [json_name = "rawID"];
bytes raw_id = 2;
// Payload contains the raw payload.
bytes payload = 3;
@ -546,7 +646,7 @@ message RawPacketForwarderCommand {
// ConnState contains the connection state of a gateway.
message ConnState {
// Gateway ID.
bytes gateway_id = 1 [json_name = "gatewayID"];
bytes gateway_id = 1;
enum State {
OFFLINE = 0;

View File

@ -1,202 +0,0 @@
syntax = "proto3";
package gw;
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/gw";
option java_package = "io.chirpstack.api.gw";
option java_multiple_files = true;
option java_outer_classname = "GatewayProto";
import "chirpstack-api/common/common.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
enum CodeRate {
CR_UNDEFINED = 0;
CR_4_5 = 1;
CR_4_6 = 2;
CR_4_7 = 3;
CR_4_8 = 4;
}
message UplinkFrame {
// PHYPayload.
bytes phy_payload = 1;
// TX meta-data.
UplinkTxParams tx_params = 2;
// RX meta-data.
UplinkRxParams rx_params = 3;
}
message DownlinkFrame {
// Gateway ID.
string gateway_id = 1;
// Downlink ID.
uint32 downlink_id = 2;
// Downlink frame items.
// This makes it possible to send multiple downlink opportunities to the
// gateway at once (e.g. RX1 and RX2 in LoRaWAN). The first item has the
// highest priority, the last the lowest. The gateway will emit at most
// one item.
repeated DownlinkFrameItem items = 3;
}
message UplinkTxParams {
// Frequency (Hz).
uint32 frequency = 1;
// Modulation.
Modulation modulation = 2;
}
message Modulation {
oneof parameters {
// LoRa.
LoraModulationParams lora = 1;
// FSK.
FskModulationParams fsk = 2;
// LR-FHSS.
LrFhssModulationParams lr_fhss = 3;
}
}
message LoraModulationParams {
// Bandwidth (Hz).
uint32 bandwidth = 1;
// Spreading-factor.
uint32 spreading_factor = 2;
// Polarization inversion.
bool polarization_inversion = 3;
// Code-rate.
CodeRate code_rate = 4;
}
message FskModulationParams {
// Frequency deviation.
uint32 frequency_deviation = 1;
// FSK datarate (bits / sec).
uint32 datarate = 2;
}
message LrFhssModulationParams {
// Operating channel width (OCW) in Hz.
uint32 operating_channel_width = 1;
// Code-rate.
CodeRate code_rate = 2;
// Hopping grid number of steps.
uint32 grid_steps = 3;
}
message UplinkRxParams {
// Gateway ID (EUI).
string gateway_id = 1;
// Uplink ID (UUID).
uint32 uplink_id = 2;
// Rx time.
google.protobuf.Timestamp time = 3;
// RX time since GPS epoch (only set when the gateway has a GPS module).
google.protobuf.Duration time_since_gps_epoch = 4;
// Fine-timestamp.
// This timestamp can be used for TDOA based geolocation.
google.protobuf.Duration fine_time_since_gps_epoch = 5;
// RSSI.
int32 rssi = 6;
// SNR.
// Note: only available for LoRa modulation.
float snr = 7;
// Board.
uint32 board = 8;
// Antenna.
uint32 antenna = 9;
// Location.
common.Location location = 10;
// Gateway specific context.
// This value must be returned to the gateway on (Class-A) downlink.
bytes context = 11;
// Properties.
google.protobuf.Struct properties = 12;
}
message DownlinkFrameItem {
// PHYPayload.
bytes phy_payload = 1;
// Tx parameters.
DownlinkTxParams tx_params = 2;
}
message DownlinkTxParams {
// Tx frequency (Hz).
uint32 frequency = 1;
// Tx power (dBm).
int32 power = 2;
// Modulation.
Modulation modulation = 3;
// The board identifier for emitting the frame.
uint32 board = 4;
// The antenna identifier for emitting the frame.
uint32 antenna = 5;
// Downlink timing.
DownlinkTiming timing = 6;
// Gateway specific context.
// In case of a Class-A downlink, this must contain a copy of the uplink context.
bytes context = 7;
}
message DownlinkTiming {
oneof parameters {
// Immediately timing information.
DownlinkTimingImmediately immediately = 1;
// Delay timing information.
DownlinkTimingDelay delay = 2;
// GPS epoch timing information.
DownlinkTimingGpsEpoch gps_epoch = 3;
}
}
message DownlinkTimingImmediately {
// No fields implemented yet.
}
message DownlinkTimingDelay {
// Delay relative to provided context.
google.protobuf.Duration delay = 1;
}
message DownlinkTimingGpsEpoch {
// Duration since GPS epoch.
google.protobuf.Duration time_since_gps_epoch = 1;
}

View File

@ -104,7 +104,7 @@ message UplinkEvent {
uint32 dr = 6;
// Frame counter.
uint32 f_cnt_up = 7;
uint32 f_cnt = 7;
// Frame port.
uint32 f_port = 8;
@ -119,10 +119,10 @@ message UplinkEvent {
google.protobuf.Struct object = 11;
// Receiving gateway RX info.
repeated gw.UplinkRXInfo rx_info = 12;
repeated gw.UplinkRxInfo rx_info = 12;
// TX info.
gw.UplinkTXInfo tx_info = 13;
gw.UplinkTxInfo tx_info = 13;
}
// JoinEvent is the message sent when a device joined the network.
@ -167,8 +167,8 @@ message AckEvent {
// 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 {
// Downlink ID (UUID).
string downlink_id = 1;
// Downlink ID.
uint32 downlink_id = 1;
// Timestamp.
google.protobuf.Timestamp time = 2;
@ -186,31 +186,28 @@ message TxAckEvent {
string gateway_id = 6;
// TX info.
gw.DownlinkTXInfo tx_info = 7;
gw.DownlinkTxInfo tx_info = 7;
}
// LogEvent is the message sent when a device-related log was sent.
message LogEvent {
// Deduplication ID (UUID).
string deduplication_id = 1;
// Timestamp.
google.protobuf.Timestamp time = 2;
google.protobuf.Timestamp time = 1;
// Device info.
DeviceInfo device_info = 3;
DeviceInfo device_info = 2;
// Log level.
LogLevel level = 4;
LogLevel level = 3;
// Log code.
LogCode code = 5;
LogCode code = 4;
// Description message.
string description = 6;
string description = 5;
// Context map.
map<string, string> context = 7;
map<string, string> context = 6;
}
// StatusEvent is the message sent when a device-status mac-command was sent
@ -276,3 +273,28 @@ message IntegrationEvent {
// Struct containing the event object.
google.protobuf.Struct object = 6;
}
// 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;
// Device EUI (EUI64).
string dev_eui = 2;
// Confirmed.
bool confirmed = 3;
// FPort (must be > 0).
uint32 f_port = 4;
// Data.
// Or use the json_object field when a codec has been configured.
bytes data = 5;
// Only use this when a codec has been configured that can encode this
// object to bytes.
google.protobuf.Struct object = 6;
}

View File

@ -199,8 +199,8 @@ message DeviceGatewayRxInfoItem {
}
message DownlinkFrame {
// Downlink ID (UUID).
bytes downlink_id = 1;
// Downlink ID.
uint32 downlink_id = 1;
// DevEUI.
bytes dev_eui = 2;
@ -231,5 +231,36 @@ message LoraCloudGeolocBuffer {
message LoraCloudGeolocBufferUplink {
// RxInfo set for a single uplink.
repeated gw.UplinkRXInfo rx_info = 1;
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;
}

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package meta;
option go_package = "github.com/chirpstack/chirpstack-api/go/v4/meta";
option go_package = "github.com/chirpstack/chirpstack/api/go/v4/meta";
option java_package = "io.chirpstack.api.meta";
option java_multiple_files = true;
option java_outer_classname = "MetaProto";
@ -16,10 +16,10 @@ message UplinkMeta {
string dev_eui = 1;
// TX meta-data.
gw.UplinkTXInfo tx_info = 2;
gw.UplinkTxInfo tx_info = 2;
// RX meta-data.
repeated gw.UplinkRXInfo rx_info = 3;
repeated gw.UplinkRxInfo rx_info = 3;
// PHYPayload byte count.
uint32 phy_payload_byte_count = 4;
@ -42,7 +42,7 @@ message DownlinkMeta {
string multicast_group_id = 2;
// TX meta-data.
gw.DownlinkTXInfo tx_info = 3;
gw.DownlinkTxInfo tx_info = 3;
// PHYPayload byte count.
uint32 phy_payload_byte_count = 4;