Skip to content

Commit 9b7fb91

Browse files
committed
Add SDP service
1 parent ab8427a commit 9b7fb91

1 file changed

Lines changed: 142 additions & 0 deletions

File tree

pandora/sdp.proto

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
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+
option java_outer_classname = "SDPProto";
18+
19+
package pandora.sdp;
20+
21+
import "google/protobuf/empty.proto";
22+
import "google/protobuf/any.proto";
23+
import "pandora/host.proto";
24+
25+
service SDP {
26+
// Server methods
27+
// Register an SDP service
28+
rpc AddService(AddServiceRequest) returns (google.protobuf.Empty);
29+
// Remove an SDP service
30+
rpc RemoveService(RemoveServiceRequest) returns (google.protobuf.Empty);
31+
// List all registered SDP services
32+
rpc ListAttributes(ListAttributesRequest) returns (ListAttributesResponse);
33+
// Client methods
34+
// Connect an SDP protocol channel
35+
rpc Connect(ConnectionRequest) returns (ConnectionResponse);
36+
// Disconnect an SDP protocol channel
37+
rpc Disconnect(DisconnectionRequest) returns (google.protobuf.Empty);
38+
// Core Specification v5.2 Vol. 3 Part B Section 4.5
39+
rpc ServiceSearch(ServiceSearchRequest) returns (ServiceSearchResponse);
40+
// Core Specification v5.2 Vol. 3 Part B Section 4.6
41+
rpc ServiceAttribute(ServiceAttributeRequest)
42+
returns (ServiceAttributeResponse);
43+
// Core Specification v5.2 Vol. 3 Part B Section 4.7
44+
rpc ServiceSearchAttribute(ServiceSearchAttributeRequest)
45+
returns (ServiceSearchAttributeResponse);
46+
}
47+
48+
message Channel {
49+
google.protobuf.Any cookie = 1;
50+
}
51+
52+
message DataElementSequence {
53+
repeated DataElement elements = 1;
54+
}
55+
56+
message DataElement {
57+
uint32 size = 1;
58+
oneof type {
59+
google.protobuf.Empty nil = 2;
60+
uint32 unsigned_integer = 3;
61+
int32 signed_integer = 4;
62+
string uuid = 5;
63+
string text_string = 6;
64+
bool boolean = 7;
65+
DataElementSequence sequence = 8;
66+
DataElementSequence alternative = 9;
67+
}
68+
}
69+
70+
message ServiceAttribute {
71+
uint32 id = 1;
72+
DataElement value = 2;
73+
}
74+
75+
message ConnectionRequest {
76+
Connection connection = 1;
77+
}
78+
79+
message ConnectionResponse {
80+
oneof result {
81+
Channel channel = 1;
82+
google.protobuf.Empty connection_failed = 2;
83+
}
84+
}
85+
86+
message DisconnectionRequest {
87+
Channel channel = 1;
88+
}
89+
90+
message AddServiceRequest {
91+
uint32 service_record_handle = 1;
92+
repeated ServiceAttribute attributes_in_service = 2;
93+
}
94+
95+
message RemoveServiceRequest {
96+
uint32 service_record_handle = 1;
97+
}
98+
99+
message ListAttributesRequest {}
100+
101+
message ListAttributesResponse {
102+
repeated ServiceAttribute attributes = 1;
103+
}
104+
105+
message ServiceSearchRequest {
106+
// A list of UUID to search for
107+
repeated string service_search_pattern = 1;
108+
}
109+
110+
message ServiceSearchResponse {
111+
repeated uint32 service_record_handles = 1;
112+
}
113+
114+
message ServiceAttributeRequest {
115+
uint32 service_record_handle = 1;
116+
// Must set either attribute_ids or attribute_id_ranges
117+
// Each element represents an attribute ID (Only 16-bit meaningful)
118+
repeated uint32 attribute_ids = 2;
119+
// Must have even size.
120+
// Each pair represents (range_begin(16-bit), range_end(16-bit))
121+
repeated uint32 attribute_id_ranges = 3;
122+
}
123+
124+
message ServiceAttributeResponse {
125+
repeated ServiceAttribute attributes = 1;
126+
}
127+
128+
message ServiceSearchAttributeRequest {
129+
uint32 service_record_handle = 1;
130+
// A list of UUID to search for
131+
repeated string service_search_pattern = 2;
132+
// Must set either
133+
// Each element represents an attribute ID (16-bit meaningful)
134+
repeated uint32 attribute_ids = 3;
135+
// Each item represents (range_begin(16-bit), range_end(16-bit))
136+
// (32-bit meaningful)
137+
repeated uint32 attribute_id_ranges = 4;
138+
}
139+
140+
message ServiceSearchAttributeResponse {
141+
repeated ServiceAttribute attributes = 1;
142+
}

0 commit comments

Comments
 (0)