1syntax = "proto3";
2
3package pandora;
4
5option java_outer_classname = "HidProto";
6
7import "google/protobuf/empty.proto";
8
9service HID {
10  // Connect HID Host
11  rpc ConnectHost(google.protobuf.Empty) returns (google.protobuf.Empty);
12  // Disconnect HID Host
13  rpc DisconnectHost(google.protobuf.Empty) returns (google.protobuf.Empty);
14  // Virtual Cable Unplug HID Host
15  rpc VirtualCableUnplugHost(google.protobuf.Empty) returns (google.protobuf.Empty);
16  // Send a SET_REPORT command, acting as a HID host, to a connected HID device
17  rpc SendHostReport(SendHostReportRequest) returns (SendHostReportResponse);
18  // receive Protocol Mode Event
19  rpc OnSetProtocolMode(google.protobuf.Empty) returns (stream ProtocolModeEvent);
20  // receive Report Event
21  rpc OnSetReport(google.protobuf.Empty) returns (stream ReportEvent);
22}
23// Enum values match those in BluetoothHidHost.java
24enum HidReportType {
25  HID_REPORT_TYPE_UNSPECIFIED = 0;
26  HID_REPORT_TYPE_INPUT = 1;
27  HID_REPORT_TYPE_OUTPUT = 2;
28  HID_REPORT_TYPE_FEATURE = 3;
29}
30// Enum values match those in BluetoothHidHost.java
31enum ProtocolMode {
32  PROTOCOL_REPORT_MODE = 0;
33  PROTOCOL_BOOT_MODE = 1;
34  PROTOCOL_UNSUPPORTED_MODE = 255;
35}
36enum HidReportId {
37  HID_KEYBD_RPT_ID = 0;
38  HID_MOUSE_RPT_ID = 1;
39  HID_INVALID_RPT_ID = 3;
40}
41
42message SendHostReportRequest {
43  bytes address = 1;
44  HidReportType report_type = 2;
45  string report = 3;
46}
47
48message SendHostReportResponse {
49
50}
51
52message ProtocolModeEvent {
53  ProtocolMode protocol_mode = 1;
54}
55
56message ReportEvent {
57  HidReportType report_type = 1;
58  HidReportId report_id = 2;
59  string report_data = 3;
60}
61