| syntax = "proto3"; |
| |
| option java_outer_classname = "ManagerProto"; |
| |
| package blueship; |
| |
| import "google/protobuf/empty.proto"; |
| import "blueship/audio.proto"; |
| |
| service Manager { |
| // Reset the gRPC server to the default state. |
| rpc ResetServer(google.protobuf.Empty) returns (google.protobuf.Empty); |
| // Restart the gRPC server with the specified configurations |
| // after clearing existing states and configurations. |
| rpc RestartServer(RestartServerRequest) returns (RestartServerResponse); |
| // Read the current applied configurations |
| rpc ReadConfig(google.protobuf.Empty) returns (ReadConfigResponse); |
| // Returns True/False if the given config is supported by the bluetooth |
| // device. |
| rpc IsConfigOK(IsConfigOKRequest) returns (IsConfigOKResonse); |
| // Returns true or false, which indicates server readiness. |
| rpc IsServerReady(google.protobuf.Empty) returns (IsServerReadyResponse); |
| } |
| |
| message APIConfig { |
| ConfigVariant support_api_version = 1; // string |
| } |
| |
| enum IOCapability { |
| IO_CAPABILITY_UNKNOWN = 0; |
| IO_CAPABILITY_DISPLAY_ONLY = 1; |
| IO_CAPABILITY_DISPLAY_YES_NO = 2; |
| IO_CAPABILITY_KEYBOARD_ONLY = 3; |
| IO_CAPABILITY_NO_INPUT_NO_OUTPUT = 4; |
| IO_CAPABILITY_KEYBOARD_DISPLAY = 5; |
| } |
| |
| enum DeviceCategory { |
| DEVICE_CATEGORY_UNKNOWN = 0; |
| DEVICE_CATEGORY_AUDIO = 1; |
| DEVICE_CATEGORY_KEYBOARD = 2; |
| DEVICE_CATEGORY_MOUSE = 3; |
| DEVICE_CATEGORY_PHONE = 4; |
| DEVICE_CATEGORY_DEV_KIT = 5; |
| DEVICE_CATEGORY_NOT_CONFIGURED = 255; |
| } |
| |
| enum SecureConnections { |
| SECURE_CONNECTIONS_UNKNOWN = 0; |
| SECURE_CONNECTIONS_OFF = 1; |
| SECURE_CONNECTIONS_ON = 2; |
| SECURE_CONNECTIONS_ONLY = 3; |
| } |
| |
| enum LinkMode { |
| LINK_MODE_NONE = 0; |
| LINK_MODE_ACCEPT = 1; |
| LINK_MODE_MASTER = 2; |
| LINK_MODE_AUTH = 3; |
| LINK_MODE_ENCRYPT = 4; |
| LINK_MODE_TRUSTED = 5; |
| LINK_MODE_RELIABLE = 6; |
| LINK_MODE_SECURE = 7; |
| } |
| |
| message DeviceInfoConfig { |
| ConfigVariant mac_address = 1; // string |
| ConfigVariant name = 2; // string |
| ConfigVariant io_capability = 3; // IOCapability |
| ConfigVariant class_of_device = 4; // int32 |
| ConfigVariant category = 5; // DeviceCategory |
| ConfigVariant supported_profiles = 6; // RepeatedString |
| } |
| |
| message ControllerConfig { |
| ConfigVariant support_classic = 1; // bool |
| ConfigVariant support_le = 2; // bool |
| ConfigVariant support_le_ext_scan = 10; // bool |
| } |
| |
| message SecurityConfig { |
| ConfigVariant pin = 1; // string |
| ConfigVariant secure_connections = 2; // SecureConnections |
| ConfigVariant secure_simple_pairing = 3; // bool |
| ConfigVariant link_mode = 4; // LinkMode |
| } |
| |
| message AudioConfig { |
| ConfigVariant supported_codecs = 1; // RepeatedCodec |
| ConfigVariant supported_player_commands = 2; // RepeatedPlayerCommands |
| } |
| |
| enum Codec { |
| CODEC_UNKNOWN = 0; |
| /* A2DP Codec */ |
| CODEC_SBC = 1; |
| CODEC_AAC = 2; |
| CODEC_APTX = 3; |
| CODEC_LDAC = 4; |
| CODEC_LC3 = 5; |
| /* HFP Codec */ |
| CODEC_MSBC = 101; |
| CODEC_CVSD = 102; |
| } |
| |
| message RepeatedString { repeated string string_list = 1; } |
| |
| message RepeatedCodec { repeated Codec codec_list = 1; } |
| |
| message RepeatedPlayerCommands { repeated PlayerCmd player_cmd_list = 1; } |
| |
| message DevKitConfig { |
| ConfigVariant rfcomm_services = 1; // RepeatedRfcommService |
| } |
| |
| enum RfcommService { |
| UNKNOWN_SERVICE = 0; |
| ECHO_SERVICE = 1; |
| MAP_SERVICE = 2; |
| PBAP_SERVICE = 3; |
| } |
| |
| message RepeatedRfcommService { repeated RfcommService service_list = 1; } |
| |
| message ConfigVariant { |
| bool writable = 1; |
| |
| oneof value { |
| // Built-in types |
| string string_value = 2; |
| bytes bytes_value = 3; |
| bool bool_value = 4; |
| int32 int32_value = 5; |
| // Enum |
| IOCapability io_capability = 101; |
| DeviceCategory device_category = 102; |
| SecureConnections secure_connections = 103; |
| LinkMode link_mode = 104; |
| // Message |
| RepeatedString string_list = 201; |
| RepeatedCodec codec_list = 202; |
| RepeatedPlayerCommands player_cmd_list = 203; |
| RepeatedRfcommService service_list = 204; |
| } |
| } |
| |
| // TODO: Make the fields optional to allow clients to update a subset of |
| // configurations. This is currently not doable because the generator script |
| // is too old and we are not able to update it because of python version in pi. |
| message Configuration { |
| APIConfig api = 1; |
| DeviceInfoConfig device = 2; |
| ControllerConfig controller = 3; |
| SecurityConfig security = 4; |
| AudioConfig audio = 5; |
| DevKitConfig devkit = 6; |
| } |
| |
| message RestartServerRequest { Configuration next_config = 1; } |
| |
| message RestartServerResponse { bool success = 1; } |
| |
| message ReadConfigResponse { Configuration config = 1; } |
| |
| message IsConfigOKRequest { Configuration config = 1; } |
| |
| message IsConfigOKResonse { bool ok = 1; } |
| |
| message IsServerReadyResponse { bool value = 1; } |