1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef PROFILE_INFO_H
17 #define PROFILE_INFO_H
18 
19 #include <string>
20 #include <vector>
21 #include "bt_def.h"
22 
23 namespace OHOS {
24 namespace bluetooth {
25 /**
26  * @brief Represents profile information.
27  *
28  * @since 6
29  */
30 struct ProfileInfo {
31 public:
32     /**
33      * @brief A constructor used to create an <b>ProfileInfo</b> instance.
34      *
35      * @since 6
36      */
37     ProfileInfo() = delete;
38     /**
39      * @brief A constructor used to create an <b>ProfileInfo</b> instance.
40      *
41      * @param name Profile service name.
42      * @param id Profile service Id.
43      * @param uuid Profile service uuid.
44      * @since 6
45      */
ProfileInfoProfileInfo46     ProfileInfo(const std::string &name, uint32_t id, const std::string &uuid) : name_(name), id_(id), uuid_(uuid){};
47     /**
48      * @brief A destructor used to delete the <b>ProfileInfo</b> instance.
49      *
50      * @since 6
51      */
52     ~ProfileInfo() = default;
53     std::string name_ = {""};
54     uint32_t id_ = {0};
55     std::string uuid_ = {""};
56 };
57 
58 class SupportProfilesInfo {
59 public:
60     /**
61      * @brief A constructor used to create an <b>SupportProfilesInfo</b> instance.
62      *
63      * @since 6
64      */
65     SupportProfilesInfo() = default;
66     /**
67      * @brief A destructor used to delete the <b>SupportProfilesInfo</b> instance.
68      *
69      * @since 6
70      */
71     ~SupportProfilesInfo() = default;
72     /**
73      * @brief Get supported profiles vector.
74      *
75      * @return Returns supported profiles vector.
76      * @since 6
77      */
78     static const std::vector<ProfileInfo> &GetSupportProfiles();
79     /**
80      * @brief Get supported profiles vector.
81      *
82      * @param id Profile Id.
83      * @return Returns profile name by Id.
84      * @since 6
85      */
86     static std::string IdToName(uint32_t id);
87     /**
88      * @brief Get supported profiles vector.
89      *
90      * @param transport Adapter transport.
91      * @return Returns profiles information by adapter transport.
92      * @since 6
93      */
94     static const std::vector<ProfileInfo> GetConfigSupportProfiles(BTTransport transport);
95 
96 private:
97     static const std::vector<ProfileInfo> SUPPORT_FILES;
98 };
99 
100 #define GET_CONFIG_PROFILES SupportProfilesInfo::GetConfigSupportProfiles
101 #define GET_SUPPORT_PROFILES SupportProfilesInfo::GetSupportProfiles
102 }  // namespace bluetooth
103 }  // namespace OHOS
104 
105 #endif  // PROFILE_CONFIG_H