• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-2022 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 BLUETOOTH_DEF_H
17 #define BLUETOOTH_DEF_H
18 
19 #include <string>
20 #include <vector>
21 #include <cstdint>
22 
23 namespace OHOS {
24 namespace Bluetooth {
25 // Defined here are various status codes
26 /*********************************************
27  *
28  * Interface Return Value Macro Define
29  *
30  *********************************************/
31 constexpr int RET_NO_ERROR = 0;
32 constexpr int RET_NO_SUPPORT = -1;
33 constexpr int RET_BAD_PARAM = -2;
34 constexpr int RET_BAD_STATUS = -3;
35 constexpr int RET_NO_SPACE = -4;
36 
37 /*********************************************
38  *
39  * Bluetoot UUID Macro Define
40  *
41  *********************************************/
42 const std::string BLUETOOTH_UUID_BASE_UUID = "00000000-0000-1000-8000-00805F9B34FB";
43 const std::string BLUETOOTH_UUID_A2DP_SINK = "0000110B-0000-1000-8000-00805F9B34FB";
44 const std::string BLUETOOTH_UUID_A2DP_SRC = "0000110A-0000-1000-8000-00805F9B34FB";
45 const std::string BLUETOOTH_UUID_GATT = "00001801-0000-1000-8000-00805F9B34FB";
46 const std::string BLUETOOTH_UUID_AVRCP_CT = "0000110E-0000-1000-8000-00805F9B34FB";
47 const std::string BLUETOOTH_UUID_AVRCP_TG = "0000110C-0000-1000-8000-00805F9B34FB";
48 const std::string BLUETOOTH_UUID_HFP_AG = "0000111F-0000-1000-8000-00805F9B34FB";
49 const std::string BLUETOOTH_UUID_HFP_HF = "0000111E-0000-1000-8000-00805F9B34FB";
50 const std::string BLUETOOTH_UUID_PBAP_PCE = "0000112E-0000-1000-8000-00805F9B34FB";
51 const std::string BLUETOOTH_UUID_PBAP_PSE = "0000112F-0000-1000-8000-00805F9B34FB";
52 const std::string BLUETOOTH_UUID_SPP = "00001101-0000-1000-8000-00805F9B34FB";
53 const std::string BLUETOOTH_UUID_PNP = "00001200-0000-1000-8000-00805F9B34FB";
54 
55 /*********************************************
56  *
57  * Adapter Macro Define
58  *
59  *********************************************/
60 /**
61  * @brief bt transport define
62  * use to GetRemoteDevice(),GetPairedDevices()...
63  */
64 enum BTTransport {
65     ADAPTER_BREDR = 0,
66     ADAPTER_BLE,
67 };
68 /**
69  * @brief bt adapter/profile state define
70  * use to GetBtConnectionState(),GetBtProfileConnState(),...
71  */
72 enum BTStateID {
73     STATE_TURNING_ON,
74     STATE_TURN_ON,
75     STATE_TURNING_OFF,
76     STATE_TURN_OFF,
77 };
78 /**
79  * @brief connect state define
80  * use to ConnectionState()...
81  */
82 enum class BTConnectState : int {
83     CONNECTING,
84     CONNECTED,
85     DISCONNECTING,
86     DISCONNECTED,
87 };
88 /**
89  * @brief access permission define
90  * use to
91  * Get/SetPhonebookPermission(),Get/SetMessagePermission()
92  */
93 enum class BTPermissionType : int {
94     ACCESS_UNKNOWN,
95     ACCESS_ALLOWED,
96     ACCESS_FORBIDDEN,
97 };
98 /**
99  * @brief connection strategy define
100  * use to
101  * SetConnectionStrategy(),GetConnectionStrategy()
102  */
103 enum class BTStrategyType : int {
104     CONNECTION_UNKNOWN,
105     CONNECTION_ALLOWED,
106     CONNECTION_FORBIDDEN,
107 };
108 /**
109  * @brief profile id define
110  * use to
111  * GetBtProfileConnState(),GetProfileList()
112  */
113 const uint32_t PROFILE_ID_GATT_CLIENT = 0x00000001;
114 const uint32_t PROFILE_ID_GATT_SERVER = 0x00000002;
115 const uint32_t PROFILE_ID_A2DP_SRC = 0x00000004;
116 const uint32_t PROFILE_ID_A2DP_SINK = 0x00000008;
117 const uint32_t PROFILE_ID_AVRCP_CT = 0x00000010;
118 const uint32_t PROFILE_ID_AVRCP_TG = 0x00000020;
119 const uint32_t PROFILE_ID_HFP_AG = 0x00000040;
120 const uint32_t PROFILE_ID_HFP_HF = 0x00000080;
121 const uint32_t PROFILE_ID_MAP_MCE = 0x00000100;
122 const uint32_t PROFILE_ID_MAP_MSE = 0x00000200;
123 const uint32_t PROFILE_ID_PBAP_PCE = 0x00000400;
124 const uint32_t PROFILE_ID_PBAP_PSE = 0x00000800;
125 const uint32_t PROFILE_ID_SPP = 0x00001000;
126 const uint32_t PROFILE_ID_DI = 0x00002000;
127 const uint32_t PROFILE_ID_BEL_ADVERTISER = 0x00004000;
128 const uint32_t PROFILE_ID_BLE_CENTRAL_MANAGER_SERVER = 0x00008000;
129 const uint32_t PROFILE_ID_BLE_GATT_MANAGER = 0x00010000;
130 const uint32_t PROFILE_ID_HID_HOST_SERVER = 0x00020000;
131 const uint32_t PROFILE_ID_OPP_SERVER = 0x00040000;
132 const uint32_t PROFILE_ID_PAN_SERVER = 0x00080000;
133 const uint32_t PROFILE_ID_HOST = 0x00100000;
134 
135 /**
136  * @brief default value
137  * use to
138  * initialize mac address, name or other values.
139  */
140 const std::string INVALID_MAC_ADDRESS = "00:00:00:00:00:00";
141 const std::string INVALID_NAME = "";
142 const int INVALID_VALUE = 0;
143 const int INVALID_TYPE = -1;
144 const int ADDRESS_LENGTH = 17;
145 const int ADDRESS_COLON_INDEX = 2;
146 const int ADDRESS_SEPARATOR_UNIT = 3;
147 
148 /**
149  * @brief discovery state
150  * use to
151  * GetBtScanMode(), SetBtScanMode()
152  */
153 const int DISCOVERY_STARTED = 0x01;
154 const int DISCOVERYING = 0x02;
155 const int DISCOVERY_STOPED = 0x03;
156 
157 /**
158  * @brief pairing result
159  * use to
160  * OnPairStatusChanged()
161  */
162 const int PAIR_NONE = 0x01;
163 const int PAIR_PAIRING = 0x02;
164 const int PAIR_PAIRED = 0x03;
165 
166 /**
167  * @brief discoverable mode and connect mode
168  * use to
169  * GetBtScanMode(), SetBtScanMode()
170  */
171 const int SCAN_MODE_NONE = 0x00;
172 const int SCAN_MODE_CONNECTABLE = 0x01;
173 const int SCAN_MODE_GENERAL_DISCOVERABLE = 0x02;
174 const int SCAN_MODE_LIMITED_DISCOVERABLE = 0x03;
175 const int SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE = 0x04;
176 const int SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE = 0x05;
177 
178 /**
179  * @brief bondable mode define
180  * use to
181  * GetBondableMode(), SetBondableMode()
182  */
183 const int BONDABLE_MODE_OFF = 0x00;
184 const int BONDABLE_MODE_ON = 0x01;
185 
186 /**
187  * @brief remote device's transport type
188  * use to
189  * GetTransportType()
190  */
191 const int BT_TRANSPORT_BREDR = 0;
192 const int BT_TRANSPORT_BLE = 1;
193 
194 /**
195  * @brief remote device type
196  * use to
197  * GetDeviceType
198  */
199 const int DEVICE_TYPE_UNKNOWN = -1;
200 const int DEVICE_TYPE_BREDR = 0;
201 const int DEVICE_TYPE_LE = 1;
202 const int DEVICE_TYPE_DUAL_MONO = 2;
203 /*********************************************
204  *
205  * GATT Macro Define
206  *
207  *********************************************/
208 
209 constexpr uint8_t GATT_TRANSPORT_TYPE_AUTO = 0x0;
210 constexpr uint8_t GATT_TRANSPORT_TYPE_LE = 0x1;
211 constexpr uint8_t GATT_TRANSPORT_TYPE_CLASSIC = 0x2;
212 
213 /**
214  * @brief user confirm type during paring process.
215  * use to
216  * OnPairConfirmed()
217  */
218 enum PinType {
219     PIN_TYPE_ENTER_PIN_CODE = 0,     // enter the pin code displayed on the peer device
220     PIN_TYPE_ENTER_PASSKEY = 1,      // enter the passkey displayed on the peer device
221     PIN_TYPE_CONFIRM_PASSKEY = 2,    // confirm the passkey displayed on the local device
222     PIN_TYPE_NO_PASSKEY_CONSENT = 3, // accept or deny the pairing request
223     PIN_TYPE_NOTIFY_PASSKEY = 4,     // enter the passkey displayed on the local device on the peer device
224     PIN_TYPE_DISPLAY_PIN_CODE = 5,   // enter the pin code displayed on the peer device, used for bluetooth 2.0
225     PIN_TYPE_OOB_CONSENT = 6,        // accept or deny the OOB pairing request, not suppport now
226     PIN_TYPE_PIN_16_DIGITS = 7,      // enter the 16-digit pin code displayed on the peer device
227 };
228 
229 /** A GATT Attribute Permission.
230  *  Define GATT Attribute permissions.
231  */
232 enum class GattPermission : uint16_t {
233     READABLE = 1 << 0, /**< readable */
234     READ_ENCRYPTED = 1 << 1,
235     READ_ENCRYPTED_MITM = 1 << 2,
236     WRITEABLE = 1 << 4,
237     WRITE_ENCRYPTED = 1 << 5,
238     WRITE_ENCRYPTED_MITM = 1 << 6,
239     WRITE_SIGNED = 1 << 7,
240     WRITE_SIGNED_MITM = 1 << 8,
241 };
242 
243 enum class GattConnectionPriority : int {
244     BALANCED,
245     HIGH,
246     LOW_POWER
247 };
248 
249 enum GattStatus {
250     INVALID_REMOTE_DEVICE = -29,
251     INCLUDE_SERVICE_NOT_FOUND,
252     REFERENCED_BY_OTHER_SERVICE,
253     INVALID_CHARACTERISTIC,
254     INVALID_CHARACTERISTIC_DATA,
255     INVALID_CHARACTERISTIC_DESCRIPTOR,
256     INVALID_CHARACTERISTIC_DESCRIPTOR_DATA,
257     NOT_ENOUGH_HANDLES,
258     HANDLE_NOT_FOUND,
259     INVALID_PARAMETER,
260     INTERNAL_ERROR,
261     REQUEST_NOT_SUPPORT,
262     REMOTE_DEVICE_BUSY,
263     MAX_CONNECTIONS,
264     MAX_APPLICATIONS,
265     DEVICE_ALREADY_BIND,
266     INVALID_HANDLE,
267     INVALID_OFFSET,
268     READ_NOT_PERMITTED,
269     WRITE_NOT_PERMITTED,
270     INSUFFICIENT_ENCRYPTION,
271     INSUFFICIENT_AUTHENTICATION,
272     INSUFFICIENT_AUTHORIZATION,
273     INSUFFICIENT_ENCRYPTION_KEY_SIZE,
274     PREPARE_QUEUE_FULL,
275     ATTRIBUTE_NOT_LONG,
276     INVALID_ATTRIBUTE_VALUE_LENGTH,
277     WRITE_REQUEST_REJECTED,
278     GATT_FAILURE,
279     GATT_SUCCESS
280 };
281 
282 enum BtStatus{
283     BT_SUCCESS = 0,
284     BT_FAILURE = -1,
285 };
286 
287 /*********************************************
288  *
289  * BLE Macro Define
290  *
291  *********************************************/
292 // Minimum value for advertising interval.
293 const int BLE_ADV_MIN_INTERVAL = 0x0020;
294 // Maximum value for advertising interval.
295 const int BLE_ADV_MAX_INTERVAL = 0x4000;
296 // Default value for advertising interval.
297 const int BLE_ADV_DEFAULT_INTERVAL = 0x03E8;
298 
299 // Special advertising set handle used for the legacy advertising set.
300 const uint8_t BLE_LEGACY_ADVERTISING_HANDLE = 0x00;
301 // Special advertising set handle used as return or parameter to signify an invalid handle.
302 const uint8_t BLE_INVALID_ADVERTISING_HANDLE = 0xFF;
303 
304 // Report delay millis default value
305 const int BLE_REPORT_DELAY_MILLIS = 5000;
306 
307 // Definitions for UUID length constants.
308 const int BLE_UUID_LEN_16 = 2;
309 const int BLE_UUID_LEN_32 = 4;
310 const int BLE_UUID_LEN_128 = 16;
311 const int DEVICE_NAME_MAX_LEN = 26;
312 
313 const uint32_t BLE_ADV_PER_FIELD_OVERHEAD_LENGTH = 2;
314 const uint32_t BLE_ADV_MANUFACTURER_ID_LENGTH = 2;
315 const uint32_t BLE_ADV_FLAGS_FIELD_LENGTH = 3;
316 const uint32_t BLE_ADV_MAX_LEGACY_ADVERTISING_DATA_BYTES = 31;
317 
318 // BLE acl connect status
319 const int BLE_CONNECTION_STATE_DISCONNECTED = 0x00;
320 const int BLE_CONNECTION_STATE_CONNECTED = 0x01;
321 const int BLE_CONNECTION_STATE_ENCRYPTED_BREDR = 0x02;
322 const int BLE_CONNECTION_STATE_ENCRYPTED_LE = 0x04;
323 
324 const int BLE_PAIR_NONE = 0x01;
325 const int BLE_PAIR_PAIRING = 0x02;
326 const int BLE_PAIR_PAIRED = 0x03;
327 const int BLE_PAIR_CANCELING = 0x04;
328 
329 const int BLE_ADV_DEFAULT_OP_CODE = 0x00;
330 const int BLE_ADV_STOP_COMPLETE_OP_CODE = 0x01;
331 const int BLE_ADV_START_FAILED_OP_CODE = 0x02;
332 
333 const uint8_t BLE_ADV_DATA_BYTE_FIELD_LEN = 3;
334 const uint8_t BLE_ADV_DATA_FIELD_TYPE_AND_LEN = 2;
335 const uint8_t BLE_ONE_BYTE_LEN = 8;
336 
337 const int8_t BLE_ADV_TX_POWER_ULTRA_LOW_VALUE = -21;
338 const int8_t BLE_ADV_TX_POWER_LOW_VALUE = -15;
339 const int8_t BLE_ADV_TX_POWER_MEDIUM_VALUE = -7;
340 const int8_t BLE_ADV_TX_POWER_HIGH_VALUE = 1;
341 
342 // Entended Advertising PHY
343 const uint8_t BLE_ADVERTISEMENT_PHY_NONE = 0x00;
344 const uint8_t BLE_ADVERTISEMENT_PHY_1M = 0x01;
345 const uint8_t BLE_ADVERTISEMENT_PHY_2M = 0x02;
346 const uint8_t BLE_ADVERTISEMENT_PHY_CODED = 0x03;
347 
348 const uint8_t BLE_LEGACY_ADV_IND_WITH_EX_ADV = 0x13;
349 const uint8_t BLE_LEGACY_ADV_NONCONN_IND_WITH_EX_ADV = 0x10;
350 
351 // Incomplete, more data to come
352 const uint8_t BLE_EX_SCAN_DATE_STATUS_INCOMPLETE_MORE = 0x20;
353 // Incomplete, data truncated, no more to come
354 const uint8_t BLE_EX_SCAN_DATE_STATUS_INCOMPLETE_NO_MORE = 0x40;
355 
356 // Scan mode
357 typedef enum {
358     SCAN_MODE_LOW_POWER = 0x00,
359     SCAN_MODE_BALANCED = 0x01,
360     SCAN_MODE_LOW_LATENCY = 0x02,
361     SCAN_MODE_OP_P2_60_3000 = 0x03,
362     SCAN_MODE_OP_P10_60_600 = 0x04,
363     SCAN_MODE_OP_P25_60_240 = 0x05,
364     SCAN_MODE_OP_P100_1000_1000 = 0x06,
365     SCAN_MODE_OP_P50_100_200 = 0x07,
366     SCAN_MODE_INVALID
367 } SCAN_MODE;
368 
369 // Phy type
370 typedef enum { PHY_LE_1M = 1, PHY_LE_2M = 2, PHY_LE_CODED = 3, PHY_LE_ALL_SUPPORTED = 255 } PHY_TYPE;
371 
372 // BLE advertiser TX power level.
373 typedef enum {
374     BLE_ADV_TX_POWER_ULTRA_LOW = 0x00,
375     BLE_ADV_TX_POWER_LOW = 0x01,
376     BLE_ADV_TX_POWER_MEDIUM = 0x02,
377     BLE_ADV_TX_POWER_HIGH = 0x03
378 } BLE_ADV_TX_POWER_LEVEL;
379 
380 // BLE advertiser flag
381 const uint8_t BLE_ADV_FLAG_NON_LIMIT_DISC     = 0x00;
382 const uint8_t BLE_ADV_FLAG_LIMIT_DISC         = 0x01 << 0;
383 const uint8_t BLE_ADV_FLAG_GEN_DISC           = 0x01 << 1;
384 const uint8_t BLE_ADV_FLAG_BREDR_NOT_SPT      = 0x01 << 2;
385 const uint8_t BLE_ADV_FLAG_DMT_CONTROLLER_SPT = 0x01 << 3;
386 const uint8_t BLE_ADV_FLAG_DMT_HOST_SPT       = 0x01 << 4;
387 
388 // Bluetooth device type
389 typedef enum {
390     BLE_BT_DEVICE_TYPE_UNKNOWN = -1,
391     BLE_BT_DEVICE_TYPE_BREDR = 0,
392     BLE_BT_DEVICE_TYPE_BLE = 1,
393     BLE_BT_DEVICE_TYPE_DUMO = 2,
394 } BLE_BT_DEV_TYPE;
395 
396 // BLE device address type
397 typedef enum {
398     BLE_ADDR_TYPE_PUBLIC = 0x00,
399     BLE_ADDR_TYPE_RANDOM = 0x01,
400     BLE_ADDR_TYPE_NON_RPA = 0x02,
401     BLE_ADDR_TYPE_RPA = 0x03,
402     BLE_ADDR_TYPE_UNKNOWN = 0xFE,
403     BLE_ADDR_TYPE_ANONYMOUS = 0xFF,
404 } BLE_ADDR_TYPE;
405 
406 typedef enum {
407     BLE_IO_CAP_OUT = 0x00,    // DisplayOnly
408     BLE_IO_CAP_IO = 0x01,     // DisplayYesNo
409     BLE_IO_CAP_IN = 0x02,     // KeyboardOnly
410     BLE_IO_CAP_NONE = 0x03,   // NoInputNoOutput
411     BLE_IO_CAP_KBDISP = 0x04  // Keyboard display
412 } BLE_IO_CAP;
413 
414 // Adv status
415 typedef enum {
416     BLE_ADV_STATE_IDLE,
417     BLE_ADV_STATE_ADVERTISING,
418 } Ble_AdvState;
419 
420 // The type of advertising data(not adv_type)
421 typedef enum {
422     BLE_AD_TYPE_FLAG = 0x01,
423     BLE_AD_TYPE_16SRV_PART = 0x02,
424     BLE_AD_TYPE_16SRV_CMPL = 0x03,
425     BLE_AD_TYPE_32SRV_PART = 0x04,
426     BLE_AD_TYPE_32SRV_CMPL = 0x05,
427     BLE_AD_TYPE_128SRV_PART = 0x06,
428     BLE_AD_TYPE_128SRV_CMPL = 0x07,
429     BLE_AD_TYPE_NAME_SHORT = 0x08,
430     BLE_AD_TYPE_NAME_CMPL = 0x09,
431     BLE_AD_TYPE_TX_PWR = 0x0A,
432     BLE_AD_TYPE_DEV_CLASS = 0x0D,
433     BLE_AD_TYPE_SM_TK = 0x10,
434     BLE_AD_TYPE_SM_OOB_FLAG = 0x11,
435     BLE_AD_TYPE_INT_RANGE = 0x12,
436     BLE_AD_TYPE_SOL_SRV_UUID = 0x14,
437     BLE_AD_TYPE_128SOL_SRV_UUID = 0x15,
438     BLE_AD_TYPE_SERVICE_DATA = 0x16,
439     BLE_AD_TYPE_PUBLIC_TARGET = 0x17,
440     BLE_AD_TYPE_RANDOM_TARGET = 0x18,
441     BLE_AD_TYPE_APPEARANCE = 0x19,
442     BLE_AD_TYPE_ADV_INT = 0x1A,
443     BLE_AD_TYPE_LE_DEV_ADDR = 0x1b,
444     BLE_AD_TYPE_LE_ROLE = 0x1c,
445     BLE_AD_TYPE_SPAIR_C256 = 0x1d,
446     BLE_AD_TYPE_SPAIR_R256 = 0x1e,
447     BLE_AD_TYPE_32SOL_SRV_UUID = 0x1f,
448     BLE_AD_TYPE_32SERVICE_DATA = 0x20,
449     BLE_AD_TYPE_128SERVICE_DATA = 0x21,
450     BLE_AD_TYPE_LE_SECURE_CONFIRM = 0x22,
451     BLE_AD_TYPE_LE_SECURE_RANDOM = 0x23,
452     BLE_AD_TYPE_URI = 0x24,
453     BLE_AD_TYPE_INDOOR_POSITION = 0x25,
454     BLE_AD_TYPE_TRANS_DISC_DATA = 0x26,
455     BLE_AD_TYPE_LE_SUPPORT_FEATURE = 0x27,
456     BLE_AD_TYPE_CHAN_MAP_UPDATE = 0x28,
457     BLE_AD_MANUFACTURER_SPECIFIC_TYPE = 0xFF,
458 } BLE_ADV_DATA_TYPE;
459 
460 /*********************************************
461  *
462  * Map Define
463  *
464  *********************************************/
465 // Map Message Type
466 enum class MapMessageType : int {
467     EMAIL = 0,
468     SMS_GSM = 1,
469     SMS_CDMA = 2,
470     MMS = 3,
471     IM = 4,
472     INVALID = 5
473 };  // IM only support in bmessage ver1.1
474 
475 // Map Message Status
476 enum class MapMessageStatus : int { READ, UNREAD, INVALID };  // default UNREAD
477 
478 // Map BoolType , YES or NO
479 enum class MapBoolType : int { YES, NO, INVALID };  // default NO
480 
481 // Map Message ReceptionStatus
482 enum class MapMsgReceptionStatus : int { COMPLETE, FRACTIONED, NOTIFICATION, INVALID };
483 
484 // Map MsgDeliveryStatus
485 enum class MapMsgDeliveryStatus : int { DELIVERED, SENT, UNKNOWN, INVALID };
486 
487 // Map MsgDirection
488 enum class MapMsgDirection : int { INCOMING, OUTGOING, OUTGOINGDRAFT, OUTGOINGPENDING, INVALID };
489 
490 // Map FractionDeliverType
491 enum class MapFractionDeliverType : int { MORE, LAST, INVALID };
492 
493 // Map FractionRequest Type
494 enum class MapFractionRequestType : uint8_t { FIRST = 0x00, NEXT = 0x01, INVALID = 0x02 };
495 
496 // Map OnOff Type
497 enum class MapOnOffType : uint8_t { OFF = 0, ON = 1, INVALID = 3 };
498 
499 // Map Charset Type
500 enum class MapCharsetType : uint8_t { NATIVE = 0x00, UTF_8 = 0x01, INVALID = 0x02 };
501 
502 // Attachment Type
503 enum class MapAttachmentType : uint8_t { NO = 0x00, HAVE = 0x01, INVALID = 0x02 };
504 
505 // Map StatusIndicator Type
506 enum class MapStatusIndicatorType : uint8_t {
507     READ_STATUS = 0x00,
508     DELETED_STATUS = 0x01,
509     SET_EXTENDED_DATA = 0x02,
510     INVALID = 0x03
511 };
512 
513 // Map StatusValue Type
514 enum class MapStatusValueType : uint8_t { NO = 0x00, YES = 0x01 };
515 
516 // Map ModifyText Type
517 enum class MapModifyTextType : uint8_t { REPLACE = 0x00, PREPEND = 0x01, INVALID = 0x02 };
518 
519 // Map Action Type
520 enum class MapActionType : int {
521     GET_UNREAD_MESSAGES,
522     GET_SUPPORTED_FEATURES,
523     SEND_MESSAGE,
524     SET_NOTIFICATION_FILTER,
525     GET_MESSAGES_LISTING,
526     GET_MESSAGE,
527     UPDATE_INBOX,
528     GET_CONVERSATION_LISTING,
529     SET_MESSAGE_STATUS,
530     SET_OWNER_STATUS,
531     GET_OWNER_STATUS,
532     GET_MAS_INSTANCE_INFO
533 };
534 
535 // Map ExecuteStatus Type
536 enum class MapExecuteStatus : int {
537     SUCCEED = 0,
538     CONTINUE = 1,
539     BAD_PARAM = (-1),
540     BAD_STATUS = (-2),
541     NOT_SUPPORT = (-3)
542 };
543 
544 // Supported Message Types
545 #define MAP_MCE_SUPPORTED_MESSAGE_TYPE_EMAIL 0x01
546 #define MAP_MCE_SUPPORTED_MESSAGE_TYPE_SMS_GSM 0x02
547 #define MAP_MCE_SUPPORTED_MESSAGE_TYPE_SMS_CDMA 0x04
548 #define MAP_MCE_SUPPORTED_MESSAGE_TYPE_MMS 0x08
549 #define MAP_MCE_SUPPORTED_MESSAGE_TYPE_IM 0x10
550 #define MAP_MCE_SUPPORTED_MESSAGE_TYPE_ALL 0x01F
551 
552 // Api: MapClient::GetMessagesListing Application Parameters Mask defines
553 // FilterMessageType Mask, 1 is "filter out this type", 0 is "no filtering, get this type"
554 #define MAP_FILTER_MESSAGE_MASK_SMS_GSM 0b00000001
555 #define MAP_FILTER_MESSAGE_MASK_SMS_CDMA 0b00000010
556 #define MAP_FILTER_MESSAGE_MASK_EMAIL 0b00000100
557 #define MAP_FILTER_MESSAGE_MASK_MMS 0b00001000
558 #define MAP_FILTER_MESSAGE_MASK_IM 0b00010000
559 #define MAP_FILTER_MESSAGE_MASK_NO_FILTERING 0b00000000
560 // FilterReadStatus,  0b00000001 is get unread messages only,
561 // 0b00000010 is get read messages only
562 #define MAP_FILTER_READ_STATUS_MASK_UNREAD 0b00000001
563 #define MAP_FILTER_READ_STATUS_MASK_READ 0b00000010
564 #define MAP_FILTER_READ_STATUS_MASK_NO_FILTERING 0b00000000
565 // FilterPriority, 0b00000001 is get high priority messages only,
566 // 0b00000010 is get non-high priority messages only
567 #define MAP_FILTER_PRIORITY_MASK_HIGH 0b00000001
568 #define MAP_FILTER_PRIORITY_MASK_NO_HIGH 0b00000010
569 #define MAP_FILTER_PRIORITY_MASK_NO_FILTERING 0b00000000
570 // ParameterMask , Bits 0-20 has been used , Bits 21–31 Reserved for Future Use
571 #define MAP_GETMESSAGELIST_PARAMETER_MASK_REQUIRED 0b000000000000000000000000
572 #define MAP_GETMESSAGELIST_PARAMETER_MASK_PRESENT_ALL 0b000111111111111111111111
573 #define MAP_GETMESSAGELIST_PARAMETER_MASK_SUBJECT 0b000000000000000000000001
574 #define MAP_GETMESSAGELIST_PARAMETER_MASK_DATETIME 0b000000000000000000000010
575 #define MAP_GETMESSAGELIST_PARAMETER_MASK_SENDER_NAME 0b000000000000000000000100
576 #define MAP_GETMESSAGELIST_PARAMETER_MASK_SENDER_ADDRESSING 0b000000000000000000001000
577 #define MAP_GETMESSAGELIST_PARAMETER_MASK_RECIPIENT_NAME 0b000000000000000000010000
578 #define MAP_GETMESSAGELIST_PARAMETER_MASK_RECIPIENT_ADDRESSING 0b000000000000000000100000
579 #define MAP_GETMESSAGELIST_PARAMETER_MASK_TYPE 0b000000000000000001000000
580 #define MAP_GETMESSAGELIST_PARAMETER_MASK_SIZE 0b000000000000000010000000
581 #define MAP_GETMESSAGELIST_PARAMETER_MASK_RECEPTION_STATUS 0b000000000000000100000000
582 #define MAP_GETMESSAGELIST_PARAMETER_MASK_TEXT 0b000000000000001000000000
583 #define MAP_GETMESSAGELIST_PARAMETER_MASK_ATTACHMENT_SIZE 0b000000000000010000000000
584 #define MAP_GETMESSAGELIST_PARAMETER_MASK_PRIORITY 0b000000000000100000000000
585 #define MAP_GETMESSAGELIST_PARAMETER_MASK_READ 0b000000000001000000000000
586 #define MAP_GETMESSAGELIST_PARAMETER_MASK_SENT 0b000000000010000000000000
587 #define MAP_GETMESSAGELIST_PARAMETER_MASK_PROTECTED 0b000000000100000000000000
588 #define MAP_GETMESSAGELIST_PARAMETER_MASK_REPLYTO_ADDRESSING 0b000000001000000000000000
589 #define MAP_GETMESSAGELIST_PARAMETER_MASK_DELIVERY_STATUS 0b000000010000000000000000
590 #define MAP_GETMESSAGELIST_PARAMETER_MASK_CONVERSATION_ID 0b000000100000000000000000
591 #define MAP_GETMESSAGELIST_PARAMETER_MASK_CONVERSATION_NAME 0b000001000000000000000000
592 #define MAP_GETMESSAGELIST_PARAMETER_MASK_DIRECTION 0b000010000000000000000000
593 #define MAP_GETMESSAGELIST_PARAMETER_MASK_ATTACHMENT_MIME 0b000100000000000000000000
594 
595 // Api: MapClient::GetConversationListing Application Parameters Mask defines
596 // ConvParameterMask , Bits 0-14 has been used, Bits 15–31 Reserved for Future Use
597 // Bit i is 1 indicates that the parameter related to Bit i shall be present in the requested Conversation-Listing.
598 // The reserved bits shall be set to 0 by the MCE and discarded by the MSE.
599 // If Bit 5 has the value 0, the Conversation-Listing in the response shall not contain any participant element
600 // and therefore the Bits 6–14 do not have any impact.
601 // If Bit 5 has the value 1, then at least one of the Bits 6–14 shall also have the value 1.
602 // If any of the Bits 6–14 has the value 1, Bit 5 shall have the value 1.
603 #define MAP_GETCONV_PARAMETER_MASK_ALL_ON 0b000000000111111111111111
604 #define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_NAME 0b000000000000000000000001
605 #define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_LAST_ACTIVITY 0b000000000000000000000010
606 #define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_READ_STATUS 0b000000000000000000000100
607 #define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_VERSION_COUNTER 0b000000000000000000001000
608 #define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_SUMMARY 0b000000000000000000010000
609 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANTS 0b000000000000000000100000
610 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_UCI 0b000000000000000001000000
611 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_DISPLAY_NAME 0b000000000000000010000000
612 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_CHAT_STATE 0b000000000000000100000000
613 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_LAST_ACTIVITY 0b000000000000001000000000
614 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_X_BT_UID 0b000000000000010000000000
615 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_NAME 0b000000000000100000000000
616 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_PRESENCE_AVAILABILITY 0b000000000001000000000000
617 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_PRESENCE_TEXT 0b000000000010000000000000
618 #define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_PRIORITY 0b000000000100000000000000
619 
620 // Api: MapClient::SetNotificationFilter input param mask defines
621 // Bit i is 0 indicates that the MSE shall not send the notification related to bit i for the current MAS.
622 // NotificationFilterMask ,Bits 0-14 has been used, Bits 15–31 Reserved for Future Use
623 #define MAP_NOTIFICATION_FILTER_MASK_ALL_OFF 0b000000000000000000000000
624 #define MAP_NOTIFICATION_FILTER_MASK_ALL_ON 0b000000000111111111111111
625 #define MAP_NOTIFICATION_FILTER_MASK_NEW_MESSAGE 0b000000000000000000000001
626 #define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_DELETED 0b000000000000000000000010
627 #define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_SHIFT 0b000000000000000000000100
628 #define MAP_NOTIFICATION_FILTER_MASK_SENDING_SUCCESS 0b000000000000000000001000
629 #define MAP_NOTIFICATION_FILTER_MASK_SENDING_FAILURE 0b000000000000000000010000
630 #define MAP_NOTIFICATION_FILTER_MASK_DELIVERY_SUCCESS 0b000000000000000000100000
631 #define MAP_NOTIFICATION_FILTER_MASK_DELIVERY_FAILURE 0b000000000000000001000000
632 #define MAP_NOTIFICATION_FILTER_MASK_MEMORY_FULL 0b000000000000000010000000
633 #define MAP_NOTIFICATION_FILTER_MASK_MEMORY_AVAILABLE 0b000000000000000100000000
634 #define MAP_NOTIFICATION_FILTER_MASK_READ_STATUS_CHANGED 0b000000000000001000000000
635 #define MAP_NOTIFICATION_FILTER_MASK_CONVERSATION_CHANGED 0b000000000000010000000000
636 #define MAP_NOTIFICATION_FILTER_MASK_PARTICIPANT_PRESENCE_CHANGED 0b000000000000100000000000
637 #define MAP_NOTIFICATION_FILTER_MASK_PARTICIPANT_CHAT_STATE_CHANGED 0b000000000001000000000000
638 #define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_EXTENDED_DATA_CHANGED 0b000000000010000000000000
639 #define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_REMOVED 0b000000000100000000000000
640 
641 // Api: MapClient::GetSupportedFeatures action complete param mask defines
642 // Map Supported features mask
643 #define MAP_SUPPORTED_FEATURES_NOTIFICATION_REGISTRATION 0x00000001
644 #define MAP_SUPPORTED_FEATURES_NOTIFICATION_FEATURE 0x00000002
645 #define MAP_SUPPORTED_FEATURES_BROWSING 0x00000004
646 #define MAP_SUPPORTED_FEATURES_UPLOADING 0x00000008
647 #define MAP_SUPPORTED_FEATURES_DELETE_FEATURE 0x00000010
648 #define MAP_SUPPORTED_FEATURES_INSTANCE_INFO_FEATURE 0x00000020
649 #define MAP_SUPPORTED_FEATURES_EVENT_REPORT_1_1 0x00000040
650 #define MAP_SUPPORTED_FEATURES_EVENT_REPORT_1_2 0x00000080
651 #define MAP_SUPPORTED_FEATURES_MESSAGE_FORMAT_1_1 0x00000100
652 #define MAP_SUPPORTED_FEATURES_MESSAGELIST_FORMAT_1_1 0x00000200
653 #define MAP_SUPPORTED_FEATURES_PERSISTENT_MESSAGE_HANDLE 0x00000400
654 #define MAP_SUPPORTED_FEATURES_DATABASE_IDENTIFIER 0x00000800
655 #define MAP_SUPPORTED_FEATURES_FOLDOR_VERSION_COUNTER 0x00001000
656 #define MAP_SUPPORTED_FEATURES_CONVERSATION_VERSION_COUNTER 0x00002000
657 #define MAP_SUPPORTED_FEATURES_PARTICIPANT_PRESENCE_CHANGE_NOTIFICATION 0x00004000
658 #define MAP_SUPPORTED_FEATURES_PARTICIPANT_CHAT_STATE_CHANGE_NOTIFICATION 0x00008000
659 #define MAP_SUPPORTED_FEATURES_PBAP_CONTACT_CROSS_REFERENCE 0x00010000
660 #define MAP_SUPPORTED_FEATURES_NOTIFICATION_FILTER 0x00020000
661 #define MAP_SUPPORTED_FEATURES_UTC_OFFSET_TIMESTAMP_FORMAT 0x00040000
662 #define MAP_SUPPORTED_FEATURES_MAPSUPPORTED_FEATURES 0x00080000
663 #define MAP_SUPPORTED_FEATURES_CONVERSATION_LISTING 0x00100000
664 #define MAP_SUPPORTED_FEATURES_OWNER_STATUS 0x00200000
665 #define MAP_SUPPORTED_FEATURES_MESSAGE_FORWARDING 0x00400000
666 
667 /*********************************************
668  *
669  * AVRCP Macro Define
670  *
671  *********************************************/
672 
673 // The default label. The valid range is 0x00 ~ 0x0F.
674 #define AVRC_DEFAULT_LABEL (0x00)
675 // The invalid label.
676 #define AVRC_INVALID_LABEL (0x10)
677 
678 /**
679  * @brief This enumeration declares the types of the methods.
680  *
681  * @since 6
682  */
683 enum AvrcCtActionType : uint8_t {
684     AVRC_ACTION_TYPE_INVALID = 0x00,
685     AVRC_ACTION_TYPE_PRESS_BUTTON,
686     AVRC_ACTION_TYPE_RELEASE_BUTTON,
687     AVRC_ACTION_TYPE_SET_ADDRESSED_PLAYER,
688     AVRC_ACTION_TYPE_SET_BROWSED_PLAYER,
689     AVRC_ACTION_TYPE_GET_CAPABILITIES,
690     AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_ATTRIBUTES,
691     AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_VALUES,
692     AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_CURRENT_VALUE,
693     AVRC_ACTION_TYPE_SET_PLAYER_APP_SETTING_CURRENT_VALUE,
694     AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_ATTRIBUTE_TEXT,
695     AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_VALUE_TEXT,
696     AVRC_ACTION_TYPE_GET_ELEMENT_ATTRIBUTES,
697     AVRC_ACTION_TYPE_GET_PLAY_STATUS,
698     AVRC_ACTION_TYPE_PLAY_ITEM,
699     AVRC_ACTION_TYPE_ADD_TO_NOW_PLAYING,
700     AVRC_ACTION_TYPE_CHANGE_PATH,
701     AVRC_ACTION_TYPE_GET_FOLDER_ITEMS,
702     AVRC_ACTION_TYPE_GET_ITEM_ATTRIBUTES,
703     AVRC_ACTION_TYPE_GET_TOTAL_NUMBER_OF_ITEMS,
704     AVRC_ACTION_TYPE_SET_ABSOLUTE_VOLUME,
705     AVRC_ACTION_TYPE_NOTIFY_PLAYBACK_STATUS_CHANGED,
706     AVRC_ACTION_TYPE_NOTIFY_TRACK_CHANGED,
707     AVRC_ACTION_TYPE_NOTIFY_TRACK_REACHED_END,
708     AVRC_ACTION_TYPE_NOTIFY_TRACK_REACHED_START,
709     AVRC_ACTION_TYPE_NOTIFY_PLAYBACK_POS_CHANGED,
710     AVRC_ACTION_TYPE_NOTIFY_PLAYER_APPLICATION_SETTING_CHANGED,
711     AVRC_ACTION_TYPE_NOTIFY_NOW_PLAYING_CONTENT_CHANGED,
712     AVRC_ACTION_TYPE_NOTIFY_AVAILABLE_PLAYERS_CHANGED,
713     AVRC_ACTION_TYPE_NOTIFY_ADDRESSED_PLAYER_CHANGED,
714     AVRC_ACTION_TYPE_NOTIFY_UIDS_CHANGED,
715     AVRC_ACTION_TYPE_NOTIFY_VOLUME_CHANGED,
716     AVRC_ACTION_TYPE_GET_MEDIA_PLAYER_LIST,
717 };
718 
719 /**
720  * @brief This enumeration declares the values of the supported button.
721  * @see AV/C Panel Subunit Specification 1.23 Section 9.4 PASS THROUGH control command Table 9.21 - Operation id List
722  *
723  * @since 6
724  */
725 enum AvrcKeyOperation : uint8_t {
726     AVRC_KEY_OPERATION_VOLUME_UP = 0x41,     // Volume up.
727     AVRC_KEY_OPERATION_VOLUME_DOWN = 0x42,   // Volume down.
728     AVRC_KEY_OPERATION_MUTE = 0x43,          // Mute.
729     AVRC_KEY_OPERATION_PLAY = 0x44,          // Play.
730     AVRC_KEY_OPERATION_STOP = 0x45,          // Stop.
731     AVRC_KEY_OPERATION_PAUSE = 0x46,         // Pause.
732     AVRC_KEY_OPERATION_REWIND = 0x48,        // Rewind.
733     AVRC_KEY_OPERATION_FAST_FORWARD = 0x49,  // Fast forward.
734     AVRC_KEY_OPERATION_FORWARD = 0x4B,       // Forward.
735     AVRC_KEY_OPERATION_BACKWARD = 0x4C,      // Backward.
736     AVRC_KEY_OPERATION_INVALID = 0x7F,
737 };
738 
739 /**
740  * @brief This enumeration declares the values of the key state.
741  *
742  * @since 6
743  */
744 enum AvrcTgKeyState : uint8_t {
745     AVRC_KEY_STATE_PRESS = 0x00,    // The key is pushed.
746     AVRC_KEY_STATE_RELEASE = 0x01,  // The key is released.
747     AVRC_KEY_STATE_INVALID,         // Invalid key state.
748 };
749 
750 /**
751  * @brief This enumeration declares the values of the player application setting attributes.
752  * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
753  *
754  * @since 6
755  */
756 enum AvrcPlayerAttribute : uint8_t {
757     AVRC_PLAYER_ATTRIBUTE_ILLEGAL = 0x00,       // Illegal , Should not be used.
758     AVRC_PLAYER_ATTRIBUTE_EQUALIZER = 0x01,     // Equalizer ON / OFF status.
759     AVRC_PLAYER_ATTRIBUTE_REPEAT = 0x02,        // Repeat Mode status.
760     AVRC_PLAYER_ATTRIBUTE_SHUFFLE = 0x03,       // Shuffle ON/OFF status.
761     AVRC_PLAYER_ATTRIBUTE_SCAN = 0x04,          // Scan ON/OFF status.
762     AVRC_PLAYER_ATTRIBUTE_RESERVED_MIN = 0x05,  // Reserved for future use. 0x05 - 0x7F
763     AVRC_PLAYER_ATTRIBUTE_RESERVED_MAX = 0x7F,  // Reserved for future use. 0x05 - 0x7F
764     AVRC_PLAYER_ATTRIBUTE_EXTENSION = 0x80,     // Provided for TG driven static media player menu extension.
765                                                 // Range: 0x80 - 0xFF
766 };
767 
768 /**
769  * @brief This enumeration declares the values of the Equalizer ON/OFF status.
770  * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
771  *
772  * @since 6
773  */
774 enum AvrcEqualizer : uint8_t {
775     AVRC_EQUALIZER_OFF = 0x01,
776     AVRC_EQUALIZER_ON,
777     AVRC_EQUALIZER_INVALID,
778 };
779 
780 /**
781  * @brief This enumeration declares the values of the Repeat Mode status.
782  * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
783  *
784  * @since 6
785  */
786 enum AvrcRepeat : uint8_t {
787     AVRC_REPEAT_OFF = 0x01,
788     AVRC_REPEAT_SINGLE_TRACK,
789     AVRC_REPEAT_ALL_TRACK,
790     AVRC_REPEAT_GROUP,
791     AVRC_REPEAT_INVALID,
792 };
793 
794 /**
795  * @brief This enumeration declares the values of the Shuffle ON/OFF status.
796  * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
797  *
798  * @since 6
799  */
800 enum AvrcShuffle : uint8_t {
801     AVRC_SHUFFLE_OFF = 0x01,
802     AVRC_SHUFFLE_ALL_TRACKS,
803     AVRC_SHUFFLE_GROUP,
804     AVRC_SHUFFLE_INVALID,
805 };
806 
807 /**
808  * @brief This enumeration declares the values of the Scan ON/OFF status.
809  * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
810  *
811  * @since 6
812  */
813 enum AvrcScan : uint8_t {
814     AVRC_SCAN_OFF = 0x01,
815     AVRC_SCAN_ALL_TRACKS,
816     AVRC_SCAN_GROUP,
817     AVRC_SCAN_INVALID,
818 };
819 
820 /**
821  * @brief This enumeration declares the values of the play status.
822  *
823  * @since 6
824  */
825 enum AvrcPlayStatus : uint32_t {
826     AVRC_PLAY_STATUS_STOPPED = 0x00,                      // Stopped.
827     AVRC_PLAY_STATUS_PLAYING,                             // Playing.
828     AVRC_PLAY_STATUS_PAUSED,                              // Paused.
829     AVRC_PLAY_STATUS_FWD_SEEK,                            // Fwd seek.
830     AVRC_PLAY_STATUS_REV_SEEK,                            // Rev seek.
831     AVRC_PLAY_STATUS_RESERVED_MIN = 0x05,                 // Reserved for future use.
832     AVRC_PLAY_STATUS_RESERVED_MAX = 0xFE,                 // Reserved for future use.
833     AVRC_PLAY_STATUS_ERROR = 0xFF,                        // Error.
834     AVRC_PLAY_STATUS_INVALID_SONG_LENGTH = 0xFFFFFFFF,    // If TG does not support, then TG shall return 0xFFFFFFFF.
835     AVRC_PLAY_STATUS_INVALID_SONG_POSITION = 0xFFFFFFFF,  // If TG does not support, then TG shall return 0xFFFFFFFF.
836 };
837 
838 /**
839  * @brief This enumeration declares the values of folder direction.
840  *
841  * @since 6
842  */
843 enum AvrcFolderDirection : uint8_t {
844     AVRC_FOLDER_DIRECTION_UP = 0x00,       // Folder up.
845     AVRC_FOLDER_DIRECTION_DOWN = 0x01,     // Folder down.
846     AVRC_FOLDER_DIRECTION_INVALID = 0x02,  // Reserved.
847 };
848 
849 /**
850  * @brief This enumeration declares the values of the scope in which the UID of the media element item or folder item.
851  * @see Audio/Video Remote Control 1.6.2 Section 6.10.1 Scope.
852  *
853  * @since 6
854  */
855 enum AvrcMediaScope : uint8_t {
856     AVRC_MEDIA_SCOPE_PLAYER_LIST = 0x00,   // Contains all available media players.
857     AVRC_MEDIA_SCOPE_VIRTUAL_FILE_SYSTEM,  // Contains the media content of the browsed player.
858     AVRC_MEDIA_SCOPE_SEARCH,               // The results of a search operation on the browsed player.
859     AVRC_MEDIA_SCOPE_NOW_PLAYING,          // The Now Playing list (or queue) of the addressed player.
860     AVRC_MEDIA_SCOPE_INVALID,
861 };
862 
863 /**
864  * @brief This enumeration declares the values of the browseable items.
865  * @see Audio/Video Remote Control 1.6.2 Section 6.10.2 Browseable items.
866  *
867  * @since 6
868  */
869 enum AvrcMediaType : uint8_t {
870     AVRC_MEDIA_TYPE_MEDIA_PLAYER_ITEM = 0x01,
871     AVRC_MEDIA_TYPE_FOLDER_ITEM,
872     AVRC_MEDIA_TYPE_MEDIA_ELEMENT_ITEM,
873     AVRC_MEDIA_TYPE_INVALID,
874 };
875 
876 /**
877  * @brief This enumeration declares the values of the attribute count.
878  * @see Audio/Video Remote Control 1.6.2 Section 6.10.4.2 GetFolderItems - Attribute Count.
879  *
880  * @since 6
881  */
882 enum AvrcAttributeCount {
883     AVRC_ATTRIBUTE_COUNT_ALL = 0x00,
884     AVRC_ATTRIBUTE_COUNT_NO = 0xFF,
885 };
886 
887 /**
888  * @brief This enumeration declares the values of the media attribute. These values are used to uniquely identify media
889  * information.
890  * @see Audio/Video Remote Control 1.6.2 Section 26 Appendix E: list of media attributes.
891  *
892  * @since 6
893  */
894 enum AvrcMediaAttribute : uint8_t {
895     // Not used.
896     AVRC_MEDIA_ATTRIBUTE_NOT_USED = 0x00,
897     // Text field representing the title, song name or content description coded per specified character set.
898     AVRC_MEDIA_ATTRIBUTE_TITLE,
899     // Text field representing artist(s), performer(s) or group coded per specified character set.
900     AVRC_MEDIA_ATTRIBUTE_ARTIST_NAME,
901     // Text field representing the title of the recording(source) from which the audio in the file is taken.
902     AVRC_MEDIA_ATTRIBUTE_ALBUM_NAME,
903     // Numeric ASCII string containing the order number of the audio - file on its original recording.O 0x5 Total
904     // Number of Tracks.
905     AVRC_MEDIA_ATTRIBUTE_TRACK_NUMBER,
906     // Numeric ASCII string containing the total number of tracks or elements on the original recording.
907     AVRC_MEDIA_ATTRIBUTE_TOTAL_NUMBER_OF_TRACKS,
908     // Text field representing the category of the composition characterized by a particular style.
909     AVRC_MEDIA_ATTRIBUTE_GENRE,
910     // Numeric ASCII string containing the length of the audio file in milliseconds.(E.g .02 : 30 = 150000)
911     AVRC_MEDIA_ATTRIBUTE_PLAYING_TIME,
912     // BIP Image Handle.
913     AVRC_MEDIA_ATTRIBUTE_DEFAULT_COVER_ART,
914     // Reserved for future use.
915     AVRC_MEDIA_ATTRIBUTE_RESERVED,
916 };
917 
918 /**
919  * @brief This enumeration declares the values of the major player type.
920  * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.1 Media player item - Major Player Type
921  *
922  * @since 6
923  */
924 enum AvrcMediaMajorPlayerType : uint8_t {
925     AVRC_MEDIA_MAJOR_PLAYER_TYPE_AUDIO = 0x01,               // Audio.
926     AVRC_MEDIA_MAJOR_PLAYER_TYPE_VIDEO = 0x02,               // Video.
927     AVRC_MEDIA_MAJOR_PLAYER_TYPE_BROADCASTING_AUDIO = 0x04,  // Broadcasting Audio.
928     AVRC_MEDIA_MAJOR_PLAYER_TYPE_BROADCASTING_VIDEO = 0x08,  // Broadcasting Video.
929     AVRC_MEDIA_MAJOR_PLAYER_TYPE_RESERVED = 0x10             // Reserved for future use.
930 };
931 
932 /**
933  * @brief This enumeration declares the values of the major player type.
934  * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.1 Media player item - Player Sub Type
935  *
936  * @since 6
937  */
938 enum AvrcMediaPlayerSubType : uint32_t {
939     AVRC_MEDIA_PLAYER_SUB_TYPE_AUDIO_BOOK = 0x00000001,  // Audio Book.
940     AVRC_MEDIA_PLAYER_SUB_TYPE_PODCAST = 0x00000002,     // Pod cast.
941     AVRC_MEDIA_PLAYER_SUB_TYPE_RESERVED = 0x00000004     // Reserved for future use.
942 };
943 
944 /**
945  * @brief This enumeration declares the values of character set.
946  *
947  * @since 6
948  */
949 enum AvrcMediaCharacterSet : uint16_t {
950     AVRC_MEDIA_CHARACTER_SET_UTF8 = 0x006A,  // The value of UTF-8 as defined in IANA character set document.
951 };
952 
953 /**
954  * @brief This enumeration declares the values of the folder type.
955  * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.2 Folder item - Folder Type
956  *
957  * @since 6
958  */
959 enum AvrcMediaFolderType : uint8_t {
960     AVRC_MEDIA_FOLDER_TYPE_MIXED = 0x00,  // Mixed.
961     AVRC_MEDIA_FOLDER_TYPE_TITLES,        // Titles.
962     AVRC_MEDIA_FOLDER_TYPE_ALBUMS,        // Albums.
963     AVRC_MEDIA_FOLDER_TYPE_ARTISTS,       // Artists.
964     AVRC_MEDIA_FOLDER_TYPE_GENRES,        // Genres.
965     AVRC_MEDIA_FOLDER_TYPE_PLAY_LISTS,    // Play lists.
966     AVRC_MEDIA_FOLDER_TYPE_YEARS,         // Years.
967     AVRC_MEDIA_FOLDER_TYPE_RESERVED,      // Reserved for future use.
968 };
969 
970 /**
971  * @brief This enumeration declares the values of the is playable.
972  * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.2 Folder item - Is Playable
973  *
974  * @since 6
975  */
976 enum AvrcMediaFolderPlayable : uint8_t {
977     // The folder cannot be played. This means that the folder UID shall not be passed to either the PlayItem or
978     // AddToNowPlaying commands.
979     AVRC_MEDIA_FOLDER_PLAYABLE_NO = 0x00,
980     // The folder can be played. The folder UID may be passed to the PlayItem and AddToNowPlaying(if supported)
981     // commands. The media player behavior on playing a folder should be same as on the local user interface.
982     AVRC_MEDIA_FOLDER_PLAYABLE_YES,
983     AVRC_MEDIA_FOLDER_PLAYABLE_RESERVED,  // Reserved for future use.
984 };
985 
986 /**
987  * @brief This enumeration declares the values of the media type.
988  * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.3 Media element item - Media Type
989  *
990  * @since 6
991  */
992 enum AvrcMediaElementType : uint8_t {
993     AVRC_MEDIA_ELEMENT_TYPE_AUDIO = 0x00,  // Audio.
994     AVRC_MEDIA_ELEMENT_TYPE_VIDEO,         // Video.
995     AVRC_MEDIA_ELEMENT_TYPE_RESERVED,      // Reserved for future use.
996 };
997 
998 /**
999  * @brief This enumeration declares the values of the media type.
1000  *
1001  * @details An Absolute Volume is represented in one octet. The top bit (bit 7) is reserved for future addition (RFA).
1002  * The volume is specified as a percentage of the maximum. The value 0x0 corresponds to 0%. The value 0x7F corresponds
1003  * to 100%. Scaling should be applied to achieve values between these two. The existence of this scale does not impose
1004  * any restriction on the granularity of the volume control scale on the TG.
1005  * @see Audio/Video Remote Control 1.6.2 Section 6.13.1 Absolute Volume
1006  *
1007  * @since 6
1008  */
1009 enum AvrcAbsoluteVolume : uint8_t {
1010     AVRC_ABSOLUTE_VOLUME_PERCENTAGE_0 = 0x00,    // 0%
1011     AVRC_ABSOLUTE_VOLUME_PERCENTAGE_100 = 0x7F,  // 100%
1012     AVRC_ABSOLUTE_VOLUME_INVALID = 0x80,
1013 };
1014 
1015 /**
1016  * @brief This enumeration declares the values of the "EVENT ID".
1017  * @see Audio/Video Remote Control 1.6.2 Section 28 Appendix H: list of defined notification events.
1018  *
1019  * @since 6
1020  */
1021 enum AvrcEventId : uint8_t {
1022     AVRC_EVENT_ID_PLAYBACK_STATUS_CHANGED = 0x01,  // Change in playback status of the current track.
1023     AVRC_EVENT_ID_TRACK_CHANGED,                   // Change of current track.
1024     AVRC_EVENT_ID_TRACK_REACHED_END,               // Reached end of a track.
1025     AVRC_EVENT_ID_TRACK_REACHED_START,             // Reached start of a track.
1026     // Change in playback position. Returned after the specified playback notification change notification interval.
1027     AVRC_EVENT_ID_PLAYBACK_POS_CHANGED,
1028     AVRC_EVENT_ID_BATT_STATUS_CHANGED,                 // Change in battery status.
1029     AVRC_EVENT_ID_SYSTEM_STATUS_CHANGED,               // Change in system status.
1030     AVRC_EVENT_ID_PLAYER_APPLICATION_SETTING_CHANGED,  // Change in player application setting.
1031     AVRC_EVENT_ID_NOW_PLAYING_CONTENT_CHANGED,         // The content of the Now Playing list has changed.
1032     AVRC_EVENT_ID_AVAILABLE_PLAYERS_CHANGED,           // The available players have changed
1033     AVRC_EVENT_ID_ADDRESSED_PLAYER_CHANGED,            // The Addressed Player has been changed.
1034     AVRC_EVENT_ID_UIDS_CHANGED,                        // The UIDs have changed.
1035     AVRC_EVENT_ID_VOLUME_CHANGED,                      // The volume has been changed locally on the TG.
1036     AVRC_EVENT_ID_RESERVED = 0x0E,
1037 };
1038 
1039 /**
1040  * @bUnique identifier to identify an element on TG
1041  *
1042  * @since 6
1043  */
1044 enum AvrcElementIdentifier : uint64_t {
1045     AVRC_ELEMENT_ATTRIBUTES_IDENTIFIER_PLAYING =
1046         0x0000000000000000,  // attribute information for the element which is current track in the TG device.
1047     AVRC_ELEMENT_ATTRIBUTES_IDENTIFIER_RESERVED =
1048         0x0000000000000001,  // All other values other than 0x0 are currently reserved.
1049 };
1050 
1051 /**
1052  * @brief This enumeration declares the allowed values for GetCapabilities Command.
1053  *
1054  * @since 6
1055  */
1056 enum AvrcCapabilityId : uint8_t {
1057     AVRC_CAPABILITY_COMPANYID = 0x02,  // The list of CompanyID supported by TG.
1058     AVRC_CAPABILITY_EVENTID = 0x03,    // EventIDs defined in this specification to be supported by TG.
1059 };
1060 
1061 /**
1062  * @brief This enumeration declares the values of playback interval in seconds.
1063  *
1064  * @since 6
1065  */
1066 enum AvrcPlaybackInterval : uint8_t {
1067     AVRC_PLAYBACK_INTERVAL_1_SEC = 0x01,
1068     AVRC_PLAYBACK_INTERVAL_5_SEC = 0x05,
1069     AVRC_PLAYBACK_INTERVAL_10_SEC = 0x0A,
1070     AVRC_PLAYBACK_INTERVAL_15_SEC = 0x0F,
1071     AVRC_PLAYBACK_INTERVAL_20_SEC = 0x14,
1072     AVRC_PLAYBACK_INTERVAL_25_SEC = 0x19,
1073     AVRC_PLAYBACK_INTERVAL_30_SEC = 0x1E,
1074 };
1075 
1076 /**
1077  * @brief This enumeration declares the error / status code of the vendor dependent command frame and the browsing
1078  * command frame.
1079  *
1080  * @since 6
1081  */
1082 enum AvrcEsCode : uint8_t {
1083     AVRC_ES_CODE_INVALID = 0xFF,  // Reserved.
1084     // Invalid command, sent if TG received a PDU that it did not understand.
1085     AVRC_ES_CODE_INVALID_COMMAND = 0x00,
1086     // Invalid parameter, sent if the TG received a PDU with a parameter ID that it did not understand. This error code
1087     // applies to the following identifiers :
1088     // PDU ID.
1089     // Capability ID.
1090     // Event ID.
1091     // Player Application Setting Attribute ID.
1092     // Player Application Setting Value ID.
1093     // Element Attribute ID.
1094     AVRC_ES_CODE_INVALID_PARAMETER = 0x01,
1095     // Parameter content error.Sent if the parameter ID is understood, but content is wrong or corrupted.
1096     AVRC_ES_CODE_PARAMETER_CONTENT_ERROR = 0x02,
1097     // Internal Error - sent if there are error conditions not covered by a more specific error code.
1098     AVRC_ES_CODE_INTERNAL_ERROR = 0x03,
1099     // Operation completed without error.This is the status that should be returned if the operation was successful.
1100     AVRC_ES_CODE_NO_ERROR = 0x04,
1101     // UID Changed - The UIDs on the device have changed.
1102     AVRC_ES_CODE_UID_CHANGED = 0x05,
1103     // Reserved.
1104     AVRC_ES_CODE_RESERVED = 0x06,
1105     // Invalid Direction - The Direction parameter is invalid.
1106     AVRC_ES_CODE_INVALID_DIRECTION = 0x07,
1107     // Not a Directory - The UID provided does not refer to a folder item.
1108     AVRC_ES_CODE_NOT_A_DIRECTORY = 0x08,
1109     // Does Not Exist - The UID provided does not refer to any currently valid item.
1110     AVRC_ES_CODE_DOES_NOT_EXIST = 0x09,
1111     // Invalid Scope - The scope parameter is invalid.
1112     AVRC_ES_CODE_INVALID_SCOPE = 0x0A,
1113     // Range Out of Bounds - The start of range provided is not valid.
1114     AVRC_ES_CODE_RANGE_OUT_OF_BOUNDS = 0x0B,
1115     // Folder Item is not playable - The UID provided refers to a folder item which cannot be handled by this media
1116     // player.
1117     AVRC_ES_CODE_FOLDER_ITEM_IS_NOT_PLAYABLE = 0x0C,
1118     // Media in Use - The media is not able to be used for this operation at this time.
1119     AVRC_ES_CODE_MEDIA_IN_USE = 0x0D,
1120     // Now Playing List Full - No more items can be added to the Now Playing List.
1121     AVRC_ES_CODE_NOW_PLAYING_LIST_FULL = 0x0E,
1122     // Search Not Supported - The Browsed Media Player does not support search.
1123     AVRC_ES_CODE_SEARCH_NOT_SUPPORTED = 0x0F,
1124     // Search in Progress - A search operation is already in progress.
1125     AVRC_ES_CODE_SEARCH_IN_PROGRESS = 0x10,
1126     // Invalid Player Id - The specified Player Id does not refer to a valid player.
1127     AVRC_ES_CODE_INVALID_PLAYER_ID = 0x11,
1128     // Player Not Browsable - The Player Id supplied refers to a Media Player which does not support browsing.
1129     AVRC_ES_CODE_PLAYER_NOT_BROWSABLE = 0x12,
1130     // Player Not Addressed.The Player Id supplied refers to a player which is not currently addressed, and the command
1131     // is not able to be performed if the player is not set as addressed.
1132     AVRC_ES_CODE_PLAYER_NOT_ADDRESSED = 0x13,
1133     // No valid Search Results - The Search result list does not contain valid entries, e.g.after being invalidated due
1134     // to change of browsed player.
1135     AVRC_ES_CODE_NO_VALID_SEARCH_RESULTS = 0x14,
1136     // No available players.
1137     AVRC_ES_CODE_NO_AVAILABLE_PLAYERS = 0x15,
1138     // Addressed Player Changed.
1139     AVRC_ES_CODE_ADDRESSED_PLAYER_CHANGED = 0x16,
1140 
1141     // User custom error code.
1142     AVRC_ES_CODE_NOTIFICATION_CHANGED = 0xFF,
1143 };
1144 
1145 /*********************************************
1146  *
1147  * HFP Definitions
1148  *
1149  *********************************************/
1150 /**
1151  * @brief sco connect state define
1152  * use to notify sco connection observers.
1153  */
1154 enum class HfpScoConnectState : int { SCO_DISCONNECTED = 3, SCO_CONNECTING, SCO_DISCONNECTING, SCO_CONNECTED };
1155 
1156 /*********************************************
1157  *
1158  * A2DP Definitions
1159  *
1160  *********************************************/
1161 
1162 /**
1163  * @brief a2dp optional codec support state define
1164  *
1165  * @since 6
1166  */
1167 enum A2DP_OPTIONAL_SUPPORT_STATE {
1168     A2DP_OPTIONAL_NOT_SUPPORT,
1169     A2DP_OPTIONAL_SUPPORT,
1170     A2DP_OPTIONAL_SUPPORT_UNKNOWN,
1171 };
1172 
1173 /**
1174  * @brief a2dp optional codec enable state define
1175  *
1176  * @since 6
1177  */
1178 enum A2DP_OPTIONAL_ENABLE_STATE { A2DP_OPTIONAL_DISABLE, A2DP_OPTIONAL_ENABLE, A2DP_OPTIONAL_ENABLE_UNKNOWN };
1179 
1180 /**
1181  * @brief a2dp playing state define
1182  *
1183  * @since 6
1184  */
1185 enum A2DP_PLAYING_STATE { A2DP_NOT_PLAYING, A2DP_IS_PLAYING };
1186 
1187 /**
1188  * @brief A2dp codec type enum.
1189  *
1190  * @since 6
1191 
1192  */
1193 enum A2dpUserCodecType : uint8_t {
1194     A2DP_CODEC_TYPE_SBC_USER = 0,
1195     A2DP_CODEC_TYPE_MPEG1_USER = 0x01,
1196     A2DP_CODEC_TYPE_AAC_USER = 0x01 << 1,
1197     A2DP_CODEC_TYPE_ATRAC_USER = 0x01 << 2,
1198     A2DP_CODEC_TYPE_NONA2DP_USER = 0xFF
1199 };
1200 
1201 /**
1202  * @brief A2dp codec priority enum.
1203  *
1204  * @since 6
1205  */
1206 enum A2dpUserCodecPriority : uint32_t {
1207     A2DP_CODEC_PRIORITY_DISABLED_USER = 0,
1208     A2DP_CODEC_PRIORITY_DEFAULT_USER,
1209     A2DP_CODEC_PRIORITY_HIGHEST_USER = 1000 * 1000,
1210 };
1211 
1212 /**
1213  * @brief A2dp codec sample rate enum.
1214  *
1215  * @since 6
1216  */
1217 enum A2dpUserCodecSampleRate : uint32_t {
1218     A2DP_SAMPLE_RATE_NONE_USER = 0x0,
1219     A2DP_SBC_SAMPLE_RATE_48000_USER = 0x1 << 4, /* octet0 b4 */
1220     A2DP_SBC_SAMPLE_RATE_44100_USER = 0x1 << 5, /* octet0 b5 */
1221     A2DP_SBC_SAMPLE_RATE_32000_USER = 0x1 << 6, /* octet0 b6 */
1222     A2DP_SBC_SAMPLE_RATE_16000_USER = 0x1 << 7, /* octet0 b7 */
1223     A2DP_SBC_SAMPLE_RATE_MSK_USER = 0xF0,
1224     A2DP_AAC_SAMPLE_RATE_OCTET1_44100_USER = 0x01,
1225     A2DP_AAC_SAMPLE_RATE_OCTET1_32000_USER = 0x01 << 1,
1226     A2DP_AAC_SAMPLE_RATE_OCTET1_24000_USER = 0x01 << 2,
1227     A2DP_AAC_SAMPLE_RATE_OCTET1_22050_USER = 0x01 << 3,
1228     A2DP_AAC_SAMPLE_RATE_OCTET1_16000_USER = 0x01 << 4,
1229     A2DP_AAC_SAMPLE_RATE_OCTET1_12000_USER = 0x01 << 5,
1230     A2DP_AAC_SAMPLE_RATE_OCTET1_11025_USER = 0x01 << 6,
1231     A2DP_AAC_SAMPLE_RATE_OCTET1_8000_USER = 0x01 << 7,
1232     A2DP_AAC_SAMPLE_RATE_OCTET1_MSK_USER = 0xFF,
1233     A2DP_AAC_SAMPLE_RATE_OCTET2_96000_USER = 0x01 << 12,
1234     A2DP_AAC_SAMPLE_RATE_OCTET2_88200_USER = 0x01 << 13,
1235     A2DP_AAC_SAMPLE_RATE_OCTET2_64000_USER = 0x01 << 14,
1236     A2DP_AAC_SAMPLE_RATE_OCTET2_48000_USER = 0x01 << 15,
1237     A2DP_AAC_SAMPLE_RATE_OCTET2_MSK_USER = 0xF0,
1238 };
1239 
1240 /**
1241  * @brief A2dp codec channel mode enum.
1242  *
1243  * @since 6
1244  */
1245 enum A2dpUserCodecChannelMode : uint8_t {
1246     A2DP_CHANNEL_MODE_NONE_USER = 0x0,
1247     A2DP_SBC_CHANNEL_MODE_JOINT_STEREO_USER = 0x1, /* octet0 b0 */
1248     A2DP_SBC_CHANNEL_MODE_STEREO_USER = 0x1 << 1,  /* octet0 b1 */
1249     A2DP_SBC_CHANNEL_MODE_DUAL_USER = 0x1 << 2,    /* octet0 b2 */
1250     A2DP_SBC_CHANNEL_MODE_MONO_USER = 0x1 << 3,    /* octet0 b3 */
1251     A2DP_SBC_CHANNEL_MODE_MSK_USER = 0x0F,
1252     A2DP_AAC_CHANNEL_MODE_OCTET2_DOUBLE_USER = 0x01 << 2, /* octet2 b2 */
1253     A2DP_AAC_CHANNEL_MODE_OCTET2_SINGLE_USER = 0x01 << 3, /* octet2 b3 */
1254     A2DP_AAC_CHANNEL_MODE_OCTET2_MSK_USER = 0x0C,
1255 };
1256 
1257 /**
1258  * @brief A2dp codec bits per sample enum.
1259  *
1260  * @since 6
1261  */
1262 enum A2dpUserCodecBitsPerSample : uint8_t {
1263     A2DP_SAMPLE_BITS_NONE_USER = 0x0,
1264     A2DP_SAMPLE_BITS_16_USER = 0x1 << 0,
1265     A2DP_SAMPLE_BITS_24_USER = 0x1 << 1,
1266     A2DP_SAMPLE_BITS_32_USER = 0x1 << 2,
1267     A2DP_SAMPLE_BITS_MSK_USER = 0x06,
1268     A2DP_AAC_SAMPLE_BITS_OCTET3_BIT0_USER = 0x01,      /* octet3 b0 */
1269     A2DP_AAC_SAMPLE_BITS_OCTET3_BIT1_USER = 0x01 << 1, /* octet3 b1 */
1270     A2DP_AAC_SAMPLE_BITS_OCTET3_BIT2_USER = 0x01 << 2, /* octet3 b2 */
1271     A2DP_AAC_SAMPLE_BITS_OCTET3_BIT3_USER = 0x01 << 3, /* octet3 b3 */
1272     A2DP_AAC_SAMPLE_BITS_OCTET3_BIT4_USER = 0x01 << 4, /* octet3 b4 */
1273     A2DP_AAC_SAMPLE_BITS_OCTET3_BIT5_USER = 0x01 << 5, /* octet3 b5 */
1274     A2DP_AAC_SAMPLE_BITS_OCTET3_BIT6_USER = 0x01 << 6, /* octet3 b6 */
1275     A2DP_AAC_SAMPLE_BITS_OCTET4_BIT0_USER = 0x01,      /* octet4 b0 */
1276     A2DP_AAC_SAMPLE_BITS_OCTET4_BIT1_USER = 0x01 << 1, /* octet4 b1 */
1277     A2DP_AAC_SAMPLE_BITS_OCTET4_BIT2_USER = 0x01 << 2, /* octet4 b2 */
1278     A2DP_AAC_SAMPLE_BITS_OCTET4_BIT3_USER = 0x01 << 3, /* octet4 b3 */
1279     A2DP_AAC_SAMPLE_BITS_OCTET4_BIT4_USER = 0x01 << 4, /* octet4 b4 */
1280     A2DP_AAC_SAMPLE_BITS_OCTET4_BIT5_USER = 0x01 << 5, /* octet4 b5 */
1281     A2DP_AAC_SAMPLE_BITS_OCTET4_BIT6_USER = 0x01 << 6, /* octet4 b6 */
1282     A2DP_AAC_SAMPLE_BITS_OCTET4_BIT7_USER = 0x01 << 7, /* octet4 b6 */
1283     A2DP_AAC_SAMPLE_BITS_OCTET5_BIT0_USER = 0x01,      /* octet5 b0 */
1284     A2DP_AAC_SAMPLE_BITS_OCTET5_BIT1_USER = 0x01 << 1, /* octet5 b1 */
1285     A2DP_AAC_SAMPLE_BITS_OCTET5_BIT2_USER = 0x01 << 2, /* octet5 b2 */
1286     A2DP_AAC_SAMPLE_BITS_OCTET5_BIT3_USER = 0x01 << 3, /* octet5 b3 */
1287     A2DP_AAC_SAMPLE_BITS_OCTET5_BIT4_USER = 0x01 << 4, /* octet5 b4 */
1288     A2DP_AAC_SAMPLE_BITS_OCTET5_BIT5_USER = 0x01 << 5, /* octet5 b5 */
1289     A2DP_AAC_SAMPLE_BITS_OCTET5_BIT6_USER = 0x01 << 6, /* octet5 b6 */
1290     A2DP_AAC_SAMPLE_BITS_OCTET5_BIT7_USER = 0x01 << 7, /* octet5 b6 */
1291 };
1292 
1293 /**
1294  * @brief Pbap action Type.
1295  *
1296  * @since 6
1297  */
1298 enum PbapActionType : uint16_t {
1299     PBAP_ACTION_PULLPHONEBOOKSIZE,     // pull phonebooksize
1300     PBAP_ACTION_PULLPHONEBOOK,         // pull phonebook
1301     PBAP_ACTION_SETPHONEBOOK,          // set  phonebook
1302     PBAP_ACTION_PULLVCARDLISTINGSIZE,  // pull vcard listing size
1303     PBAP_ACTION_PULLVCARDLISTING,      // pull vcard listing
1304     PBAP_ACTION_PULLVCARDENTRY,        // pull vcard entry
1305     PBAP_ACTION_ABORT,                 // abort downloading
1306 };
1307 
1308 // PBAP_PHONEBOOK_NAME
1309 #define PBAP_PHONEBOOK_PB u"/telecom/pb.vcf"
1310 #define PBAP_PHONEBOOK_ICH u"/telecom/ich.vcf"
1311 #define PBAP_PHONEBOOK_OCH u"/telecom/och.vcf"
1312 #define PBAP_PHONEBOOK_MCH u"/telecom/mch.vcf"
1313 #define PBAP_PHONEBOOK_CCH u"/telecom/cch.vcf"
1314 #define PBAP_PHONEBOOK_SPD u"/telecom/spd.vcf"
1315 #define PBAP_PHONEBOOK_FAV u"/telecom/fav.vcf"
1316 #define PBAP_PHONEBOOK_PB1 u"/SIM1/telecom/pb.vcf"
1317 #define PBAP_PHONEBOOK_ICH1 u"/SIM1/telecom/ich.vcf"
1318 #define PBAP_PHONEBOOK_OCH1 u"/SIM1/telecom/och.vcf"
1319 #define PBAP_PHONEBOOK_MCH1 u"/SIM1/telecom/mch.vcf"
1320 #define PBAP_PHONEBOOK_CCH1 u"/SIM1/telecom/cch.vcf"
1321 
1322 enum PbapOrderType : uint8_t {
1323     PBAP_ORDER_INDEXED = 0x00,       // indexed order
1324     PBAP_ORDER_ALPHANUMERIC = 0x01,  // alphabetical order
1325     PBAP_ORDER_PHONETIC = 0x02,      // phonetic order
1326 };
1327 
1328 enum PbapFormatType : uint8_t {
1329     PBAP_FORMAT_VCARD2_1 = 0x00,  // vCard Version
1330     PBAP_FORMAT_VCARD3_0 = 0x01,  // vCard Version
1331 };
1332 
1333 // 5.1.4.1 PropertySelector {PropertyMask (64-bit value)}
1334 #define PBAP_PROPERTY_VERSION (1ULL << 0)                // vCard Version
1335 #define PBAP_PROPERTY_FN (1ULL << 1)                     // Formatted Name
1336 #define PBAP_PROPERTY_N (1ULL << 2)                      // Structured Presentation of Name
1337 #define PBAP_PROPERTY_PHOTO (1ULL << 3)                  // Associated Image or Photo
1338 #define PBAP_PROPERTY_BDAY (1ULL << 4)                   // Birthday
1339 #define PBAP_PROPERTY_ADR (1ULL << 5)                    // Delivery Address
1340 #define PBAP_PROPERTY_LABEL (1ULL << 6)                  // Delivery
1341 #define PBAP_PROPERTY_TEL (1ULL << 7)                    // Telephone Number
1342 #define PBAP_PROPERTY_EMAIL (1ULL << 8)                  // Electronic Mail Address
1343 #define PBAP_PROPERTY_MAILER (1ULL << 9)                 // Electronic Mail
1344 #define PBAP_PROPERTY_TZ (1ULL << 10)                    // Time Zone
1345 #define PBAP_PROPERTY_GEO (1ULL << 11)                   // Geographic Position
1346 #define PBAP_PROPERTY_TITLE (1ULL << 12)                 // Job
1347 #define PBAP_PROPERTY_ROLE (1ULL << 13)                  // Role within the Organization
1348 #define PBAP_PROPERTY_LOGO (1ULL << 14)                  // Organization Logo
1349 #define PBAP_PROPERTY_AGENT (1ULL << 15)                 // vCard of Person Representing
1350 #define PBAP_PROPERTY_ORG (1ULL << 16)                   // Name of Organization
1351 #define PBAP_PROPERTY_NOTE (1ULL << 17)                  // Comments
1352 #define PBAP_PROPERTY_REV (1ULL << 18)                   // Revision
1353 #define PBAP_PROPERTY_SOUND (1ULL << 19)                 // Pronunciation of Name
1354 #define PBAP_PROPERTY_URL (1ULL << 20)                   // Uniform Resource Locator
1355 #define PBAP_PROPERTY_UID (1ULL << 21)                   // Unique ID
1356 #define PBAP_PROPERTY_KEY (1ULL << 22)                   // Public Encryption Key
1357 #define PBAP_PROPERTY_NICKNAME (1ULL << 23)              // Nickname
1358 #define PBAP_PROPERTY_CATEGORIES (1ULL << 24)            // Categories
1359 #define PBAP_PROPERTY_PROID (1ULL << 25)                 // Product ID
1360 #define PBAP_PROPERTY_CLASS (1ULL << 26)                 // Class information
1361 #define PBAP_PROPERTY_SORT_STRING (1ULL << 27)           // String used for sorting operations
1362 #define PBAP_PROPERTY_X_IRMC_CALL_DATETIME (1ULL << 28)  // Time stamp
1363 #define PBAP_PROPERTY_X_BT_SPEEDDIALKEY (1ULL << 29)     // Speed-dial shortcut
1364 #define PBAP_PROPERTY_X_BT_UCI (1ULL << 30)              // Uniform Caller Identifier
1365 #define PBAP_PROPERTY_X_BT_UID (1ULL << 31)              // Bluetooth Contact Unique Identifier
1366 #define PBAP_PROPERTY_PROPRIENTARY_FILTER (1ULL << 39)   // Bluetooth Proprientary
1367 
1368 enum PbapSelectorOperatorType : uint8_t {
1369     PBAP_SELECTOR_OPERATOR_OR = 0x00,   // SelectorOperator Or
1370     PBAP_SELECTOR_OPERATOR_AND = 0x01,  // SelectorOperator And
1371 };
1372 
1373 enum PbapSearchPropertyType : uint8_t {
1374     PBAP_SEARCH_PROPERTY_NAME = 0x00,    // name
1375     PBAP_SEARCH_PROPERTY_NUMBER = 0x01,  // number
1376     PBAP_SEARCH_PROPERTY_SOUND = 0x02,   // sound
1377 };
1378 
1379 const uint8_t PBAP_FLAG_GO_TO_ROOT = 0x02;  // go back to root
1380 const uint8_t PBAP_FLAG_GO_DOWN = 0x02;     // go down
1381 const uint8_t PBAP_FLAG_GO_UP = 0x03;       // go up
1382 
1383 enum PbapResponseCode : uint8_t {
1384     PBAP_CONTINUE = 0x90,                    // 100 Continue
1385     PBAP_SUCCESS = 0xA0,                     // 200 OK, Success
1386     PBAP_CREATED = 0xA1,                     // 201 Created
1387     PBAP_PBAP_ACCEPTED = 0xA2,               // 202 Accepted
1388     PBAP_NON_AUTH = 0xA3,                    // 203 Non-Authoritative Information
1389     PBAP_NO_CONTENT = 0xA4,                  // 204 No Content
1390     PBAP_RESET_CONTENT = 0xA5,               // 205 Reset Content
1391     PBAP_PARTIAL_CONTENT = 0xA6,             // 206 Partial Content
1392     PBAP_MULTIPLE_CHOICES = 0xB0,            // 300 Multiple Choices
1393     PBAP_MOVED_PERMANENTLY = 0xB1,           // 301 Moved Permanently
1394     PBAP_MOVED_TEMPORARILY = 0xB2,           // 302 Moved temporarily
1395     PBAP_SEE_OTHER = 0xB3,                   // 303 See Other
1396     PBAP_NOT_MODIFIED = 0xB4,                // 304 Not modified
1397     PBAP_USE_PROXY = 0xB5,                   // 305 Use Proxy
1398     PBAP_BAD_REQUEST = 0xC0,                 // 400 Bad Request - server couldn’t understand request
1399     PBAP_UNAUTHORIZED = 0xC1,                // 401 Unauthorized
1400     PBAP_PAYMENT_REQUIRED = 0xC2,            // 402 Payment required
1401     PBAP_FORBIDDEN = 0xC3,                   // 403 Forbidden - operation is understood but refused
1402     PBAP_NOT_FOUND = 0xC4,                   // 404 Not Found
1403     PBAP_METHOD_NOT_ALLOWED = 0xC5,          // 405 Method not allowed
1404     PBAP_NOT_ACCEPTABLE = 0xC6,              // 406 Not Acceptable
1405     PBAP_PROXY_AUTH_REQUIRED = 0xC7,         // 407 Proxy Authentication required
1406     PBAP_REQUEST_TIME_OUT = 0xC8,            // 408 Request Time Out
1407     PBAP_CONFLICT = 0xC9,                    // 409 Conflict
1408     PBAP_GONE = 0xCA,                        // 410 Gone
1409     PBAP_LENGTH_REQUIRED = 0xCB,             // 411 Length Required
1410     PBAP_PRECONDITION_FAILED = 0xCC,         // 412 Precondition failed
1411     PBAP_REQUESTED_ENTITY_TOO_LARGE = 0xCD,  // 413 Requested entity too large
1412     PBAP_REQUEST_URL_TOO_LARGE = 0xCE,       // 414 Request URL too large
1413     PBAP_UNSUPPORTED_MEDIA_TYPE = 0xCF,      // 415 Unsupported media type
1414     PBAP_INTERNAL_SERVER_ERROR = 0xD0,       // 500 Internal Server Error
1415     PBAP_NOT_IMPLEMENTED = 0xD1,             // 501 Not Implemented
1416     PBAP_BAD_GATEWAY = 0xD2,                 // 502 Bad Gateway
1417     PBAP_SERVICE_UNAVAILABLE = 0xD3,         // 503 Service Unavailable
1418     PBAP_GATEWAY_TIMEOUT = 0xD4,             // 504 Gateway Timeout
1419     PBAP_HTTP_VERSION_NOT_SUPPORTED = 0xD5,  // 505 HTTP version not supported
1420     PBAP_DATABASE_FULL = 0xE0,               // Database Full
1421     PBAP_DATABASE_LOCKED = 0xE1              // Database Locked
1422 };
1423 
1424 constexpr int BLE_LPDEVICE_SCAN_SETTING_VALID_BIT = 0x01;
1425 constexpr int BLE_LPDEVICE_SCAN_FILTER_VALID_BIT = 0x02;
1426 constexpr int BLE_LPDEVICE_ADV_SETTING_VALID_BIT = 0x04;
1427 constexpr int BLE_LPDEVICE_ADVDATA_VALID_BIT = 0x08;
1428 constexpr int BLE_LPDEVICE_RESPDATA_VALID_BIT = 0x10;
1429 constexpr int BLE_LPDEVICE_ADV_DEVICEINFO_VALID_BIT = 0x20;
1430 constexpr int32_t BLE_SCAN_INVALID_ID = 0;
1431 
1432 #define IS_BT_ENABLED() (BluetoothHost::GetDefaultHost().IsBrEnabled())
1433 
1434 #define IS_BLE_ENABLED() (BluetoothHost::GetDefaultHost().IsBleEnabled())
1435 
1436 #ifdef BLUETOOTH_EXPORT
1437 #define BLUETOOTH_API __attribute__((visibility("default")))
1438 #else
1439 #define BLUETOOTH_API
1440 #endif
1441 } // namespace Bluetooth
1442 } // namespace OHOS
1443 #endif  // BLUETOOTH_DEF_H