1 /* 2 * Copyright 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #pragma once 18 19 #include "l2cap/dynamic_channel.h" 20 #include "l2cap/le/link_options.h" 21 #include "l2cap/mtu.h" 22 23 namespace bluetooth { 24 namespace l2cap { 25 namespace le { 26 namespace internal { 27 class Link; 28 } 29 30 class DynamicChannel : public l2cap::DynamicChannel { 31 public: DynamicChannel(std::shared_ptr<l2cap::internal::DynamicChannelImpl> impl,os::Handler * l2cap_handler,internal::Link * link,Mtu mtu)32 DynamicChannel( 33 std::shared_ptr<l2cap::internal::DynamicChannelImpl> impl, 34 os::Handler* l2cap_handler, 35 internal::Link* link, 36 Mtu mtu) 37 : l2cap::DynamicChannel(impl, l2cap_handler), link_(link), mtu_(mtu) {} 38 39 /** 40 * Get the Proxy for L2CAP Link Options. 41 * Only few special L2CAP users need to use it, including 42 * Hearing Aid Profile and Java API. 43 */ 44 LinkOptions* GetLinkOptions(); 45 46 Mtu GetMtu() const; 47 48 private: 49 internal::Link* link_; 50 Mtu mtu_; 51 }; 52 53 } // namespace le 54 } // namespace l2cap 55 } // namespace bluetooth 56