Loading system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +15 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,7 @@ DualModeController::DualModeController(const std::string& properties_filename, u SET_SUPPORTED(SNIFF_MODE, SniffMode); SET_SUPPORTED(EXIT_SNIFF_MODE, ExitSniffMode); SET_SUPPORTED(QOS_SETUP, QosSetup); SET_SUPPORTED(ROLE_DISCOVERY, RoleDiscovery); SET_SUPPORTED(READ_DEFAULT_LINK_POLICY_SETTINGS, ReadDefaultLinkPolicySettings); SET_SUPPORTED(WRITE_DEFAULT_LINK_POLICY_SETTINGS, Loading Loading @@ -1182,6 +1183,20 @@ void DualModeController::QosSetup(CommandView command) { send_event_(std::move(packet)); } void DualModeController::RoleDiscovery(CommandView command) { auto command_view = gd_hci::RoleDiscoveryView::Create( gd_hci::ConnectionManagementCommandView::Create( gd_hci::AclCommandView::Create(command))); ASSERT(command_view.IsValid()); uint16_t handle = command_view.GetConnectionHandle(); auto status = link_layer_controller_.RoleDiscovery(handle); auto packet = bluetooth::hci::RoleDiscoveryCompleteBuilder::Create( kNumCommandPackets, status, handle, bluetooth::hci::Role::CENTRAL); send_event_(std::move(packet)); } void DualModeController::ReadDefaultLinkPolicySettings(CommandView command) { auto command_view = gd_hci::ReadDefaultLinkPolicySettingsView::Create( gd_hci::ConnectionManagementCommandView::Create( Loading system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +3 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,9 @@ class DualModeController : public Device { // 7.2.6 void QosSetup(CommandView args); // 7.2.7 void RoleDiscovery(CommandView args); // 7.2.10 void WriteLinkPolicySettings(CommandView args); Loading system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +9 −0 Original line number Diff line number Diff line Loading @@ -2456,6 +2456,15 @@ ErrorCode LinkLayerController::QosSetup(uint16_t handle, uint8_t service_type, return ErrorCode::COMMAND_DISALLOWED; } ErrorCode LinkLayerController::RoleDiscovery(uint16_t handle) { if (!connections_.HasHandle(handle)) { return ErrorCode::UNKNOWN_CONNECTION; } // TODO: Implement real logic return ErrorCode::SUCCESS; } ErrorCode LinkLayerController::SwitchRole(Address /* bd_addr */, uint8_t /* role */) { // TODO: implement real logic Loading system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h +1 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,7 @@ class LinkLayerController { ErrorCode QosSetup(uint16_t handle, uint8_t service_type, uint32_t token_rate, uint32_t peak_bandwidth, uint32_t latency, uint32_t delay_variation); ErrorCode RoleDiscovery(uint16_t handle); ErrorCode SwitchRole(Address bd_addr, uint8_t role); ErrorCode WriteLinkPolicySettings(uint16_t handle, uint16_t settings); ErrorCode FlowSpecification(uint16_t handle, uint8_t flow_direction, Loading Loading
system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +15 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,7 @@ DualModeController::DualModeController(const std::string& properties_filename, u SET_SUPPORTED(SNIFF_MODE, SniffMode); SET_SUPPORTED(EXIT_SNIFF_MODE, ExitSniffMode); SET_SUPPORTED(QOS_SETUP, QosSetup); SET_SUPPORTED(ROLE_DISCOVERY, RoleDiscovery); SET_SUPPORTED(READ_DEFAULT_LINK_POLICY_SETTINGS, ReadDefaultLinkPolicySettings); SET_SUPPORTED(WRITE_DEFAULT_LINK_POLICY_SETTINGS, Loading Loading @@ -1182,6 +1183,20 @@ void DualModeController::QosSetup(CommandView command) { send_event_(std::move(packet)); } void DualModeController::RoleDiscovery(CommandView command) { auto command_view = gd_hci::RoleDiscoveryView::Create( gd_hci::ConnectionManagementCommandView::Create( gd_hci::AclCommandView::Create(command))); ASSERT(command_view.IsValid()); uint16_t handle = command_view.GetConnectionHandle(); auto status = link_layer_controller_.RoleDiscovery(handle); auto packet = bluetooth::hci::RoleDiscoveryCompleteBuilder::Create( kNumCommandPackets, status, handle, bluetooth::hci::Role::CENTRAL); send_event_(std::move(packet)); } void DualModeController::ReadDefaultLinkPolicySettings(CommandView command) { auto command_view = gd_hci::ReadDefaultLinkPolicySettingsView::Create( gd_hci::ConnectionManagementCommandView::Create( Loading
system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +3 −0 Original line number Diff line number Diff line Loading @@ -213,6 +213,9 @@ class DualModeController : public Device { // 7.2.6 void QosSetup(CommandView args); // 7.2.7 void RoleDiscovery(CommandView args); // 7.2.10 void WriteLinkPolicySettings(CommandView args); Loading
system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.cc +9 −0 Original line number Diff line number Diff line Loading @@ -2456,6 +2456,15 @@ ErrorCode LinkLayerController::QosSetup(uint16_t handle, uint8_t service_type, return ErrorCode::COMMAND_DISALLOWED; } ErrorCode LinkLayerController::RoleDiscovery(uint16_t handle) { if (!connections_.HasHandle(handle)) { return ErrorCode::UNKNOWN_CONNECTION; } // TODO: Implement real logic return ErrorCode::SUCCESS; } ErrorCode LinkLayerController::SwitchRole(Address /* bd_addr */, uint8_t /* role */) { // TODO: implement real logic Loading
system/vendor_libs/test_vendor_lib/model/controller/link_layer_controller.h +1 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,7 @@ class LinkLayerController { ErrorCode QosSetup(uint16_t handle, uint8_t service_type, uint32_t token_rate, uint32_t peak_bandwidth, uint32_t latency, uint32_t delay_variation); ErrorCode RoleDiscovery(uint16_t handle); ErrorCode SwitchRole(Address bd_addr, uint8_t role); ErrorCode WriteLinkPolicySettings(uint16_t handle, uint16_t settings); ErrorCode FlowSpecification(uint16_t handle, uint8_t flow_direction, Loading