1syntax = "proto3"; 2 3package bluetooth.l2cap.le; 4 5import "google/protobuf/empty.proto"; 6import "facade/common.proto"; 7 8service L2capLeModuleFacade { 9 rpc FetchL2capData(google.protobuf.Empty) returns (stream L2capPacket) {} 10 // Initiate a credit based connection request and block until response is received for up to some timeout (2s) 11 rpc OpenDynamicChannel(OpenDynamicChannelRequest) returns (OpenDynamicChannelResponse) {} 12 rpc CloseDynamicChannel(CloseDynamicChannelRequest) returns (google.protobuf.Empty) {} 13 rpc SetDynamicChannel(SetEnableDynamicChannelRequest) returns (google.protobuf.Empty) {} 14 rpc SendDynamicChannelPacket(DynamicChannelPacket) returns (google.protobuf.Empty) {} 15 rpc SetFixedChannel(SetEnableFixedChannelRequest) returns (google.protobuf.Empty) {} 16 rpc SendFixedChannelPacket(FixedChannelPacket) returns (google.protobuf.Empty) {} 17 rpc SendConnectionParameterUpdate(ConnectionParameter) returns (google.protobuf.Empty) {} 18} 19 20message L2capPacket { 21 oneof channel_type { 22 uint32 psm = 1; 23 uint32 fixed_cid = 2; 24 } 25 bytes payload = 3; 26} 27 28message DynamicChannelOpenEvent { 29 uint32 psm = 1; 30 uint32 connection_response_result = 2; 31} 32 33message OpenDynamicChannelRequest { 34 facade.BluetoothAddressWithType remote = 1; 35 uint32 psm = 2; 36} 37 38message OpenDynamicChannelResponse { 39 uint32 status = 1; 40} 41 42message CloseDynamicChannelRequest { 43 facade.BluetoothAddressWithType remote = 1; 44 uint32 psm = 2; 45} 46 47enum SecurityLevel { 48 NO_SECURITY = 0; 49 UNAUTHENTICATED_PAIRING_WITH_ENCRYPTION = 1; 50 AUTHENTICATED_PAIRING_WITH_ENCRYPTION = 2; 51 AUTHENTICATED_PAIRING_WITH_128_BIT_KEY = 3; 52 AUTHORIZATION = 4; 53} 54 55message SetEnableDynamicChannelRequest { 56 uint32 psm = 1; 57 bool enable = 2; 58 SecurityLevel security_level = 3; 59} 60 61message DynamicChannelPacket { 62 facade.BluetoothAddressWithType remote = 1; 63 uint32 psm = 2; 64 bytes payload = 3; 65} 66 67message SetEnableFixedChannelRequest { 68 uint32 cid = 1; 69 bool enable = 2; 70} 71 72message FixedChannelPacket { 73 facade.BluetoothAddressWithType remote = 1; 74 uint32 cid = 2; 75 bytes payload = 3; 76} 77 78message ConnectionParameter { 79 uint32 conn_interval_min = 2; 80 uint32 conn_interval_max = 3; 81 uint32 conn_latency = 4; 82 uint32 supervision_timeout = 5; 83 uint32 min_ce_length = 6; 84 uint32 max_ce_length = 7; 85} 86