Skip to content

Commit 116e338

Browse files
committed
Add RFCOMM service
1 parent ab8427a commit 116e338

1 file changed

Lines changed: 117 additions & 0 deletions

File tree

pandora/rfcomm.proto

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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+
15+
syntax = "proto3";
16+
17+
package pandora.rfcomm;
18+
19+
import "google/protobuf/any.proto";
20+
import "google/protobuf/empty.proto";
21+
import "pandora/host.proto";
22+
23+
option java_outer_classname = "RFCOMMProto";
24+
25+
service RFCOMM {
26+
// Establish an RFCOMM channel on an ACL connection.
27+
rpc Connect(ConnectRequest) returns (ConnectResponse);
28+
// Wait and accept incoming RFCOMM channels on an ACL connection.
29+
rpc OnConnection(OnConnectionRequest) returns (stream OnConnectionResponse);
30+
// Disconnect an RFCOMM channel.
31+
rpc Disconnect(DisconnectRequest) returns (DisconnectResponse);
32+
// Wait an RFCOMM channel to be disconnected.
33+
rpc WaitDisconnection(WaitDisconnectionRequest)
34+
returns (WaitDisconnectionResponse);
35+
// Receive data from an RFCOMM channel.
36+
rpc Receive(ReceiveRequest) returns (stream ReceiveResponse);
37+
// Send data to an RFCOMM channel.
38+
rpc Send(SendRequest) returns (SendResponse);
39+
}
40+
41+
message Channel {
42+
google.protobuf.Any cookie = 1;
43+
}
44+
45+
message ConnectRequest {
46+
// BR/EDR connection.
47+
Connection connection = 1;
48+
oneof type {
49+
// Connect to the given RFCOMM server channel
50+
uint32 channel = 2;
51+
// Discover service with the given UUID, and connect to its included channel
52+
string uuid = 3;
53+
}
54+
}
55+
56+
message ConnectResponse {
57+
oneof result {
58+
Channel channel = 1;
59+
}
60+
}
61+
62+
message OnConnectionRequest {
63+
// BR/EDR connection.
64+
Connection connection = 1;
65+
oneof type {
66+
// Listen on the given RFCOMM server channel
67+
uint32 channel = 2;
68+
// Register SDP entries with given UUID, and allocate an RFCOMM server
69+
// channel
70+
string uuid = 3;
71+
}
72+
}
73+
74+
message OnConnectionResponse {
75+
oneof result {
76+
Channel channel = 1;
77+
}
78+
}
79+
80+
message DisconnectRequest {
81+
Channel channel = 1;
82+
}
83+
84+
message DisconnectResponse {
85+
oneof result {
86+
google.protobuf.Empty success = 1;
87+
}
88+
}
89+
90+
message WaitDisconnectionRequest {
91+
Channel channel = 1;
92+
}
93+
94+
message WaitDisconnectionResponse {
95+
oneof result {
96+
google.protobuf.Empty success = 1;
97+
}
98+
}
99+
100+
message ReceiveRequest {
101+
Channel channel = 1;
102+
}
103+
104+
message ReceiveResponse {
105+
bytes data = 1;
106+
}
107+
108+
message SendRequest {
109+
Channel channel = 1;
110+
bytes data = 2;
111+
}
112+
113+
message SendResponse {
114+
oneof result {
115+
google.protobuf.Empty success = 1;
116+
}
117+
}

0 commit comments

Comments
 (0)