195489c19Sopenharmony_ci/* 295489c19Sopenharmony_ci * Copyright (C) 2021 Huawei Device Co., Ltd. 395489c19Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 495489c19Sopenharmony_ci * you may not use this file except in compliance with the License. 595489c19Sopenharmony_ci * You may obtain a copy of the License at 695489c19Sopenharmony_ci * 795489c19Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 895489c19Sopenharmony_ci * 995489c19Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1095489c19Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1195489c19Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1295489c19Sopenharmony_ci * See the License for the specific language governing permissions and 1395489c19Sopenharmony_ci * limitations under the License. 1495489c19Sopenharmony_ci */ 1595489c19Sopenharmony_ci 1695489c19Sopenharmony_ci/** 1795489c19Sopenharmony_ci * @file bluetooth_avrcp_ct.h 1895489c19Sopenharmony_ci * 1995489c19Sopenharmony_ci * @brief Declares the class of the AVRCP controller framework, including attributes and methods. 2095489c19Sopenharmony_ci * 2195489c19Sopenharmony_ci * @since 6 2295489c19Sopenharmony_ci */ 2395489c19Sopenharmony_ci 2495489c19Sopenharmony_ci#ifndef BLUETOOTH_AVRCP_CT_H 2595489c19Sopenharmony_ci#define BLUETOOTH_AVRCP_CT_H 2695489c19Sopenharmony_ci 2795489c19Sopenharmony_ci#include <vector> 2895489c19Sopenharmony_ci 2995489c19Sopenharmony_ci#include "bluetooth_def.h" 3095489c19Sopenharmony_ci#include "bluetooth_types.h" 3195489c19Sopenharmony_ci#include "bluetooth_remote_device.h" 3295489c19Sopenharmony_ci#include "bluetooth_no_destructor.h" 3395489c19Sopenharmony_ci 3495489c19Sopenharmony_cinamespace OHOS { 3595489c19Sopenharmony_cinamespace Bluetooth { 3695489c19Sopenharmony_ci/** 3795489c19Sopenharmony_ci * @brief This class provides the attribute of the result of the actions. 3895489c19Sopenharmony_ci * 3995489c19Sopenharmony_ci * @since 6 4095489c19Sopenharmony_ci */ 4195489c19Sopenharmony_ciclass AvrcpCtResponse { 4295489c19Sopenharmony_cipublic: 4395489c19Sopenharmony_ci /** 4495489c19Sopenharmony_ci * @brief This struct declares the attributes of the button. 4595489c19Sopenharmony_ci * 4695489c19Sopenharmony_ci * @since 6 4795489c19Sopenharmony_ci */ 4895489c19Sopenharmony_ci class Button { 4995489c19Sopenharmony_ci public: 5095489c19Sopenharmony_ci explicit Button(uint8_t code) : code_(code) 5195489c19Sopenharmony_ci {}; 5295489c19Sopenharmony_ci ~Button() 5395489c19Sopenharmony_ci {}; 5495489c19Sopenharmony_ci uint8_t code_; // The value of the button. 5595489c19Sopenharmony_ci 5695489c19Sopenharmony_ci private: 5795489c19Sopenharmony_ci Button() = delete; 5895489c19Sopenharmony_ci }; 5995489c19Sopenharmony_ci 6095489c19Sopenharmony_ci /** 6195489c19Sopenharmony_ci * @brief This struct declares a set of capabilities supported by TG. 6295489c19Sopenharmony_ci * 6395489c19Sopenharmony_ci * @since 6 6495489c19Sopenharmony_ci */ 6595489c19Sopenharmony_ci class Capabilities { 6695489c19Sopenharmony_ci public: 6795489c19Sopenharmony_ci explicit Capabilities(std::vector<uint32_t> companies) : companies_(companies) 6895489c19Sopenharmony_ci {}; 6995489c19Sopenharmony_ci explicit Capabilities(std::vector<uint8_t> events) : events_(events) 7095489c19Sopenharmony_ci {}; 7195489c19Sopenharmony_ci ~Capabilities() 7295489c19Sopenharmony_ci { 7395489c19Sopenharmony_ci events_.clear(); 7495489c19Sopenharmony_ci companies_.clear(); 7595489c19Sopenharmony_ci } 7695489c19Sopenharmony_ci std::vector<uint32_t> companies_; 7795489c19Sopenharmony_ci std::vector<uint8_t> events_; 7895489c19Sopenharmony_ci 7995489c19Sopenharmony_ci private: 8095489c19Sopenharmony_ci Capabilities() = delete; 8195489c19Sopenharmony_ci }; 8295489c19Sopenharmony_ci 8395489c19Sopenharmony_ci /** 8495489c19Sopenharmony_ci * @brief This struct declares a set of attributes of the player application setting. 8595489c19Sopenharmony_ci * 8695489c19Sopenharmony_ci * @since 6 8795489c19Sopenharmony_ci */ 8895489c19Sopenharmony_ci class PlayerSettingAttributes { 8995489c19Sopenharmony_ci public: 9095489c19Sopenharmony_ci explicit PlayerSettingAttributes(std::vector<uint8_t> attributes) : attributes_(attributes) 9195489c19Sopenharmony_ci {}; 9295489c19Sopenharmony_ci ~PlayerSettingAttributes() 9395489c19Sopenharmony_ci { 9495489c19Sopenharmony_ci attributes_.clear(); 9595489c19Sopenharmony_ci }; 9695489c19Sopenharmony_ci std::vector<uint8_t> attributes_; // The attribute of the player application setting. 9795489c19Sopenharmony_ci 9895489c19Sopenharmony_ci private: 9995489c19Sopenharmony_ci PlayerSettingAttributes() = delete; 10095489c19Sopenharmony_ci }; 10195489c19Sopenharmony_ci 10295489c19Sopenharmony_ci /** 10395489c19Sopenharmony_ci * @brief This struct declares a set of attributes of the player application setting values. 10495489c19Sopenharmony_ci * 10595489c19Sopenharmony_ci * @since 6 10695489c19Sopenharmony_ci */ 10795489c19Sopenharmony_ci class PlayerSettingValues { 10895489c19Sopenharmony_ci public: 10995489c19Sopenharmony_ci PlayerSettingValues(uint8_t attribute, const std::vector<uint8_t> &values) 11095489c19Sopenharmony_ci : attribute_(attribute), values_(values) 11195489c19Sopenharmony_ci {}; 11295489c19Sopenharmony_ci ~PlayerSettingValues() 11395489c19Sopenharmony_ci { 11495489c19Sopenharmony_ci values_.clear(); 11595489c19Sopenharmony_ci }; 11695489c19Sopenharmony_ci uint8_t attribute_; // The attribute of the player application setting. 11795489c19Sopenharmony_ci std::vector<uint8_t> values_; // The values of the specified attribute of the player application setting. 11895489c19Sopenharmony_ci 11995489c19Sopenharmony_ci private: 12095489c19Sopenharmony_ci PlayerSettingValues() = delete; 12195489c19Sopenharmony_ci }; 12295489c19Sopenharmony_ci 12395489c19Sopenharmony_ci /** 12495489c19Sopenharmony_ci * @brief This struct declares a set of attributes of the current player application setting value. 12595489c19Sopenharmony_ci * 12695489c19Sopenharmony_ci * @since 6 12795489c19Sopenharmony_ci */ 12895489c19Sopenharmony_ci class PlayerSettingCurrentValue { 12995489c19Sopenharmony_ci public: 13095489c19Sopenharmony_ci PlayerSettingCurrentValue(const std::vector<uint8_t> &attributes, const std::vector<uint8_t> &values) 13195489c19Sopenharmony_ci : attributes_(attributes), values_(values) 13295489c19Sopenharmony_ci {}; 13395489c19Sopenharmony_ci ~PlayerSettingCurrentValue() 13495489c19Sopenharmony_ci { 13595489c19Sopenharmony_ci attributes_.clear(); 13695489c19Sopenharmony_ci values_.clear(); 13795489c19Sopenharmony_ci }; 13895489c19Sopenharmony_ci std::vector<uint8_t> attributes_; // The attribute of the player application settings. 13995489c19Sopenharmony_ci std::vector<uint8_t> values_; // The value of the specified attribute of the player application settings. 14095489c19Sopenharmony_ci 14195489c19Sopenharmony_ci private: 14295489c19Sopenharmony_ci PlayerSettingCurrentValue() = delete; 14395489c19Sopenharmony_ci }; 14495489c19Sopenharmony_ci 14595489c19Sopenharmony_ci /** 14695489c19Sopenharmony_ci * @brief This struct declares a set of attributes of the player application getting attribtue text. 14795489c19Sopenharmony_ci * 14895489c19Sopenharmony_ci * @since 6 14995489c19Sopenharmony_ci */ 15095489c19Sopenharmony_ci class PlayerGettingText { 15195489c19Sopenharmony_ci public: 15295489c19Sopenharmony_ci PlayerGettingText(const std::vector<uint8_t> &attributes, const std::vector<std::string> &attrStr) 15395489c19Sopenharmony_ci : attributes_(attributes), attrStr_(attrStr) 15495489c19Sopenharmony_ci {}; 15595489c19Sopenharmony_ci ~PlayerGettingText() 15695489c19Sopenharmony_ci { 15795489c19Sopenharmony_ci attributes_.clear(); 15895489c19Sopenharmony_ci attrStr_.clear(); 15995489c19Sopenharmony_ci }; 16095489c19Sopenharmony_ci std::vector<uint8_t> attributes_; // The attribute of the player application settings. 16195489c19Sopenharmony_ci std::vector<std::string> attrStr_; // The values associated witch the attribute. 16295489c19Sopenharmony_ci 16395489c19Sopenharmony_ci private: 16495489c19Sopenharmony_ci PlayerGettingText() = delete; 16595489c19Sopenharmony_ci }; 16695489c19Sopenharmony_ci 16795489c19Sopenharmony_ci /** 16895489c19Sopenharmony_ci * @brief This struct declares a set of element attribute. 16995489c19Sopenharmony_ci * 17095489c19Sopenharmony_ci * @since 6 17195489c19Sopenharmony_ci */ 17295489c19Sopenharmony_ci class ElementAttributes { 17395489c19Sopenharmony_ci public: 17495489c19Sopenharmony_ci ElementAttributes(const std::vector<uint32_t> &attributes, const std::vector<std::string> &values) 17595489c19Sopenharmony_ci : attributes_(attributes), values_(values) 17695489c19Sopenharmony_ci {}; 17795489c19Sopenharmony_ci ~ElementAttributes() 17895489c19Sopenharmony_ci { 17995489c19Sopenharmony_ci attributes_.clear(); 18095489c19Sopenharmony_ci values_.clear(); 18195489c19Sopenharmony_ci }; 18295489c19Sopenharmony_ci std::vector<uint32_t> attributes_; // The attribute of the player application settings. 18395489c19Sopenharmony_ci std::vector<std::string> values_; // The value of the specified attribute of the player application settings. 18495489c19Sopenharmony_ci 18595489c19Sopenharmony_ci private: 18695489c19Sopenharmony_ci ElementAttributes() = delete; 18795489c19Sopenharmony_ci }; 18895489c19Sopenharmony_ci 18995489c19Sopenharmony_ci /** 19095489c19Sopenharmony_ci * @brief This struct declares the attributes of the player status. 19195489c19Sopenharmony_ci * 19295489c19Sopenharmony_ci * @since 6 19395489c19Sopenharmony_ci */ 19495489c19Sopenharmony_ci class PlayStatus { 19595489c19Sopenharmony_ci public: 19695489c19Sopenharmony_ci PlayStatus(uint32_t songLength, uint32_t songPosition, uint8_t playStatus) 19795489c19Sopenharmony_ci : songLength_(songLength), songPosition_(songPosition), playStatus_(playStatus) 19895489c19Sopenharmony_ci {}; 19995489c19Sopenharmony_ci ~PlayStatus() 20095489c19Sopenharmony_ci {}; 20195489c19Sopenharmony_ci uint32_t songLength_; // The total length of the playing song in milliseconds. 20295489c19Sopenharmony_ci uint32_t songPosition_; // The current position of the playing in milliseconds elapsed. 20395489c19Sopenharmony_ci uint8_t playStatus_; // The current status of playing. Refer to <b>AvrcPlayStatus</b>. 20495489c19Sopenharmony_ci 20595489c19Sopenharmony_ci private: 20695489c19Sopenharmony_ci PlayStatus() = delete; 20795489c19Sopenharmony_ci }; 20895489c19Sopenharmony_ci 20995489c19Sopenharmony_ci /** 21095489c19Sopenharmony_ci * @brief This struct declares the attributes of the media item. 21195489c19Sopenharmony_ci * 21295489c19Sopenharmony_ci * @since 6 21395489c19Sopenharmony_ci 21495489c19Sopenharmony_ci */ 21595489c19Sopenharmony_ci class MediaItems { 21695489c19Sopenharmony_ci public: 21795489c19Sopenharmony_ci struct MediaItem { 21895489c19Sopenharmony_ci // The value of the "Folder Type" and the "Media Type". Refer to <b>AvrcMediaFolderType</b> and 21995489c19Sopenharmony_ci // <b>AvrcMediaElementType</b>. 22095489c19Sopenharmony_ci uint8_t type_ {AVRC_MEDIA_ELEMENT_TYPE_RESERVED}; 22195489c19Sopenharmony_ci // The value of the "Is Playable". Refer to <b>AvrcMediaFolderPlayable</b>. 22295489c19Sopenharmony_ci uint8_t playable_ {AVRC_MEDIA_FOLDER_PLAYABLE_RESERVED}; 22395489c19Sopenharmony_ci uint64_t uid_ {0xFFFFFFFFFFFFFFFF}; 22495489c19Sopenharmony_ci // The value of the "Displayable Name". 22595489c19Sopenharmony_ci std::string name_; 22695489c19Sopenharmony_ci // The list of the "Attribute ID". Refer to <b>AvrcMediaAttribute</b>. 22795489c19Sopenharmony_ci std::vector<uint32_t> attributes_; 22895489c19Sopenharmony_ci // The list of the "Attribute Value". 22995489c19Sopenharmony_ci std::vector<std::string> values_; 23095489c19Sopenharmony_ci }; 23195489c19Sopenharmony_ci MediaItems(uint16_t uidCounter, const std::vector<MediaItem> &mediaItems) 23295489c19Sopenharmony_ci : uidCounter_(uidCounter), mediaItems_(mediaItems) 23395489c19Sopenharmony_ci {}; 23495489c19Sopenharmony_ci ~MediaItems() 23595489c19Sopenharmony_ci {}; 23695489c19Sopenharmony_ci 23795489c19Sopenharmony_ci uint16_t uidCounter_ {0xFFFF}; 23895489c19Sopenharmony_ci std::vector<MediaItem> mediaItems_; 23995489c19Sopenharmony_ci 24095489c19Sopenharmony_ci private: 24195489c19Sopenharmony_ci MediaItems() = delete; 24295489c19Sopenharmony_ci }; 24395489c19Sopenharmony_ci 24495489c19Sopenharmony_ci /** 24595489c19Sopenharmony_ci * @brief This struct declares the the media player list. 24695489c19Sopenharmony_ci * 24795489c19Sopenharmony_ci * @since 6 24895489c19Sopenharmony_ci */ 24995489c19Sopenharmony_ci class MediaPlayers { 25095489c19Sopenharmony_ci public: 25195489c19Sopenharmony_ci struct MediaPlayer { 25295489c19Sopenharmony_ci /// The value of the "Folder Type" and the "Media Type". Refer to <b>AvrcMediaFolderType</b> and 25395489c19Sopenharmony_ci /// <b>AvrcMediaElementType</b>. 25495489c19Sopenharmony_ci uint8_t itemType_ {AVRC_MEDIA_ELEMENT_TYPE_RESERVED}; 25595489c19Sopenharmony_ci /// The value of the "Is Playable". Refer to <b>AvrcMediaFolderPlayable</b>. 25695489c19Sopenharmony_ci uint16_t playerId_ {AVRC_MEDIA_FOLDER_PLAYABLE_RESERVED}; 25795489c19Sopenharmony_ci ///< The value of the "Major Player Type". Refer to <b>AvrcMediaMajorPlayerType</b>. 25895489c19Sopenharmony_ci uint8_t majorType_ = 0x00; 25995489c19Sopenharmony_ci ///< The value of the "Player Sub Type". Refer to <b>AvrcMediaPlayerSubType</b>. 26095489c19Sopenharmony_ci uint32_t subType_ = 0x00; 26195489c19Sopenharmony_ci ///< The value of the "Play Status". Refer to <b>AvrcPlayStatus</b>. 26295489c19Sopenharmony_ci uint8_t playStatus_ = 0x00; 26395489c19Sopenharmony_ci ///< The value of the "Feature Bit Mask". 26495489c19Sopenharmony_ci std::vector<uint8_t> features_; 26595489c19Sopenharmony_ci ///< The value of the "Displayable Name". 26695489c19Sopenharmony_ci std::string name_ = "\0"; 26795489c19Sopenharmony_ci }; 26895489c19Sopenharmony_ci MediaPlayers(uint16_t uidCounter, const std::vector<MediaPlayer> &mediaPlayers) 26995489c19Sopenharmony_ci : uidCounter_(uidCounter), mediaPlayers_(mediaPlayers) 27095489c19Sopenharmony_ci {}; 27195489c19Sopenharmony_ci ~MediaPlayers() 27295489c19Sopenharmony_ci {}; 27395489c19Sopenharmony_ci 27495489c19Sopenharmony_ci uint16_t uidCounter_ {0xFFFF}; 27595489c19Sopenharmony_ci std::vector<MediaPlayer> mediaPlayers_; 27695489c19Sopenharmony_ci 27795489c19Sopenharmony_ci private: 27895489c19Sopenharmony_ci MediaPlayers() = delete; 27995489c19Sopenharmony_ci }; 28095489c19Sopenharmony_ci 28195489c19Sopenharmony_ci /** 28295489c19Sopenharmony_ci * @brief This struct declares the attributes of the media item attribute. 28395489c19Sopenharmony_ci * 28495489c19Sopenharmony_ci * @since 6 28595489c19Sopenharmony_ci */ 28695489c19Sopenharmony_ci class ItemAttributes { 28795489c19Sopenharmony_ci public: 28895489c19Sopenharmony_ci struct ItemAttribute { 28995489c19Sopenharmony_ci uint32_t attribute_; 29095489c19Sopenharmony_ci std::string value_; 29195489c19Sopenharmony_ci }; 29295489c19Sopenharmony_ci explicit ItemAttributes(const std::vector<ItemAttribute> &itemAttrs) : itemAttrs_(itemAttrs) 29395489c19Sopenharmony_ci {}; 29495489c19Sopenharmony_ci ~ItemAttributes() 29595489c19Sopenharmony_ci {}; 29695489c19Sopenharmony_ci std::vector<ItemAttribute> itemAttrs_; 29795489c19Sopenharmony_ci 29895489c19Sopenharmony_ci private: 29995489c19Sopenharmony_ci ItemAttributes() = delete; 30095489c19Sopenharmony_ci }; 30195489c19Sopenharmony_ci 30295489c19Sopenharmony_ci /** 30395489c19Sopenharmony_ci * @brief This struct declares a set of attributes of the player application setting values. 30495489c19Sopenharmony_ci * 30595489c19Sopenharmony_ci * @since 6 30695489c19Sopenharmony_ci */ 30795489c19Sopenharmony_ci class TotalNumberOfItems { 30895489c19Sopenharmony_ci public: 30995489c19Sopenharmony_ci TotalNumberOfItems(uint16_t uidCounter, uint32_t numOfItems) 31095489c19Sopenharmony_ci : uidCounter_(uidCounter), numOfItems_(numOfItems) 31195489c19Sopenharmony_ci {}; 31295489c19Sopenharmony_ci ~TotalNumberOfItems() 31395489c19Sopenharmony_ci {}; 31495489c19Sopenharmony_ci uint16_t uidCounter_; // The value of the uid counter. 31595489c19Sopenharmony_ci uint32_t numOfItems_; // The number of items in the directory. 31695489c19Sopenharmony_ci 31795489c19Sopenharmony_ci private: 31895489c19Sopenharmony_ci TotalNumberOfItems() = delete; 31995489c19Sopenharmony_ci }; 32095489c19Sopenharmony_ci 32195489c19Sopenharmony_ci /** 32295489c19Sopenharmony_ci * @brief This struct declares a set of attributes of the player application setting values. 32395489c19Sopenharmony_ci * 32495489c19Sopenharmony_ci * @since 6 32595489c19Sopenharmony_ci */ 32695489c19Sopenharmony_ci class AbsoluteVolume { 32795489c19Sopenharmony_ci public: 32895489c19Sopenharmony_ci explicit AbsoluteVolume(uint8_t volume) : volume_(volume) 32995489c19Sopenharmony_ci {}; 33095489c19Sopenharmony_ci ~AbsoluteVolume() 33195489c19Sopenharmony_ci {}; 33295489c19Sopenharmony_ci uint8_t volume_; // The percentage of the absolute volume.Refer to <b> AvrcAbsoluteVolume</ b>. 33395489c19Sopenharmony_ci 33495489c19Sopenharmony_ci private: 33595489c19Sopenharmony_ci AbsoluteVolume() = delete; 33695489c19Sopenharmony_ci }; 33795489c19Sopenharmony_ci 33895489c19Sopenharmony_ci /** 33995489c19Sopenharmony_ci * @brief This struct declares a set of attributes of the notifications. 34095489c19Sopenharmony_ci * 34195489c19Sopenharmony_ci * @since 6 34295489c19Sopenharmony_ci */ 34395489c19Sopenharmony_ci class Notification { 34495489c19Sopenharmony_ci public: 34595489c19Sopenharmony_ci Notification(uint8_t playStatus, uint8_t volume) : playStatus_(playStatus), volume_(volume) 34695489c19Sopenharmony_ci {}; 34795489c19Sopenharmony_ci explicit Notification(uint64_t uid) : uid_(uid) 34895489c19Sopenharmony_ci {}; 34995489c19Sopenharmony_ci explicit Notification(uint32_t playbackPos) : playbackPos_(playbackPos) 35095489c19Sopenharmony_ci {}; 35195489c19Sopenharmony_ci Notification(const std::vector<uint8_t> &attributes, const std::vector<uint8_t> &values) 35295489c19Sopenharmony_ci : attributes_(attributes), values_(values) 35395489c19Sopenharmony_ci {}; 35495489c19Sopenharmony_ci Notification(uint16_t playerId, uint16_t uidCounter) : playerId_(playerId), uidCounter_(uidCounter) 35595489c19Sopenharmony_ci {}; 35695489c19Sopenharmony_ci explicit Notification(uint16_t uidCounter) : uidCounter_(uidCounter) 35795489c19Sopenharmony_ci {}; 35895489c19Sopenharmony_ci ~Notification() 35995489c19Sopenharmony_ci {}; 36095489c19Sopenharmony_ci uint8_t playStatus_ {AVRC_PLAY_STATUS_ERROR}; // The value of the "PlayStatus". 36195489c19Sopenharmony_ci uint64_t uid_ {0xFFFFFFFFFFFFFFFF}; // The value of the "Identifier". 36295489c19Sopenharmony_ci uint32_t playbackPos_ {0x00000000}; // The value of the "Playback position". 36395489c19Sopenharmony_ci std::vector<uint8_t> attributes_; // The value of the "PlayerApplicationSettingAttributeID". 36495489c19Sopenharmony_ci std::vector<uint8_t> values_; // The value of the "PlayerApplicationSettingValueID". 36595489c19Sopenharmony_ci uint16_t playerId_ {0xFFFF}; // The value of the "Player Id". 36695489c19Sopenharmony_ci uint16_t uidCounter_ {0xFFFF}; // The value of the "UID Counter". 36795489c19Sopenharmony_ci uint8_t volume_ {AVRC_ABSOLUTE_VOLUME_INVALID}; // The value of the "Absolute Volume". 36895489c19Sopenharmony_ci private: 36995489c19Sopenharmony_ci Notification() = delete; 37095489c19Sopenharmony_ci }; 37195489c19Sopenharmony_ci 37295489c19Sopenharmony_ci AvrcpCtResponse(uint8_t type, int resp); 37395489c19Sopenharmony_ci ~AvrcpCtResponse(); 37495489c19Sopenharmony_ci 37595489c19Sopenharmony_ci uint8_t type_; // The type of the action. 37695489c19Sopenharmony_ci int resp_; // The result of the called action. 37795489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::Button</b> class. 37895489c19Sopenharmony_ci std::unique_ptr<Button> button_ {nullptr}; 37995489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::GetCapabilities</b> class. 38095489c19Sopenharmony_ci std::unique_ptr<Capabilities> capabilities_ {nullptr}; 38195489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::PlayerSettingAttributes</b> class. 38295489c19Sopenharmony_ci std::unique_ptr<PlayerSettingAttributes> playerAttrs_ {nullptr}; 38395489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::PlayerSettingValues</b> class. 38495489c19Sopenharmony_ci std::unique_ptr<PlayerSettingValues> playerVals_ {nullptr}; 38595489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::PlayerSettingCurrentValue</b> class. 38695489c19Sopenharmony_ci std::unique_ptr<PlayerSettingCurrentValue> playerCurVal_ {nullptr}; 38795489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::PlayerGettingAttribtueText</b> class. 38895489c19Sopenharmony_ci std::unique_ptr<PlayerGettingText> playerText_ {nullptr}; 38995489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::GetElementAttributes</b> class. 39095489c19Sopenharmony_ci std::unique_ptr<ElementAttributes> eleSts_ {nullptr}; 39195489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::PlayStatus</b> class. 39295489c19Sopenharmony_ci std::unique_ptr<PlayStatus> playSts_ {nullptr}; 39395489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::MediaItem</b> class. 39495489c19Sopenharmony_ci std::unique_ptr<MediaItems> mediaItems_ {nullptr}; 39595489c19Sopenharmony_ci ///< The unique pointer to the <b>AvrcpCtResponse::MediaPlayer</b> class. 39695489c19Sopenharmony_ci std::unique_ptr<MediaPlayers> mediaPlayers_ {nullptr}; 39795489c19Sopenharmony_ci ///< The unique pointer to the <b>AvrcpCtResponse::ItemAttributes</b> class. 39895489c19Sopenharmony_ci std::unique_ptr<ItemAttributes> itemAttrs_ {nullptr}; 39995489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::TotalNumberOfItems</b> class. 40095489c19Sopenharmony_ci std::unique_ptr<TotalNumberOfItems> totalItems_ {nullptr}; 40195489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::AbsoluteVolume</b> class. 40295489c19Sopenharmony_ci std::unique_ptr<AbsoluteVolume> absVolume_ {nullptr}; 40395489c19Sopenharmony_ci // The unique pointer to the <b>AvrcpCtResponse::Notification</b> class. 40495489c19Sopenharmony_ci std::unique_ptr<Notification> notify_ {nullptr}; 40595489c19Sopenharmony_ci 40695489c19Sopenharmony_ciprivate: 40795489c19Sopenharmony_ci AvrcpCtResponse() = delete; 40895489c19Sopenharmony_ci}; 40995489c19Sopenharmony_ci 41095489c19Sopenharmony_ci/** 41195489c19Sopenharmony_ci * @brief This class provides a set of methods for operating the AVRCP controller. 41295489c19Sopenharmony_ci * 41395489c19Sopenharmony_ci * @since 6 41495489c19Sopenharmony_ci */ 41595489c19Sopenharmony_ciclass BLUETOOTH_API AvrcpController { 41695489c19Sopenharmony_cipublic: 41795489c19Sopenharmony_ci /** 41895489c19Sopenharmony_ci * @brief This abstract class declares a set of methods for observing the <b>AvrcpController::IObserver</b> class. 41995489c19Sopenharmony_ci * 42095489c19Sopenharmony_ci * @since 6 42195489c19Sopenharmony_ci */ 42295489c19Sopenharmony_ci class IObserver { 42395489c19Sopenharmony_ci public: 42495489c19Sopenharmony_ci /** 42595489c19Sopenharmony_ci * @brief A constructor used to create an <b>AvrcpController::IObserver</b> instance. 42695489c19Sopenharmony_ci * 42795489c19Sopenharmony_ci * @since 6 42895489c19Sopenharmony_ci */ 42995489c19Sopenharmony_ci IObserver() = default; 43095489c19Sopenharmony_ci 43195489c19Sopenharmony_ci /** 43295489c19Sopenharmony_ci * @brief A destructor used to delete the <b>AvrcpController::IObserver</b> instance. 43395489c19Sopenharmony_ci * 43495489c19Sopenharmony_ci * @since 6 43595489c19Sopenharmony_ci */ 43695489c19Sopenharmony_ci virtual ~IObserver() = default; 43795489c19Sopenharmony_ci 43895489c19Sopenharmony_ci /** 43995489c19Sopenharmony_ci * @brief Observes the state of the connection. 44095489c19Sopenharmony_ci * 44195489c19Sopenharmony_ci * @param[in] device The bluetooth device. 44295489c19Sopenharmony_ci * @param[in] state The connection state. Refer to <b>BTConnectState</b>. 44395489c19Sopenharmony_ci * @param[in] cause The connection change cause. 44495489c19Sopenharmony_ci * 44595489c19Sopenharmony_ci * @since 12 44695489c19Sopenharmony_ci */ 44795489c19Sopenharmony_ci virtual void OnConnectionStateChanged(const BluetoothRemoteDevice &device, int state, int cause) = 0; 44895489c19Sopenharmony_ci 44995489c19Sopenharmony_ci /** 45095489c19Sopenharmony_ci * @brief Observes the status of the other actions. 45195489c19Sopenharmony_ci * 45295489c19Sopenharmony_ci * @param[in] device The bluetooth device. 45395489c19Sopenharmony_ci * @param[in] resp The result of the called action. 45495489c19Sopenharmony_ci * 45595489c19Sopenharmony_ci * @since 6 45695489c19Sopenharmony_ci */ 45795489c19Sopenharmony_ci virtual void OnActionCompleted(const BluetoothRemoteDevice &device, const AvrcpCtResponse &resp) = 0; 45895489c19Sopenharmony_ci }; 45995489c19Sopenharmony_ci 46095489c19Sopenharmony_ci /** 46195489c19Sopenharmony_ci * @brief Gets the static instance of the <b>AvrcpController</b> class. 46295489c19Sopenharmony_ci * 46395489c19Sopenharmony_ci * @return The static instance. 46495489c19Sopenharmony_ci * 46595489c19Sopenharmony_ci * @since 6 46695489c19Sopenharmony_ci */ 46795489c19Sopenharmony_ci static AvrcpController *GetProfile(void); 46895489c19Sopenharmony_ci 46995489c19Sopenharmony_ci /****************************************************************** 47095489c19Sopenharmony_ci * REGISTER / UNREGISTER OBSERVER * 47195489c19Sopenharmony_ci ******************************************************************/ 47295489c19Sopenharmony_ci 47395489c19Sopenharmony_ci /** 47495489c19Sopenharmony_ci * @brief Registers the observer. 47595489c19Sopenharmony_ci * 47695489c19Sopenharmony_ci * @param[in] observer The pointer to the <b>AvrcpController::IObserver</b>. 47795489c19Sopenharmony_ci * @since 6 47895489c19Sopenharmony_ci */ 47995489c19Sopenharmony_ci void RegisterObserver(std::shared_ptr<AvrcpController::IObserver> observer); 48095489c19Sopenharmony_ci 48195489c19Sopenharmony_ci /** 48295489c19Sopenharmony_ci * @brief Unregisters the observer. 48395489c19Sopenharmony_ci * 48495489c19Sopenharmony_ci * @param[in] observer The pointer to the <b>AvrcpController::IObserver</b>. 48595489c19Sopenharmony_ci * @since 6 48695489c19Sopenharmony_ci */ 48795489c19Sopenharmony_ci void UnregisterObserver(std::shared_ptr<AvrcpController::IObserver> observer); 48895489c19Sopenharmony_ci 48995489c19Sopenharmony_ci /****************************************************************** 49095489c19Sopenharmony_ci * CONNECTION * 49195489c19Sopenharmony_ci ******************************************************************/ 49295489c19Sopenharmony_ci 49395489c19Sopenharmony_ci /** 49495489c19Sopenharmony_ci * @brief Gets the connected devices. 49595489c19Sopenharmony_ci * 49695489c19Sopenharmony_ci * @return The list of the instance of the <b>BluetoothRemoteDevice</b> class. 49795489c19Sopenharmony_ci * 49895489c19Sopenharmony_ci * @since 6 49995489c19Sopenharmony_ci */ 50095489c19Sopenharmony_ci std::vector<BluetoothRemoteDevice> GetConnectedDevices(void); 50195489c19Sopenharmony_ci 50295489c19Sopenharmony_ci /** 50395489c19Sopenharmony_ci * @brief Gets the devices of the specified states. 50495489c19Sopenharmony_ci * 50595489c19Sopenharmony_ci * @param[in] states The connection states. Refer to <b>BTConnectState</b>. 50695489c19Sopenharmony_ci * @return The list of the instance of the <b>BluetoothRemoteDevice</b> class. 50795489c19Sopenharmony_ci * 50895489c19Sopenharmony_ci * @since 6 50995489c19Sopenharmony_ci */ 51095489c19Sopenharmony_ci std::vector<BluetoothRemoteDevice> GetDevicesByStates(const std::vector<int> &states); 51195489c19Sopenharmony_ci 51295489c19Sopenharmony_ci /** 51395489c19Sopenharmony_ci * @brief Gets the connection state of the specified bluetooth device. 51495489c19Sopenharmony_ci * 51595489c19Sopenharmony_ci * @param[in] device The bluetooth device. 51695489c19Sopenharmony_ci * @return The connection state. Refer to <b>BTConnectState</b>. 51795489c19Sopenharmony_ci * 51895489c19Sopenharmony_ci * @since 6 51995489c19Sopenharmony_ci */ 52095489c19Sopenharmony_ci int GetDeviceState(const BluetoothRemoteDevice &device); 52195489c19Sopenharmony_ci 52295489c19Sopenharmony_ci /** 52395489c19Sopenharmony_ci * @brief Connects to the AVRCP TG service. 52495489c19Sopenharmony_ci * 52595489c19Sopenharmony_ci * @param[in] device The bluetooth device. 52695489c19Sopenharmony_ci * @return The result of the method execution. 52795489c19Sopenharmony_ci * @retval true command send success. 52895489c19Sopenharmony_ci * @retval false command seend failed. 52995489c19Sopenharmony_ci * 53095489c19Sopenharmony_ci * @since 6 53195489c19Sopenharmony_ci */ 53295489c19Sopenharmony_ci bool Connect(const BluetoothRemoteDevice &device); 53395489c19Sopenharmony_ci 53495489c19Sopenharmony_ci /** 53595489c19Sopenharmony_ci * @brief Disconnects from the AVRCP TG service. 53695489c19Sopenharmony_ci * 53795489c19Sopenharmony_ci * @param[in] device The bluetooth device. 53895489c19Sopenharmony_ci * @return The result of the method execution. 53995489c19Sopenharmony_ci * @retval true command send success. 54095489c19Sopenharmony_ci * @retval false command seend failed. 54195489c19Sopenharmony_ci * 54295489c19Sopenharmony_ci * @since 6 54395489c19Sopenharmony_ci */ 54495489c19Sopenharmony_ci bool Disconnect(const BluetoothRemoteDevice &device); 54595489c19Sopenharmony_ci 54695489c19Sopenharmony_ci /****************************************************************** 54795489c19Sopenharmony_ci * BUTTON OPERATION * 54895489c19Sopenharmony_ci ******************************************************************/ 54995489c19Sopenharmony_ci 55095489c19Sopenharmony_ci /** 55195489c19Sopenharmony_ci * @brief Presses the button. 55295489c19Sopenharmony_ci * 55395489c19Sopenharmony_ci * @param[in] device The bluetooth device. 55495489c19Sopenharmony_ci * @param[in] button The value of the key operation. Refer to <b>AvrcKeyOperation</b> 55595489c19Sopenharmony_ci * @return The result of the method execution. 55695489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 55795489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 55895489c19Sopenharmony_ci * @retval RET_BAD_PARAM Bad parameters. 55995489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 56095489c19Sopenharmony_ci * 56195489c19Sopenharmony_ci * @since 6 56295489c19Sopenharmony_ci */ 56395489c19Sopenharmony_ci int PressButton(const BluetoothRemoteDevice &device, uint8_t button); 56495489c19Sopenharmony_ci 56595489c19Sopenharmony_ci /** 56695489c19Sopenharmony_ci * @brief Releases the button. 56795489c19Sopenharmony_ci * 56895489c19Sopenharmony_ci * @param[in] device The bluetooth device. 56995489c19Sopenharmony_ci * @param[in] button The value of the key operation. Refer to <b>AvrcKeyOperation</b> 57095489c19Sopenharmony_ci * @return The result of the method execution. 57195489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 57295489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 57395489c19Sopenharmony_ci * @retval RET_BAD_PARAM Bad parameters. 57495489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 57595489c19Sopenharmony_ci * 57695489c19Sopenharmony_ci * @since 6 57795489c19Sopenharmony_ci */ 57895489c19Sopenharmony_ci int ReleaseButton(const BluetoothRemoteDevice &device, uint8_t button); 57995489c19Sopenharmony_ci 58095489c19Sopenharmony_ci /****************************************************************** 58195489c19Sopenharmony_ci * UNIT INFO / SUB UNIT INFO * 58295489c19Sopenharmony_ci ******************************************************************/ 58395489c19Sopenharmony_ci 58495489c19Sopenharmony_ci // TEMP 58595489c19Sopenharmony_ci /** 58695489c19Sopenharmony_ci * @brief Gets the unit information. 58795489c19Sopenharmony_ci * 58895489c19Sopenharmony_ci * @param[in] device The bluetooth device. 58995489c19Sopenharmony_ci * @return The result of the method execution. 59095489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 59195489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 59295489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 59395489c19Sopenharmony_ci * 59495489c19Sopenharmony_ci * @since 6 59595489c19Sopenharmony_ci */ 59695489c19Sopenharmony_ci int GetUnitInfo(const BluetoothRemoteDevice &device); 59795489c19Sopenharmony_ci 59895489c19Sopenharmony_ci // TEMP 59995489c19Sopenharmony_ci /** 60095489c19Sopenharmony_ci * @brief Gets the sub unit information. 60195489c19Sopenharmony_ci * 60295489c19Sopenharmony_ci * @param[in] device The bluetooth device. 60395489c19Sopenharmony_ci * @return The result of the method execution. 60495489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 60595489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 60695489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 60795489c19Sopenharmony_ci * 60895489c19Sopenharmony_ci * @since 6 60995489c19Sopenharmony_ci */ 61095489c19Sopenharmony_ci int GetSubUnitInfo(const BluetoothRemoteDevice &device); 61195489c19Sopenharmony_ci 61295489c19Sopenharmony_ci /****************************************************************** 61395489c19Sopenharmony_ci * Media Player Selection * 61495489c19Sopenharmony_ci ******************************************************************/ 61595489c19Sopenharmony_ci 61695489c19Sopenharmony_ci // TEMP 61795489c19Sopenharmony_ci /** 61895489c19Sopenharmony_ci * @brief Informs which media player wishes to control. 61995489c19Sopenharmony_ci * 62095489c19Sopenharmony_ci * @param[in] device The bluetooth device. 62195489c19Sopenharmony_ci * @param[in] playerId The unique media player id. 62295489c19Sopenharmony_ci * @return The result of the method execution. 62395489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 62495489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 62595489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 62695489c19Sopenharmony_ci * 62795489c19Sopenharmony_ci * @since 6 62895489c19Sopenharmony_ci */ 62995489c19Sopenharmony_ci int SetAddressedPlayer(const BluetoothRemoteDevice &device, uint16_t playerId); 63095489c19Sopenharmony_ci 63195489c19Sopenharmony_ci /** 63295489c19Sopenharmony_ci * @brief Informs to which player browsing commands should be routed. 63395489c19Sopenharmony_ci * 63495489c19Sopenharmony_ci * @param[in] device The bluetooth device. 63595489c19Sopenharmony_ci * @param[in] playerId The unique media player id. 63695489c19Sopenharmony_ci * @return The result of the method execution. 63795489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 63895489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 63995489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 64095489c19Sopenharmony_ci * 64195489c19Sopenharmony_ci * @since 6 64295489c19Sopenharmony_ci */ 64395489c19Sopenharmony_ci int SetBrowsedPlayer(const BluetoothRemoteDevice &device, uint16_t playerId); 64495489c19Sopenharmony_ci 64595489c19Sopenharmony_ci /****************************************************************** 64695489c19Sopenharmony_ci * Capabilities * 64795489c19Sopenharmony_ci ******************************************************************/ 64895489c19Sopenharmony_ci 64995489c19Sopenharmony_ci /** 65095489c19Sopenharmony_ci * @brief Get the supported companies by remote device. 65195489c19Sopenharmony_ci * 65295489c19Sopenharmony_ci * @details This is sent by CT to get the capabilities of the peer device. 65395489c19Sopenharmony_ci * @param[in] rawAddr The address of the bluetooth device. 65495489c19Sopenharmony_ci * @return The result of the method execution. 65595489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 65695489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 65795489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 65895489c19Sopenharmony_ci * 65995489c19Sopenharmony_ci * @since 6 66095489c19Sopenharmony_ci */ 66195489c19Sopenharmony_ci int GetSupportedCompanies(const BluetoothRemoteDevice &device); 66295489c19Sopenharmony_ci 66395489c19Sopenharmony_ci /** 66495489c19Sopenharmony_ci * @brief Get the supported events by remote device. 66595489c19Sopenharmony_ci * 66695489c19Sopenharmony_ci * @details This is sent by CT to get the capabilities of the peer device. 66795489c19Sopenharmony_ci * @param[in] rawAddr The address of the bluetooth device. 66895489c19Sopenharmony_ci * @return The result of the method execution. 66995489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 67095489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 67195489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 67295489c19Sopenharmony_ci * 67395489c19Sopenharmony_ci * @since 6 67495489c19Sopenharmony_ci */ 67595489c19Sopenharmony_ci int GetSupportedEvents(const BluetoothRemoteDevice &device); 67695489c19Sopenharmony_ci /****************************************************************** 67795489c19Sopenharmony_ci * PLAYER APPLICATION SETTINGS * 67895489c19Sopenharmony_ci ******************************************************************/ 67995489c19Sopenharmony_ci 68095489c19Sopenharmony_ci /** 68195489c19Sopenharmony_ci * @brief Gets the attribute of the player application. 68295489c19Sopenharmony_ci * 68395489c19Sopenharmony_ci * @param[in] device The bluetooth device. 68495489c19Sopenharmony_ci * @return The result of the method execution. 68595489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 68695489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 68795489c19Sopenharmony_ci * @retval RET_BAD_PARAM Bad parameters. 68895489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 68995489c19Sopenharmony_ci * 69095489c19Sopenharmony_ci * @since 6 69195489c19Sopenharmony_ci */ 69295489c19Sopenharmony_ci int GetPlayerAppSettingAttributes(const BluetoothRemoteDevice &device); 69395489c19Sopenharmony_ci 69495489c19Sopenharmony_ci /** 69595489c19Sopenharmony_ci * @brief Gets the values of the specified attribute of the player application. 69695489c19Sopenharmony_ci * 69795489c19Sopenharmony_ci * @param[in] device The bluetooth device. 69895489c19Sopenharmony_ci * @param[in] attribute The attribute of the player application setting. Refer to <b>AvrcPlayerAttribute</b>. 69995489c19Sopenharmony_ci * @return The result of the method execution. 70095489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 70195489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 70295489c19Sopenharmony_ci * @retval RET_BAD_PARAM Bad parameters. 70395489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 70495489c19Sopenharmony_ci * 70595489c19Sopenharmony_ci * @since 6 70695489c19Sopenharmony_ci */ 70795489c19Sopenharmony_ci int GetPlayerAppSettingValues(const BluetoothRemoteDevice &device, uint8_t attribute); 70895489c19Sopenharmony_ci 70995489c19Sopenharmony_ci /** 71095489c19Sopenharmony_ci * @brief Gets the current set values on the target for the provided player application setting attributes list. 71195489c19Sopenharmony_ci * 71295489c19Sopenharmony_ci * @param[in] device The bluetooth device. 71395489c19Sopenharmony_ci * @param[in] attributes The attribute of the player application settings. Refer to <b>AvrcPlayerAttribute</b>. 71495489c19Sopenharmony_ci * @return The result of the method execution. 71595489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 71695489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 71795489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 71895489c19Sopenharmony_ci * 71995489c19Sopenharmony_ci * @since 6 72095489c19Sopenharmony_ci */ 72195489c19Sopenharmony_ci int GetPlayerAppSettingCurrentValue(const BluetoothRemoteDevice &device, const std::vector<uint8_t> &attributes); 72295489c19Sopenharmony_ci 72395489c19Sopenharmony_ci /** 72495489c19Sopenharmony_ci * @brief Sets the player application setting list of player application setting values on the target device for the 72595489c19Sopenharmony_ci * corresponding defined list of AvrcPlayerAttribute. 72695489c19Sopenharmony_ci * 72795489c19Sopenharmony_ci * @param[in] device The bluetooth device. 72895489c19Sopenharmony_ci * @param[in] attributes The attribute of the player application settings. Refer to <b>AvrcPlayerAttribute</b>. 72995489c19Sopenharmony_ci * @param[in] values The value of the player application setting attribute. 73095489c19Sopenharmony_ci * @return The result of the method execution. 73195489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 73295489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 73395489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 73495489c19Sopenharmony_ci * 73595489c19Sopenharmony_ci * @since 6 73695489c19Sopenharmony_ci */ 73795489c19Sopenharmony_ci int SetPlayerAppSettingCurrentValue(const BluetoothRemoteDevice &device, const std::vector<uint8_t> &attributes, 73895489c19Sopenharmony_ci const std::vector<uint8_t> &values); 73995489c19Sopenharmony_ci 74095489c19Sopenharmony_ci /** 74195489c19Sopenharmony_ci * @brief provide supported player application setting attribute displayable text. 74295489c19Sopenharmony_ci * 74395489c19Sopenharmony_ci * @details Switch to the thread of the AVRCP CT service in this method. 74495489c19Sopenharmony_ci * @param[in] rawAddr The address of the bluetooth device. 74595489c19Sopenharmony_ci * @param[in] attributes The attribute of the player application settings. 74695489c19Sopenharmony_ci * @return The result of the method execution. 74795489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 74895489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 74995489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 75095489c19Sopenharmony_ci * 75195489c19Sopenharmony_ci * @since 6 75295489c19Sopenharmony_ci */ 75395489c19Sopenharmony_ci int GetPlayerApplicationSettingAttributeText( 75495489c19Sopenharmony_ci const BluetoothRemoteDevice &device, const std::vector<uint8_t> &attributes); 75595489c19Sopenharmony_ci 75695489c19Sopenharmony_ci /** 75795489c19Sopenharmony_ci * @brief request the target device to provide target supported player application setting value displayable text. 75895489c19Sopenharmony_ci * 75995489c19Sopenharmony_ci * @details Switch to the thread of the AVRCP CT service in this method. 76095489c19Sopenharmony_ci * @param[in] rawAddr The address of the bluetooth device. 76195489c19Sopenharmony_ci * @param[in] attributeId Player application setting attribute ID. 76295489c19Sopenharmony_ci * @param[in] values Player application setting value ID. 76395489c19Sopenharmony_ci * @return The result of the method execution. 76495489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 76595489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 76695489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 76795489c19Sopenharmony_ci * 76895489c19Sopenharmony_ci * @since 6 76995489c19Sopenharmony_ci */ 77095489c19Sopenharmony_ci int GetPlayerApplicationSettingValueText( 77195489c19Sopenharmony_ci const BluetoothRemoteDevice &device, uint8_t attributeId, const std::vector<uint8_t> &values); 77295489c19Sopenharmony_ci 77395489c19Sopenharmony_ci /****************************************************************** 77495489c19Sopenharmony_ci * MEDIA INFORMATION PDUS * 77595489c19Sopenharmony_ci ******************************************************************/ 77695489c19Sopenharmony_ci 77795489c19Sopenharmony_ci /** 77895489c19Sopenharmony_ci * @brief Requests the TG to provide the attributes of the element specified in the parameter. 77995489c19Sopenharmony_ci * 78095489c19Sopenharmony_ci * @details Switch to the thread of the AVRCP CT service in this function. 78195489c19Sopenharmony_ci * @param[in] device The bluetooth device. 78295489c19Sopenharmony_ci * @param[in] attributes Specifies the attribute ID for the attributes to be retrieved 78395489c19Sopenharmony_ci * @c RET_NO_ERROR : The action is successful. 78495489c19Sopenharmony_ci * @c RET_NO_SUPPORT : The action is not supported. 78595489c19Sopenharmony_ci * @c RET_BAD_STATUS : The action is failed. 78695489c19Sopenharmony_ci */ 78795489c19Sopenharmony_ci 78895489c19Sopenharmony_ci int GetElementAttributes(const BluetoothRemoteDevice &device, const std::vector<uint32_t> &attributes); 78995489c19Sopenharmony_ci 79095489c19Sopenharmony_ci /****************************************************************** 79195489c19Sopenharmony_ci * PLAY * 79295489c19Sopenharmony_ci ******************************************************************/ 79395489c19Sopenharmony_ci 79495489c19Sopenharmony_ci /** 79595489c19Sopenharmony_ci * @brief Gets the play status. 79695489c19Sopenharmony_ci * 79795489c19Sopenharmony_ci * @param[in] device The bluetooth device. 79895489c19Sopenharmony_ci * @return The result of the method execution. 79995489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 80095489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 80195489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 80295489c19Sopenharmony_ci * 80395489c19Sopenharmony_ci * @since 6 80495489c19Sopenharmony_ci */ 80595489c19Sopenharmony_ci int GetPlayStatus(const BluetoothRemoteDevice &device); 80695489c19Sopenharmony_ci 80795489c19Sopenharmony_ci /** 80895489c19Sopenharmony_ci * @brief Starts playing an item indicated by the UID. 80995489c19Sopenharmony_ci * 81095489c19Sopenharmony_ci * @param[in] device The bluetooth device. 81195489c19Sopenharmony_ci * @param[in] scope The scope in which media content navigation may take place. Refer to <b>AvrcMediaScope</b>. 81295489c19Sopenharmony_ci * @param[in] uid The unique ID of media item. 81395489c19Sopenharmony_ci * @param[in] uidCounter The UID counter shall be incremented every time the TG makes an update. 81495489c19Sopenharmony_ci * @return The result of the method execution. 81595489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 81695489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 81795489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 81895489c19Sopenharmony_ci * 81995489c19Sopenharmony_ci * @since 6 82095489c19Sopenharmony_ci */ 82195489c19Sopenharmony_ci int PlayItem(const BluetoothRemoteDevice &device, uint64_t uid, uint16_t uidCounter); 82295489c19Sopenharmony_ci 82395489c19Sopenharmony_ci // TEMP 82495489c19Sopenharmony_ci /** 82595489c19Sopenharmony_ci * @brief Adds an item indicated by the UID to the Now Playing queue. 82695489c19Sopenharmony_ci * 82795489c19Sopenharmony_ci * @param[in] device The bluetooth device. 82895489c19Sopenharmony_ci * @param[in] scope The scope in which media content navigation may take place. Refer to <b>AvrcMediaScope</b>. 82995489c19Sopenharmony_ci * @param[in] uid The UID of the media element item or folder item. 83095489c19Sopenharmony_ci * @param[in] uidCounter The UID Counter. 83195489c19Sopenharmony_ci * @return The result of the method execution. 83295489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 83395489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 83495489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 83595489c19Sopenharmony_ci * 83695489c19Sopenharmony_ci * @since 6 83795489c19Sopenharmony_ci */ 83895489c19Sopenharmony_ci int AddToNowPlaying(const BluetoothRemoteDevice &device, uint64_t uid, uint16_t uidCounter); 83995489c19Sopenharmony_ci 84095489c19Sopenharmony_ci /****************************************************************** 84195489c19Sopenharmony_ci * CONTINUING RESPONSE / ABORT CONTINUING RESPONSE * 84295489c19Sopenharmony_ci ******************************************************************/ 84395489c19Sopenharmony_ci 84495489c19Sopenharmony_ci /** 84595489c19Sopenharmony_ci * @brief Requests continuing response. 84695489c19Sopenharmony_ci * 84795489c19Sopenharmony_ci * @param[in] device The bluetooth device. 84895489c19Sopenharmony_ci * @param[in] pduId The PDU ID which wants to request. 84995489c19Sopenharmony_ci * @return The result of the method execution. 85095489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 85195489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 85295489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 85395489c19Sopenharmony_ci */ 85495489c19Sopenharmony_ci int RequestContinuingResponse(const BluetoothRemoteDevice &device, uint8_t pduId); 85595489c19Sopenharmony_ci 85695489c19Sopenharmony_ci /** 85795489c19Sopenharmony_ci * @brief Aborts continuing response. 85895489c19Sopenharmony_ci * 85995489c19Sopenharmony_ci * @param[in] device The bluetooth device. 86095489c19Sopenharmony_ci * @param[in] pduId The PDU ID which wants to abort. 86195489c19Sopenharmony_ci * @return The result of the method execution. 86295489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 86395489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not Support. 86495489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 86595489c19Sopenharmony_ci * 86695489c19Sopenharmony_ci * @since 6.0 86795489c19Sopenharmony_ci */ 86895489c19Sopenharmony_ci int AbortContinuingResponse(const BluetoothRemoteDevice &device, uint8_t pduId); 86995489c19Sopenharmony_ci 87095489c19Sopenharmony_ci /****************************************************************** 87195489c19Sopenharmony_ci * OPERATE THE VIRTUAL FILE SYSTEM * 87295489c19Sopenharmony_ci ******************************************************************/ 87395489c19Sopenharmony_ci 87495489c19Sopenharmony_ci /** 87595489c19Sopenharmony_ci * @brief Navigates one level up or down in the virtual file system. 87695489c19Sopenharmony_ci * 87795489c19Sopenharmony_ci * @param[in] device The bluetooth device. 87895489c19Sopenharmony_ci * @param[in] uidCounter The value of the uid counter. 87995489c19Sopenharmony_ci * @param[in] direction The flag of the navigation. Refer to <b>bluetooth::AvrcFolderDirection</b>. 88095489c19Sopenharmony_ci * @param[in] folderUid The UID of the folder to navigate to. This may be retrieved via a GetFolderItems command. 88195489c19Sopenharmony_ci * If the navigation command is Folder Up this field is reserved. 88295489c19Sopenharmony_ci * @return The result of the method execution. 88395489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 88495489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 88595489c19Sopenharmony_ci * @retval RET_BAD_PARAM Bad parameters. 88695489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 88795489c19Sopenharmony_ci * 88895489c19Sopenharmony_ci * @since 6 88995489c19Sopenharmony_ci */ 89095489c19Sopenharmony_ci int ChangePath(const BluetoothRemoteDevice &device, uint16_t uidCounter, uint16_t direction, uint64_t folderUid); 89195489c19Sopenharmony_ci 89295489c19Sopenharmony_ci /** 89395489c19Sopenharmony_ci * @brief Retrieves a listing of the contents of a folder. 89495489c19Sopenharmony_ci * 89595489c19Sopenharmony_ci * @param[in] device The bluetooth device. 89695489c19Sopenharmony_ci * @param[in] startItem The offset within the listing of the item, which should be the first returned item. The 89795489c19Sopenharmony_ci * first element in the listing is at offset 0. 89895489c19Sopenharmony_ci * @param[in] endItem The offset within the listing of the item which should be the final returned item. If this 89995489c19Sopenharmony_ci * is set to a value beyond what is available, the TG shall return items from the provided Start Item index to the 90095489c19Sopenharmony_ci * index of the final item. If the End Item index is smaller than the Start Item index, the TG shall return an 90195489c19Sopenharmony_ci * error. If CT requests too many items, TG can respond with a sub-set of the requested items. 90295489c19Sopenharmony_ci * @param[in] attributes The list of media attributes. 90395489c19Sopenharmony_ci * @return The result of the method execution. 90495489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 90595489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 90695489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 90795489c19Sopenharmony_ci * 90895489c19Sopenharmony_ci * @since 6 90995489c19Sopenharmony_ci */ 91095489c19Sopenharmony_ci int GetFolderItems(const BluetoothRemoteDevice &device, uint32_t startItem, uint32_t endItem, 91195489c19Sopenharmony_ci const std::vector<uint32_t> &attributes); 91295489c19Sopenharmony_ci 91395489c19Sopenharmony_ci /** 91495489c19Sopenharmony_ci * @brief Retrieves a listing of the contents of a folder. 91595489c19Sopenharmony_ci * 91695489c19Sopenharmony_ci * @param[in] device The bluetooth device. 91795489c19Sopenharmony_ci * @param[in] startItem The offset within the listing of the item, which should be the first returned item. The 91895489c19Sopenharmony_ci * first element in the listing is at offset 0. 91995489c19Sopenharmony_ci * @param[in] endItem The offset within the listing of the item which should be the final returned item. If this 92095489c19Sopenharmony_ci * is set to a value beyond what is available, the TG shall return items from the provided Start Item index to the 92195489c19Sopenharmony_ci * index of the final item. If the End Item index is smaller than the Start Item index, the TG shall return an 92295489c19Sopenharmony_ci * error. If CT requests too many items, TG can respond with a sub-set of the requested items. 92395489c19Sopenharmony_ci * @return The result of the method execution. 92495489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 92595489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 92695489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 92795489c19Sopenharmony_ci * 92895489c19Sopenharmony_ci * @since 6 92995489c19Sopenharmony_ci */ 93095489c19Sopenharmony_ci int GetMeidaPlayerList(const BluetoothRemoteDevice &device, uint32_t startItem, uint32_t endItem); 93195489c19Sopenharmony_ci 93295489c19Sopenharmony_ci /** 93395489c19Sopenharmony_ci * @brief Retrieves the metadata attributes for a particular media element item or folder item. 93495489c19Sopenharmony_ci * 93595489c19Sopenharmony_ci * @param[in] device The bluetooth device. 93695489c19Sopenharmony_ci * @param[in] uid The UID of the media element item or folder item. 93795489c19Sopenharmony_ci * @param[in] uidCounter The UID Counter. 93895489c19Sopenharmony_ci * @param[in] attributes The list of media attributes. 93995489c19Sopenharmony_ci * @return The result of the method execution. 94095489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 94195489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 94295489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 94395489c19Sopenharmony_ci * 94495489c19Sopenharmony_ci * @since 6 94595489c19Sopenharmony_ci */ 94695489c19Sopenharmony_ci int GetItemAttributes(const BluetoothRemoteDevice &device, uint64_t uid, uint16_t uidCounter, 94795489c19Sopenharmony_ci const std::vector<uint32_t> &attributes); 94895489c19Sopenharmony_ci 94995489c19Sopenharmony_ci /** 95095489c19Sopenharmony_ci * @brief Gets the number of items in the now playing scope. 95195489c19Sopenharmony_ci * 95295489c19Sopenharmony_ci * @param[in] device The bluetooth device. 95395489c19Sopenharmony_ci * @return The result of the method execution. 95495489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 95595489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 95695489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 95795489c19Sopenharmony_ci * 95895489c19Sopenharmony_ci * @since 6 95995489c19Sopenharmony_ci */ 96095489c19Sopenharmony_ci int GetTotalNumberOfItems(const BluetoothRemoteDevice &device); 96195489c19Sopenharmony_ci 96295489c19Sopenharmony_ci /****************************************************************** 96395489c19Sopenharmony_ci * ABSOLUTE VOLUME * 96495489c19Sopenharmony_ci ******************************************************************/ 96595489c19Sopenharmony_ci 96695489c19Sopenharmony_ci /** 96795489c19Sopenharmony_ci * @brief Sets an absolute volume to be used by the rendering device. 96895489c19Sopenharmony_ci * 96995489c19Sopenharmony_ci * @param[in] device The bluetooth device. 97095489c19Sopenharmony_ci * @param[in] volume The percentage of the absolute volume. Refer to <b>AvrcAbsoluteVolume</b>. 97195489c19Sopenharmony_ci * @return The result of the method execution. 97295489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 97395489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 97495489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 97595489c19Sopenharmony_ci * 97695489c19Sopenharmony_ci * @since 6 97795489c19Sopenharmony_ci */ 97895489c19Sopenharmony_ci int SetAbsoluteVolume(const BluetoothRemoteDevice &device, uint8_t volume); 97995489c19Sopenharmony_ci 98095489c19Sopenharmony_ci /****************************************************************** 98195489c19Sopenharmony_ci * NOTIFICATION * 98295489c19Sopenharmony_ci ******************************************************************/ 98395489c19Sopenharmony_ci 98495489c19Sopenharmony_ci /** 98595489c19Sopenharmony_ci * @brief Enables for receiving notifications asynchronously based on specific events occurring. 98695489c19Sopenharmony_ci * 98795489c19Sopenharmony_ci * @details Switch to the thread of the AVRCP CT service in this method. 98895489c19Sopenharmony_ci * @param[in] rawAddr The address of the bluetooth device. 98995489c19Sopenharmony_ci * @param[in] events The event for which the requires notification. Refer to <b>AvrcEventId</b>. 99095489c19Sopenharmony_ci * @param[in] interval The specifies the time interval (in seconds) at which the change in playback position will be 99195489c19Sopenharmony_ci * notified. 99295489c19Sopenharmony_ci * @return The result of the method execution. 99395489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 99495489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 99595489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 99695489c19Sopenharmony_ci * 99795489c19Sopenharmony_ci * @since 6 99895489c19Sopenharmony_ci */ 99995489c19Sopenharmony_ci int EnableNotification(const BluetoothRemoteDevice &device, const std::vector<uint8_t> &events, 100095489c19Sopenharmony_ci uint32_t interval = AVRC_PLAYBACK_INTERVAL_1_SEC); 100195489c19Sopenharmony_ci 100295489c19Sopenharmony_ci /** 100395489c19Sopenharmony_ci * @brief Disables for receiving notifications asynchronously based on specific events occurring. 100495489c19Sopenharmony_ci * 100595489c19Sopenharmony_ci * @details Switch to the thread of the AVRCP CT service in this method. 100695489c19Sopenharmony_ci * @param[in] rawAddr The address of the bluetooth device. 100795489c19Sopenharmony_ci * @param[in] events The event for which the requires notification. Refer to <b>AvrcEventId</b>. 100895489c19Sopenharmony_ci * @return The result of the method execution. 100995489c19Sopenharmony_ci * @retval RET_NO_ERROR Execute success. 101095489c19Sopenharmony_ci * @retval RET_NO_SUPPORT Not support. 101195489c19Sopenharmony_ci * @retval RET_BAD_STATUS Execute failure. 101295489c19Sopenharmony_ci * 101395489c19Sopenharmony_ci * @since 6 101495489c19Sopenharmony_ci */ 101595489c19Sopenharmony_ci int DisableNotification(const BluetoothRemoteDevice &device, const std::vector<uint8_t> &events); 101695489c19Sopenharmony_ci 101795489c19Sopenharmony_ci /** 101895489c19Sopenharmony_ci * @brief The external process calls the A2dpsrc profile interface before the Bluetooth process starts. At this 101995489c19Sopenharmony_ci * time, it needs to monitor the start of the Bluetooth process, and then call this interface to initialize the 102095489c19Sopenharmony_ci * A2dpsrc proflie. 102195489c19Sopenharmony_ci */ 102295489c19Sopenharmony_ci void Init(); 102395489c19Sopenharmony_ci 102495489c19Sopenharmony_ciprivate: 102595489c19Sopenharmony_ci /** 102695489c19Sopenharmony_ci * @brief A constructor used to create an <b>AvrcpController</b> instance. 102795489c19Sopenharmony_ci * 102895489c19Sopenharmony_ci * @since 6 102995489c19Sopenharmony_ci */ 103095489c19Sopenharmony_ci AvrcpController(); 103195489c19Sopenharmony_ci 103295489c19Sopenharmony_ci /** 103395489c19Sopenharmony_ci * @brief A destructor used to delete the <b>AvrcpController</b> instance. 103495489c19Sopenharmony_ci * 103595489c19Sopenharmony_ci * @since 6 103695489c19Sopenharmony_ci */ 103795489c19Sopenharmony_ci virtual ~AvrcpController(); 103895489c19Sopenharmony_ci 103995489c19Sopenharmony_ci BLUETOOTH_DISALLOW_COPY_AND_ASSIGN(AvrcpController); 104095489c19Sopenharmony_ci BLUETOOTH_DECLARE_IMPL(); 104195489c19Sopenharmony_ci 104295489c19Sopenharmony_ci#ifdef DTFUZZ_TEST 104395489c19Sopenharmony_ci friend class BluetoothNoDestructor<AvrcpController>; 104495489c19Sopenharmony_ci#endif 104595489c19Sopenharmony_ci}; 104695489c19Sopenharmony_ci} // namespace Bluetooth 104795489c19Sopenharmony_ci} // namespace OHOS 104895489c19Sopenharmony_ci#endif // !BLUETOOTH_AVRCP_CT_H 1049