Jack He | fcb2bbf | 2019-07-31 15:44:05 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
Jack He | ff38d89 | 2019-10-03 17:11:07 -0700 | [diff] [blame] | 3 | package bluetooth.l2cap.classic; |
Jack He | fcb2bbf | 2019-07-31 15:44:05 -0700 | [diff] [blame] | 4 | |
| 5 | import "google/protobuf/empty.proto"; |
| 6 | import "facade/common.proto"; |
| 7 | |
| 8 | service L2capModuleFacade { |
Hansong Zhang | 7092a1f | 2019-08-29 14:28:40 -0700 | [diff] [blame] | 9 | 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 Zhang | 80bbfc3 | 2019-09-10 16:12:05 -0700 | [diff] [blame] | 16 | rpc OpenChannel(OpenChannelRequest) returns (google.protobuf.Empty) {} |
| 17 | rpc ConfigureChannel(ConfigureChannelRequest) returns (google.protobuf.Empty) {} |
| 18 | rpc SendL2capPacket(L2capPacket) returns (SendL2capPacketResult) {} |
Hansong Zhang | 7092a1f | 2019-08-29 14:28:40 -0700 | [diff] [blame] | 19 | rpc FetchL2capData(facade.EventStreamRequest) returns (stream L2capPacket) {} |
Hansong Zhang | cd0c319 | 2019-09-20 15:50:42 -0700 | [diff] [blame] | 20 | rpc RegisterDynamicChannel(RegisterDynamicChannelRequest) returns (google.protobuf.Empty) {} |
| 21 | rpc SetDynamicChannel(SetEnableDynamicChannelRequest) returns (google.protobuf.Empty) {} |
| 22 | rpc SendDynamicChannelPacket(DynamicChannelPacket) returns (google.protobuf.Empty) {} |
Hansong Zhang | 7092a1f | 2019-08-29 14:28:40 -0700 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | message RegisterChannelRequest { |
| 26 | uint32 channel = 1; |
| 27 | } |
| 28 | |
| 29 | message ConnectionCompleteEvent { |
| 30 | facade.BluetoothAddress remote = 1; |
| 31 | } |
| 32 | |
Hansong Zhang | 80bbfc3 | 2019-09-10 16:12:05 -0700 | [diff] [blame] | 33 | message OpenChannelRequest { |
| 34 | facade.BluetoothAddress remote = 1; |
| 35 | uint32 psm = 2; |
| 36 | } |
| 37 | |
| 38 | message ConfigureChannelRequest { |
| 39 | facade.BluetoothAddress remote = 1; |
| 40 | // Config |
| 41 | } |
| 42 | |
| 43 | message CloseChannelRequest { |
| 44 | facade.BluetoothAddress remote = 1; |
| 45 | uint32 cid = 2; |
| 46 | } |
| 47 | |
| 48 | enum ChannelSignalEventType { |
| 49 | OPEN = 0; |
| 50 | CLOSE = 1; |
| 51 | CONFIGURE = 2; |
| 52 | } |
| 53 | |
| 54 | message ChannelSignalEvent { |
| 55 | uint32 cid = 1; |
| 56 | ChannelSignalEventType type = 2; |
| 57 | } |
| 58 | |
| 59 | enum SendL2capPacketResultType { |
| 60 | OK = 0; |
| 61 | BAD_CID = 1; |
| 62 | } |
| 63 | |
| 64 | message SendL2capPacketResult { |
| 65 | SendL2capPacketResultType result_type = 1; |
| 66 | } |
| 67 | |
Hansong Zhang | 7092a1f | 2019-08-29 14:28:40 -0700 | [diff] [blame] | 68 | message L2capPacket { |
| 69 | facade.BluetoothAddress remote = 1; |
| 70 | uint32 channel = 2; |
| 71 | bytes payload = 3; |
Jack He | fcb2bbf | 2019-07-31 15:44:05 -0700 | [diff] [blame] | 72 | } |
Hansong Zhang | cd0c319 | 2019-09-20 15:50:42 -0700 | [diff] [blame] | 73 | |
| 74 | message RegisterDynamicChannelRequest { |
| 75 | uint32 psm = 1; |
| 76 | } |
| 77 | |
| 78 | message SetEnableDynamicChannelRequest { |
| 79 | uint32 psm = 1; |
| 80 | bool enable = 2; |
| 81 | } |
| 82 | |
| 83 | message DynamicChannelPacket { |
| 84 | facade.BluetoothAddress remote = 1; |
| 85 | uint32 psm = 2; |
| 86 | bytes payload = 3; |
| 87 | } |