Loading system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.cc +15 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ DualModeController::DualModeController(const std::string& properties_filename, u SET_HANDLER(OpCode::WRITE_LOCAL_NAME, HciWriteLocalName); SET_HANDLER(OpCode::READ_LOCAL_NAME, HciReadLocalName); SET_HANDLER(OpCode::WRITE_EXTENDED_INQUIRY_RESPONSE, HciWriteExtendedInquiryResponse); SET_HANDLER(OpCode::REFRESH_ENCRYPTION_KEY, HciRefreshEncryptionKey); SET_HANDLER(OpCode::WRITE_VOICE_SETTING, HciWriteVoiceSetting); SET_HANDLER(OpCode::WRITE_CURRENT_IAC_LAP, HciWriteCurrentIacLap); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_ACTIVITY, HciWriteInquiryScanActivity); Loading Loading @@ -653,6 +654,20 @@ void DualModeController::HciWriteExtendedInquiryResponse(packets::PacketView<tru SendCommandCompleteSuccess(OpCode::WRITE_EXTENDED_INQUIRY_RESPONSE); } void DualModeController::HciRefreshEncryptionKey( packets::PacketView<true> args) { CHECK(args.size() == 2) << __func__ << " size=" << args.size(); auto args_itr = args.begin(); uint16_t handle = args_itr.extract<uint16_t>(); SendCommandStatusSuccess(OpCode::REFRESH_ENCRYPTION_KEY); // TODO: Support this in the link layer hci::Status status = hci::Status::SUCCESS; send_event_( packets::EventPacketBuilder::CreateEncryptionKeyRefreshCompleteEvent( status, handle) ->ToVector()); } void DualModeController::HciWriteVoiceSetting(packets::PacketView<true> args) { CHECK(args.size() == 2) << __func__ << " size=" << args.size(); SendCommandCompleteSuccess(OpCode::WRITE_VOICE_SETTING); Loading system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +3 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,9 @@ class DualModeController : public Device { // 7.3.56 void HciWriteExtendedInquiryResponse(packets::PacketView<true> args); // 7.3.57 void HciRefreshEncryptionKey(packets::PacketView<true> args); // 7.3.59 void HciWriteSimplePairingMode(packets::PacketView<true> args); Loading system/vendor_libs/test_vendor_lib/packets/hci/event_packet_builder.cc +12 −0 Original line number Diff line number Diff line Loading @@ -476,6 +476,18 @@ std::unique_ptr<EventPacketBuilder> EventPacketBuilder::CreateExtendedInquiryRes return evt_ptr; } // Bluetooth Core Specification Version 4.2, Volume 2, Part E, Section 7.7.38 std::unique_ptr<EventPacketBuilder> EventPacketBuilder::CreateEncryptionKeyRefreshCompleteEvent(hci::Status status, uint16_t handle) { std::unique_ptr<EventPacketBuilder> evt_ptr = std::unique_ptr<EventPacketBuilder>( new EventPacketBuilder(EventCode::ENCRYPTION_KEY_REFRESH_COMPLETE)); CHECK(evt_ptr->AddPayloadOctets1(static_cast<uint8_t>(status))); CHECK(evt_ptr->AddPayloadOctets2(handle)); return evt_ptr; } // Bluetooth Core Specification Version 4.2, Volume 2, Part E, Section 7.7.40 std::unique_ptr<EventPacketBuilder> EventPacketBuilder::CreateIoCapabilityRequestEvent(const Address& peer) { std::unique_ptr<EventPacketBuilder> evt_ptr = Loading system/vendor_libs/test_vendor_lib/packets/hci/event_packet_builder.h +4 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,10 @@ class EventPacketBuilder : public HciPacketBuilder { const Address& bt_address, uint8_t page_scan_repetition_mode, ClassOfDevice class_of_device, uint16_t clock_offset, uint8_t rssi, const std::vector<uint8_t>& extended_inquiry_response); // Bluetooth Core Specification Version 4.2, Volume 2, Part E, Section 7.7.39 static std::unique_ptr<EventPacketBuilder> CreateEncryptionKeyRefreshCompleteEvent(hci::Status status, uint16_t handle); // Bluetooth Core Specification Version 4.2, Volume 2, Part E, Section 7.7.40 static std::unique_ptr<EventPacketBuilder> CreateIoCapabilityRequestEvent(const Address& peer); 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 @@ -178,6 +178,7 @@ DualModeController::DualModeController(const std::string& properties_filename, u SET_HANDLER(OpCode::WRITE_LOCAL_NAME, HciWriteLocalName); SET_HANDLER(OpCode::READ_LOCAL_NAME, HciReadLocalName); SET_HANDLER(OpCode::WRITE_EXTENDED_INQUIRY_RESPONSE, HciWriteExtendedInquiryResponse); SET_HANDLER(OpCode::REFRESH_ENCRYPTION_KEY, HciRefreshEncryptionKey); SET_HANDLER(OpCode::WRITE_VOICE_SETTING, HciWriteVoiceSetting); SET_HANDLER(OpCode::WRITE_CURRENT_IAC_LAP, HciWriteCurrentIacLap); SET_HANDLER(OpCode::WRITE_INQUIRY_SCAN_ACTIVITY, HciWriteInquiryScanActivity); Loading Loading @@ -653,6 +654,20 @@ void DualModeController::HciWriteExtendedInquiryResponse(packets::PacketView<tru SendCommandCompleteSuccess(OpCode::WRITE_EXTENDED_INQUIRY_RESPONSE); } void DualModeController::HciRefreshEncryptionKey( packets::PacketView<true> args) { CHECK(args.size() == 2) << __func__ << " size=" << args.size(); auto args_itr = args.begin(); uint16_t handle = args_itr.extract<uint16_t>(); SendCommandStatusSuccess(OpCode::REFRESH_ENCRYPTION_KEY); // TODO: Support this in the link layer hci::Status status = hci::Status::SUCCESS; send_event_( packets::EventPacketBuilder::CreateEncryptionKeyRefreshCompleteEvent( status, handle) ->ToVector()); } void DualModeController::HciWriteVoiceSetting(packets::PacketView<true> args) { CHECK(args.size() == 2) << __func__ << " size=" << args.size(); SendCommandCompleteSuccess(OpCode::WRITE_VOICE_SETTING); Loading
system/vendor_libs/test_vendor_lib/model/controller/dual_mode_controller.h +3 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,9 @@ class DualModeController : public Device { // 7.3.56 void HciWriteExtendedInquiryResponse(packets::PacketView<true> args); // 7.3.57 void HciRefreshEncryptionKey(packets::PacketView<true> args); // 7.3.59 void HciWriteSimplePairingMode(packets::PacketView<true> args); Loading
system/vendor_libs/test_vendor_lib/packets/hci/event_packet_builder.cc +12 −0 Original line number Diff line number Diff line Loading @@ -476,6 +476,18 @@ std::unique_ptr<EventPacketBuilder> EventPacketBuilder::CreateExtendedInquiryRes return evt_ptr; } // Bluetooth Core Specification Version 4.2, Volume 2, Part E, Section 7.7.38 std::unique_ptr<EventPacketBuilder> EventPacketBuilder::CreateEncryptionKeyRefreshCompleteEvent(hci::Status status, uint16_t handle) { std::unique_ptr<EventPacketBuilder> evt_ptr = std::unique_ptr<EventPacketBuilder>( new EventPacketBuilder(EventCode::ENCRYPTION_KEY_REFRESH_COMPLETE)); CHECK(evt_ptr->AddPayloadOctets1(static_cast<uint8_t>(status))); CHECK(evt_ptr->AddPayloadOctets2(handle)); return evt_ptr; } // Bluetooth Core Specification Version 4.2, Volume 2, Part E, Section 7.7.40 std::unique_ptr<EventPacketBuilder> EventPacketBuilder::CreateIoCapabilityRequestEvent(const Address& peer) { std::unique_ptr<EventPacketBuilder> evt_ptr = Loading
system/vendor_libs/test_vendor_lib/packets/hci/event_packet_builder.h +4 −0 Original line number Diff line number Diff line Loading @@ -203,6 +203,10 @@ class EventPacketBuilder : public HciPacketBuilder { const Address& bt_address, uint8_t page_scan_repetition_mode, ClassOfDevice class_of_device, uint16_t clock_offset, uint8_t rssi, const std::vector<uint8_t>& extended_inquiry_response); // Bluetooth Core Specification Version 4.2, Volume 2, Part E, Section 7.7.39 static std::unique_ptr<EventPacketBuilder> CreateEncryptionKeyRefreshCompleteEvent(hci::Status status, uint16_t handle); // Bluetooth Core Specification Version 4.2, Volume 2, Part E, Section 7.7.40 static std::unique_ptr<EventPacketBuilder> CreateIoCapabilityRequestEvent(const Address& peer); Loading