• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto2";
16
17package rootcanal.configuration;
18option optimize_for = CODE_SIZE;
19
20enum ControllerPreset {
21  // Version 5.3, all features enabled, all quirks disabled.
22  DEFAULT = 0;
23  // Official PTS dongle, Laird BL654.
24  LAIRD_BL654 = 1;
25  // Official PTS dongle, CSR rck.
26  CSR_RCK_PTS_DONGLE = 2;
27  // Official PTS dongle, Intel BE200.
28  INTEL_BE200 = 3;
29}
30
31message ControllerFeatures {
32  optional bool le_extended_advertising = 1;
33  optional bool le_periodic_advertising = 2;
34  optional bool ll_privacy = 3;
35  optional bool le_2m_phy = 4;
36  optional bool le_coded_phy = 5;
37  // Enable the support for both LL Connected Isochronous Stream Central
38  // and LL Connected Isochronous Stream Peripheral.
39  optional bool le_connected_isochronous_stream = 6;
40}
41
42message ControllerQuirks {
43  // Randomly send ACL payloads before the Connection Complete event
44  // is sent to the Host stack.
45  optional bool send_acl_data_before_connection_complete = 1;
46  // Configure a default value for the LE random address.
47  optional bool has_default_random_address = 2;
48  // Send an Hardware Error event if any command is called before HCI Reset.
49  optional bool hardware_error_before_reset = 3;
50}
51
52message VendorFeatures {
53  // Enable the support for the CSR vendor command.
54  optional bool csr = 1;
55  // Enable the support for Android vendor commands.
56  // Note: not all required vendor commands are necessarily implemented
57  // in RootCanal, unimplemented commands will return a Command Status or
58  // Command Complete HCI event with the status Unsupported Opcode.
59  optional bool android = 2;
60}
61
62message Controller {
63  // Configure the controller preset. Presets come with a pre-selection
64  // of features and quirks, but these can be overridden with the next fields.
65  optional ControllerPreset preset = 1;
66  // Configure support for controller features.
67  optional ControllerFeatures features = 2;
68  // Enable controller quirks.
69  // Quirks are behaviors observed in real controllers that are not valid
70  // according to the specification.
71  optional ControllerQuirks quirks = 3;
72  // Enable strict mode (defaults to enabled).
73  // Activate assertion checks in RootCanal for missing RootCanal features
74  // or Host stack misbehavior.
75  optional bool strict = 4;
76  // Configure support for vendor features.
77  optional VendorFeatures vendor = 5;
78}
79
80message TcpServer {
81  // Configure the TCP port on which the controller with this defined
82  // configuration will be served.
83  required int32 tcp_port = 1;
84  // Controller configuration for this port.
85  optional Controller configuration = 2;
86}
87
88message Configuration {
89  repeated TcpServer tcp_server = 1;
90}
91