blob: 21add63e0c106d3a40452745b25a7575e6a0760b [file] [log] [blame]
Jack Hefcb2bbf2019-07-31 15:44:05 -07001syntax = "proto3";
2
Jack Heff38d892019-10-03 17:11:07 -07003package bluetooth.l2cap.classic;
Jack Hefcb2bbf2019-07-31 15:44:05 -07004
5import "google/protobuf/empty.proto";
6import "facade/common.proto";
7
8service L2capModuleFacade {
Hansong Zhang7092a1f2019-08-29 14:28:40 -07009 rpc RegisterChannel(RegisterChannelRequest) returns (google.protobuf.Empty) {
10 // Testing Android Bluetooth stack only. Optional for other stack.
11 }
12 rpc FetchConnectionComplete(facade.EventStreamRequest) returns (stream ConnectionCompleteEvent) {
13 // Testing Android Bluetooth stack only. Optional for other stack.
14 }
15 rpc Connect(facade.BluetoothAddress) returns (google.protobuf.Empty) {}
Hansong Zhang80bbfc32019-09-10 16:12:05 -070016 rpc OpenChannel(OpenChannelRequest) returns (google.protobuf.Empty) {}
17 rpc ConfigureChannel(ConfigureChannelRequest) returns (google.protobuf.Empty) {}
18 rpc SendL2capPacket(L2capPacket) returns (SendL2capPacketResult) {}
Hansong Zhang7092a1f2019-08-29 14:28:40 -070019 rpc FetchL2capData(facade.EventStreamRequest) returns (stream L2capPacket) {}
Hansong Zhangcd0c3192019-09-20 15:50:42 -070020 rpc RegisterDynamicChannel(RegisterDynamicChannelRequest) returns (google.protobuf.Empty) {}
21 rpc SetDynamicChannel(SetEnableDynamicChannelRequest) returns (google.protobuf.Empty) {}
22 rpc SendDynamicChannelPacket(DynamicChannelPacket) returns (google.protobuf.Empty) {}
Hansong Zhang7092a1f2019-08-29 14:28:40 -070023}
24
25message RegisterChannelRequest {
26 uint32 channel = 1;
27}
28
29message ConnectionCompleteEvent {
30 facade.BluetoothAddress remote = 1;
31}
32
Hansong Zhang80bbfc32019-09-10 16:12:05 -070033message OpenChannelRequest {
34 facade.BluetoothAddress remote = 1;
35 uint32 psm = 2;
36}
37
38message ConfigureChannelRequest {
39 facade.BluetoothAddress remote = 1;
40 // Config
41}
42
43message CloseChannelRequest {
44 facade.BluetoothAddress remote = 1;
45 uint32 cid = 2;
46}
47
48enum ChannelSignalEventType {
49 OPEN = 0;
50 CLOSE = 1;
51 CONFIGURE = 2;
52}
53
54message ChannelSignalEvent {
55 uint32 cid = 1;
56 ChannelSignalEventType type = 2;
57}
58
59enum SendL2capPacketResultType {
60 OK = 0;
61 BAD_CID = 1;
62}
63
64message SendL2capPacketResult {
65 SendL2capPacketResultType result_type = 1;
66}
67
Hansong Zhang7092a1f2019-08-29 14:28:40 -070068message L2capPacket {
69 facade.BluetoothAddress remote = 1;
70 uint32 channel = 2;
71 bytes payload = 3;
Jack Hefcb2bbf2019-07-31 15:44:05 -070072}
Hansong Zhangcd0c3192019-09-20 15:50:42 -070073
74message RegisterDynamicChannelRequest {
75 uint32 psm = 1;
76}
77
78message SetEnableDynamicChannelRequest {
79 uint32 psm = 1;
80 bool enable = 2;
81}
82
83message DynamicChannelPacket {
84 facade.BluetoothAddress remote = 1;
85 uint32 psm = 2;
86 bytes payload = 3;
87}