Loading tools/rootcanal/model/controller/acl_connection.cc +12 −0 Original line number Diff line number Diff line Loading @@ -46,4 +46,16 @@ void AclConnection::SetOwnAddress(AddressWithType address) { Phy::Type AclConnection::GetPhyType() const { return type_; } uint16_t AclConnection::GetLinkPolicySettings() const { return link_policy_settings_; }; void AclConnection::SetLinkPolicySettings(uint16_t settings) { link_policy_settings_ = settings; } bluetooth::hci::Role AclConnection::GetRole() const { return role_; }; void AclConnection::SetRole(bluetooth::hci::Role role) { role_ = role; } } // namespace rootcanal tools/rootcanal/model/controller/acl_connection.h +10 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,14 @@ class AclConnection { Phy::Type GetPhyType() const; uint16_t GetLinkPolicySettings() const; void SetLinkPolicySettings(uint16_t settings); bluetooth::hci::Role GetRole() const; void SetRole(bluetooth::hci::Role role); private: AddressWithType address_; AddressWithType own_address_; Loading @@ -57,6 +65,8 @@ class AclConnection { // State variables bool encrypted_{false}; uint16_t link_policy_settings_{0}; bluetooth::hci::Role role_{bluetooth::hci::Role::CENTRAL}; }; } // namespace rootcanal tools/rootcanal/model/controller/acl_connection_handler.cc +18 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,24 @@ Phy::Type AclConnectionHandler::GetPhyType(uint16_t handle) const { return acl_connections_.at(handle).GetPhyType(); } uint16_t AclConnectionHandler::GetAclLinkPolicySettings(uint16_t handle) const { return acl_connections_.at(handle).GetLinkPolicySettings(); }; void AclConnectionHandler::SetAclLinkPolicySettings(uint16_t handle, uint16_t settings) { acl_connections_.at(handle).SetLinkPolicySettings(settings); } bluetooth::hci::Role AclConnectionHandler::GetAclRole(uint16_t handle) const { return acl_connections_.at(handle).GetRole(); }; void AclConnectionHandler::SetAclRole(uint16_t handle, bluetooth::hci::Role role) { acl_connections_.at(handle).SetRole(role); } std::unique_ptr<bluetooth::hci::LeSetCigParametersCompleteBuilder> AclConnectionHandler::SetCigParameters( uint8_t id, uint32_t sdu_interval_m_to_s, uint32_t sdu_interval_s_to_m, Loading tools/rootcanal/model/controller/acl_connection_handler.h +6 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,12 @@ class AclConnectionHandler { Phy::Type GetPhyType(uint16_t handle) const; uint16_t GetAclLinkPolicySettings(uint16_t handle) const; void SetAclLinkPolicySettings(uint16_t handle, uint16_t settings); bluetooth::hci::Role GetAclRole(uint16_t handle) const; void SetAclRole(uint16_t handle, bluetooth::hci::Role role); std::unique_ptr<bluetooth::hci::LeSetCigParametersCompleteBuilder> SetCigParameters(uint8_t id, uint32_t sdu_interval_m_to_s, uint32_t sdu_interval_s_to_m, Loading tools/rootcanal/model/controller/dual_mode_controller.cc +22 −4 Original line number Diff line number Diff line Loading @@ -184,6 +184,7 @@ DualModeController::DualModeController(const std::string& properties_filename, SET_SUPPORTED(WRITE_DEFAULT_LINK_POLICY_SETTINGS, WriteDefaultLinkPolicySettings); SET_SUPPORTED(FLOW_SPECIFICATION, FlowSpecification); SET_SUPPORTED(READ_LINK_POLICY_SETTINGS, ReadLinkPolicySettings); SET_SUPPORTED(WRITE_LINK_POLICY_SETTINGS, WriteLinkPolicySettings); SET_SUPPORTED(CHANGE_CONNECTION_PACKET_TYPE, ChangeConnectionPacketType); SET_SUPPORTED(WRITE_LOCAL_NAME, WriteLocalName); Loading Loading @@ -629,8 +630,8 @@ void DualModeController::SwitchRole(CommandView command) { gd_hci::AclCommandView::Create(command))); ASSERT(command_view.IsValid()); auto status = link_layer_controller_.SwitchRole( command_view.GetBdAddr(), static_cast<uint8_t>(command_view.GetRole())); auto status = link_layer_controller_.SwitchRole(command_view.GetBdAddr(), command_view.GetRole()); send_event_(bluetooth::hci::SwitchRoleStatusBuilder::Create( status, kNumCommandPackets)); Loading Loading @@ -1586,10 +1587,11 @@ void DualModeController::RoleDiscovery(CommandView command) { ASSERT(command_view.IsValid()); uint16_t handle = command_view.GetConnectionHandle(); auto status = link_layer_controller_.RoleDiscovery(handle); auto role = bluetooth::hci::Role::CENTRAL; auto status = link_layer_controller_.RoleDiscovery(handle, &role); send_event_(bluetooth::hci::RoleDiscoveryCompleteBuilder::Create( kNumCommandPackets, status, handle, bluetooth::hci::Role::CENTRAL)); kNumCommandPackets, status, handle, role)); } void DualModeController::ReadDefaultLinkPolicySettings(CommandView command) { Loading Loading @@ -1637,6 +1639,22 @@ void DualModeController::FlowSpecification(CommandView command) { status, kNumCommandPackets)); } void DualModeController::ReadLinkPolicySettings(CommandView command) { auto command_view = gd_hci::ReadLinkPolicySettingsView::Create( gd_hci::ConnectionManagementCommandView::Create( gd_hci::AclCommandView::Create(command))); ASSERT(command_view.IsValid()); uint16_t handle = command_view.GetConnectionHandle(); uint16_t settings; auto status = link_layer_controller_.ReadLinkPolicySettings(handle, &settings); send_event_(bluetooth::hci::ReadLinkPolicySettingsCompleteBuilder::Create( kNumCommandPackets, status, handle, settings)); } void DualModeController::WriteLinkPolicySettings(CommandView command) { auto command_view = gd_hci::WriteLinkPolicySettingsView::Create( gd_hci::ConnectionManagementCommandView::Create( Loading Loading
tools/rootcanal/model/controller/acl_connection.cc +12 −0 Original line number Diff line number Diff line Loading @@ -46,4 +46,16 @@ void AclConnection::SetOwnAddress(AddressWithType address) { Phy::Type AclConnection::GetPhyType() const { return type_; } uint16_t AclConnection::GetLinkPolicySettings() const { return link_policy_settings_; }; void AclConnection::SetLinkPolicySettings(uint16_t settings) { link_policy_settings_ = settings; } bluetooth::hci::Role AclConnection::GetRole() const { return role_; }; void AclConnection::SetRole(bluetooth::hci::Role role) { role_ = role; } } // namespace rootcanal
tools/rootcanal/model/controller/acl_connection.h +10 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,14 @@ class AclConnection { Phy::Type GetPhyType() const; uint16_t GetLinkPolicySettings() const; void SetLinkPolicySettings(uint16_t settings); bluetooth::hci::Role GetRole() const; void SetRole(bluetooth::hci::Role role); private: AddressWithType address_; AddressWithType own_address_; Loading @@ -57,6 +65,8 @@ class AclConnection { // State variables bool encrypted_{false}; uint16_t link_policy_settings_{0}; bluetooth::hci::Role role_{bluetooth::hci::Role::CENTRAL}; }; } // namespace rootcanal
tools/rootcanal/model/controller/acl_connection_handler.cc +18 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,24 @@ Phy::Type AclConnectionHandler::GetPhyType(uint16_t handle) const { return acl_connections_.at(handle).GetPhyType(); } uint16_t AclConnectionHandler::GetAclLinkPolicySettings(uint16_t handle) const { return acl_connections_.at(handle).GetLinkPolicySettings(); }; void AclConnectionHandler::SetAclLinkPolicySettings(uint16_t handle, uint16_t settings) { acl_connections_.at(handle).SetLinkPolicySettings(settings); } bluetooth::hci::Role AclConnectionHandler::GetAclRole(uint16_t handle) const { return acl_connections_.at(handle).GetRole(); }; void AclConnectionHandler::SetAclRole(uint16_t handle, bluetooth::hci::Role role) { acl_connections_.at(handle).SetRole(role); } std::unique_ptr<bluetooth::hci::LeSetCigParametersCompleteBuilder> AclConnectionHandler::SetCigParameters( uint8_t id, uint32_t sdu_interval_m_to_s, uint32_t sdu_interval_s_to_m, Loading
tools/rootcanal/model/controller/acl_connection_handler.h +6 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,12 @@ class AclConnectionHandler { Phy::Type GetPhyType(uint16_t handle) const; uint16_t GetAclLinkPolicySettings(uint16_t handle) const; void SetAclLinkPolicySettings(uint16_t handle, uint16_t settings); bluetooth::hci::Role GetAclRole(uint16_t handle) const; void SetAclRole(uint16_t handle, bluetooth::hci::Role role); std::unique_ptr<bluetooth::hci::LeSetCigParametersCompleteBuilder> SetCigParameters(uint8_t id, uint32_t sdu_interval_m_to_s, uint32_t sdu_interval_s_to_m, Loading
tools/rootcanal/model/controller/dual_mode_controller.cc +22 −4 Original line number Diff line number Diff line Loading @@ -184,6 +184,7 @@ DualModeController::DualModeController(const std::string& properties_filename, SET_SUPPORTED(WRITE_DEFAULT_LINK_POLICY_SETTINGS, WriteDefaultLinkPolicySettings); SET_SUPPORTED(FLOW_SPECIFICATION, FlowSpecification); SET_SUPPORTED(READ_LINK_POLICY_SETTINGS, ReadLinkPolicySettings); SET_SUPPORTED(WRITE_LINK_POLICY_SETTINGS, WriteLinkPolicySettings); SET_SUPPORTED(CHANGE_CONNECTION_PACKET_TYPE, ChangeConnectionPacketType); SET_SUPPORTED(WRITE_LOCAL_NAME, WriteLocalName); Loading Loading @@ -629,8 +630,8 @@ void DualModeController::SwitchRole(CommandView command) { gd_hci::AclCommandView::Create(command))); ASSERT(command_view.IsValid()); auto status = link_layer_controller_.SwitchRole( command_view.GetBdAddr(), static_cast<uint8_t>(command_view.GetRole())); auto status = link_layer_controller_.SwitchRole(command_view.GetBdAddr(), command_view.GetRole()); send_event_(bluetooth::hci::SwitchRoleStatusBuilder::Create( status, kNumCommandPackets)); Loading Loading @@ -1586,10 +1587,11 @@ void DualModeController::RoleDiscovery(CommandView command) { ASSERT(command_view.IsValid()); uint16_t handle = command_view.GetConnectionHandle(); auto status = link_layer_controller_.RoleDiscovery(handle); auto role = bluetooth::hci::Role::CENTRAL; auto status = link_layer_controller_.RoleDiscovery(handle, &role); send_event_(bluetooth::hci::RoleDiscoveryCompleteBuilder::Create( kNumCommandPackets, status, handle, bluetooth::hci::Role::CENTRAL)); kNumCommandPackets, status, handle, role)); } void DualModeController::ReadDefaultLinkPolicySettings(CommandView command) { Loading Loading @@ -1637,6 +1639,22 @@ void DualModeController::FlowSpecification(CommandView command) { status, kNumCommandPackets)); } void DualModeController::ReadLinkPolicySettings(CommandView command) { auto command_view = gd_hci::ReadLinkPolicySettingsView::Create( gd_hci::ConnectionManagementCommandView::Create( gd_hci::AclCommandView::Create(command))); ASSERT(command_view.IsValid()); uint16_t handle = command_view.GetConnectionHandle(); uint16_t settings; auto status = link_layer_controller_.ReadLinkPolicySettings(handle, &settings); send_event_(bluetooth::hci::ReadLinkPolicySettingsCompleteBuilder::Create( kNumCommandPackets, status, handle, settings)); } void DualModeController::WriteLinkPolicySettings(CommandView command) { auto command_view = gd_hci::WriteLinkPolicySettingsView::Create( gd_hci::ConnectionManagementCommandView::Create( Loading