summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/pairing.gypi12
-rw-r--r--components/pairing/BUILD.gn10
-rw-r--r--components/pairing/pairing_api.proto80
3 files changed, 102 insertions, 0 deletions
diff --git a/components/pairing.gypi b/components/pairing.gypi
index e6756c6..b6c00ff 100644
--- a/components/pairing.gypi
+++ b/components/pairing.gypi
@@ -11,6 +11,7 @@
'..',
],
'dependencies': [
+ 'pairing_api_proto',
'../base/base.gyp:base',
'../device/bluetooth/bluetooth.gyp:device_bluetooth',
],
@@ -25,5 +26,16 @@
'pairing/host_pairing_controller.h',
],
},
+ {
+ # Protobuf compiler / generator for the pairing api protocol buffer.
+ 'target_name': 'pairing_api_proto',
+ 'type': 'static_library',
+ 'sources': [ 'pairing/pairing_api.proto' ],
+ 'variables': {
+ 'proto_in_dir': 'pairing',
+ 'proto_out_dir': 'components/pairing',
+ },
+ 'includes': [ '../build/protoc.gypi' ]
+ },
],
}
diff --git a/components/pairing/BUILD.gn b/components/pairing/BUILD.gn
index 5022bc5..af7b979 100644
--- a/components/pairing/BUILD.gn
+++ b/components/pairing/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//third_party/protobuf/proto_library.gni")
+
source_set("pairing") {
sources = [
"pairing/fake_controller_pairing_controller.cc",
@@ -19,3 +21,11 @@ source_set("pairing") {
"//device/bluetooth",
]
}
+
+proto_library("proto") {
+ sources = [
+ "pairing_api.proto",
+ ]
+ 'proto_in_dir' = 'pairing'
+ 'proto_out_dir' = 'components/pairing'
+}
diff --git a/components/pairing/pairing_api.proto b/components/pairing/pairing_api.proto
new file mode 100644
index 0000000..98eab7a
--- /dev/null
+++ b/components/pairing/pairing_api.proto
@@ -0,0 +1,80 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Protocol buffer definitions for Syncable FileSystem.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package pairing_api;
+
+message HostStatusParameters {
+ enum Connectivity {
+ CONNECTIVITY_UNTESTED = 0;
+ CONNECTIVITY_NONE = 1;
+ CONNECTIVITY_LIMITED = 2;
+ CONNECTIVITY_CONNECTING = 3;
+ CONNECTIVITY_CONNECTED = 4;
+ }
+
+ enum UpdateStatus {
+ UPDATE_STATUS_UNKNOWN = 0;
+ UPDATE_STATUS_UPDATING = 1;
+ UPDATE_STATUS_REBOOTING = 2;
+ UPDATE_STATUS_UPDATED = 3;
+ }
+
+ optional string domain = 1;
+ optional Connectivity connectivity = 2;
+ optional UpdateStatus update_status = 3;
+ repeated string paired_controllers = 4;
+}
+
+message HostStatus {
+ optional int32 api_version = 1;
+ optional HostStatusParameters parameters = 2;
+}
+
+message ConfigureHostParameters {
+ optional bool accepted_eula = 1;
+ optional string lang = 2;
+ optional string timezone = 3;
+ optional bool send_reports = 4;
+ optional string keyboard_layout = 5;
+}
+
+message ConfigureHost {
+ optional int32 api_version = 1;
+ optional ConfigureHostParameters parameters = 2;
+}
+
+message PairDevicesParameters {
+ optional string controller_access_token = 1;
+ optional string admin_access_token = 2;
+}
+
+message PairDevices {
+ optional int32 api_version = 1;
+ optional PairDevicesParameters parameters = 2;
+}
+
+message CompleteSetupParameters {
+ optional bool add_another = 1;
+}
+
+message CompleteSetup {
+ optional int32 api_version = 1;
+ optional CompleteSetupParameters parameters = 2;
+}
+
+message ErrorParameters {
+ optional int32 code = 1;
+ optional string description = 2;
+}
+
+message Error {
+ optional int32 api_version = 1;
+ optional ErrorParameters parameters = 2;
+}