-
Notifications
You must be signed in to change notification settings - Fork 8
Add SDP service #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add SDP service #10
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,145 @@ | ||||||
| // Copyright 2023 Google LLC | ||||||
| // | ||||||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
| // you may not use this file except in compliance with the License. | ||||||
| // You may obtain a copy of the License at | ||||||
| // | ||||||
| // https://www.apache.org/licenses/LICENSE-2.0 | ||||||
| // | ||||||
| // Unless required by applicable law or agreed to in writing, software | ||||||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||||||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
| // See the License for the specific language governing permissions and | ||||||
| // limitations under the License. | ||||||
|
|
||||||
| syntax = "proto3"; | ||||||
|
|
||||||
| option java_outer_classname = "SDPProto"; | ||||||
|
|
||||||
| package pandora.sdp; | ||||||
|
|
||||||
| import "google/protobuf/empty.proto"; | ||||||
| import "google/protobuf/any.proto"; | ||||||
| import "pandora/host.proto"; | ||||||
|
|
||||||
| service SDP { | ||||||
| // Server methods | ||||||
| // Register an SDP service | ||||||
| rpc AddService(AddServiceRequest) returns (google.protobuf.Empty); | ||||||
| // Remove an SDP service | ||||||
| rpc RemoveService(RemoveServiceRequest) returns (google.protobuf.Empty); | ||||||
| // List all registered SDP services | ||||||
| rpc ListAttributes(ListAttributesRequest) returns (ListAttributesResponse); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any use case for this one ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. An usage is to avoid handle collision |
||||||
| // Client methods | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest to remove the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would them be a problem: if there are multiple SDP connections on the same ACL connection, which one it should go? |
||||||
| // Connect an SDP protocol channel | ||||||
| rpc Connect(ConnectionRequest) returns (ConnectionResponse); | ||||||
| // Disconnect an SDP protocol channel | ||||||
| rpc Disconnect(DisconnectionRequest) returns (google.protobuf.Empty); | ||||||
| // Core Specification v5.2 Vol. 3 Part B Section 4.5 | ||||||
| rpc ServiceSearch(ServiceSearchRequest) returns (ServiceSearchResponse); | ||||||
| // Core Specification v5.2 Vol. 3 Part B Section 4.6 | ||||||
| rpc ServiceAttribute(ServiceAttributeRequest) | ||||||
| returns (ServiceAttributeResponse); | ||||||
| // Core Specification v5.2 Vol. 3 Part B Section 4.7 | ||||||
| rpc ServiceSearchAttribute(ServiceSearchAttributeRequest) | ||||||
| returns (ServiceSearchAttributeResponse); | ||||||
| } | ||||||
|
|
||||||
| message Channel { | ||||||
| google.protobuf.Any cookie = 1; | ||||||
| } | ||||||
|
|
||||||
| message DataElementSequence { | ||||||
| repeated DataElement elements = 1; | ||||||
| } | ||||||
|
|
||||||
| message DataElement { | ||||||
uael marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| uint32 size = 1; | ||||||
| oneof type { | ||||||
| google.protobuf.Empty nil = 2; | ||||||
| uint32 unsigned_integer = 3; | ||||||
| int32 signed_integer = 4; | ||||||
| string uuid = 5; | ||||||
| string text_string = 6; | ||||||
| bool boolean = 7; | ||||||
| DataElementSequence sequence = 8; | ||||||
| DataElementSequence alternative = 9; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| message ServiceAttribute { | ||||||
| uint32 id = 1; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use an enum instead |
||||||
| DataElement value = 2; | ||||||
| } | ||||||
|
|
||||||
| message ConnectionRequest { | ||||||
| Connection connection = 1; | ||||||
| } | ||||||
|
|
||||||
| message ConnectionResponse { | ||||||
| oneof result { | ||||||
| Channel channel = 1; | ||||||
| google.protobuf.Empty connection_failed = 2; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| message DisconnectionRequest { | ||||||
| Channel channel = 1; | ||||||
| } | ||||||
|
|
||||||
| message AddServiceRequest { | ||||||
| uint32 service_record_handle = 1; | ||||||
| repeated ServiceAttribute attributes_in_service = 2; | ||||||
| } | ||||||
|
|
||||||
| message RemoveServiceRequest { | ||||||
| uint32 service_record_handle = 1; | ||||||
| } | ||||||
|
|
||||||
| message ListAttributesRequest {} | ||||||
|
|
||||||
| message ListAttributesResponse { | ||||||
| repeated ServiceAttribute attributes = 1; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| message ServiceSearchRequest { | ||||||
| Channel channel = 1; | ||||||
| // A list of UUID to search for | ||||||
| repeated string service_search_pattern = 2; | ||||||
| } | ||||||
|
|
||||||
| message ServiceSearchResponse { | ||||||
| repeated uint32 service_record_handles = 1; | ||||||
| } | ||||||
|
|
||||||
| message ServiceAttributeRequest { | ||||||
| Channel channel = 1; | ||||||
| uint32 service_record_handle = 2; | ||||||
| // Must set either attribute_ids or attribute_id_ranges | ||||||
| // Each element represents an attribute ID (Only 16-bit meaningful) | ||||||
| repeated uint32 attribute_ids = 3; | ||||||
| // Must have even size. | ||||||
| // Each pair represents (range_begin(16-bit), range_end(16-bit)) | ||||||
| repeated uint32 attribute_id_ranges = 4; | ||||||
| } | ||||||
|
|
||||||
| message ServiceAttributeResponse { | ||||||
| repeated ServiceAttribute attributes = 1; | ||||||
| } | ||||||
|
|
||||||
| message ServiceSearchAttributeRequest { | ||||||
| Channel channel = 1; | ||||||
| uint32 service_record_handle = 2; | ||||||
| // A list of UUID to search for | ||||||
| repeated string service_search_pattern = 3; | ||||||
| // Must set either | ||||||
| // Each element represents an attribute ID (16-bit meaningful) | ||||||
| repeated uint32 attribute_ids = 4; | ||||||
| // Each item represents (range_begin(16-bit), range_end(16-bit)) | ||||||
| // (32-bit meaningful) | ||||||
| repeated uint32 attribute_id_ranges = 5; | ||||||
| } | ||||||
|
|
||||||
| message ServiceSearchAttributeResponse { | ||||||
| repeated ServiceAttribute attributes = 1; | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove the
RemoveServiceAPI and I'm not even sure we need toAddServiceas well 🤔