Loading system/gd/shim/l2cap.cc +2 −0 Original line number Diff line number Diff line Loading @@ -611,6 +611,7 @@ void L2cap::RegisterClassicService( uint16_t raw_psm, bool use_ertm, uint16_t mtu, uint16_t required_remote_mtu, ConnectionCompleteCallback on_complete, RegisterServicePromise register_promise) { l2cap::Psm psm{raw_psm}; Loading @@ -620,6 +621,7 @@ void L2cap::RegisterClassicService( l2cap::classic::DynamicChannelConfigurationOption::RetransmissionAndFlowControlMode::ENHANCED_RETRANSMISSION; } option.incoming_mtu = mtu; option.minimal_remote_mtu = required_remote_mtu; GetHandler()->Post(common::BindOnce( &L2cap::impl::RegisterService, common::Unretained(pimpl_.get()), Loading system/gd/shim/l2cap.h +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ class L2cap : public bluetooth::Module { uint16_t psm, bool use_ertm, uint16_t mtu, uint16_t required_remote_mtu, ConnectionCompleteCallback on_complete, RegisterServicePromise register_promise); void UnregisterClassicService(uint16_t psm, UnregisterServicePromise unregister_promise); Loading system/gd/shim/l2cap_test.cc +3 −0 Original line number Diff line number Diff line Loading @@ -401,6 +401,7 @@ TEST_F(ShimL2capTest, RegisterService_Success) { kPsm, kNoUseErtm, kMtu, kMtu, std::bind( &bluetooth::shim::ShimL2capTest::OnConnectionComplete, this, Loading Loading @@ -432,6 +433,7 @@ TEST_F(ShimL2capTest, RegisterService_Duplicate) { kPsm, kNoUseErtm, kMtu, kMtu, std::bind( &bluetooth::shim::ShimL2capTest::OnConnectionComplete, this, Loading Loading @@ -464,6 +466,7 @@ TEST_F(ShimL2capTest, RegisterService_Invalid) { kPsm, kNoUseErtm, kMtu, kMtu, std::bind( &bluetooth::shim::ShimL2capTest::OnConnectionComplete, this, Loading system/main/shim/l2c_api.cc +5 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ uint16_t bluetooth::shim::L2CA_Register(uint16_t client_psm, const tL2CAP_APPL_INFO& callbacks, bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info, uint16_t required_mtu) { uint16_t my_mtu, uint16_t required_remote_mtu) { if (L2C_INVALID_PSM(client_psm)) { LOG_ERROR("%s Invalid classic psm:%hd", __func__, client_psm); return 0; Loading Loading @@ -63,9 +64,10 @@ uint16_t bluetooth::shim::L2CA_Register(uint16_t client_psm, return 0; } LOG_INFO("%s classic client_psm:%hd psm:%hd", __func__, client_psm, psm); // Minimum acceptable MTU is 48 bytes required_remote_mtu = std::max<uint16_t>(required_remote_mtu, 48); return shim_l2cap.RegisterService(psm, callbacks, enable_snoop, p_ertm_info, required_mtu); my_mtu, required_remote_mtu); } void bluetooth::shim::L2CA_Deregister(uint16_t client_psm) { Loading system/main/shim/l2c_api.h +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ namespace shim { ******************************************************************************/ uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info, uint16_t required_mtu); uint16_t my_mtu, uint16_t required_remote_mtu); /******************************************************************************* * Loading Loading
system/gd/shim/l2cap.cc +2 −0 Original line number Diff line number Diff line Loading @@ -611,6 +611,7 @@ void L2cap::RegisterClassicService( uint16_t raw_psm, bool use_ertm, uint16_t mtu, uint16_t required_remote_mtu, ConnectionCompleteCallback on_complete, RegisterServicePromise register_promise) { l2cap::Psm psm{raw_psm}; Loading @@ -620,6 +621,7 @@ void L2cap::RegisterClassicService( l2cap::classic::DynamicChannelConfigurationOption::RetransmissionAndFlowControlMode::ENHANCED_RETRANSMISSION; } option.incoming_mtu = mtu; option.minimal_remote_mtu = required_remote_mtu; GetHandler()->Post(common::BindOnce( &L2cap::impl::RegisterService, common::Unretained(pimpl_.get()), Loading
system/gd/shim/l2cap.h +1 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ class L2cap : public bluetooth::Module { uint16_t psm, bool use_ertm, uint16_t mtu, uint16_t required_remote_mtu, ConnectionCompleteCallback on_complete, RegisterServicePromise register_promise); void UnregisterClassicService(uint16_t psm, UnregisterServicePromise unregister_promise); Loading
system/gd/shim/l2cap_test.cc +3 −0 Original line number Diff line number Diff line Loading @@ -401,6 +401,7 @@ TEST_F(ShimL2capTest, RegisterService_Success) { kPsm, kNoUseErtm, kMtu, kMtu, std::bind( &bluetooth::shim::ShimL2capTest::OnConnectionComplete, this, Loading Loading @@ -432,6 +433,7 @@ TEST_F(ShimL2capTest, RegisterService_Duplicate) { kPsm, kNoUseErtm, kMtu, kMtu, std::bind( &bluetooth::shim::ShimL2capTest::OnConnectionComplete, this, Loading Loading @@ -464,6 +466,7 @@ TEST_F(ShimL2capTest, RegisterService_Invalid) { kPsm, kNoUseErtm, kMtu, kMtu, std::bind( &bluetooth::shim::ShimL2capTest::OnConnectionComplete, this, Loading
system/main/shim/l2c_api.cc +5 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ uint16_t bluetooth::shim::L2CA_Register(uint16_t client_psm, const tL2CAP_APPL_INFO& callbacks, bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info, uint16_t required_mtu) { uint16_t my_mtu, uint16_t required_remote_mtu) { if (L2C_INVALID_PSM(client_psm)) { LOG_ERROR("%s Invalid classic psm:%hd", __func__, client_psm); return 0; Loading Loading @@ -63,9 +64,10 @@ uint16_t bluetooth::shim::L2CA_Register(uint16_t client_psm, return 0; } LOG_INFO("%s classic client_psm:%hd psm:%hd", __func__, client_psm, psm); // Minimum acceptable MTU is 48 bytes required_remote_mtu = std::max<uint16_t>(required_remote_mtu, 48); return shim_l2cap.RegisterService(psm, callbacks, enable_snoop, p_ertm_info, required_mtu); my_mtu, required_remote_mtu); } void bluetooth::shim::L2CA_Deregister(uint16_t client_psm) { Loading
system/main/shim/l2c_api.h +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ namespace shim { ******************************************************************************/ uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info, uint16_t required_mtu); uint16_t my_mtu, uint16_t required_remote_mtu); /******************************************************************************* * Loading