1syntax = "proto3"; 2 3package bluetooth.l2cap.classic; 4 5import "google/protobuf/empty.proto"; 6import "facade/common.proto"; 7 8service L2capClassicModuleFacade { 9 rpc RegisterChannel(RegisterChannelRequest) returns (google.protobuf.Empty) { 10 // Testing Android Bluetooth stack only. Optional for other stack. 11 } 12 rpc FetchConnectionComplete(google.protobuf.Empty) returns (stream ConnectionCompleteEvent) { 13 // Testing Android Bluetooth stack only. Optional for other stack. 14 } 15 rpc FetchConnectionClose(google.protobuf.Empty) returns (stream ConnectionCloseEvent) { 16 // Testing Android Bluetooth stack only. Optional for other stack. 17 } 18 rpc Connect(facade.BluetoothAddress) returns (google.protobuf.Empty) {} 19 rpc OpenChannel(OpenChannelRequest) returns (google.protobuf.Empty) {} 20 rpc CloseChannel(CloseChannelRequest) returns (google.protobuf.Empty) {} 21 rpc ConfigureChannel(ConfigureChannelRequest) returns (google.protobuf.Empty) {} 22 rpc SendL2capPacket(L2capPacket) returns (SendL2capPacketResult) {} 23 rpc FetchL2capData(google.protobuf.Empty) returns (stream L2capPacket) {} 24 rpc SetDynamicChannel(SetEnableDynamicChannelRequest) returns (google.protobuf.Empty) {} 25 rpc SendDynamicChannelPacket(DynamicChannelPacket) returns (google.protobuf.Empty) {} 26} 27 28message RegisterChannelRequest { 29 uint32 channel = 1; 30} 31 32message ConnectionCompleteEvent { 33 facade.BluetoothAddress remote = 1; 34} 35 36message ConnectionCloseEvent { 37 facade.BluetoothAddress remote = 1; 38 uint32 reason = 2; 39} 40 41enum RetransmissionFlowControlMode { 42 BASIC = 0; 43 ERTM = 3; 44} 45 46message OpenChannelRequest { 47 facade.BluetoothAddress remote = 1; 48 uint32 psm = 2; 49 RetransmissionFlowControlMode mode = 3; 50} 51 52message ConfigureChannelRequest { 53 facade.BluetoothAddress remote = 1; 54 // Config 55} 56 57message CloseChannelRequest { 58 uint32 psm = 1; 59} 60 61enum ChannelSignalEventType { 62 OPEN = 0; 63 CLOSE = 1; 64 CONFIGURE = 2; 65} 66 67message ChannelSignalEvent { 68 uint32 cid = 1; 69 ChannelSignalEventType type = 2; 70} 71 72enum SendL2capPacketResultType { 73 OK = 0; 74 BAD_CID = 1; 75} 76 77message SendL2capPacketResult { 78 SendL2capPacketResultType result_type = 1; 79} 80 81message L2capPacket { 82 facade.BluetoothAddress remote = 1; 83 uint32 channel = 2; 84 bytes payload = 3; 85} 86 87message SetEnableDynamicChannelRequest { 88 uint32 psm = 1; 89 bool enable = 2; 90 RetransmissionFlowControlMode retransmission_mode = 3; 91} 92 93message DynamicChannelPacket { 94 facade.BluetoothAddress remote = 1; 95 uint32 psm = 2; 96 bytes payload = 3; 97} 98