syndilights/open-lighting-architecture/ola-0.8.4/common/protocol/Ola.proto

243 lines
5.9 KiB
Protocol Buffer

/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Ola.proto
* Defines the protocol buffers used to talk to olad
* Copyright (C) 2005 - 2008 Simon Newton
*/
package ola.proto;
enum RegisterAction {
REGISTER = 1;
UNREGISTER = 2;
}
enum PatchAction {
PATCH = 1;
UNPATCH = 2;
}
enum MergeMode {
HTP = 1;
LTP = 2;
}
enum PluginIds {
OLA_PLUGIN_ALL = 0;
OLA_PLUGIN_DUMMY = 1;
OLA_PLUGIN_ARTNET = 2;
OLA_PLUGIN_SHOWNET = 3;
OLA_PLUGIN_ESPNET = 4;
OLA_PLUGIN_USBPRO = 5;
OLA_PLUGIN_OPENDMX = 6;
OLA_PLUGIN_SANDNET = 7;
OLA_PLUGIN_STAGEPROFI = 8;
OLA_PLUGIN_PATHPORT = 9;
OLA_PLUGIN_DMX4LINUX = 10;
OLA_PLUGIN_E131 = 11;
OLA_PLUGIN_USBDMX = 12;
}
// This is a special string which indicates that no response will be received
// for an RPC.
message STREAMING_NO_RESPONSE {}
// Generic Ack Message
message Ack {}
// request the list of available plugins
message PluginListRequest {}
message PluginInfo {
required int32 plugin_id = 1;
required string name = 2;
}
message PluginListReply {
repeated PluginInfo plugin = 1;
}
// request the description for a plugin
message PluginDescriptionRequest {
required int32 plugin_id = 1;
}
message PluginDescriptionReply {
required string name = 1;
required string description = 2;
}
// request info on a device
message DeviceInfoRequest {
optional int32 plugin_id = 1;
}
message PortInfo {
required int32 port_id = 1;
required int32 priority_capability = 2;
required string description = 5;
optional int32 universe = 3;
optional bool active = 4;
optional int32 priority_mode = 6;
optional int32 priority = 7;
}
message DeviceInfo {
required int32 device_alias = 1;
required int32 plugin_id = 2;
required string device_name = 3;
repeated PortInfo input_port = 4;
repeated PortInfo output_port = 5;
required string device_id = 6;
}
message DeviceInfoReply {
repeated DeviceInfo device = 1;
}
message DmxData {
required int32 universe = 1;
required bytes data = 2;
optional int32 priority = 3;
}
message RegisterDmxRequest {
required int32 universe = 1;
required RegisterAction action = 2;
}
message PatchPortRequest {
required int32 universe = 1;
required int32 device_alias = 2;
required int32 port_id = 3;
required PatchAction action = 4;
required bool is_output = 5;
}
message UniverseNameRequest {
required int32 universe = 1;
required string name = 2;
}
message MergeModeRequest {
required int32 universe = 1;
required MergeMode merge_mode = 2;
}
// request info about a universe
message OptionalUniverseRequest {
optional int32 universe = 1;
}
message UniverseInfo {
required int32 universe = 1;
required string name = 2;
required MergeMode merge_mode = 3;
required int32 input_port_count = 4;
required int32 output_port_count = 5;
required int32 rdm_devices = 6;
}
message UniverseInfoReply {
repeated UniverseInfo universe = 1;
}
message PortPriorityRequest {
required int32 device_alias = 1;
required bool is_output = 2;
required int32 port_id = 3;
required int32 priority_mode = 4;
optional int32 priority = 5;
}
// a device config request
message DeviceConfigRequest {
required int32 device_alias = 1;
required bytes data = 2;
}
message DeviceConfigReply {
required bytes data = 1;
}
// RDM Messages
// This represents a UID
message UID {
required int32 esta_id = 1; // only lower 2 bytes are used
required fixed32 device_id = 2;
}
// Request the UID list for a universe
message UniverseRequest {
required int32 universe = 1;
}
message UIDListReply {
required int32 universe = 1;
repeated UID uid = 2;
}
message RDMRequest {
required int32 universe = 1;
required UID uid = 2;
required int32 sub_device = 3;
required int32 param_id = 4;
required bytes data = 5; // 0 - 231 bytes
required bool is_set = 6;
}
message RDMResponse {
required bool was_broadcast = 1;
required uint32 response_code = 2;
required uint32 message_count = 3;
required bytes data = 4; // 0 - 231 bytes
}
// Services
// RPCs handled by the OLA Server
service OlaServerService {
rpc GetPlugins (PluginListRequest) returns (PluginListReply);
rpc GetPluginDescription (PluginDescriptionRequest) returns
(PluginDescriptionReply);
rpc GetDeviceInfo (DeviceInfoRequest) returns (DeviceInfoReply);
rpc GetCandidatePorts (OptionalUniverseRequest) returns (DeviceInfoReply);
rpc ConfigureDevice (DeviceConfigRequest) returns (DeviceConfigReply);
rpc SetPortPriority (PortPriorityRequest) returns (Ack);
rpc GetUniverseInfo (OptionalUniverseRequest) returns (UniverseInfoReply);
rpc SetUniverseName (UniverseNameRequest) returns (Ack);
rpc SetMergeMode (MergeModeRequest) returns (Ack);
rpc PatchPort (PatchPortRequest) returns (Ack);
rpc RegisterForDmx (RegisterDmxRequest) returns (Ack);
rpc UpdateDmxData (DmxData) returns (Ack);
rpc GetDmx (UniverseRequest) returns (DmxData);
rpc GetUIDs (UniverseRequest) returns (UIDListReply);
rpc ForceDiscovery (UniverseRequest) returns (Ack);
rpc SetSourceUID (UID) returns (Ack);
rpc RDMCommand (RDMRequest) returns (RDMResponse);
rpc StreamDmxData (DmxData) returns (STREAMING_NO_RESPONSE);
}
// RPCs handled by the OLA Client
service OlaClientService {
rpc UpdateDmxData (DmxData) returns (Ack);
}