• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1syntax = "proto3";
2
3package bluetooth.l2cap.classic;
4
5import "google/protobuf/empty.proto";
6import "facade/common.proto";
7
8service L2capClassicModuleFacade {
9  rpc FetchConnectionComplete(google.protobuf.Empty) returns (stream ConnectionCompleteEvent) {
10    // Testing Android Bluetooth stack only. Optional for other stack.
11  }
12  rpc FetchConnectionClose(google.protobuf.Empty) returns (stream ConnectionCloseEvent) {
13    // Testing Android Bluetooth stack only. Optional for other stack.
14  }
15  rpc OpenChannel(OpenChannelRequest) returns (google.protobuf.Empty) {}
16  rpc CloseChannel(CloseChannelRequest) returns (google.protobuf.Empty) {}
17  rpc FetchL2capData(google.protobuf.Empty) returns (stream L2capPacket) {}
18  rpc SetDynamicChannel(SetEnableDynamicChannelRequest) returns (google.protobuf.Empty) {}
19  rpc SendDynamicChannelPacket(DynamicChannelPacket) returns (google.protobuf.Empty) {}
20  rpc SetTrafficPaused(SetTrafficPausedRequest) returns (google.protobuf.Empty) {}
21  rpc GetChannelQueueDepth(google.protobuf.Empty) returns (GetChannelQueueDepthResponse) {
22    // Get the buffer size of channel queue end for L2CAP user (how many packets we can buffer
23    // before L2CAP user dequeues.
24  }
25  rpc InitiateConnectionForSecurity(facade.BluetoothAddress) returns (google.protobuf.Empty) {}
26  rpc FetchSecurityConnectionEvents(google.protobuf.Empty) returns (stream LinkSecurityInterfaceCallbackEvent) {}
27  rpc SecurityLinkEnsureAuthenticated(facade.BluetoothAddress) returns (google.protobuf.Empty) {}
28  rpc SecurityLinkHold(facade.BluetoothAddress) returns (google.protobuf.Empty) {}
29  rpc SecurityLinkDisconnect(facade.BluetoothAddress) returns (google.protobuf.Empty) {}
30  rpc SecurityLinkRelease(facade.BluetoothAddress) returns (google.protobuf.Empty) {}
31}
32
33enum LinkSecurityInterfaceCallbackEventType {
34  ON_CONNECTED = 0;
35  ON_DISCONNECTED = 1;
36  ON_AUTHENTICATION_COMPLETE = 2;
37  ON_ENCRYPTION_CHANGE = 3;
38  ON_READ_REMOTE_VERSION_INFO = 4;
39  ON_READ_REMOTE_EXTENDED_FEATURES = 5;
40}
41
42message LinkSecurityInterfaceCallbackEvent {
43  facade.BluetoothAddress address = 1;
44  LinkSecurityInterfaceCallbackEventType event_type = 2;
45}
46
47message RegisterChannelRequest {
48  uint32 channel = 1;
49}
50
51message ConnectionCompleteEvent {
52  facade.BluetoothAddress remote = 1;
53}
54
55message ConnectionCloseEvent {
56  facade.BluetoothAddress remote = 1;
57  uint32 reason = 2;
58}
59
60enum RetransmissionFlowControlMode {
61  BASIC = 0;
62  ERTM = 1;
63  ERTM_OPTIONAL = 2;
64}
65
66message OpenChannelRequest {
67  facade.BluetoothAddress remote = 1;
68  uint32 psm = 2;
69  RetransmissionFlowControlMode mode = 3;
70}
71
72message CloseChannelRequest {
73  uint32 psm = 1;
74}
75
76enum ChannelSignalEventType {
77  OPEN = 0;
78  CLOSE = 1;
79  CONFIGURE = 2;
80}
81
82message ChannelSignalEvent {
83  uint32 cid = 1;
84  ChannelSignalEventType type = 2;
85}
86
87enum SendL2capPacketResultType {
88  OK = 0;
89  BAD_CID = 1;
90}
91
92message SendL2capPacketResult {
93  SendL2capPacketResultType result_type = 1;
94}
95
96message L2capPacket {
97  oneof channel_type {
98    uint32 psm = 1;
99    uint32 fixed_cid = 2;
100  }
101  bytes payload = 3;
102}
103
104message SetEnableDynamicChannelRequest {
105  uint32 psm = 1;
106  bool enable = 2;
107  RetransmissionFlowControlMode retransmission_mode = 3;
108}
109
110message DynamicChannelPacket {
111  facade.BluetoothAddress remote = 1;
112  uint32 psm = 2;
113  bytes payload = 3;
114}
115
116message SetTrafficPausedRequest {
117  bool paused = 1;
118  uint32 psm = 2;
119}
120
121message GetChannelQueueDepthResponse {
122  uint32 size = 1;
123}
124
125enum ClassicSecurityPolicy {
126  ENCRYPTED_TRANSPORT = 0;
127  AUTHENTICATED_ENCRYPTED_TRANSPORT = 1;
128  BEST = 2;
129  _SDP_ONLY_NO_SECURITY_WHATSOEVER_PLAINTEXT_TRANSPORT_OK = 3;
130}
131