Loading system/include/hardware/avrcp/avrcp_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ enum class BrowsePdu : uint8_t { CHANGE_PATH = 0x72, GET_ITEM_ATTRIBUTES = 0x73, GET_TOTAL_NUMBER_OF_ITEMS = 0x75, GENERAL_REJECT = 0xa0, }; enum class Scope : uint8_t { Loading system/packet/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ cc_test { "tests/avrcp/avrcp_packet_test.cc", "tests/avrcp/avrcp_reject_packet_test.cc", "tests/avrcp/change_path_packet_test.cc", "tests/avrcp/general_reject_packet_test.cc", "tests/avrcp/get_capabilities_packet_test.cc", "tests/avrcp/get_element_attributes_packet_test.cc", "tests/avrcp/get_folder_items_packet_test.cc", Loading system/packet/avrcp/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ cc_library_static { "avrcp_reject_packet.cc", "capabilities_packet.cc", "change_path.cc", "general_reject_packet.cc", "get_element_attributes_packet.cc", "get_folder_items.cc", "get_item_attributes.cc", Loading system/packet/avrcp/general_reject_packet.cc 0 → 100644 +47 −0 Original line number Diff line number Diff line /* * Copyright 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "general_reject_packet.h" namespace bluetooth { namespace avrcp { std::unique_ptr<GeneralRejectBuilder> GeneralRejectBuilder::MakeBuilder( BrowsePdu pdu, Status reason) { std::unique_ptr<GeneralRejectBuilder> builder = std::unique_ptr<GeneralRejectBuilder>( new GeneralRejectBuilder(pdu, reason)); return builder; } size_t GeneralRejectBuilder::size() const { return BrowsePacket::kMinSize() + 1; } bool GeneralRejectBuilder::Serialize( const std::shared_ptr<::bluetooth::Packet>& pkt) { ReserveSpace(pkt, size()); BrowsePacketBuilder::PushHeader(pkt, size() - BrowsePacket::kMinSize()); AddPayloadOctets1(pkt, static_cast<uint8_t>(reason_)); return true; } } // namespace avrcp } // namespace bluetooth system/packet/avrcp/general_reject_packet.h 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "avrcp_browse_packet.h" namespace bluetooth { namespace avrcp { class GeneralRejectBuilder : public BrowsePacketBuilder { public: virtual ~GeneralRejectBuilder() = default; static std::unique_ptr<GeneralRejectBuilder> MakeBuilder(BrowsePdu pdu, Status reason); virtual size_t size() const override; virtual bool Serialize( const std::shared_ptr<::bluetooth::Packet>& pkt) override; protected: Status reason_; GeneralRejectBuilder(BrowsePdu pdu, Status reason) : BrowsePacketBuilder(pdu), reason_(reason){}; }; } // namespace avrcp } // namespace bluetooth Loading
system/include/hardware/avrcp/avrcp_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ enum class BrowsePdu : uint8_t { CHANGE_PATH = 0x72, GET_ITEM_ATTRIBUTES = 0x73, GET_TOTAL_NUMBER_OF_ITEMS = 0x75, GENERAL_REJECT = 0xa0, }; enum class Scope : uint8_t { Loading
system/packet/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ cc_test { "tests/avrcp/avrcp_packet_test.cc", "tests/avrcp/avrcp_reject_packet_test.cc", "tests/avrcp/change_path_packet_test.cc", "tests/avrcp/general_reject_packet_test.cc", "tests/avrcp/get_capabilities_packet_test.cc", "tests/avrcp/get_element_attributes_packet_test.cc", "tests/avrcp/get_folder_items_packet_test.cc", Loading
system/packet/avrcp/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ cc_library_static { "avrcp_reject_packet.cc", "capabilities_packet.cc", "change_path.cc", "general_reject_packet.cc", "get_element_attributes_packet.cc", "get_folder_items.cc", "get_item_attributes.cc", Loading
system/packet/avrcp/general_reject_packet.cc 0 → 100644 +47 −0 Original line number Diff line number Diff line /* * Copyright 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "general_reject_packet.h" namespace bluetooth { namespace avrcp { std::unique_ptr<GeneralRejectBuilder> GeneralRejectBuilder::MakeBuilder( BrowsePdu pdu, Status reason) { std::unique_ptr<GeneralRejectBuilder> builder = std::unique_ptr<GeneralRejectBuilder>( new GeneralRejectBuilder(pdu, reason)); return builder; } size_t GeneralRejectBuilder::size() const { return BrowsePacket::kMinSize() + 1; } bool GeneralRejectBuilder::Serialize( const std::shared_ptr<::bluetooth::Packet>& pkt) { ReserveSpace(pkt, size()); BrowsePacketBuilder::PushHeader(pkt, size() - BrowsePacket::kMinSize()); AddPayloadOctets1(pkt, static_cast<uint8_t>(reason_)); return true; } } // namespace avrcp } // namespace bluetooth
system/packet/avrcp/general_reject_packet.h 0 → 100644 +43 −0 Original line number Diff line number Diff line /* * Copyright 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "avrcp_browse_packet.h" namespace bluetooth { namespace avrcp { class GeneralRejectBuilder : public BrowsePacketBuilder { public: virtual ~GeneralRejectBuilder() = default; static std::unique_ptr<GeneralRejectBuilder> MakeBuilder(BrowsePdu pdu, Status reason); virtual size_t size() const override; virtual bool Serialize( const std::shared_ptr<::bluetooth::Packet>& pkt) override; protected: Status reason_; GeneralRejectBuilder(BrowsePdu pdu, Status reason) : BrowsePacketBuilder(pdu), reason_(reason){}; }; } // namespace avrcp } // namespace bluetooth