195489c19Sopenharmony_ci/*
295489c19Sopenharmony_ci * Copyright (C) 2021-2022 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#ifndef BT_DEF_H
1795489c19Sopenharmony_ci#define BT_DEF_H
1895489c19Sopenharmony_ci
1995489c19Sopenharmony_ci#include <string>
2095489c19Sopenharmony_ci#include <vector>
2195489c19Sopenharmony_ci
2295489c19Sopenharmony_cinamespace OHOS {
2395489c19Sopenharmony_cinamespace bluetooth {
2495489c19Sopenharmony_ci// Defined here are various status codes
2595489c19Sopenharmony_ci/*********************************************
2695489c19Sopenharmony_ci *
2795489c19Sopenharmony_ci * Interface Return Value Macro Define
2895489c19Sopenharmony_ci *
2995489c19Sopenharmony_ci *********************************************/
3095489c19Sopenharmony_ciconstexpr int RET_NO_ERROR = 0;
3195489c19Sopenharmony_ciconstexpr int RET_NO_SUPPORT = -1;
3295489c19Sopenharmony_ciconstexpr int RET_BAD_PARAM = -2;
3395489c19Sopenharmony_ciconstexpr int RET_BAD_STATUS = -3;
3495489c19Sopenharmony_ciconstexpr int RET_NO_SPACE = -4;
3595489c19Sopenharmony_ciconstexpr int RET_REACH_MAX = -5;
3695489c19Sopenharmony_ci
3795489c19Sopenharmony_ci/*********************************************
3895489c19Sopenharmony_ci *
3995489c19Sopenharmony_ci * Bluetooth UUID Macro Define
4095489c19Sopenharmony_ci *
4195489c19Sopenharmony_ci *********************************************/
4295489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_BASE_UUID = "00000000-0000-1000-8000-00805F9B34FB";
4395489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_A2DP_SINK = "0000110B-0000-1000-8000-00805F9B34FB";
4495489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_A2DP_SRC = "0000110A-0000-1000-8000-00805F9B34FB";
4595489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_GATT = "00001801-0000-1000-8000-00805F9B34FB";
4695489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_AVRCP_CT = "0000110E-0000-1000-8000-00805F9B34FB";
4795489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_AVRCP_TG = "0000110C-0000-1000-8000-00805F9B34FB";
4895489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_HFP_AG = "0000111F-0000-1000-8000-00805F9B34FB";
4995489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_HFP_HF = "0000111E-0000-1000-8000-00805F9B34FB";
5095489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_PBAP_PCE = "0000112E-0000-1000-8000-00805F9B34FB";
5195489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_PBAP_PSE = "0000112F-0000-1000-8000-00805F9B34FB";
5295489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_SPP = "00001101-0000-1000-8000-00805F9B34FB";
5395489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_PNP = "00001200-0000-1000-8000-00805F9B34FB";
5495489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_HID_HOST = "00001124-0000-1000-8000-00805F9B34FB";
5595489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_PAN = "00001116-0000-1000-8000-00805F9B34FB";
5695489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_OPP = "00001105-0000-1000-8000-00805F9B34FB";
5795489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_HSP_AG = "00001112-0000-1000-8000-00805F9B34FB";
5895489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_HSP_HS = "00001108-0000-1000-8000-00805F9B34FB";
5995489c19Sopenharmony_ciconstexpr const char *BLUETOOTH_UUID_HOGP = "00001812-0000-1000-8000-00805F9B34FB";
6095489c19Sopenharmony_ciconstexpr const char *ADV_AUDIO_DIST = "0000110D-0000-1000-8000-00805F9B34FB";
6195489c19Sopenharmony_ci
6295489c19Sopenharmony_ci/*********************************************
6395489c19Sopenharmony_ci *
6495489c19Sopenharmony_ci * Adapter Macro Define
6595489c19Sopenharmony_ci *
6695489c19Sopenharmony_ci *********************************************/
6795489c19Sopenharmony_ci/**
6895489c19Sopenharmony_ci * @brief bt transport define
6995489c19Sopenharmony_ci * use to GetRemoteDevice(),GetPairedDevices()...
7095489c19Sopenharmony_ci */
7195489c19Sopenharmony_cienum BTTransport {
7295489c19Sopenharmony_ci    ADAPTER_BREDR = 0,
7395489c19Sopenharmony_ci    ADAPTER_BLE,
7495489c19Sopenharmony_ci};
7595489c19Sopenharmony_ci/**
7695489c19Sopenharmony_ci * @brief bt adapter/profile state define
7795489c19Sopenharmony_ci * use to GetBtConnectionState(),GetBtProfileConnState(),...
7895489c19Sopenharmony_ci */
7995489c19Sopenharmony_cienum BTStateID {
8095489c19Sopenharmony_ci    STATE_TURNING_ON,
8195489c19Sopenharmony_ci    STATE_TURN_ON,
8295489c19Sopenharmony_ci    STATE_TURNING_OFF,
8395489c19Sopenharmony_ci    STATE_TURN_OFF,
8495489c19Sopenharmony_ci};
8595489c19Sopenharmony_ci/**
8695489c19Sopenharmony_ci * @brief connect state define
8795489c19Sopenharmony_ci * use to ConnectionState()...
8895489c19Sopenharmony_ci */
8995489c19Sopenharmony_cienum class BTConnectState : int {
9095489c19Sopenharmony_ci    CONNECTING,
9195489c19Sopenharmony_ci    CONNECTED,
9295489c19Sopenharmony_ci    DISCONNECTING,
9395489c19Sopenharmony_ci    DISCONNECTED,
9495489c19Sopenharmony_ci};
9595489c19Sopenharmony_cienum class ConnChangeCause : int {
9695489c19Sopenharmony_ci    CONNECT_CHANGE_COMMON_CAUSE = 0,            // Common connect change cause.
9795489c19Sopenharmony_ci    DISCONNECT_CAUSE_USER_DISCONNECT = 0,       // User disconnect device.
9895489c19Sopenharmony_ci    DISCONNECT_CAUSE_CONNECT_FROM_KEYBOARD = 1, // The connection needs to be initiated from the keyboard side.
9995489c19Sopenharmony_ci    DISCONNECT_CAUSE_CONNECT_FROM_MOUSE = 2,    // The connection needs to be initiated from the mouse side.
10095489c19Sopenharmony_ci    DISCONNECT_CAUSE_CONNECT_FROM_CAR = 3,      // The connection needs to be initiated from the car side.
10195489c19Sopenharmony_ci    DISCONNECT_TOO_MANY_CONNECTED_DEVICES = 4,  // Too many devices are currently connected.
10295489c19Sopenharmony_ci    DISCONNECT_CAUSE_CONNECT_FAIL_INTERNAL = 5, // Connection failed due to an internal error.
10395489c19Sopenharmony_ci};
10495489c19Sopenharmony_ci/**
10595489c19Sopenharmony_ci * @brief access permission define
10695489c19Sopenharmony_ci * use to
10795489c19Sopenharmony_ci * Get/SetPhonebookPermission(),Get/SetMessagePermission()
10895489c19Sopenharmony_ci */
10995489c19Sopenharmony_cienum class BTPermissionType : int {
11095489c19Sopenharmony_ci    ACCESS_UNKNOWN,
11195489c19Sopenharmony_ci    ACCESS_ALLOWED,
11295489c19Sopenharmony_ci    ACCESS_FORBIDDEN,
11395489c19Sopenharmony_ci};
11495489c19Sopenharmony_ci/**
11595489c19Sopenharmony_ci * @brief connection strategy define
11695489c19Sopenharmony_ci * use to
11795489c19Sopenharmony_ci * SetConnectionStrategy(),GetConnectionStrategy()
11895489c19Sopenharmony_ci */
11995489c19Sopenharmony_cienum class BTStrategyType : int {
12095489c19Sopenharmony_ci    CONNECTION_UNKNOWN,
12195489c19Sopenharmony_ci    CONNECTION_ALLOWED,
12295489c19Sopenharmony_ci    CONNECTION_FORBIDDEN,
12395489c19Sopenharmony_ci};
12495489c19Sopenharmony_ci/**
12595489c19Sopenharmony_ci * @brief the type of the call
12695489c19Sopenharmony_ci * use to
12795489c19Sopenharmony_ci * ConnectSco(),DisconnectSco()
12895489c19Sopenharmony_ci */
12995489c19Sopenharmony_cienum class BTCallType : uint8_t {
13095489c19Sopenharmony_ci    CALL_TYPE_CELLULAR = 0,
13195489c19Sopenharmony_ci    CALL_TYPE_VIRTUAL = 1,
13295489c19Sopenharmony_ci    CALL_TYPE_RECOGNITION = 2,
13395489c19Sopenharmony_ci};
13495489c19Sopenharmony_ci/**
13595489c19Sopenharmony_ci * @brief profile id define
13695489c19Sopenharmony_ci * use to
13795489c19Sopenharmony_ci * GetBtProfileConnState(),GetProfileList()
13895489c19Sopenharmony_ci */
13995489c19Sopenharmony_ciconst uint32_t PROFILE_ID_GATT_CLIENT = 0x00000001;
14095489c19Sopenharmony_ciconst uint32_t PROFILE_ID_GATT_SERVER = 0x00000002;
14195489c19Sopenharmony_ciconst uint32_t PROFILE_ID_A2DP_SRC = 0x00000004;
14295489c19Sopenharmony_ciconst uint32_t PROFILE_ID_A2DP_SINK = 0x00000008;
14395489c19Sopenharmony_ciconst uint32_t PROFILE_ID_AVRCP_CT = 0x00000010;
14495489c19Sopenharmony_ciconst uint32_t PROFILE_ID_AVRCP_TG = 0x00000020;
14595489c19Sopenharmony_ciconst uint32_t PROFILE_ID_HFP_AG = 0x00000040;
14695489c19Sopenharmony_ciconst uint32_t PROFILE_ID_HFP_HF = 0x00000080;
14795489c19Sopenharmony_ciconst uint32_t PROFILE_ID_MAP_MCE = 0x00000100;
14895489c19Sopenharmony_ciconst uint32_t PROFILE_ID_MAP_MSE = 0x00000200;
14995489c19Sopenharmony_ciconst uint32_t PROFILE_ID_PBAP_PCE = 0x00000400;
15095489c19Sopenharmony_ciconst uint32_t PROFILE_ID_PBAP_PSE = 0x00000800;
15195489c19Sopenharmony_ciconst uint32_t PROFILE_ID_SPP = 0x00001000;
15295489c19Sopenharmony_ciconst uint32_t PROFILE_ID_DI = 0x00002000;
15395489c19Sopenharmony_ciconst uint32_t PROFILE_ID_BLE_ADVERTISER = 0x00004000;
15495489c19Sopenharmony_ciconst uint32_t PROFILE_ID_BLE_CENTRAL_MANAGER_SERVER = 0x00008000;
15595489c19Sopenharmony_ciconst uint32_t PROFILE_ID_BLE_GATT_MANAGER = 0x00010000;
15695489c19Sopenharmony_ciconst uint32_t PROFILE_ID_HID_HOST = 0x00020000;
15795489c19Sopenharmony_ciconst uint32_t PROFILE_ID_OPP = 0x00040000;
15895489c19Sopenharmony_ciconst uint32_t PROFILE_ID_PAN = 0x00080000;
15995489c19Sopenharmony_ciconst uint32_t PROFILE_ID_HOST = 0x00100000;
16095489c19Sopenharmony_ci
16195489c19Sopenharmony_ci/**
16295489c19Sopenharmony_ci * @brief default value
16395489c19Sopenharmony_ci * use to
16495489c19Sopenharmony_ci * initialize mac address, name or other values.
16595489c19Sopenharmony_ci */
16695489c19Sopenharmony_ciconstexpr const char *INVALID_MAC_ADDRESS = "00:00:00:00:00:00";
16795489c19Sopenharmony_ciconstexpr const char *INVALID_NAME = "";
16895489c19Sopenharmony_ciconst int INVALID_VALUE = 0;
16995489c19Sopenharmony_ciconst int INVALID_TYPE = -1;
17095489c19Sopenharmony_ciconst int ADDRESS_LENGTH = 17;
17195489c19Sopenharmony_ciconst int ADDRESS_COLON_INDEX = 2;
17295489c19Sopenharmony_ciconst int ADDRESS_SEPARATOR_UNIT = 3;
17395489c19Sopenharmony_ci
17495489c19Sopenharmony_ci/**
17595489c19Sopenharmony_ci * @brief discovery state
17695489c19Sopenharmony_ci * use to
17795489c19Sopenharmony_ci * GetBtScanMode(), SetBtScanMode()
17895489c19Sopenharmony_ci */
17995489c19Sopenharmony_ciconst int DISCOVERY_STARTED = 0x01;
18095489c19Sopenharmony_ciconst int DISCOVERYING = 0x02;
18195489c19Sopenharmony_ciconst int DISCOVERY_STOPED = 0x03;
18295489c19Sopenharmony_ci
18395489c19Sopenharmony_ci/**
18495489c19Sopenharmony_ci * @brief pairing result
18595489c19Sopenharmony_ci * use to
18695489c19Sopenharmony_ci * OnPairStatusChanged()
18795489c19Sopenharmony_ci */
18895489c19Sopenharmony_ciconst int PAIR_NONE = 0x01;
18995489c19Sopenharmony_ciconst int PAIR_PAIRING = 0x02;
19095489c19Sopenharmony_ciconst int PAIR_PAIRED = 0x03;
19195489c19Sopenharmony_cienum UnbondCause : int {
19295489c19Sopenharmony_ci    PAIR_COMMON_BOND_CAUSE = 0,          // Common bond cause value.
19395489c19Sopenharmony_ci    UNBOND_CAUSE_USER_REMOVED = 0,       // User proactively removed device.
19495489c19Sopenharmony_ci    UNBOND_CAUSE_REMOTE_DEVICE_DOWN = 1, // Remote device shut down.
19595489c19Sopenharmony_ci    UNBOND_CAUSE_AUTH_FAILURE = 2,       // Wrong PIN code.
19695489c19Sopenharmony_ci    UNBOND_CAUSE_AUTH_REJECTED = 3,      // Remote device rejected.
19795489c19Sopenharmony_ci    UNBOND_CAUSE_INTERNAL_ERROR = 4,     // Internal error.
19895489c19Sopenharmony_ci};
19995489c19Sopenharmony_ci
20095489c19Sopenharmony_ci/**
20195489c19Sopenharmony_ci * @brief discoverable mode and connect mode
20295489c19Sopenharmony_ci * use to
20395489c19Sopenharmony_ci * GetBtScanMode(), SetBtScanMode()
20495489c19Sopenharmony_ci */
20595489c19Sopenharmony_ciconst int SCAN_MODE_NONE = 0x00;
20695489c19Sopenharmony_ciconst int SCAN_MODE_CONNECTABLE = 0x01;
20795489c19Sopenharmony_ciconst int SCAN_MODE_GENERAL_DISCOVERABLE = 0x02;
20895489c19Sopenharmony_ciconst int SCAN_MODE_LIMITED_DISCOVERABLE = 0x03;
20995489c19Sopenharmony_ciconst int SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE = 0x04;
21095489c19Sopenharmony_ciconst int SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE = 0x05;
21195489c19Sopenharmony_ci
21295489c19Sopenharmony_ci/**
21395489c19Sopenharmony_ci * @brief bondable mode define
21495489c19Sopenharmony_ci * use to
21595489c19Sopenharmony_ci * GetBondableMode(), SetBondableMode()
21695489c19Sopenharmony_ci */
21795489c19Sopenharmony_ciconst int BONDABLE_MODE_OFF = 0x00;
21895489c19Sopenharmony_ciconst int BONDABLE_MODE_ON = 0x01;
21995489c19Sopenharmony_ci
22095489c19Sopenharmony_ci/**
22195489c19Sopenharmony_ci * @brief remote device's transport type
22295489c19Sopenharmony_ci * use to
22395489c19Sopenharmony_ci * GetTransportType()
22495489c19Sopenharmony_ci */
22595489c19Sopenharmony_ciconst int BT_TRANSPORT_NONE = -1;
22695489c19Sopenharmony_ciconst int BT_TRANSPORT_BREDR = 0;
22795489c19Sopenharmony_ciconst int BT_TRANSPORT_BLE = 1;
22895489c19Sopenharmony_ci
22995489c19Sopenharmony_ci/**
23095489c19Sopenharmony_ci * @brief remote device type
23195489c19Sopenharmony_ci * use to
23295489c19Sopenharmony_ci * GetDeviceType
23395489c19Sopenharmony_ci */
23495489c19Sopenharmony_ciconst int DEVICE_TYPE_UNKNOWN = -1;
23595489c19Sopenharmony_ciconst int DEVICE_TYPE_BREDR = 0;
23695489c19Sopenharmony_ciconst int DEVICE_TYPE_LE = 1;
23795489c19Sopenharmony_ciconst int DEVICE_TYPE_DUAL_MONO = 2;
23895489c19Sopenharmony_ci
23995489c19Sopenharmony_ciinline int DeviceTypeToTransport(int type)
24095489c19Sopenharmony_ci{
24195489c19Sopenharmony_ci    switch (type) {
24295489c19Sopenharmony_ci        case DEVICE_TYPE_LE:
24395489c19Sopenharmony_ci            return BT_TRANSPORT_BLE;
24495489c19Sopenharmony_ci        case DEVICE_TYPE_BREDR:
24595489c19Sopenharmony_ci            return BT_TRANSPORT_BREDR;
24695489c19Sopenharmony_ci        case DEVICE_TYPE_DUAL_MONO:
24795489c19Sopenharmony_ci            return BT_TRANSPORT_BREDR;
24895489c19Sopenharmony_ci        default:
24995489c19Sopenharmony_ci            return BT_TRANSPORT_NONE;
25095489c19Sopenharmony_ci    }
25195489c19Sopenharmony_ci}
25295489c19Sopenharmony_ci
25395489c19Sopenharmony_ci/**
25495489c19Sopenharmony_ci * @brief ACL LINK TYPE.
25595489c19Sopenharmony_ci * use to
25695489c19Sopenharmony_ci * acl connectCallback()
25795489c19Sopenharmony_ci */
25895489c19Sopenharmony_ciconst int LINK_TYPE_UNKNOWN = -1;
25995489c19Sopenharmony_ciconst int LINK_TYPE_BREDR = 0;
26095489c19Sopenharmony_ciconst int LINK_TYPE_LE = 1;
26195489c19Sopenharmony_ci
26295489c19Sopenharmony_ci/*********************************************
26395489c19Sopenharmony_ci *
26495489c19Sopenharmony_ci * GATT Macro Define
26595489c19Sopenharmony_ci *
26695489c19Sopenharmony_ci *********************************************/
26795489c19Sopenharmony_ci
26895489c19Sopenharmony_ciconstexpr uint8_t GATT_TRANSPORT_TYPE_AUTO = 0x0;
26995489c19Sopenharmony_ciconstexpr uint8_t GATT_TRANSPORT_TYPE_LE = 0x1;
27095489c19Sopenharmony_ciconstexpr uint8_t GATT_TRANSPORT_TYPE_CLASSIC = 0x2;
27195489c19Sopenharmony_ciconstexpr uint8_t GATT_ROLE_MASTER = 0x00;
27295489c19Sopenharmony_ciconstexpr uint8_t GATT_ROLE_SLAVE = 0x01;
27395489c19Sopenharmony_ciconstexpr uint8_t GATT_ROLE_INVALID = 0xFF;
27495489c19Sopenharmony_ci
27595489c19Sopenharmony_ci/**
27695489c19Sopenharmony_ci * @brief user confirm type during paring process.
27795489c19Sopenharmony_ci * use to
27895489c19Sopenharmony_ci * OnPairConfirmed()
27995489c19Sopenharmony_ci */
28095489c19Sopenharmony_cienum PinType {
28195489c19Sopenharmony_ci    PIN_TYPE_ENTER_PIN_CODE = 0,         // enter the pin code displayed on the peer device
28295489c19Sopenharmony_ci    PIN_TYPE_ENTER_PASSKEY = 1,          // enter the passkey displayed on the peer device
28395489c19Sopenharmony_ci    PIN_TYPE_CONFIRM_PASSKEY = 2,        // confirm the passkey displayed on the local device
28495489c19Sopenharmony_ci    PIN_TYPE_NO_PASSKEY_CONSENT = 3,     // accept or deny the pairing request
28595489c19Sopenharmony_ci    PIN_TYPE_NOTIFY_PASSKEY = 4,         // enter the passkey displayed on the local device on the peer device
28695489c19Sopenharmony_ci    PIN_TYPE_DISPLAY_PIN_CODE = 5,       // enter the pin code displayed on the peer device, used for bluetooth 2.0
28795489c19Sopenharmony_ci    PIN_TYPE_OOB_CONSENT = 6,            // accept or deny the OOB pairing request, not suppport now
28895489c19Sopenharmony_ci    PIN_TYPE_PIN_16_DIGITS = 7,          // enter the 16-digit pin code displayed on the peer device
28995489c19Sopenharmony_ci};
29095489c19Sopenharmony_ci
29195489c19Sopenharmony_ci/** A GATT Attribute Permission.
29295489c19Sopenharmony_ci *  Define GATT Attribute permissions.
29395489c19Sopenharmony_ci */
29495489c19Sopenharmony_cienum class GattPermission : uint16_t {
29595489c19Sopenharmony_ci    READABLE = 1 << 0, /**< readable */
29695489c19Sopenharmony_ci    READ_ENCRYPTED = 1 << 1,
29795489c19Sopenharmony_ci    READ_ENCRYPTED_MITM = 1 << 2,
29895489c19Sopenharmony_ci    WRITEABLE = 1 << 4,
29995489c19Sopenharmony_ci    WRITE_ENCRYPTED = 1 << 5,
30095489c19Sopenharmony_ci    WRITE_ENCRYPTED_MITM = 1 << 6,
30195489c19Sopenharmony_ci    WRITE_SIGNED = 1 << 7,
30295489c19Sopenharmony_ci    WRITE_SIGNED_MITM = 1 << 8,
30395489c19Sopenharmony_ci    PERMISSON_MAX = 1 << 9,
30495489c19Sopenharmony_ci};
30595489c19Sopenharmony_ci
30695489c19Sopenharmony_cienum class GattConnectionPriority : int { BALANCED, HIGH, LOW_POWER };
30795489c19Sopenharmony_ci
30895489c19Sopenharmony_cienum GattStatus {
30995489c19Sopenharmony_ci    INVALID_REMOTE_DEVICE = -29,
31095489c19Sopenharmony_ci    INCLUDE_SERVICE_NOT_FOUND,
31195489c19Sopenharmony_ci    REFERENCED_BY_OTHER_SERVICE,
31295489c19Sopenharmony_ci    INVALID_CHARACTERISTIC,
31395489c19Sopenharmony_ci    INVALID_CHARACTERISTIC_DATA,
31495489c19Sopenharmony_ci    INVALID_CHARACTERISTIC_DESCRIPTOR,
31595489c19Sopenharmony_ci    INVALID_CHARACTERISTIC_DESCRIPTOR_DATA,
31695489c19Sopenharmony_ci    NOT_ENOUGH_HANDLES,
31795489c19Sopenharmony_ci    HANDLE_NOT_FOUND,
31895489c19Sopenharmony_ci    INVALID_PARAMETER,
31995489c19Sopenharmony_ci    INTERNAL_ERROR,
32095489c19Sopenharmony_ci    REQUEST_NOT_SUPPORT,
32195489c19Sopenharmony_ci    REMOTE_DEVICE_BUSY,
32295489c19Sopenharmony_ci    MAX_CONNECTIONS,
32395489c19Sopenharmony_ci    MAX_APPLICATIONS,
32495489c19Sopenharmony_ci    DEVICE_ALREADY_BIND,
32595489c19Sopenharmony_ci    INVALID_HANDLE,
32695489c19Sopenharmony_ci    INVALID_OFFSET,
32795489c19Sopenharmony_ci    READ_NOT_PERMITTED,
32895489c19Sopenharmony_ci    WRITE_NOT_PERMITTED,
32995489c19Sopenharmony_ci    INSUFFICIENT_ENCRYPTION,
33095489c19Sopenharmony_ci    INSUFFICIENT_AUTHENTICATION,
33195489c19Sopenharmony_ci    INSUFFICIENT_AUTHORIZATION,
33295489c19Sopenharmony_ci    INSUFFICIENT_ENCRYPTION_KEY_SIZE,
33395489c19Sopenharmony_ci    PREPARE_QUEUE_FULL,
33495489c19Sopenharmony_ci    ATTRIBUTE_NOT_LONG,
33595489c19Sopenharmony_ci    INVALID_ATTRIBUTE_VALUE_LENGTH,
33695489c19Sopenharmony_ci    WRITE_REQUEST_REJECTED,
33795489c19Sopenharmony_ci    GATT_FAILURE,
33895489c19Sopenharmony_ci    GATT_SUCCESS
33995489c19Sopenharmony_ci};
34095489c19Sopenharmony_ci
34195489c19Sopenharmony_ci/*********************************************
34295489c19Sopenharmony_ci *
34395489c19Sopenharmony_ci * BLE Macro Define
34495489c19Sopenharmony_ci *
34595489c19Sopenharmony_ci *********************************************/
34695489c19Sopenharmony_ci// Minimum value for advertising interval.
34795489c19Sopenharmony_ciconst int BLE_ADV_MIN_INTERVAL = 0x0020;
34895489c19Sopenharmony_ci// Maximum value for advertising interval.
34995489c19Sopenharmony_ciconst int BLE_ADV_MAX_INTERVAL = 0x4000;
35095489c19Sopenharmony_ci// Default value for advertising interval.
35195489c19Sopenharmony_ciconst int BLE_ADV_DEFAULT_INTERVAL = 0x03E8;
35295489c19Sopenharmony_ci
35395489c19Sopenharmony_ci// Special advertising set handle used for the legacy advertising set.
35495489c19Sopenharmony_ciconst uint8_t BLE_LEGACY_ADVERTISING_HANDLE = 0x00;
35595489c19Sopenharmony_ci// Special advertising set handle used as return or parameter to signify an invalid handle.
35695489c19Sopenharmony_ciconst uint8_t BLE_INVALID_ADVERTISING_HANDLE = 0xFF;
35795489c19Sopenharmony_ci
35895489c19Sopenharmony_ci// Report delay millis default value
35995489c19Sopenharmony_ciconst int BLE_REPORT_DELAY_MILLIS = 5000;
36095489c19Sopenharmony_ci
36195489c19Sopenharmony_ci// Definitions for UUID length constants.
36295489c19Sopenharmony_ciconst int BLE_UUID_LEN_16 = 2;
36395489c19Sopenharmony_ciconst int BLE_UUID_LEN_32 = 4;
36495489c19Sopenharmony_ciconst int BLE_UUID_LEN_128 = 16;
36595489c19Sopenharmony_ciconst int DEVICE_NAME_MAX_LEN = 26;
36695489c19Sopenharmony_ci
36795489c19Sopenharmony_ci// BLE acl connect status
36895489c19Sopenharmony_ciconst int BLE_CONNECTION_STATE_DISCONNECTED = 0x00;
36995489c19Sopenharmony_ciconst int BLE_CONNECTION_STATE_CONNECTED = 0x01;
37095489c19Sopenharmony_ciconst int BLE_CONNECTION_STATE_ENCRYPTED_BREDR = 0x02;
37195489c19Sopenharmony_ciconst int BLE_CONNECTION_STATE_ENCRYPTED_LE = 0x04;
37295489c19Sopenharmony_ci
37395489c19Sopenharmony_ciconst int BLE_PAIR_NONE = 0x01;
37495489c19Sopenharmony_ciconst int BLE_PAIR_PAIRING = 0x02;
37595489c19Sopenharmony_ciconst int BLE_PAIR_PAIRED = 0x03;
37695489c19Sopenharmony_ciconst int BLE_PAIR_CANCELING = 0x04;
37795489c19Sopenharmony_ci
37895489c19Sopenharmony_ciconst int BLE_ADV_DEFAULT_OP_CODE = 0x00;
37995489c19Sopenharmony_ciconst int BLE_ADV_STOP_COMPLETE_OP_CODE = 0x01;
38095489c19Sopenharmony_ciconst int BLE_ADV_START_FAILED_OP_CODE = 0x02;
38195489c19Sopenharmony_ci
38295489c19Sopenharmony_ciconst uint8_t BLE_ADV_DATA_BYTE_FIELD_LEN = 3;
38395489c19Sopenharmony_ciconst uint8_t BLE_ADV_DATA_FIELD_TYPE_AND_LEN = 2;
38495489c19Sopenharmony_ciconst uint8_t BLE_ONE_BYTE_LEN = 8;
38595489c19Sopenharmony_ci
38695489c19Sopenharmony_ciconst int8_t BLE_ADV_TX_POWER_ULTRA_LOW_VALUE = -21;
38795489c19Sopenharmony_ciconst int8_t BLE_ADV_TX_POWER_LOW_VALUE = -15;
38895489c19Sopenharmony_ciconst int8_t BLE_ADV_TX_POWER_MEDIUM_VALUE = -7;
38995489c19Sopenharmony_ciconst int8_t BLE_ADV_TX_POWER_HIGH_VALUE = 1;
39095489c19Sopenharmony_ci
39195489c19Sopenharmony_ci// Intended Advertising PHY
39295489c19Sopenharmony_ciconst uint8_t BLE_ADVERTISEMENT_PHY_NONE = 0x00;
39395489c19Sopenharmony_ciconst uint8_t BLE_ADVERTISEMENT_PHY_1M = 0x01;
39495489c19Sopenharmony_ciconst uint8_t BLE_ADVERTISEMENT_PHY_2M = 0x02;
39595489c19Sopenharmony_ciconst uint8_t BLE_ADVERTISEMENT_PHY_CODED = 0x03;
39695489c19Sopenharmony_ci
39795489c19Sopenharmony_ciconst uint8_t BLE_LEGACY_SCAN_RESPONSE = 3;
39895489c19Sopenharmony_ciconst uint8_t BLE_LEGACY_ADV_SCAN_IND = 1;
39995489c19Sopenharmony_ciconst uint8_t BLE_LEGACY_ADV_IND_WITH_EX_ADV = 0x13;
40095489c19Sopenharmony_ciconst uint8_t BLE_LEGACY_ADV_NONCONN_IND_WITH_EX_ADV = 0x10;
40195489c19Sopenharmony_ciconst uint8_t BLE_ADV_EVT_LEGACY_BIT = 4;
40295489c19Sopenharmony_ci
40395489c19Sopenharmony_ci// Incomplete, more data to come
40495489c19Sopenharmony_ciconst uint8_t BLE_EX_SCAN_DATE_STATUS_INCOMPLETE_MORE = 0x20;
40595489c19Sopenharmony_ci// Incomplete, data truncated, no more to come
40695489c19Sopenharmony_ciconst uint8_t BLE_EX_SCAN_DATE_STATUS_INCOMPLETE_NO_MORE = 0x40;
40795489c19Sopenharmony_ci
40895489c19Sopenharmony_ci// Scan mode
40995489c19Sopenharmony_citypedef enum {
41095489c19Sopenharmony_ci    SCAN_MODE_LOW_POWER = 0x00,
41195489c19Sopenharmony_ci    SCAN_MODE_BALANCED = 0x01,
41295489c19Sopenharmony_ci    SCAN_MODE_LOW_LATENCY = 0x02,
41395489c19Sopenharmony_ci    SCAN_MODE_OP_P2_60_3000 = 0x03,
41495489c19Sopenharmony_ci    SCAN_MODE_OP_P10_60_600 = 0x04,
41595489c19Sopenharmony_ci    SCAN_MODE_OP_P25_60_240 = 0x05,
41695489c19Sopenharmony_ci    SCAN_MODE_OP_P100_1000_1000 = 0x06,
41795489c19Sopenharmony_ci    SCAN_MODE_OP_P50_100_200 = 0x07,
41895489c19Sopenharmony_ci    SCAN_MODE_OP_P10_30_300 = 0x08,
41995489c19Sopenharmony_ci    SCAN_MODE_OP_P2_30_1500 = 0x09,
42095489c19Sopenharmony_ci    SCAN_MODE_OP_P75_30_40 = 0x0A,
42195489c19Sopenharmony_ci    SCAN_MODE_OP_P50_30_60 = 0x0B,
42295489c19Sopenharmony_ci    SCAN_MODE_OP_MAX,
42395489c19Sopenharmony_ci} SCAN_MODE;
42495489c19Sopenharmony_ci
42595489c19Sopenharmony_ci// Scan callback type
42695489c19Sopenharmony_ciconstexpr uint8_t BLE_SCAN_CALLBACK_TYPE_ALL_MATCH = 1;
42795489c19Sopenharmony_ciconstexpr uint8_t BLE_SCAN_CALLBACK_TYPE_FIRST_MATCH = 2;
42895489c19Sopenharmony_ciconstexpr uint8_t BLE_SCAN_CALLBACK_TYPE_LOST_MATCH = 4;
42995489c19Sopenharmony_ciconstexpr uint8_t BLE_SCAN_CALLBACK_TYPE_FIRST_AND_LOST_MATCH = 6;
43095489c19Sopenharmony_ci
43195489c19Sopenharmony_ci// Match mode for Bluetooth LE scan filters hardware match
43295489c19Sopenharmony_citypedef enum { MATCH_MODE_AGGRESSIVE = 1, MATCH_MODE_STICKY = 2 } MATCH_MODE;
43395489c19Sopenharmony_ci
43495489c19Sopenharmony_ci// Determines total number of advertisers to track per filter
43595489c19Sopenharmony_citypedef enum { ONE_MATCH_TRACK_ADV = 1, FEW_MATCH_TRACK_ADV = 2, MAX_MATCH_TRACK_ADV = 3 } MATCH_TRACK_ADV_TYPE;
43695489c19Sopenharmony_ci
43795489c19Sopenharmony_ci// Regular scan params
43895489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_LOW_POWER_WINDOW_MS = 512;
43995489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_LOW_POWER_INTERVAL_MS = 5120;
44095489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_BALANCED_WINDOW_MS = 1024;
44195489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_BALANCED_INTERVAL_MS = 4096;
44295489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_LOW_LATENCY_WINDOW_MS = 4096;
44395489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_LOW_LATENCY_INTERVAL_MS = 4096;
44495489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P2_60_3000_WINDOW_MS = 60;
44595489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P2_60_3000_INTERVAL_MS = 3000;
44695489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P10_60_600_WINDOW_MS = 60;
44795489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P10_60_600_INTERVAL_MS = 600;
44895489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P25_60_240_WINDOW_MS = 60;
44995489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P25_60_240_INTERVAL_MS = 240;
45095489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P100_1000_1000_WINDOW_MS = 1000;
45195489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P100_1000_1000_INTERVAL_MS = 1000;
45295489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P50_100_200_WINDOW_MS = 100;
45395489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P50_100_200_INTERVAL_MS = 200;
45495489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P10_30_300_WINDOW_MS = 30;
45595489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P10_30_300_INTERVAL_MS = 300;
45695489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P2_30_1500_WINDOW_MS = 30;
45795489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P2_30_1500_INTERVAL_MS = 1500;
45895489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P75_30_40_WINDOW_MS = 30;
45995489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P75_30_40_INTERVAL_MS = 40;
46095489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P50_30_60_WINDOW_MS = 30;
46195489c19Sopenharmony_ciconstexpr uint16_t BLE_SCAN_MODE_OP_P50_30_60_INTERVAL_MS = 60;
46295489c19Sopenharmony_ciconstexpr float BLE_SCAN_UNIT_TIME = 0.625;
46395489c19Sopenharmony_civoid ConvertBleScanMode(int scanMode, uint16_t &outScanWindow, uint16_t &outScanInterval);
46495489c19Sopenharmony_ci
46595489c19Sopenharmony_ci// low power device
46695489c19Sopenharmony_ciconstexpr int32_t BLE_LPDEVICE_SCAN_SETTING_VALID_BIT = 0x01;
46795489c19Sopenharmony_ciconstexpr int32_t BLE_LPDEVICE_SCAN_FILTER_VALID_BIT = 0x02;
46895489c19Sopenharmony_ciconstexpr int32_t BLE_LPDEVICE_ADV_SETTING_VALID_BIT = 0x04;
46995489c19Sopenharmony_ciconstexpr int32_t BLE_LPDEVICE_ADVDATA_VALID_BIT = 0x08;
47095489c19Sopenharmony_ciconstexpr int32_t BLE_LPDEVICE_RESPDATA_VALID_BIT = 0x10;
47195489c19Sopenharmony_ciconstexpr int32_t BLE_LPDEVICE_ADV_DEVICEINFO_VALID_BIT = 0x20;
47295489c19Sopenharmony_ci
47395489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_DEV_INFO = 0x00;
47495489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_SOFT_FILTER = 0x01;
47595489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_ADV_PARAM = 0x02;
47695489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_ADV_DATA = 0x03;
47795489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_ADV_RSP_DATA = 0x04;
47895489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_UUID_DATA = 0x0a;
47995489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_ADV_HANDLE = 0x0b;
48095489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_SCAN_STATUS = 0x0c;
48195489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_SCAN_PARAM = 0x0d;
48295489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_CAPABILITY_QUERY = 0x13;
48395489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_SCAN_COLLABORATION_QUERY = 0x14;
48495489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_SCAN_COLLABORATION_RESULT = 0x15;
48595489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_GATT_CONN_COLLABORATION_QUERY = 0x16;
48695489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_GATT_CONN_COLLABORATION_RESULT = 0x17;
48795489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_MSG_SET_BLE_BUFFER_SIZE_AND_NUM = 0x18;
48895489c19Sopenharmony_ci
48995489c19Sopenharmony_ci// collaboration msg from lpdevice
49095489c19Sopenharmony_ciconstexpr uint8_t BLE_LPDEVICE_MSG_CAPABILITY = 0x01;
49195489c19Sopenharmony_ciconstexpr uint8_t BLE_LPDEVICE_MSG_SCAN_COLLABORATION_NOTIFY_STATUS = 0x02;
49295489c19Sopenharmony_ciconstexpr uint8_t BLE_LPDEVICE_MSG_GATT_CONN_COLLABORATION_NOTIFY_STATUS = 0x03;
49395489c19Sopenharmony_ci
49495489c19Sopenharmony_ciconstexpr uint8_t BLE_LPDEVICE_MSG_TYPE_NOTICE_UP_DATA = 0x02;
49595489c19Sopenharmony_ci
49695489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_DISABLE_SCAN_IN_LPDEVICE = 0;
49795489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_ENABLE_SCAN_IN_LPDEVICE = 1;
49895489c19Sopenharmony_ci
49995489c19Sopenharmony_ciconstexpr int8_t BLE_LPDEVICE_DEVICE_TYPE_ALL = 2;
50095489c19Sopenharmony_ci
50195489c19Sopenharmony_ciconstexpr uint32_t BLE_LPDEVICE_RECOVERY_DOING = 1;
50295489c19Sopenharmony_ciconstexpr uint32_t BLE_LPDEVICE_RECOVERY_DONE = 2;
50395489c19Sopenharmony_ci
50495489c19Sopenharmony_ciconstexpr int32_t BLE_LPDEVICE_HANDLE_RESOURCE_NOT_APPLY = -100;
50595489c19Sopenharmony_ci
50695489c19Sopenharmony_ciconstexpr uint8_t BLE_DATA_LEN_1 = 1;
50795489c19Sopenharmony_ciconstexpr uint8_t BLE_DATA_LEN_2 = 2;
50895489c19Sopenharmony_ciconstexpr uint8_t BLE_DATA_LEN_3 = 3;
50995489c19Sopenharmony_ciconstexpr uint8_t BLE_DATA_LEN_4 = 4;
51095489c19Sopenharmony_ci
51195489c19Sopenharmony_ciconstexpr uint8_t BLE_DEVICE_ADDR_LEN = 6;
51295489c19Sopenharmony_ciconstexpr uint8_t BLE_ADV_DEVICE_ID_LEN = 8;
51395489c19Sopenharmony_ciconstexpr uint8_t BLE_UUID_LEN = 16;
51495489c19Sopenharmony_ciconstexpr uint8_t BLE_UUID_HALF_LEN = 8;
51595489c19Sopenharmony_ci
51695489c19Sopenharmony_ciconstexpr int32_t BLE_SCAN_MAX_NUM = 1000;
51795489c19Sopenharmony_ci
51895489c19Sopenharmony_ci// Phy type
51995489c19Sopenharmony_ciusing PHY_TYPE = enum { PHY_LE_1M = 1, PHY_LE_2M = 2, PHY_LE_CODED = 3, PHY_LE_ALL_SUPPORTED = 255 };
52095489c19Sopenharmony_ci
52195489c19Sopenharmony_ci// BLE advertiser TX power level.
52295489c19Sopenharmony_ciusing BLE_ADV_TX_POWER_LEVEL = enum {
52395489c19Sopenharmony_ci    BLE_ADV_TX_POWER_ULTRA_LOW = 0x00,
52495489c19Sopenharmony_ci    BLE_ADV_TX_POWER_LOW = 0x01,
52595489c19Sopenharmony_ci    BLE_ADV_TX_POWER_MEDIUM = 0x02,
52695489c19Sopenharmony_ci    BLE_ADV_TX_POWER_HIGH = 0x03
52795489c19Sopenharmony_ci};
52895489c19Sopenharmony_ci
52995489c19Sopenharmony_ci// BLE advertiser flag
53095489c19Sopenharmony_ciconst uint8_t BLE_ADV_FLAG_NON_LIMIT_DISC = 0x00;
53195489c19Sopenharmony_ciconst uint8_t BLE_ADV_FLAG_LIMIT_DISC = 0x01 << 0;
53295489c19Sopenharmony_ciconst uint8_t BLE_ADV_FLAG_GEN_DISC = 0x01 << 1;
53395489c19Sopenharmony_ciconst uint8_t BLE_ADV_FLAG_BREDR_NOT_SPT = 0x01 << 2;
53495489c19Sopenharmony_ciconst uint8_t BLE_ADV_FLAG_DMT_CONTROLLER_SPT = 0x01 << 3;
53595489c19Sopenharmony_ciconst uint8_t BLE_ADV_FLAG_DMT_HOST_SPT = 0x01 << 4;
53695489c19Sopenharmony_ci
53795489c19Sopenharmony_ci// Bluetooth device type
53895489c19Sopenharmony_ciusing BLE_BT_DEV_TYPE = enum {
53995489c19Sopenharmony_ci    BLE_BT_DEVICE_TYPE_UNKNOWN = -1,
54095489c19Sopenharmony_ci    BLE_BT_DEVICE_TYPE_BREDR = 0,
54195489c19Sopenharmony_ci    BLE_BT_DEVICE_TYPE_BLE = 1,
54295489c19Sopenharmony_ci    BLE_BT_DEVICE_TYPE_DUMO = 2,
54395489c19Sopenharmony_ci};
54495489c19Sopenharmony_ci
54595489c19Sopenharmony_ci// BLE device address type
54695489c19Sopenharmony_ciusing BLE_ADDR_TYPE = enum {
54795489c19Sopenharmony_ci    BLE_ADDR_TYPE_PUBLIC = 0x00,
54895489c19Sopenharmony_ci    BLE_ADDR_TYPE_RANDOM = 0x01,
54995489c19Sopenharmony_ci    BLE_ADDR_TYPE_NON_RPA = 0x02,
55095489c19Sopenharmony_ci    BLE_ADDR_TYPE_RPA = 0x03,
55195489c19Sopenharmony_ci    BLE_ADDR_TYPE_UNKNOWN = 0xFE,
55295489c19Sopenharmony_ci    BLE_ADDR_TYPE_ANONYMOUS = 0xFF,
55395489c19Sopenharmony_ci};
55495489c19Sopenharmony_ci
55595489c19Sopenharmony_ciusing BLE_IO_CAP = enum {
55695489c19Sopenharmony_ci    BLE_IO_CAP_OUT = 0x00,    // DisplayOnly
55795489c19Sopenharmony_ci    BLE_IO_CAP_IO = 0x01,     // DisplayYesNo
55895489c19Sopenharmony_ci    BLE_IO_CAP_IN = 0x02,     // KeyboardOnly
55995489c19Sopenharmony_ci    BLE_IO_CAP_NONE = 0x03,   // NoInputNoOutput
56095489c19Sopenharmony_ci    BLE_IO_CAP_KBDISP = 0x04  // Keyboard display
56195489c19Sopenharmony_ci};
56295489c19Sopenharmony_ci
56395489c19Sopenharmony_ci// Adv status
56495489c19Sopenharmony_ciusing BleAdvState = enum {
56595489c19Sopenharmony_ci    BLE_ADV_STATE_IDLE,
56695489c19Sopenharmony_ci    BLE_ADV_STATE_ADVERTISING,
56795489c19Sopenharmony_ci};
56895489c19Sopenharmony_ci
56995489c19Sopenharmony_ci// The type of advertising data(not adv_type)
57095489c19Sopenharmony_ciusing BLE_ADV_DATA_TYPE = enum {
57195489c19Sopenharmony_ci    BLE_AD_TYPE_FLAG = 0x01,
57295489c19Sopenharmony_ci    BLE_AD_TYPE_16SRV_PART = 0x02,
57395489c19Sopenharmony_ci    BLE_AD_TYPE_16SRV_CMPL = 0x03,
57495489c19Sopenharmony_ci    BLE_AD_TYPE_32SRV_PART = 0x04,
57595489c19Sopenharmony_ci    BLE_AD_TYPE_32SRV_CMPL = 0x05,
57695489c19Sopenharmony_ci    BLE_AD_TYPE_128SRV_PART = 0x06,
57795489c19Sopenharmony_ci    BLE_AD_TYPE_128SRV_CMPL = 0x07,
57895489c19Sopenharmony_ci    BLE_AD_TYPE_NAME_SHORT = 0x08,
57995489c19Sopenharmony_ci    BLE_AD_TYPE_NAME_CMPL = 0x09,
58095489c19Sopenharmony_ci    BLE_AD_TYPE_TX_PWR = 0x0A,
58195489c19Sopenharmony_ci    BLE_AD_TYPE_DEV_CLASS = 0x0D,
58295489c19Sopenharmony_ci    BLE_AD_TYPE_SM_TK = 0x10,
58395489c19Sopenharmony_ci    BLE_AD_TYPE_SM_OOB_FLAG = 0x11,
58495489c19Sopenharmony_ci    BLE_AD_TYPE_INT_RANGE = 0x12,
58595489c19Sopenharmony_ci    BLE_AD_TYPE_SOL_SRV_UUID = 0x14,
58695489c19Sopenharmony_ci    BLE_AD_TYPE_128SOL_SRV_UUID = 0x15,
58795489c19Sopenharmony_ci    BLE_AD_TYPE_SERVICE_DATA = 0x16,
58895489c19Sopenharmony_ci    BLE_AD_TYPE_PUBLIC_TARGET = 0x17,
58995489c19Sopenharmony_ci    BLE_AD_TYPE_RANDOM_TARGET = 0x18,
59095489c19Sopenharmony_ci    BLE_AD_TYPE_APPEARANCE = 0x19,
59195489c19Sopenharmony_ci    BLE_AD_TYPE_ADV_INT = 0x1A,
59295489c19Sopenharmony_ci    BLE_AD_TYPE_LE_DEV_ADDR = 0x1b,
59395489c19Sopenharmony_ci    BLE_AD_TYPE_LE_ROLE = 0x1c,
59495489c19Sopenharmony_ci    BLE_AD_TYPE_SPAIR_C256 = 0x1d,
59595489c19Sopenharmony_ci    BLE_AD_TYPE_SPAIR_R256 = 0x1e,
59695489c19Sopenharmony_ci    BLE_AD_TYPE_32SOL_SRV_UUID = 0x1f,
59795489c19Sopenharmony_ci    BLE_AD_TYPE_32SERVICE_DATA = 0x20,
59895489c19Sopenharmony_ci    BLE_AD_TYPE_128SERVICE_DATA = 0x21,
59995489c19Sopenharmony_ci    BLE_AD_TYPE_LE_SECURE_CONFIRM = 0x22,
60095489c19Sopenharmony_ci    BLE_AD_TYPE_LE_SECURE_RANDOM = 0x23,
60195489c19Sopenharmony_ci    BLE_AD_TYPE_URI = 0x24,
60295489c19Sopenharmony_ci    BLE_AD_TYPE_INDOOR_POSITION = 0x25,
60395489c19Sopenharmony_ci    BLE_AD_TYPE_TRANS_DISC_DATA = 0x26,
60495489c19Sopenharmony_ci    BLE_AD_TYPE_LE_SUPPORT_FEATURE = 0x27,
60595489c19Sopenharmony_ci    BLE_AD_TYPE_CHAN_MAP_UPDATE = 0x28,
60695489c19Sopenharmony_ci    BLE_AD_MANUFACTURER_SPECIFIC_TYPE = 0xFF,
60795489c19Sopenharmony_ci};
60895489c19Sopenharmony_ci
60995489c19Sopenharmony_ci/*********************************************
61095489c19Sopenharmony_ci *
61195489c19Sopenharmony_ci * Map Define
61295489c19Sopenharmony_ci *
61395489c19Sopenharmony_ci *********************************************/
61495489c19Sopenharmony_ci// Map Message Type
61595489c19Sopenharmony_cienum class MapMessageType : int {
61695489c19Sopenharmony_ci    EMAIL = 0,
61795489c19Sopenharmony_ci    SMS_GSM = 1,
61895489c19Sopenharmony_ci    SMS_CDMA = 2,
61995489c19Sopenharmony_ci    MMS = 3,
62095489c19Sopenharmony_ci    IM = 4,
62195489c19Sopenharmony_ci    INVALID = 5
62295489c19Sopenharmony_ci};  // IM only support in bmessage ver1.1
62395489c19Sopenharmony_ci
62495489c19Sopenharmony_ci// Map Message Status
62595489c19Sopenharmony_cienum class MapMessageStatus : int { READ, UNREAD, INVALID };  // default UNREAD
62695489c19Sopenharmony_ci
62795489c19Sopenharmony_ci// Map BoolType , YES_TYPE or NO_TYPE
62895489c19Sopenharmony_cienum class MapBoolType : int { YES_TYPE, NO_TYPE, INVALID };  // default NO_TYPE
62995489c19Sopenharmony_ci
63095489c19Sopenharmony_ci// Map Message ReceptionStatus
63195489c19Sopenharmony_cienum class MapMsgReceptionStatus : int { COMPLETE, FRACTIONED, NOTIFICATION, INVALID };
63295489c19Sopenharmony_ci
63395489c19Sopenharmony_ci// Map MsgDeliveryStatus
63495489c19Sopenharmony_cienum class MapMsgDeliveryStatus : int { DELIVERED, SENT, UNKNOWN, INVALID };
63595489c19Sopenharmony_ci
63695489c19Sopenharmony_ci// Map MsgDirection
63795489c19Sopenharmony_cienum class MapMsgDirection : int { INCOMING, OUTGOING, OUTGOINGDRAFT, OUTGOINGPENDING, INVALID };
63895489c19Sopenharmony_ci
63995489c19Sopenharmony_ci// Map FractionDeliverType
64095489c19Sopenharmony_cienum class MapFractionDeliverType : int { MORE, LAST, INVALID };
64195489c19Sopenharmony_ci
64295489c19Sopenharmony_ci// Map FractionRequest Type
64395489c19Sopenharmony_cienum class MapFractionRequestType : uint8_t { FIRST = 0x00, NEXT = 0x01, INVALID = 0x02 };
64495489c19Sopenharmony_ci
64595489c19Sopenharmony_ci// Map OnOff Type
64695489c19Sopenharmony_cienum class MapOnOffType : uint8_t { OFF = 0, ON = 1, INVALID = 3 };
64795489c19Sopenharmony_ci
64895489c19Sopenharmony_ci// Map Charset Type
64995489c19Sopenharmony_cienum class MapCharsetType : uint8_t { NATIVE = 0x00, UTF_8 = 0x01, INVALID = 0x02 };
65095489c19Sopenharmony_ci
65195489c19Sopenharmony_ci// Attachment Type
65295489c19Sopenharmony_cienum class MapAttachmentType : uint8_t { NO_TYPE = 0x00, HAVE = 0x01, INVALID = 0x02 };
65395489c19Sopenharmony_ci
65495489c19Sopenharmony_ci// Map StatusIndicator Type
65595489c19Sopenharmony_cienum class MapStatusIndicatorType : uint8_t {
65695489c19Sopenharmony_ci    READ_STATUS = 0x00,
65795489c19Sopenharmony_ci    DELETED_STATUS = 0x01,
65895489c19Sopenharmony_ci    SET_EXTENDED_DATA = 0x02,
65995489c19Sopenharmony_ci    INVALID = 0x03
66095489c19Sopenharmony_ci};
66195489c19Sopenharmony_ci
66295489c19Sopenharmony_ci// Map StatusValue Type
66395489c19Sopenharmony_cienum class MapStatusValueType : uint8_t { NO_TYPE = 0x00, YES_TYPE = 0x01 };
66495489c19Sopenharmony_ci
66595489c19Sopenharmony_ci// Map ModifyText Type
66695489c19Sopenharmony_cienum class MapModifyTextType : uint8_t { REPLACE = 0x00, PREPEND = 0x01, INVALID = 0x02 };
66795489c19Sopenharmony_ci
66895489c19Sopenharmony_ci// Map Action Type
66995489c19Sopenharmony_cienum class MapActionType : int {
67095489c19Sopenharmony_ci    GET_UNREAD_MESSAGES,
67195489c19Sopenharmony_ci    GET_SUPPORTED_FEATURES,
67295489c19Sopenharmony_ci    SEND_MESSAGE,
67395489c19Sopenharmony_ci    SET_NOTIFICATION_FILTER,
67495489c19Sopenharmony_ci    GET_MESSAGES_LISTING,
67595489c19Sopenharmony_ci    GET_MESSAGE,
67695489c19Sopenharmony_ci    UPDATE_INBOX,
67795489c19Sopenharmony_ci    GET_CONVERSATION_LISTING,
67895489c19Sopenharmony_ci    SET_MESSAGE_STATUS,
67995489c19Sopenharmony_ci    SET_OWNER_STATUS,
68095489c19Sopenharmony_ci    GET_OWNER_STATUS,
68195489c19Sopenharmony_ci    GET_MAS_INSTANCE_INFO
68295489c19Sopenharmony_ci};
68395489c19Sopenharmony_ci
68495489c19Sopenharmony_ci// Map ExecuteStatus Type
68595489c19Sopenharmony_cienum class MapExecuteStatus : int {
68695489c19Sopenharmony_ci    SUCCEED = 0,
68795489c19Sopenharmony_ci    CONTINUE = 1,
68895489c19Sopenharmony_ci    BAD_PARAM = (-1),
68995489c19Sopenharmony_ci    BAD_STATUS = (-2),
69095489c19Sopenharmony_ci    NOT_SUPPORT = (-3)
69195489c19Sopenharmony_ci};
69295489c19Sopenharmony_ci
69395489c19Sopenharmony_ci// Supported Message Types
69495489c19Sopenharmony_ci#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_EMAIL 0x01
69595489c19Sopenharmony_ci#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_SMS_GSM 0x02
69695489c19Sopenharmony_ci#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_SMS_CDMA 0x04
69795489c19Sopenharmony_ci#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_MMS 0x08
69895489c19Sopenharmony_ci#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_IM 0x10
69995489c19Sopenharmony_ci#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_ALL 0x01F
70095489c19Sopenharmony_ci
70195489c19Sopenharmony_ci// Api: MapClient::GetMessagesListing Application Parameters Mask defines
70295489c19Sopenharmony_ci// FilterMessageType Mask, 1 is "filter out this type", 0 is "no filtering, get this type"
70395489c19Sopenharmony_ci#define MAP_FILTER_MESSAGE_MASK_SMS_GSM 0b00000001
70495489c19Sopenharmony_ci#define MAP_FILTER_MESSAGE_MASK_SMS_CDMA 0b00000010
70595489c19Sopenharmony_ci#define MAP_FILTER_MESSAGE_MASK_EMAIL 0b00000100
70695489c19Sopenharmony_ci#define MAP_FILTER_MESSAGE_MASK_MMS 0b00001000
70795489c19Sopenharmony_ci#define MAP_FILTER_MESSAGE_MASK_IM 0b00010000
70895489c19Sopenharmony_ci#define MAP_FILTER_MESSAGE_MASK_NO_FILTERING 0b00000000
70995489c19Sopenharmony_ci// FilterReadStatus,  0b00000001 is get unread messages only,
71095489c19Sopenharmony_ci// 0b00000010 is get read messages only
71195489c19Sopenharmony_ci#define MAP_FILTER_READ_STATUS_MASK_UNREAD 0b00000001
71295489c19Sopenharmony_ci#define MAP_FILTER_READ_STATUS_MASK_READ 0b00000010
71395489c19Sopenharmony_ci#define MAP_FILTER_READ_STATUS_MASK_NO_FILTERING 0b00000000
71495489c19Sopenharmony_ci// FilterPriority, 0b00000001 is get high priority messages only,
71595489c19Sopenharmony_ci// 0b00000010 is get non-high priority messages only
71695489c19Sopenharmony_ci#define MAP_FILTER_PRIORITY_MASK_HIGH 0b00000001
71795489c19Sopenharmony_ci#define MAP_FILTER_PRIORITY_MASK_NO_HIGH 0b00000010
71895489c19Sopenharmony_ci#define MAP_FILTER_PRIORITY_MASK_NO_FILTERING 0b00000000
71995489c19Sopenharmony_ci// ParameterMask , Bits 0-20 has been used , Bits 21–31 Reserved for Future Use
72095489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_REQUIRED 0b000000000000000000000000
72195489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_PRESENT_ALL 0b000111111111111111111111
72295489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_SUBJECT 0b000000000000000000000001
72395489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_DATETIME 0b000000000000000000000010
72495489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_SENDER_NAME 0b000000000000000000000100
72595489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_SENDER_ADDRESSING 0b000000000000000000001000
72695489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_RECIPIENT_NAME 0b000000000000000000010000
72795489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_RECIPIENT_ADDRESSING 0b000000000000000000100000
72895489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_TYPE 0b000000000000000001000000
72995489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_SIZE 0b000000000000000010000000
73095489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_RECEPTION_STATUS 0b000000000000000100000000
73195489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_TEXT 0b000000000000001000000000
73295489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_ATTACHMENT_SIZE 0b000000000000010000000000
73395489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_PRIORITY 0b000000000000100000000000
73495489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_READ 0b000000000001000000000000
73595489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_SENT 0b000000000010000000000000
73695489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_PROTECTED 0b000000000100000000000000
73795489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_REPLYTO_ADDRESSING 0b000000001000000000000000
73895489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_DELIVERY_STATUS 0b000000010000000000000000
73995489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_CONVERSATION_ID 0b000000100000000000000000
74095489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_CONVERSATION_NAME 0b000001000000000000000000
74195489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_DIRECTION 0b000010000000000000000000
74295489c19Sopenharmony_ci#define MAP_GETMESSAGELIST_PARAMETER_MASK_ATTACHMENT_MIME 0b000100000000000000000000
74395489c19Sopenharmony_ci
74495489c19Sopenharmony_ci// Api: MapClient::GetConversationListing Application Parameters Mask defines
74595489c19Sopenharmony_ci// ConvParameterMask , Bits 0-14 has been used, Bits 15–31 Reserved for Future Use
74695489c19Sopenharmony_ci// Bit i is 1 indicates that the parameter related to Bit i shall be present in the requested Conversation-Listing.
74795489c19Sopenharmony_ci// The reserved bits shall be set to 0 by the MCE and discarded by the MSE.
74895489c19Sopenharmony_ci// If Bit 5 has the value 0, the Conversation-Listing in the response shall not contain any participant element
74995489c19Sopenharmony_ci// and therefore the Bits 6–14 do not have any impact.
75095489c19Sopenharmony_ci// If Bit 5 has the value 1, then at least one of the Bits 6–14 shall also have the value 1.
75195489c19Sopenharmony_ci// If any of the Bits 6–14 has the value 1, Bit 5 shall have the value 1.
75295489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_ALL_ON 0b000000000111111111111111
75395489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_NAME 0b000000000000000000000001
75495489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_LAST_ACTIVITY 0b000000000000000000000010
75595489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_READ_STATUS 0b000000000000000000000100
75695489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_VERSION_COUNTER 0b000000000000000000001000
75795489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_SUMMARY 0b000000000000000000010000
75895489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANTS 0b000000000000000000100000
75995489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_UCI 0b000000000000000001000000
76095489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_DISPLAY_NAME 0b000000000000000010000000
76195489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_CHAT_STATE 0b000000000000000100000000
76295489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_LAST_ACTIVITY 0b000000000000001000000000
76395489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_X_BT_UID 0b000000000000010000000000
76495489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_NAME 0b000000000000100000000000
76595489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_PRESENCE_AVAILABILITY 0b000000000001000000000000
76695489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_PRESENCE_TEXT 0b000000000010000000000000
76795489c19Sopenharmony_ci#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_PRIORITY 0b000000000100000000000000
76895489c19Sopenharmony_ci
76995489c19Sopenharmony_ci// Api: MapClient::SetNotificationFilter input param mask defines
77095489c19Sopenharmony_ci// Bit i is 0 indicates that the MSE shall not send the notification related to bit i for the current MAS.
77195489c19Sopenharmony_ci// NotificationFilterMask ,Bits 0-14 has been used, Bits 15–31 Reserved for Future Use
77295489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_ALL_OFF 0b000000000000000000000000
77395489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_ALL_ON 0b000000000111111111111111
77495489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_NEW_MESSAGE 0b000000000000000000000001
77595489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_DELETED 0b000000000000000000000010
77695489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_SHIFT 0b000000000000000000000100
77795489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_SENDING_SUCCESS 0b000000000000000000001000
77895489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_SENDING_FAILURE 0b000000000000000000010000
77995489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_DELIVERY_SUCCESS 0b000000000000000000100000
78095489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_DELIVERY_FAILURE 0b000000000000000001000000
78195489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_MEMORY_FULL 0b000000000000000010000000
78295489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_MEMORY_AVAILABLE 0b000000000000000100000000
78395489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_READ_STATUS_CHANGED 0b000000000000001000000000
78495489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_CONVERSATION_CHANGED 0b000000000000010000000000
78595489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_PARTICIPANT_PRESENCE_CHANGED 0b000000000000100000000000
78695489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_PARTICIPANT_CHAT_STATE_CHANGED 0b000000000001000000000000
78795489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_EXTENDED_DATA_CHANGED 0b000000000010000000000000
78895489c19Sopenharmony_ci#define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_REMOVED 0b000000000100000000000000
78995489c19Sopenharmony_ci
79095489c19Sopenharmony_ci// Api: MapClient::GetSupportedFeatures action complete param mask defines
79195489c19Sopenharmony_ci// Map Supported features mask
79295489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_NOTIFICATION_REGISTRATION 0x00000001
79395489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_NOTIFICATION_FEATURE 0x00000002
79495489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_BROWSING 0x00000004
79595489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_UPLOADING 0x00000008
79695489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_DELETE_FEATURE 0x00000010
79795489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_INSTANCE_INFO_FEATURE 0x00000020
79895489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_EVENT_REPORT_1_1 0x00000040
79995489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_EVENT_REPORT_1_2 0x00000080
80095489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_MESSAGE_FORMAT_1_1 0x00000100
80195489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_MESSAGELIST_FORMAT_1_1 0x00000200
80295489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_PERSISTENT_MESSAGE_HANDLE 0x00000400
80395489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_DATABASE_IDENTIFIER 0x00000800
80495489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_FOLDOR_VERSION_COUNTER 0x00001000
80595489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_CONVERSATION_VERSION_COUNTER 0x00002000
80695489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_PARTICIPANT_PRESENCE_CHANGE_NOTIFICATION 0x00004000
80795489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_PARTICIPANT_CHAT_STATE_CHANGE_NOTIFICATION 0x00008000
80895489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_PBAP_CONTACT_CROSS_REFERENCE 0x00010000
80995489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_NOTIFICATION_FILTER 0x00020000
81095489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_UTC_OFFSET_TIMESTAMP_FORMAT 0x00040000
81195489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_MAPSUPPORTED_FEATURES 0x00080000
81295489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_CONVERSATION_LISTING 0x00100000
81395489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_OWNER_STATUS 0x00200000
81495489c19Sopenharmony_ci#define MAP_SUPPORTED_FEATURES_MESSAGE_FORWARDING 0x00400000
81595489c19Sopenharmony_ci
81695489c19Sopenharmony_ci/*********************************************
81795489c19Sopenharmony_ci *
81895489c19Sopenharmony_ci * AVRCP Macro Define
81995489c19Sopenharmony_ci *
82095489c19Sopenharmony_ci *********************************************/
82195489c19Sopenharmony_ci
82295489c19Sopenharmony_ci// The default label. The valid range is 0x00 ~ 0x0F.
82395489c19Sopenharmony_ci#define AVRC_DEFAULT_LABEL (0x00)
82495489c19Sopenharmony_ci// The invalid label.
82595489c19Sopenharmony_ci#define AVRC_INVALID_LABEL (0x10)
82695489c19Sopenharmony_ci
82795489c19Sopenharmony_ci/**
82895489c19Sopenharmony_ci * @brief This enumeration declares the types of the methods.
82995489c19Sopenharmony_ci *
83095489c19Sopenharmony_ci * @since 6
83195489c19Sopenharmony_ci */
83295489c19Sopenharmony_cienum AvrcCtActionType : uint8_t {
83395489c19Sopenharmony_ci    AVRC_ACTION_TYPE_INVALID = 0x00,
83495489c19Sopenharmony_ci    AVRC_ACTION_TYPE_PRESS_BUTTON,
83595489c19Sopenharmony_ci    AVRC_ACTION_TYPE_RELEASE_BUTTON,
83695489c19Sopenharmony_ci    AVRC_ACTION_TYPE_SET_ADDRESSED_PLAYER,
83795489c19Sopenharmony_ci    AVRC_ACTION_TYPE_SET_BROWSED_PLAYER,
83895489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_CAPABILITIES,
83995489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_ATTRIBUTES,
84095489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_VALUES,
84195489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_CURRENT_VALUE,
84295489c19Sopenharmony_ci    AVRC_ACTION_TYPE_SET_PLAYER_APP_SETTING_CURRENT_VALUE,
84395489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_ATTRIBUTE_TEXT,
84495489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_VALUE_TEXT,
84595489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_ELEMENT_ATTRIBUTES,
84695489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_PLAY_STATUS,
84795489c19Sopenharmony_ci    AVRC_ACTION_TYPE_PLAY_ITEM,
84895489c19Sopenharmony_ci    AVRC_ACTION_TYPE_ADD_TO_NOW_PLAYING,
84995489c19Sopenharmony_ci    AVRC_ACTION_TYPE_CHANGE_PATH,
85095489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_FOLDER_ITEMS,
85195489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_ITEM_ATTRIBUTES,
85295489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_TOTAL_NUMBER_OF_ITEMS,
85395489c19Sopenharmony_ci    AVRC_ACTION_TYPE_SET_ABSOLUTE_VOLUME,
85495489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_PLAYBACK_STATUS_CHANGED,
85595489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_TRACK_CHANGED,
85695489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_TRACK_REACHED_END,
85795489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_TRACK_REACHED_START,
85895489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_PLAYBACK_POS_CHANGED,
85995489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_PLAYER_APPLICATION_SETTING_CHANGED,
86095489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_NOW_PLAYING_CONTENT_CHANGED,
86195489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_AVAILABLE_PLAYERS_CHANGED,
86295489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_ADDRESSED_PLAYER_CHANGED,
86395489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_UIDS_CHANGED,
86495489c19Sopenharmony_ci    AVRC_ACTION_TYPE_NOTIFY_VOLUME_CHANGED,
86595489c19Sopenharmony_ci    AVRC_ACTION_TYPE_GET_MEDIA_PLAYER_LIST,
86695489c19Sopenharmony_ci};
86795489c19Sopenharmony_ci
86895489c19Sopenharmony_ci/**
86995489c19Sopenharmony_ci * @brief This enumeration declares the values of the supported button.
87095489c19Sopenharmony_ci * @see AV/C Panel Subunit Specification 1.23 Section 9.4 PASS THROUGH control command Table 9.21 - Operation id List
87195489c19Sopenharmony_ci *
87295489c19Sopenharmony_ci * @since 6
87395489c19Sopenharmony_ci */
87495489c19Sopenharmony_cienum AvrcKeyOperation : uint8_t {
87595489c19Sopenharmony_ci    AVRC_KEY_OPERATION_VOLUME_UP = 0x41,     // Volume up.
87695489c19Sopenharmony_ci    AVRC_KEY_OPERATION_VOLUME_DOWN = 0x42,   // Volume down.
87795489c19Sopenharmony_ci    AVRC_KEY_OPERATION_MUTE = 0x43,          // Mute.
87895489c19Sopenharmony_ci    AVRC_KEY_OPERATION_PLAY = 0x44,          // Play.
87995489c19Sopenharmony_ci    AVRC_KEY_OPERATION_STOP = 0x45,          // Stop.
88095489c19Sopenharmony_ci    AVRC_KEY_OPERATION_PAUSE = 0x46,         // Pause.
88195489c19Sopenharmony_ci    AVRC_KEY_OPERATION_REWIND = 0x48,        // Rewind.
88295489c19Sopenharmony_ci    AVRC_KEY_OPERATION_FAST_FORWARD = 0x49,  // Fast forward.
88395489c19Sopenharmony_ci    AVRC_KEY_OPERATION_FORWARD = 0x4B,       // Forward.
88495489c19Sopenharmony_ci    AVRC_KEY_OPERATION_BACKWARD = 0x4C,      // Backward.
88595489c19Sopenharmony_ci    AVRC_KEY_OPERATION_INVALID = 0x7F,
88695489c19Sopenharmony_ci};
88795489c19Sopenharmony_ci
88895489c19Sopenharmony_ci/**
88995489c19Sopenharmony_ci * @brief This enumeration declares the values of the key state.
89095489c19Sopenharmony_ci *
89195489c19Sopenharmony_ci * @since 6
89295489c19Sopenharmony_ci */
89395489c19Sopenharmony_cienum AvrcTgKeyState : uint8_t {
89495489c19Sopenharmony_ci    AVRC_KEY_STATE_PRESS = 0x00,    // The key is pushed.
89595489c19Sopenharmony_ci    AVRC_KEY_STATE_RELEASE = 0x01,  // The key is released.
89695489c19Sopenharmony_ci    AVRC_KEY_STATE_INVALID,         // Invalid key state.
89795489c19Sopenharmony_ci};
89895489c19Sopenharmony_ci
89995489c19Sopenharmony_ci/**
90095489c19Sopenharmony_ci * @brief This enumeration declares the values of the player application setting attributes.
90195489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
90295489c19Sopenharmony_ci *
90395489c19Sopenharmony_ci * @since 6
90495489c19Sopenharmony_ci */
90595489c19Sopenharmony_cienum AvrcPlayerAttribute : uint8_t {
90695489c19Sopenharmony_ci    AVRC_PLAYER_ATTRIBUTE_ILLEGAL = 0x00,       // Illegal , Should not be used.
90795489c19Sopenharmony_ci    AVRC_PLAYER_ATTRIBUTE_EQUALIZER = 0x01,     // Equalizer ON / OFF status.
90895489c19Sopenharmony_ci    AVRC_PLAYER_ATTRIBUTE_REPEAT = 0x02,        // Repeat Mode status.
90995489c19Sopenharmony_ci    AVRC_PLAYER_ATTRIBUTE_SHUFFLE = 0x03,       // Shuffle ON/OFF status.
91095489c19Sopenharmony_ci    AVRC_PLAYER_ATTRIBUTE_SCAN = 0x04,          // Scan ON/OFF status.
91195489c19Sopenharmony_ci    AVRC_PLAYER_ATTRIBUTE_RESERVED_MIN = 0x05,  // Reserved for future use. 0x05 - 0x7F
91295489c19Sopenharmony_ci    AVRC_PLAYER_ATTRIBUTE_RESERVED_MAX = 0x7F,  // Reserved for future use. 0x05 - 0x7F
91395489c19Sopenharmony_ci    AVRC_PLAYER_ATTRIBUTE_EXTENSION = 0x80,     // Provided for TG driven static media player menu extension.
91495489c19Sopenharmony_ci                                                // Range: 0x80 - 0xFF
91595489c19Sopenharmony_ci};
91695489c19Sopenharmony_ci
91795489c19Sopenharmony_ci/**
91895489c19Sopenharmony_ci * @brief This enumeration declares the values of the Equalizer ON/OFF status.
91995489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
92095489c19Sopenharmony_ci *
92195489c19Sopenharmony_ci * @since 6
92295489c19Sopenharmony_ci */
92395489c19Sopenharmony_cienum AvrcEqualizer : uint8_t {
92495489c19Sopenharmony_ci    AVRC_EQUALIZER_OFF = 0x01,
92595489c19Sopenharmony_ci    AVRC_EQUALIZER_ON,
92695489c19Sopenharmony_ci    AVRC_EQUALIZER_INVALID,
92795489c19Sopenharmony_ci};
92895489c19Sopenharmony_ci
92995489c19Sopenharmony_ci/**
93095489c19Sopenharmony_ci * @brief This enumeration declares the values of the Repeat Mode status.
93195489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
93295489c19Sopenharmony_ci *
93395489c19Sopenharmony_ci * @since 6
93495489c19Sopenharmony_ci */
93595489c19Sopenharmony_cienum AvrcRepeat : uint8_t {
93695489c19Sopenharmony_ci    AVRC_REPEAT_OFF = 0x01,
93795489c19Sopenharmony_ci    AVRC_REPEAT_SINGLE_TRACK,
93895489c19Sopenharmony_ci    AVRC_REPEAT_ALL_TRACK,
93995489c19Sopenharmony_ci    AVRC_REPEAT_GROUP,
94095489c19Sopenharmony_ci    AVRC_REPEAT_INVALID,
94195489c19Sopenharmony_ci};
94295489c19Sopenharmony_ci
94395489c19Sopenharmony_ci/**
94495489c19Sopenharmony_ci * @brief This enumeration declares the values of the Shuffle ON/OFF status.
94595489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
94695489c19Sopenharmony_ci *
94795489c19Sopenharmony_ci * @since 6
94895489c19Sopenharmony_ci */
94995489c19Sopenharmony_cienum AvrcShuffle : uint8_t {
95095489c19Sopenharmony_ci    AVRC_SHUFFLE_OFF = 0x01,
95195489c19Sopenharmony_ci    AVRC_SHUFFLE_ALL_TRACKS,
95295489c19Sopenharmony_ci    AVRC_SHUFFLE_GROUP,
95395489c19Sopenharmony_ci    AVRC_SHUFFLE_INVALID,
95495489c19Sopenharmony_ci};
95595489c19Sopenharmony_ci
95695489c19Sopenharmony_ci/**
95795489c19Sopenharmony_ci * @brief This enumeration declares the values of the Scan ON/OFF status.
95895489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
95995489c19Sopenharmony_ci *
96095489c19Sopenharmony_ci * @since 6
96195489c19Sopenharmony_ci */
96295489c19Sopenharmony_cienum AvrcScan : uint8_t {
96395489c19Sopenharmony_ci    AVRC_SCAN_OFF = 0x01,
96495489c19Sopenharmony_ci    AVRC_SCAN_ALL_TRACKS,
96595489c19Sopenharmony_ci    AVRC_SCAN_GROUP,
96695489c19Sopenharmony_ci    AVRC_SCAN_INVALID,
96795489c19Sopenharmony_ci};
96895489c19Sopenharmony_ci
96995489c19Sopenharmony_ci/**
97095489c19Sopenharmony_ci * @brief This enumeration declares the values of the play status.
97195489c19Sopenharmony_ci *
97295489c19Sopenharmony_ci * @since 6
97395489c19Sopenharmony_ci */
97495489c19Sopenharmony_cienum AvrcPlayStatus : uint32_t {
97595489c19Sopenharmony_ci    AVRC_PLAY_STATUS_STOPPED = 0x00,                      // Stopped.
97695489c19Sopenharmony_ci    AVRC_PLAY_STATUS_PLAYING,                             // Playing.
97795489c19Sopenharmony_ci    AVRC_PLAY_STATUS_PAUSED,                              // Paused.
97895489c19Sopenharmony_ci    AVRC_PLAY_STATUS_FWD_SEEK,                            // Fwd seek.
97995489c19Sopenharmony_ci    AVRC_PLAY_STATUS_REV_SEEK,                            // Rev seek.
98095489c19Sopenharmony_ci    AVRC_PLAY_STATUS_RESERVED_MIN = 0x05,                 // Reserved for future use.
98195489c19Sopenharmony_ci    AVRC_PLAY_STATUS_RESERVED_MAX = 0xFE,                 // Reserved for future use.
98295489c19Sopenharmony_ci    AVRC_PLAY_STATUS_ERROR = 0xFF,                        // Error.
98395489c19Sopenharmony_ci    AVRC_PLAY_STATUS_INVALID_SONG_LENGTH = 0xFFFFFFFF,    // If TG does not support, then TG shall return 0xFFFFFFFF.
98495489c19Sopenharmony_ci    AVRC_PLAY_STATUS_INVALID_SONG_POSITION = 0xFFFFFFFF,  // If TG does not support, then TG shall return 0xFFFFFFFF.
98595489c19Sopenharmony_ci};
98695489c19Sopenharmony_ci
98795489c19Sopenharmony_ci/**
98895489c19Sopenharmony_ci * @brief This enumeration declares the values of folder direction.
98995489c19Sopenharmony_ci *
99095489c19Sopenharmony_ci * @since 6
99195489c19Sopenharmony_ci */
99295489c19Sopenharmony_cienum AvrcFolderDirection : uint8_t {
99395489c19Sopenharmony_ci    AVRC_FOLDER_DIRECTION_UP = 0x00,       // Folder up.
99495489c19Sopenharmony_ci    AVRC_FOLDER_DIRECTION_DOWN = 0x01,     // Folder down.
99595489c19Sopenharmony_ci    AVRC_FOLDER_DIRECTION_INVALID = 0x02,  // Reserved.
99695489c19Sopenharmony_ci};
99795489c19Sopenharmony_ci
99895489c19Sopenharmony_ci/**
99995489c19Sopenharmony_ci * @brief This enumeration declares the values of the scope in which the UID of the media element item or folder item.
100095489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 6.10.1 Scope.
100195489c19Sopenharmony_ci *
100295489c19Sopenharmony_ci * @since 6
100395489c19Sopenharmony_ci */
100495489c19Sopenharmony_cienum AvrcMediaScope : uint8_t {
100595489c19Sopenharmony_ci    AVRC_MEDIA_SCOPE_PLAYER_LIST = 0x00,   // Contains all available media players.
100695489c19Sopenharmony_ci    AVRC_MEDIA_SCOPE_VIRTUAL_FILE_SYSTEM,  // Contains the media content of the browsed player.
100795489c19Sopenharmony_ci    AVRC_MEDIA_SCOPE_SEARCH,               // The results of a search operation on the browsed player.
100895489c19Sopenharmony_ci    AVRC_MEDIA_SCOPE_NOW_PLAYING,          // The Now Playing list (or queue) of the addressed player.
100995489c19Sopenharmony_ci    AVRC_MEDIA_SCOPE_INVALID,
101095489c19Sopenharmony_ci};
101195489c19Sopenharmony_ci
101295489c19Sopenharmony_ci/**
101395489c19Sopenharmony_ci * @brief This enumeration declares the values of the browsable items.
101495489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 6.10.2 Browsable items.
101595489c19Sopenharmony_ci *
101695489c19Sopenharmony_ci * @since 6
101795489c19Sopenharmony_ci */
101895489c19Sopenharmony_cienum AvrcMediaType : uint8_t {
101995489c19Sopenharmony_ci    AVRC_MEDIA_TYPE_MEDIA_PLAYER_ITEM = 0x01,
102095489c19Sopenharmony_ci    AVRC_MEDIA_TYPE_FOLDER_ITEM,
102195489c19Sopenharmony_ci    AVRC_MEDIA_TYPE_MEDIA_ELEMENT_ITEM,
102295489c19Sopenharmony_ci    AVRC_MEDIA_TYPE_INVALID,
102395489c19Sopenharmony_ci};
102495489c19Sopenharmony_ci
102595489c19Sopenharmony_ci/**
102695489c19Sopenharmony_ci * @brief This enumeration declares the values of the attribute count.
102795489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 6.10.4.2 GetFolderItems - Attribute Count.
102895489c19Sopenharmony_ci *
102995489c19Sopenharmony_ci * @since 6
103095489c19Sopenharmony_ci */
103195489c19Sopenharmony_cienum AvrcAttributeCount {
103295489c19Sopenharmony_ci    AVRC_ATTRIBUTE_COUNT_ALL = 0x00,
103395489c19Sopenharmony_ci    AVRC_ATTRIBUTE_COUNT_NO = 0xFF,
103495489c19Sopenharmony_ci};
103595489c19Sopenharmony_ci
103695489c19Sopenharmony_ci/**
103795489c19Sopenharmony_ci * @brief This enumeration declares the values of the media attribute. These values are used to uniquely identify media
103895489c19Sopenharmony_ci * information.
103995489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 26 Appendix E: list of media attributes.
104095489c19Sopenharmony_ci *
104195489c19Sopenharmony_ci * @since 6
104295489c19Sopenharmony_ci */
104395489c19Sopenharmony_cienum AvrcMediaAttribute : uint8_t {
104495489c19Sopenharmony_ci    // Not used.
104595489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_NOT_USED = 0x00,
104695489c19Sopenharmony_ci    // Text field representing the title, song name or content description coded per specified character set.
104795489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_TITLE,
104895489c19Sopenharmony_ci    // Text field representing artist(s), performer(s) or group coded per specified character set.
104995489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_ARTIST_NAME,
105095489c19Sopenharmony_ci    // Text field representing the title of the recording(source) from which the audio in the file is taken.
105195489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_ALBUM_NAME,
105295489c19Sopenharmony_ci    // Numeric ASCII string containing the order number of the audio - file on its original recording.O 0x5 Total
105395489c19Sopenharmony_ci    // Number of Tracks.
105495489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_TRACK_NUMBER,
105595489c19Sopenharmony_ci    // Numeric ASCII string containing the total number of tracks or elements on the original recording.
105695489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_TOTAL_NUMBER_OF_TRACKS,
105795489c19Sopenharmony_ci    // Text field representing the category of the composition characterized by a particular style.
105895489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_GENRE,
105995489c19Sopenharmony_ci    // Numeric ASCII string containing the length of the audio file in milliseconds.(E.g .02 : 30 = 150000)
106095489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_PLAYING_TIME,
106195489c19Sopenharmony_ci    // BIP Image Handle.
106295489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_DEFAULT_COVER_ART,
106395489c19Sopenharmony_ci    // Reserved for future use.
106495489c19Sopenharmony_ci    AVRC_MEDIA_ATTRIBUTE_RESERVED,
106595489c19Sopenharmony_ci};
106695489c19Sopenharmony_ci
106795489c19Sopenharmony_ci/**
106895489c19Sopenharmony_ci * @brief This enumeration declares the values of the major player type.
106995489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.1 Media player item - Major Player Type
107095489c19Sopenharmony_ci *
107195489c19Sopenharmony_ci * @since 6
107295489c19Sopenharmony_ci */
107395489c19Sopenharmony_cienum AvrcMediaMajorPlayerType : uint8_t {
107495489c19Sopenharmony_ci    AVRC_MEDIA_MAJOR_PLAYER_TYPE_AUDIO = 0x01,               // Audio.
107595489c19Sopenharmony_ci    AVRC_MEDIA_MAJOR_PLAYER_TYPE_VIDEO = 0x02,               // Video.
107695489c19Sopenharmony_ci    AVRC_MEDIA_MAJOR_PLAYER_TYPE_BROADCASTING_AUDIO = 0x04,  // Broadcasting Audio.
107795489c19Sopenharmony_ci    AVRC_MEDIA_MAJOR_PLAYER_TYPE_BROADCASTING_VIDEO = 0x08,  // Broadcasting Video.
107895489c19Sopenharmony_ci    AVRC_MEDIA_MAJOR_PLAYER_TYPE_RESERVED = 0x10             // Reserved for future use.
107995489c19Sopenharmony_ci};
108095489c19Sopenharmony_ci
108195489c19Sopenharmony_ci/**
108295489c19Sopenharmony_ci * @brief This enumeration declares the values of the major player type.
108395489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.1 Media player item - Player Sub Type
108495489c19Sopenharmony_ci *
108595489c19Sopenharmony_ci * @since 6
108695489c19Sopenharmony_ci */
108795489c19Sopenharmony_cienum AvrcMediaPlayerSubType : uint32_t {
108895489c19Sopenharmony_ci    AVRC_MEDIA_PLAYER_SUB_TYPE_AUDIO_BOOK = 0x00000001,  // Audio Book.
108995489c19Sopenharmony_ci    AVRC_MEDIA_PLAYER_SUB_TYPE_PODCAST = 0x00000002,     // Pod cast.
109095489c19Sopenharmony_ci    AVRC_MEDIA_PLAYER_SUB_TYPE_RESERVED = 0x00000004     // Reserved for future use.
109195489c19Sopenharmony_ci};
109295489c19Sopenharmony_ci
109395489c19Sopenharmony_ci/**
109495489c19Sopenharmony_ci * @brief This enumeration declares the values of character set.
109595489c19Sopenharmony_ci *
109695489c19Sopenharmony_ci * @since 6
109795489c19Sopenharmony_ci */
109895489c19Sopenharmony_cienum AvrcMediaCharacterSet : uint16_t {
109995489c19Sopenharmony_ci    AVRC_MEDIA_CHARACTER_SET_UTF8 = 0x006A,  // The value of UTF-8 as defined in IANA character set document.
110095489c19Sopenharmony_ci};
110195489c19Sopenharmony_ci
110295489c19Sopenharmony_ci/**
110395489c19Sopenharmony_ci * @brief This enumeration declares the values of the folder type.
110495489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.2 Folder item - Folder Type
110595489c19Sopenharmony_ci *
110695489c19Sopenharmony_ci * @since 6
110795489c19Sopenharmony_ci */
110895489c19Sopenharmony_cienum AvrcMediaFolderType : uint8_t {
110995489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_TYPE_MIXED = 0x00,  // Mixed.
111095489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_TYPE_TITLES,        // Titles.
111195489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_TYPE_ALBUMS,        // Albums.
111295489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_TYPE_ARTISTS,       // Artists.
111395489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_TYPE_GENRES,        // Genres.
111495489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_TYPE_PLAY_LISTS,    // Play lists.
111595489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_TYPE_YEARS,         // Years.
111695489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_TYPE_RESERVED,      // Reserved for future use.
111795489c19Sopenharmony_ci};
111895489c19Sopenharmony_ci
111995489c19Sopenharmony_ci/**
112095489c19Sopenharmony_ci * @brief This enumeration declares the values of the is playable.
112195489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.2 Folder item - Is Playable
112295489c19Sopenharmony_ci *
112395489c19Sopenharmony_ci * @since 6
112495489c19Sopenharmony_ci */
112595489c19Sopenharmony_cienum AvrcMediaFolderPlayable : uint8_t {
112695489c19Sopenharmony_ci    // The folder cannot be played. This means that the folder UID shall not be passed to either the PlayItem or
112795489c19Sopenharmony_ci    // AddToNowPlaying commands.
112895489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_PLAYABLE_NO = 0x00,
112995489c19Sopenharmony_ci    // The folder can be played. The folder UID may be passed to the PlayItem and AddToNowPlaying(if supported)
113095489c19Sopenharmony_ci    // commands. The media player behavior on playing a folder should be same as on the local user interface.
113195489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_PLAYABLE_YES,
113295489c19Sopenharmony_ci    AVRC_MEDIA_FOLDER_PLAYABLE_RESERVED,  // Reserved for future use.
113395489c19Sopenharmony_ci};
113495489c19Sopenharmony_ci
113595489c19Sopenharmony_ci/**
113695489c19Sopenharmony_ci * @brief This enumeration declares the values of the media type.
113795489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.3 Media element item - Media Type
113895489c19Sopenharmony_ci *
113995489c19Sopenharmony_ci * @since 6
114095489c19Sopenharmony_ci */
114195489c19Sopenharmony_cienum AvrcMediaElementType : uint8_t {
114295489c19Sopenharmony_ci    AVRC_MEDIA_ELEMENT_TYPE_AUDIO = 0x00,  // Audio.
114395489c19Sopenharmony_ci    AVRC_MEDIA_ELEMENT_TYPE_VIDEO,         // Video.
114495489c19Sopenharmony_ci    AVRC_MEDIA_ELEMENT_TYPE_RESERVED,      // Reserved for future use.
114595489c19Sopenharmony_ci};
114695489c19Sopenharmony_ci
114795489c19Sopenharmony_ci/**
114895489c19Sopenharmony_ci * @brief This enumeration declares the values of the media type.
114995489c19Sopenharmony_ci *
115095489c19Sopenharmony_ci * @details An Absolute Volume is represented in one octet. The top bit (bit 7) is reserved for future addition (RFA).
115195489c19Sopenharmony_ci * The volume is specified as a percentage of the maximum. The value 0x0 corresponds to 0%. The value 0x7F corresponds
115295489c19Sopenharmony_ci * to 100%. Scaling should be applied to achieve values between these two. The existence of this scale does not impose
115395489c19Sopenharmony_ci * any restriction on the granularity of the volume control scale on the TG.
115495489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 6.13.1 Absolute Volume
115595489c19Sopenharmony_ci *
115695489c19Sopenharmony_ci * @since 6
115795489c19Sopenharmony_ci */
115895489c19Sopenharmony_cienum AvrcAbsoluteVolume : uint8_t {
115995489c19Sopenharmony_ci    AVRC_ABSOLUTE_VOLUME_PERCENTAGE_0 = 0x00,    // 0%
116095489c19Sopenharmony_ci    AVRC_ABSOLUTE_VOLUME_PERCENTAGE_100 = 0x7F,  // 100%
116195489c19Sopenharmony_ci    AVRC_ABSOLUTE_VOLUME_INVALID = 0x80,
116295489c19Sopenharmony_ci};
116395489c19Sopenharmony_ci
116495489c19Sopenharmony_cienum DeviceAbsVolumeAbility {
116595489c19Sopenharmony_ci    DEVICE_ABSVOL_CLOSE = 0,
116695489c19Sopenharmony_ci    DEVICE_ABSVOL_OPEN = 1,
116795489c19Sopenharmony_ci    DEVICE_ABSVOL_UNSUPPORT = 2,
116895489c19Sopenharmony_ci    DEVICE_ABSVOL_BUTT
116995489c19Sopenharmony_ci};
117095489c19Sopenharmony_ci
117195489c19Sopenharmony_ci/**
117295489c19Sopenharmony_ci * @brief This enumeration declares the values of the "EVENT ID".
117395489c19Sopenharmony_ci * @see Audio/Video Remote Control 1.6.2 Section 28 Appendix H: list of defined notification events.
117495489c19Sopenharmony_ci *
117595489c19Sopenharmony_ci * @since 6
117695489c19Sopenharmony_ci */
117795489c19Sopenharmony_cienum AvrcEventId : uint8_t {
117895489c19Sopenharmony_ci    AVRC_EVENT_ID_PLAYBACK_STATUS_CHANGED = 0x01,  // Change in playback status of the current track.
117995489c19Sopenharmony_ci    AVRC_EVENT_ID_TRACK_CHANGED,                   // Change of current track.
118095489c19Sopenharmony_ci    AVRC_EVENT_ID_TRACK_REACHED_END,               // Reached end of a track.
118195489c19Sopenharmony_ci    AVRC_EVENT_ID_TRACK_REACHED_START,             // Reached start of a track.
118295489c19Sopenharmony_ci    // Change in playback position. Returned after the specified playback notification change notification interval.
118395489c19Sopenharmony_ci    AVRC_EVENT_ID_PLAYBACK_POS_CHANGED,
118495489c19Sopenharmony_ci    AVRC_EVENT_ID_BATT_STATUS_CHANGED,                 // Change in battery status.
118595489c19Sopenharmony_ci    AVRC_EVENT_ID_SYSTEM_STATUS_CHANGED,               // Change in system status.
118695489c19Sopenharmony_ci    AVRC_EVENT_ID_PLAYER_APPLICATION_SETTING_CHANGED,  // Change in player application setting.
118795489c19Sopenharmony_ci    AVRC_EVENT_ID_NOW_PLAYING_CONTENT_CHANGED,         // The content of the Now Playing list has changed.
118895489c19Sopenharmony_ci    AVRC_EVENT_ID_AVAILABLE_PLAYERS_CHANGED,           // The available players have changed
118995489c19Sopenharmony_ci    AVRC_EVENT_ID_ADDRESSED_PLAYER_CHANGED,            // The Addressed Player has been changed.
119095489c19Sopenharmony_ci    AVRC_EVENT_ID_UIDS_CHANGED,                        // The UIDs have changed.
119195489c19Sopenharmony_ci    AVRC_EVENT_ID_VOLUME_CHANGED,                      // The volume has been changed locally on the TG.
119295489c19Sopenharmony_ci    AVRC_EVENT_ID_RESERVED = 0x0E,
119395489c19Sopenharmony_ci};
119495489c19Sopenharmony_ci
119595489c19Sopenharmony_ci/**
119695489c19Sopenharmony_ci * @bUnique identifier to identify an element on TG
119795489c19Sopenharmony_ci *
119895489c19Sopenharmony_ci * @since 6
119995489c19Sopenharmony_ci */
120095489c19Sopenharmony_cienum AvrcElementIdentifier : uint64_t {
120195489c19Sopenharmony_ci    AVRC_ELEMENT_ATTRIBUTES_IDENTIFIER_PLAYING =
120295489c19Sopenharmony_ci        0x0000000000000000,  // attribute information for the element which is current track in the TG device.
120395489c19Sopenharmony_ci    AVRC_ELEMENT_ATTRIBUTES_IDENTIFIER_RESERVED =
120495489c19Sopenharmony_ci        0x0000000000000001,  // All other values other than 0x0 are currently reserved.
120595489c19Sopenharmony_ci};
120695489c19Sopenharmony_ci
120795489c19Sopenharmony_ci/**
120895489c19Sopenharmony_ci * @brief This enumeration declares the allowed values for GetCapabilities Command.
120995489c19Sopenharmony_ci *
121095489c19Sopenharmony_ci * @since 6
121195489c19Sopenharmony_ci */
121295489c19Sopenharmony_cienum AvrcCapabilityId : uint8_t {
121395489c19Sopenharmony_ci    AVRC_CAPABILITY_COMPANYID = 0x02,  // The list of CompanyID supported by TG.
121495489c19Sopenharmony_ci    AVRC_CAPABILITY_EVENTID = 0x03,    // EventIDs defined in this specification to be supported by TG.
121595489c19Sopenharmony_ci};
121695489c19Sopenharmony_ci
121795489c19Sopenharmony_ci/**
121895489c19Sopenharmony_ci * @brief This enumeration declares the values of playback interval in seconds.
121995489c19Sopenharmony_ci *
122095489c19Sopenharmony_ci * @since 6
122195489c19Sopenharmony_ci */
122295489c19Sopenharmony_cienum AvrcPlaybackInterval : uint8_t {
122395489c19Sopenharmony_ci    AVRC_PLAYBACK_INTERVAL_1_SEC = 0x01,
122495489c19Sopenharmony_ci    AVRC_PLAYBACK_INTERVAL_5_SEC = 0x05,
122595489c19Sopenharmony_ci    AVRC_PLAYBACK_INTERVAL_10_SEC = 0x0A,
122695489c19Sopenharmony_ci    AVRC_PLAYBACK_INTERVAL_15_SEC = 0x0F,
122795489c19Sopenharmony_ci    AVRC_PLAYBACK_INTERVAL_20_SEC = 0x14,
122895489c19Sopenharmony_ci    AVRC_PLAYBACK_INTERVAL_25_SEC = 0x19,
122995489c19Sopenharmony_ci    AVRC_PLAYBACK_INTERVAL_30_SEC = 0x1E,
123095489c19Sopenharmony_ci};
123195489c19Sopenharmony_ci
123295489c19Sopenharmony_ci/**
123395489c19Sopenharmony_ci * @brief This enumeration declares the error / status code of the vendor dependent command frame and the browsing
123495489c19Sopenharmony_ci * command frame.
123595489c19Sopenharmony_ci *
123695489c19Sopenharmony_ci * @since 6
123795489c19Sopenharmony_ci */
123895489c19Sopenharmony_cienum AvrcEsCode : uint8_t {
123995489c19Sopenharmony_ci    AVRC_ES_CODE_INVALID = 0xFF,  // Reserved.
124095489c19Sopenharmony_ci    // Invalid command, sent if TG received a PDU that it did not understand.
124195489c19Sopenharmony_ci    AVRC_ES_CODE_INVALID_COMMAND = 0x00,
124295489c19Sopenharmony_ci    // Invalid parameter, sent if the TG received a PDU with a parameter ID that it did not understand. This error code
124395489c19Sopenharmony_ci    // applies to the following identifiers :
124495489c19Sopenharmony_ci    // PDU ID.
124595489c19Sopenharmony_ci    // Capability ID.
124695489c19Sopenharmony_ci    // Event ID.
124795489c19Sopenharmony_ci    // Player Application Setting Attribute ID.
124895489c19Sopenharmony_ci    // Player Application Setting Value ID.
124995489c19Sopenharmony_ci    // Element Attribute ID.
125095489c19Sopenharmony_ci    AVRC_ES_CODE_INVALID_PARAMETER = 0x01,
125195489c19Sopenharmony_ci    // Parameter content error.Sent if the parameter ID is understood, but content is wrong or corrupted.
125295489c19Sopenharmony_ci    AVRC_ES_CODE_PARAMETER_CONTENT_ERROR = 0x02,
125395489c19Sopenharmony_ci    // Internal Error - sent if there are error conditions not covered by a more specific error code.
125495489c19Sopenharmony_ci    AVRC_ES_CODE_INTERNAL_ERROR = 0x03,
125595489c19Sopenharmony_ci    // Operation completed without error.This is the status that should be returned if the operation was successful.
125695489c19Sopenharmony_ci    AVRC_ES_CODE_NO_ERROR = 0x04,
125795489c19Sopenharmony_ci    // UID Changed - The UIDs on the device have changed.
125895489c19Sopenharmony_ci    AVRC_ES_CODE_UID_CHANGED = 0x05,
125995489c19Sopenharmony_ci    // Reserved.
126095489c19Sopenharmony_ci    AVRC_ES_CODE_RESERVED = 0x06,
126195489c19Sopenharmony_ci    // Invalid Direction - The Direction parameter is invalid.
126295489c19Sopenharmony_ci    AVRC_ES_CODE_INVALID_DIRECTION = 0x07,
126395489c19Sopenharmony_ci    // Not a Directory - The UID provided does not refer to a folder item.
126495489c19Sopenharmony_ci    AVRC_ES_CODE_NOT_A_DIRECTORY = 0x08,
126595489c19Sopenharmony_ci    // Does Not Exist - The UID provided does not refer to any currently valid item.
126695489c19Sopenharmony_ci    AVRC_ES_CODE_DOES_NOT_EXIST = 0x09,
126795489c19Sopenharmony_ci    // Invalid Scope - The scope parameter is invalid.
126895489c19Sopenharmony_ci    AVRC_ES_CODE_INVALID_SCOPE = 0x0A,
126995489c19Sopenharmony_ci    // Range Out of Bounds - The start of range provided is not valid.
127095489c19Sopenharmony_ci    AVRC_ES_CODE_RANGE_OUT_OF_BOUNDS = 0x0B,
127195489c19Sopenharmony_ci    // Folder Item is not playable - The UID provided refers to a folder item which cannot be handled by this media
127295489c19Sopenharmony_ci    // player.
127395489c19Sopenharmony_ci    AVRC_ES_CODE_FOLDER_ITEM_IS_NOT_PLAYABLE = 0x0C,
127495489c19Sopenharmony_ci    // Media in Use - The media is not able to be used for this operation at this time.
127595489c19Sopenharmony_ci    AVRC_ES_CODE_MEDIA_IN_USE = 0x0D,
127695489c19Sopenharmony_ci    // Now Playing List Full - No more items can be added to the Now Playing List.
127795489c19Sopenharmony_ci    AVRC_ES_CODE_NOW_PLAYING_LIST_FULL = 0x0E,
127895489c19Sopenharmony_ci    // Search Not Supported - The Browsed Media Player does not support search.
127995489c19Sopenharmony_ci    AVRC_ES_CODE_SEARCH_NOT_SUPPORTED = 0x0F,
128095489c19Sopenharmony_ci    // Search in Progress - A search operation is already in progress.
128195489c19Sopenharmony_ci    AVRC_ES_CODE_SEARCH_IN_PROGRESS = 0x10,
128295489c19Sopenharmony_ci    // Invalid Player Id - The specified Player Id does not refer to a valid player.
128395489c19Sopenharmony_ci    AVRC_ES_CODE_INVALID_PLAYER_ID = 0x11,
128495489c19Sopenharmony_ci    // Player Not Browsable - The Player Id supplied refers to a Media Player which does not support browsing.
128595489c19Sopenharmony_ci    AVRC_ES_CODE_PLAYER_NOT_BROWSABLE = 0x12,
128695489c19Sopenharmony_ci    // Player Not Addressed.The Player Id supplied refers to a player which is not currently addressed, and the command
128795489c19Sopenharmony_ci    // is not able to be performed if the player is not set as addressed.
128895489c19Sopenharmony_ci    AVRC_ES_CODE_PLAYER_NOT_ADDRESSED = 0x13,
128995489c19Sopenharmony_ci    // No valid Search Results - The Search result list does not contain valid entries, e.g.after being invalidated due
129095489c19Sopenharmony_ci    // to change of browsed player.
129195489c19Sopenharmony_ci    AVRC_ES_CODE_NO_VALID_SEARCH_RESULTS = 0x14,
129295489c19Sopenharmony_ci    // No available players.
129395489c19Sopenharmony_ci    AVRC_ES_CODE_NO_AVAILABLE_PLAYERS = 0x15,
129495489c19Sopenharmony_ci    // Addressed Player Changed.
129595489c19Sopenharmony_ci    AVRC_ES_CODE_ADDRESSED_PLAYER_CHANGED = 0x16,
129695489c19Sopenharmony_ci
129795489c19Sopenharmony_ci    // User custom error code.
129895489c19Sopenharmony_ci    AVRC_ES_CODE_NOTIFICATION_CHANGED = 0xFF,
129995489c19Sopenharmony_ci};
130095489c19Sopenharmony_ci
130195489c19Sopenharmony_ci/*********************************************
130295489c19Sopenharmony_ci *
130395489c19Sopenharmony_ci * HFP Definitions
130495489c19Sopenharmony_ci *
130595489c19Sopenharmony_ci *********************************************/
130695489c19Sopenharmony_ci/**
130795489c19Sopenharmony_ci * @brief sco connect state define
130895489c19Sopenharmony_ci * use to notify sco connection observers.
130995489c19Sopenharmony_ci */
131095489c19Sopenharmony_cienum class HfpScoConnectState : int { SCO_DISCONNECTED = 3, SCO_CONNECTING, SCO_DISCONNECTING, SCO_CONNECTED };
131195489c19Sopenharmony_ci
131295489c19Sopenharmony_ci/*********************************************
131395489c19Sopenharmony_ci *
131495489c19Sopenharmony_ci * A2DP Definitions
131595489c19Sopenharmony_ci *
131695489c19Sopenharmony_ci *********************************************/
131795489c19Sopenharmony_ci
131895489c19Sopenharmony_ci/**
131995489c19Sopenharmony_ci * @brief a2dp optional codec support state define
132095489c19Sopenharmony_ci *
132195489c19Sopenharmony_ci * @since 6
132295489c19Sopenharmony_ci */
132395489c19Sopenharmony_cienum A2DP_OPTIONAL_SUPPORT_STATE {
132495489c19Sopenharmony_ci    A2DP_OPTIONAL_NOT_SUPPORT,
132595489c19Sopenharmony_ci    A2DP_OPTIONAL_SUPPORT,
132695489c19Sopenharmony_ci    A2DP_OPTIONAL_SUPPORT_UNKNOWN,
132795489c19Sopenharmony_ci};
132895489c19Sopenharmony_ci
132995489c19Sopenharmony_ci/**
133095489c19Sopenharmony_ci * @brief a2dp optional codec enable state define
133195489c19Sopenharmony_ci *
133295489c19Sopenharmony_ci * @since 6
133395489c19Sopenharmony_ci */
133495489c19Sopenharmony_cienum A2DP_OPTIONAL_ENABLE_STATE { A2DP_OPTIONAL_DISABLE, A2DP_OPTIONAL_ENABLE, A2DP_OPTIONAL_ENABLE_UNKNOWN };
133595489c19Sopenharmony_ci
133695489c19Sopenharmony_ci/**
133795489c19Sopenharmony_ci * @brief a2dp playing state define
133895489c19Sopenharmony_ci *
133995489c19Sopenharmony_ci * @since 6
134095489c19Sopenharmony_ci */
134195489c19Sopenharmony_cienum A2DP_PLAYING_STATE { A2DP_NOT_PLAYING, A2DP_IS_PLAYING };
134295489c19Sopenharmony_ci
134395489c19Sopenharmony_ci/**
134495489c19Sopenharmony_ci * @brief A2dp codec type enum.
134595489c19Sopenharmony_ci *
134695489c19Sopenharmony_ci * @since 6
134795489c19Sopenharmony_ci
134895489c19Sopenharmony_ci */
134995489c19Sopenharmony_cienum A2dpUserCodecType : uint8_t {
135095489c19Sopenharmony_ci    A2DP_CODEC_TYPE_SBC_USER = 0,
135195489c19Sopenharmony_ci    A2DP_CODEC_TYPE_MPEG1_USER = 0x01,
135295489c19Sopenharmony_ci    A2DP_CODEC_TYPE_AAC_USER = 0x01 << 1,
135395489c19Sopenharmony_ci    A2DP_CODEC_TYPE_ATRAC_USER = 0x01 << 2,
135495489c19Sopenharmony_ci    A2DP_CODEC_TYPE_L2HCV2_USER = 0x0A,
135595489c19Sopenharmony_ci    A2DP_CODEC_TYPE_L2HCST_USER = 0x0B,
135695489c19Sopenharmony_ci    A2DP_CODEC_TYPE_LDAC_USER = 0x10,
135795489c19Sopenharmony_ci    A2DP_CODEC_TYPE_NONA2DP_USER = 0xFF
135895489c19Sopenharmony_ci};
135995489c19Sopenharmony_ci
136095489c19Sopenharmony_ci/**
136195489c19Sopenharmony_ci * @brief A2dp codec priority enum.
136295489c19Sopenharmony_ci *
136395489c19Sopenharmony_ci * @since 6
136495489c19Sopenharmony_ci */
136595489c19Sopenharmony_cienum A2dpUserCodecPriority : uint32_t {
136695489c19Sopenharmony_ci    A2DP_CODEC_PRIORITY_DISABLED_USER = 0,
136795489c19Sopenharmony_ci    A2DP_CODEC_PRIORITY_DEFAULT_USER,
136895489c19Sopenharmony_ci    A2DP_CODEC_PRIORITY_SBC_USER = 1001,
136995489c19Sopenharmony_ci    A2DP_CODEC_PRIORITY_AAC_USER = 2001,
137095489c19Sopenharmony_ci    A2DP_CODEC_PRIORITY_LDAC_USER = 5001,
137195489c19Sopenharmony_ci    A2DP_CODEC_PRIORITY_L2HCST_USER = 8000,
137295489c19Sopenharmony_ci    A2DP_CODEC_PRIORITY_L2HCV2_USER = 8001,
137395489c19Sopenharmony_ci    A2DP_CODEC_PRIORITY_HIGHEST_USER = 1000 * 1000,
137495489c19Sopenharmony_ci};
137595489c19Sopenharmony_ci
137695489c19Sopenharmony_ci/**
137795489c19Sopenharmony_ci * @brief A2dp codec sample rate enum.
137895489c19Sopenharmony_ci *
137995489c19Sopenharmony_ci * @since 6
138095489c19Sopenharmony_ci */
138195489c19Sopenharmony_cienum A2dpUserCodecSampleRate : uint32_t {
138295489c19Sopenharmony_ci    A2DP_SAMPLE_RATE_NONE_USER = 0x0,
138395489c19Sopenharmony_ci    A2DP_SBC_SAMPLE_RATE_48000_USER = 0x1 << 4, /* octet0 b4 */
138495489c19Sopenharmony_ci    A2DP_SBC_SAMPLE_RATE_44100_USER = 0x1 << 5, /* octet0 b5 */
138595489c19Sopenharmony_ci    A2DP_SBC_SAMPLE_RATE_32000_USER = 0x1 << 6, /* octet0 b6 */
138695489c19Sopenharmony_ci    A2DP_SBC_SAMPLE_RATE_16000_USER = 0x1 << 7, /* octet0 b7 */
138795489c19Sopenharmony_ci    A2DP_SBC_SAMPLE_RATE_MSK_USER = 0xF0,
138895489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET1_44100_USER = 0x01,
138995489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET1_32000_USER = 0x01 << 1,
139095489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET1_24000_USER = 0x01 << 2,
139195489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET1_22050_USER = 0x01 << 3,
139295489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET1_16000_USER = 0x01 << 4,
139395489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET1_12000_USER = 0x01 << 5,
139495489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET1_11025_USER = 0x01 << 6,
139595489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET1_8000_USER = 0x01 << 7,
139695489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET1_MSK_USER = 0xFF,
139795489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET2_96000_USER = 0x01 << 12,
139895489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET2_88200_USER = 0x01 << 13,
139995489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET2_64000_USER = 0x01 << 14,
140095489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET2_48000_USER = 0x01 << 15,
140195489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_RATE_OCTET2_MSK_USER = 0xF0,
140295489c19Sopenharmony_ci    A2DP_L2HCV2_SAMPLE_RATE_48000_USER = 0x01 << 1,
140395489c19Sopenharmony_ci    A2DP_L2HCV2_SAMPLE_RATE_96000_USER = 0x01 << 3,
140495489c19Sopenharmony_ci    A2DP_L2HCV2_SAMPLE_RATE_ALL_MSK_USER = 0x0A,
140595489c19Sopenharmony_ci};
140695489c19Sopenharmony_ci
140795489c19Sopenharmony_ci/**
140895489c19Sopenharmony_ci * @brief A2dp codec channel mode enum.
140995489c19Sopenharmony_ci *
141095489c19Sopenharmony_ci * @since 6
141195489c19Sopenharmony_ci */
141295489c19Sopenharmony_cienum A2dpUserCodecChannelMode : uint8_t {
141395489c19Sopenharmony_ci    A2DP_CHANNEL_MODE_NONE_USER = 0x0,
141495489c19Sopenharmony_ci    A2DP_SBC_CHANNEL_MODE_JOINT_STEREO_USER = 0x1, /* octet0 b0 */
141595489c19Sopenharmony_ci    A2DP_SBC_CHANNEL_MODE_STEREO_USER = 0x1 << 1,  /* octet0 b1 */
141695489c19Sopenharmony_ci    A2DP_SBC_CHANNEL_MODE_DUAL_USER = 0x1 << 2,    /* octet0 b2 */
141795489c19Sopenharmony_ci    A2DP_SBC_CHANNEL_MODE_MONO_USER = 0x1 << 3,    /* octet0 b3 */
141895489c19Sopenharmony_ci    A2DP_SBC_CHANNEL_MODE_MONO_STEREO_USER = 0x0A,
141995489c19Sopenharmony_ci    A2DP_SBC_CHANNEL_MODE_MSK_USER = 0x0F,
142095489c19Sopenharmony_ci    A2DP_AAC_CHANNEL_MODE_OCTET2_DOUBLE_USER = 0x01 << 2, /* octet2 b2 */
142195489c19Sopenharmony_ci    A2DP_AAC_CHANNEL_MODE_OCTET2_SINGLE_USER = 0x01 << 3, /* octet2 b3 */
142295489c19Sopenharmony_ci    A2DP_AAC_CHANNEL_MODE_OCTET2_MSK_USER = 0x0C,
142395489c19Sopenharmony_ci};
142495489c19Sopenharmony_ci
142595489c19Sopenharmony_ci/**
142695489c19Sopenharmony_ci * @brief A2dp codec bits per sample enum.
142795489c19Sopenharmony_ci *
142895489c19Sopenharmony_ci * @since 6
142995489c19Sopenharmony_ci */
143095489c19Sopenharmony_cienum A2dpUserCodecBitsPerSample : uint8_t {
143195489c19Sopenharmony_ci    A2DP_SAMPLE_BITS_NONE_USER = 0x0,
143295489c19Sopenharmony_ci    A2DP_SAMPLE_BITS_16_USER = 0x1 << 0,
143395489c19Sopenharmony_ci    A2DP_SAMPLE_BITS_24_USER = 0x1 << 1,
143495489c19Sopenharmony_ci    A2DP_SAMPLE_BITS_32_USER = 0x1 << 2,
143595489c19Sopenharmony_ci    A2DP_SAMPLE_BITS_MSK_USER = 0x06,
143695489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET3_BIT0_USER = 0x01,      /* octet3 b0 */
143795489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET3_BIT1_USER = 0x01 << 1, /* octet3 b1 */
143895489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET3_BIT2_USER = 0x01 << 2, /* octet3 b2 */
143995489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET3_BIT3_USER = 0x01 << 3, /* octet3 b3 */
144095489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET3_BIT4_USER = 0x01 << 4, /* octet3 b4 */
144195489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET3_BIT5_USER = 0x01 << 5, /* octet3 b5 */
144295489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET3_BIT6_USER = 0x01 << 6, /* octet3 b6 */
144395489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET4_BIT0_USER = 0x01,      /* octet4 b0 */
144495489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET4_BIT1_USER = 0x01 << 1, /* octet4 b1 */
144595489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET4_BIT2_USER = 0x01 << 2, /* octet4 b2 */
144695489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET4_BIT3_USER = 0x01 << 3, /* octet4 b3 */
144795489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET4_BIT4_USER = 0x01 << 4, /* octet4 b4 */
144895489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET4_BIT5_USER = 0x01 << 5, /* octet4 b5 */
144995489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET4_BIT6_USER = 0x01 << 6, /* octet4 b6 */
145095489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET4_BIT7_USER = 0x01 << 7, /* octet4 b6 */
145195489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET5_BIT0_USER = 0x01,      /* octet5 b0 */
145295489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET5_BIT1_USER = 0x01 << 1, /* octet5 b1 */
145395489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET5_BIT2_USER = 0x01 << 2, /* octet5 b2 */
145495489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET5_BIT3_USER = 0x01 << 3, /* octet5 b3 */
145595489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET5_BIT4_USER = 0x01 << 4, /* octet5 b4 */
145695489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET5_BIT5_USER = 0x01 << 5, /* octet5 b5 */
145795489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET5_BIT6_USER = 0x01 << 6, /* octet5 b6 */
145895489c19Sopenharmony_ci    A2DP_AAC_SAMPLE_BITS_OCTET5_BIT7_USER = 0x01 << 7, /* octet5 b6 */
145995489c19Sopenharmony_ci};
146095489c19Sopenharmony_ci
146195489c19Sopenharmony_ci/**
146295489c19Sopenharmony_ci * @brief Pbap action Type.
146395489c19Sopenharmony_ci *
146495489c19Sopenharmony_ci * @since 6
146595489c19Sopenharmony_ci */
146695489c19Sopenharmony_cienum PbapActionType : uint16_t {
146795489c19Sopenharmony_ci    PBAP_ACTION_PULLPHONEBOOKSIZE,     // pull phonebooksize
146895489c19Sopenharmony_ci    PBAP_ACTION_PULLPHONEBOOK,         // pull phonebook
146995489c19Sopenharmony_ci    PBAP_ACTION_SETPHONEBOOK,          // set  phonebook
147095489c19Sopenharmony_ci    PBAP_ACTION_PULLVCARDLISTINGSIZE,  // pull vcard listing size
147195489c19Sopenharmony_ci    PBAP_ACTION_PULLVCARDLISTING,      // pull vcard listing
147295489c19Sopenharmony_ci    PBAP_ACTION_PULLVCARDENTRY,        // pull vcard entry
147395489c19Sopenharmony_ci    PBAP_ACTION_ABORT,                 // abort downloading
147495489c19Sopenharmony_ci};
147595489c19Sopenharmony_ci
147695489c19Sopenharmony_ci// PBAP_PHONEBOOK_NAME
147795489c19Sopenharmony_ci#define PBAP_PHONEBOOK_PB u"/telecom/pb.vcf"
147895489c19Sopenharmony_ci#define PBAP_PHONEBOOK_ICH u"/telecom/ich.vcf"
147995489c19Sopenharmony_ci#define PBAP_PHONEBOOK_OCH u"/telecom/och.vcf"
148095489c19Sopenharmony_ci#define PBAP_PHONEBOOK_MCH u"/telecom/mch.vcf"
148195489c19Sopenharmony_ci#define PBAP_PHONEBOOK_CCH u"/telecom/cch.vcf"
148295489c19Sopenharmony_ci#define PBAP_PHONEBOOK_SPD u"/telecom/spd.vcf"
148395489c19Sopenharmony_ci#define PBAP_PHONEBOOK_FAV u"/telecom/fav.vcf"
148495489c19Sopenharmony_ci#define PBAP_PHONEBOOK_PB1 u"/SIM1/telecom/pb.vcf"
148595489c19Sopenharmony_ci#define PBAP_PHONEBOOK_ICH1 u"/SIM1/telecom/ich.vcf"
148695489c19Sopenharmony_ci#define PBAP_PHONEBOOK_OCH1 u"/SIM1/telecom/och.vcf"
148795489c19Sopenharmony_ci#define PBAP_PHONEBOOK_MCH1 u"/SIM1/telecom/mch.vcf"
148895489c19Sopenharmony_ci#define PBAP_PHONEBOOK_CCH1 u"/SIM1/telecom/cch.vcf"
148995489c19Sopenharmony_ci
149095489c19Sopenharmony_cienum PbapOrderType : uint8_t {
149195489c19Sopenharmony_ci    PBAP_ORDER_INDEXED = 0x00,       // indexed order
149295489c19Sopenharmony_ci    PBAP_ORDER_ALPHANUMERIC = 0x01,  // alphabetical order
149395489c19Sopenharmony_ci    PBAP_ORDER_PHONETIC = 0x02,      // phonetic order
149495489c19Sopenharmony_ci};
149595489c19Sopenharmony_ci
149695489c19Sopenharmony_cienum PbapFormatType : uint8_t {
149795489c19Sopenharmony_ci    PBAP_FORMAT_VCARD2_1 = 0x00,  // vCard Version
149895489c19Sopenharmony_ci    PBAP_FORMAT_VCARD3_0 = 0x01,  // vCard Version
149995489c19Sopenharmony_ci};
150095489c19Sopenharmony_ci
150195489c19Sopenharmony_ci// 5.1.4.1 PropertySelector {PropertyMask (64-bit value)}
150295489c19Sopenharmony_ci#define PBAP_PROPERTY_VERSION (1ULL << 0)                // vCard Version
150395489c19Sopenharmony_ci#define PBAP_PROPERTY_FN (1ULL << 1)                     // Formatted Name
150495489c19Sopenharmony_ci#define PBAP_PROPERTY_N (1ULL << 2)                      // Structured Presentation of Name
150595489c19Sopenharmony_ci#define PBAP_PROPERTY_PHOTO (1ULL << 3)                  // Associated Image or Photo
150695489c19Sopenharmony_ci#define PBAP_PROPERTY_BDAY (1ULL << 4)                   // Birthday
150795489c19Sopenharmony_ci#define PBAP_PROPERTY_ADR (1ULL << 5)                    // Delivery Address
150895489c19Sopenharmony_ci#define PBAP_PROPERTY_LABEL (1ULL << 6)                  // Delivery
150995489c19Sopenharmony_ci#define PBAP_PROPERTY_TEL (1ULL << 7)                    // Telephone Number
151095489c19Sopenharmony_ci#define PBAP_PROPERTY_EMAIL (1ULL << 8)                  // Electronic Mail Address
151195489c19Sopenharmony_ci#define PBAP_PROPERTY_MAILER (1ULL << 9)                 // Electronic Mail
151295489c19Sopenharmony_ci#define PBAP_PROPERTY_TZ (1ULL << 10)                    // Time Zone
151395489c19Sopenharmony_ci#define PBAP_PROPERTY_GEO (1ULL << 11)                   // Geographic Position
151495489c19Sopenharmony_ci#define PBAP_PROPERTY_TITLE (1ULL << 12)                 // Job
151595489c19Sopenharmony_ci#define PBAP_PROPERTY_ROLE (1ULL << 13)                  // Role within the Organization
151695489c19Sopenharmony_ci#define PBAP_PROPERTY_LOGO (1ULL << 14)                  // Organization Logo
151795489c19Sopenharmony_ci#define PBAP_PROPERTY_AGENT (1ULL << 15)                 // vCard of Person Representing
151895489c19Sopenharmony_ci#define PBAP_PROPERTY_ORG (1ULL << 16)                   // Name of Organization
151995489c19Sopenharmony_ci#define PBAP_PROPERTY_NOTE (1ULL << 17)                  // Comments
152095489c19Sopenharmony_ci#define PBAP_PROPERTY_REV (1ULL << 18)                   // Revision
152195489c19Sopenharmony_ci#define PBAP_PROPERTY_SOUND (1ULL << 19)                 // Pronunciation of Name
152295489c19Sopenharmony_ci#define PBAP_PROPERTY_URL (1ULL << 20)                   // Uniform Resource Locator
152395489c19Sopenharmony_ci#define PBAP_PROPERTY_UID (1ULL << 21)                   // Unique ID
152495489c19Sopenharmony_ci#define PBAP_PROPERTY_KEY (1ULL << 22)                   // Public Encryption Key
152595489c19Sopenharmony_ci#define PBAP_PROPERTY_NICKNAME (1ULL << 23)              // Nickname
152695489c19Sopenharmony_ci#define PBAP_PROPERTY_CATEGORIES (1ULL << 24)            // Categories
152795489c19Sopenharmony_ci#define PBAP_PROPERTY_PROID (1ULL << 25)                 // Product ID
152895489c19Sopenharmony_ci#define PBAP_PROPERTY_CLASS (1ULL << 26)                 // Class information
152995489c19Sopenharmony_ci#define PBAP_PROPERTY_SORT_STRING (1ULL << 27)           // String used for sorting operations
153095489c19Sopenharmony_ci#define PBAP_PROPERTY_X_IRMC_CALL_DATETIME (1ULL << 28)  // Time stamp
153195489c19Sopenharmony_ci#define PBAP_PROPERTY_X_BT_SPEEDDIALKEY (1ULL << 29)     // Speed-dial shortcut
153295489c19Sopenharmony_ci#define PBAP_PROPERTY_X_BT_UCI (1ULL << 30)              // Uniform Caller Identifier
153395489c19Sopenharmony_ci#define PBAP_PROPERTY_X_BT_UID (1ULL << 31)              // Bluetooth Contact Unique Identifier
153495489c19Sopenharmony_ci#define PBAP_PROPERTY_PROPRIENTARY_FILTER (1ULL << 39)   // Bluetooth Proprientary
153595489c19Sopenharmony_ci
153695489c19Sopenharmony_cienum PbapSelectorOperatorType : uint8_t {
153795489c19Sopenharmony_ci    PBAP_SELECTOR_OPERATOR_OR = 0x00,   // SelectorOperator Or
153895489c19Sopenharmony_ci    PBAP_SELECTOR_OPERATOR_AND = 0x01,  // SelectorOperator And
153995489c19Sopenharmony_ci};
154095489c19Sopenharmony_ci
154195489c19Sopenharmony_cienum PbapSearchPropertyType : uint8_t {
154295489c19Sopenharmony_ci    PBAP_SEARCH_PROPERTY_NAME = 0x00,    // name
154395489c19Sopenharmony_ci    PBAP_SEARCH_PROPERTY_NUMBER = 0x01,  // number
154495489c19Sopenharmony_ci    PBAP_SEARCH_PROPERTY_SOUND = 0x02,   // sound
154595489c19Sopenharmony_ci};
154695489c19Sopenharmony_ci
154795489c19Sopenharmony_ciconst uint8_t PBAP_FLAG_GO_TO_ROOT = 0x02;  // go back to root
154895489c19Sopenharmony_ciconst uint8_t PBAP_FLAG_GO_DOWN = 0x02;     // go down
154995489c19Sopenharmony_ciconst uint8_t PBAP_FLAG_GO_UP = 0x03;       // go up
155095489c19Sopenharmony_ci
155195489c19Sopenharmony_ciconstexpr const int32_t VIRTUAL_DEVICE_ADD = 0; // add virtual device
155295489c19Sopenharmony_ciconstexpr const int32_t VIRTUAL_DEVICE_REMOVE = 1; // delete virtual device
155395489c19Sopenharmony_ci
155495489c19Sopenharmony_cienum PbapResponseCode : uint8_t {
155595489c19Sopenharmony_ci    PBAP_CONTINUE = 0x90,                    // 100 Continue
155695489c19Sopenharmony_ci    PBAP_SUCCESS = 0xA0,                     // 200 OK, Success
155795489c19Sopenharmony_ci    PBAP_CREATED = 0xA1,                     // 201 Created
155895489c19Sopenharmony_ci    PBAP_PBAP_ACCEPTED = 0xA2,               // 202 Accepted
155995489c19Sopenharmony_ci    PBAP_NON_AUTH = 0xA3,                    // 203 Non-Authoritative Information
156095489c19Sopenharmony_ci    PBAP_NO_CONTENT = 0xA4,                  // 204 No Content
156195489c19Sopenharmony_ci    PBAP_RESET_CONTENT = 0xA5,               // 205 Reset Content
156295489c19Sopenharmony_ci    PBAP_PARTIAL_CONTENT = 0xA6,             // 206 Partial Content
156395489c19Sopenharmony_ci    PBAP_MULTIPLE_CHOICES = 0xB0,            // 300 Multiple Choices
156495489c19Sopenharmony_ci    PBAP_MOVED_PERMANENTLY = 0xB1,           // 301 Moved Permanently
156595489c19Sopenharmony_ci    PBAP_MOVED_TEMPORARILY = 0xB2,           // 302 Moved temporarily
156695489c19Sopenharmony_ci    PBAP_SEE_OTHER = 0xB3,                   // 303 See Other
156795489c19Sopenharmony_ci    PBAP_NOT_MODIFIED = 0xB4,                // 304 Not modified
156895489c19Sopenharmony_ci    PBAP_USE_PROXY = 0xB5,                   // 305 Use Proxy
156995489c19Sopenharmony_ci    PBAP_BAD_REQUEST = 0xC0,                 // 400 Bad Request - server couldn’t understand request
157095489c19Sopenharmony_ci    PBAP_UNAUTHORIZED = 0xC1,                // 401 Unauthorized
157195489c19Sopenharmony_ci    PBAP_PAYMENT_REQUIRED = 0xC2,            // 402 Payment required
157295489c19Sopenharmony_ci    PBAP_FORBIDDEN = 0xC3,                   // 403 Forbidden - operation is understood but refused
157395489c19Sopenharmony_ci    PBAP_NOT_FOUND = 0xC4,                   // 404 Not Found
157495489c19Sopenharmony_ci    PBAP_METHOD_NOT_ALLOWED = 0xC5,          // 405 Method not allowed
157595489c19Sopenharmony_ci    PBAP_NOT_ACCEPTABLE = 0xC6,              // 406 Not Acceptable
157695489c19Sopenharmony_ci    PBAP_PROXY_AUTH_REQUIRED = 0xC7,         // 407 Proxy Authentication required
157795489c19Sopenharmony_ci    PBAP_REQUEST_TIME_OUT = 0xC8,            // 408 Request Time Out
157895489c19Sopenharmony_ci    PBAP_CONFLICT = 0xC9,                    // 409 Conflict
157995489c19Sopenharmony_ci    PBAP_GONE = 0xCA,                        // 410 Gone
158095489c19Sopenharmony_ci    PBAP_LENGTH_REQUIRED = 0xCB,             // 411 Length Required
158195489c19Sopenharmony_ci    PBAP_PRECONDITION_FAILED = 0xCC,         // 412 Precondition failed
158295489c19Sopenharmony_ci    PBAP_REQUESTED_ENTITY_TOO_LARGE = 0xCD,  // 413 Requested entity too large
158395489c19Sopenharmony_ci    PBAP_REQUEST_URL_TOO_LARGE = 0xCE,       // 414 Request URL too large
158495489c19Sopenharmony_ci    PBAP_UNSUPPORTED_MEDIA_TYPE = 0xCF,      // 415 Unsupported media type
158595489c19Sopenharmony_ci    PBAP_INTERNAL_SERVER_ERROR = 0xD0,       // 500 Internal Server Error
158695489c19Sopenharmony_ci    PBAP_NOT_IMPLEMENTED = 0xD1,             // 501 Not Implemented
158795489c19Sopenharmony_ci    PBAP_BAD_GATEWAY = 0xD2,                 // 502 Bad Gateway
158895489c19Sopenharmony_ci    PBAP_SERVICE_UNAVAILABLE = 0xD3,         // 503 Service Unavailable
158995489c19Sopenharmony_ci    PBAP_GATEWAY_TIMEOUT = 0xD4,             // 504 Gateway Timeout
159095489c19Sopenharmony_ci    PBAP_HTTP_VERSION_NOT_SUPPORTED = 0xD5,  // 505 HTTP version not supported
159195489c19Sopenharmony_ci    PBAP_DATABASE_FULL = 0xE0,               // Database Full
159295489c19Sopenharmony_ci    PBAP_DATABASE_LOCKED = 0xE1              // Database Locked
159395489c19Sopenharmony_ci};
159495489c19Sopenharmony_ci
159595489c19Sopenharmony_cistruct CocUpdateSocketParam {
159695489c19Sopenharmony_ci    std::string addr;
159795489c19Sopenharmony_ci    int32_t minInterval;
159895489c19Sopenharmony_ci    int32_t maxInterval;
159995489c19Sopenharmony_ci    int32_t peripheralLatency;
160095489c19Sopenharmony_ci    int32_t supervisionTimeout;
160195489c19Sopenharmony_ci    int32_t minConnEventLen;
160295489c19Sopenharmony_ci    int32_t maxConnEventLen;
160395489c19Sopenharmony_ci};
160495489c19Sopenharmony_ci
160595489c19Sopenharmony_cienum UpdateOutputStackAction {
160695489c19Sopenharmony_ci    ACTION_WEAR = 0,
160795489c19Sopenharmony_ci    ACTION_UNWEAR = 1,
160895489c19Sopenharmony_ci    ACTION_ENABLE_FROM_REMOTE = 2,
160995489c19Sopenharmony_ci    ACTION_DISABLE_FROM_REMOTE = 3,
161095489c19Sopenharmony_ci    ACTION_ENABLE_WEAR_DETECTION = 4,
161195489c19Sopenharmony_ci    ACTION_DISABLE_WEAR_DETECTION = 5,
161295489c19Sopenharmony_ci    ACTION_USER_OPERATION = 6,
161395489c19Sopenharmony_ci    ACTION_STOP_VIRTUAL_CALL = 7,
161495489c19Sopenharmony_ci};
161595489c19Sopenharmony_ci
161695489c19Sopenharmony_cienum HfpAgScoStateChangeReason {
161795489c19Sopenharmony_ci    HFP_AG_SCO_INVALID = 0,
161895489c19Sopenharmony_ci    HFP_AG_SCO_LOCAL_USER_TERMINATED = 1,
161995489c19Sopenharmony_ci    HFP_AG_SCO_REMOTE_USER_TERMINATED = 2,
162095489c19Sopenharmony_ci    HFP_AG_SCO_LOCAL_USER_SET_UP = 3,
162195489c19Sopenharmony_ci    HFP_AG_SCO_REMOTE_USER_SET_UP = 4,
162295489c19Sopenharmony_ci};
162395489c19Sopenharmony_ci
162495489c19Sopenharmony_cienum DeviceType {
162595489c19Sopenharmony_ci    DEVICE_TYPE_DEFAULT = 0,
162695489c19Sopenharmony_ci    DEVICE_TYPE_CAR = 1,
162795489c19Sopenharmony_ci    DEVICE_TYPE_HEADSET = 2,
162895489c19Sopenharmony_ci    DEVICE_TYPE_HEARING = 3,
162995489c19Sopenharmony_ci    DEVICE_TYPE_GLASSES = 4,
163095489c19Sopenharmony_ci    DEVICE_TYPE_WATCH = 5,
163195489c19Sopenharmony_ci    DEVICE_TYPE_SPEAKER = 6,
163295489c19Sopenharmony_ci    DEVICE_TYPE_OTHERS = 7,
163395489c19Sopenharmony_ci};
163495489c19Sopenharmony_ci
163595489c19Sopenharmony_cienum DeviceInfoType {
163695489c19Sopenharmony_ci    DEVICE_INFO_UNKNOWN = -1,
163795489c19Sopenharmony_ci    DEVICE_VENDOR_ID = 0,
163895489c19Sopenharmony_ci    DEVICE_PRODUCT_ID = 1,
163995489c19Sopenharmony_ci    DEVICE_MODEL_ID = 2,
164095489c19Sopenharmony_ci    DEVICE_CUSTOM_TYPE = 3
164195489c19Sopenharmony_ci};
164295489c19Sopenharmony_ci
164395489c19Sopenharmony_cienum BluetoothSensingEventId : uint8_t {
164495489c19Sopenharmony_ci    INVALID_SENSING_EVENT = 0x00,
164595489c19Sopenharmony_ci    SPP_CLIENT_CONNECT_DONE = 0x01,
164695489c19Sopenharmony_ci    SPP_SERVER_CONNECT_DONE = 0x02,
164795489c19Sopenharmony_ci    SPP_PORT_CLOSE = 0x03,
164895489c19Sopenharmony_ci    SPP_SERVER_CLOSE = 0x04,
164995489c19Sopenharmony_ci    SPP_SERVER_LISTEN_DONE = 0x05,
165095489c19Sopenharmony_ci    GATT_SERVER_REGISTER_DONE = 0x10,
165195489c19Sopenharmony_ci    GATT_SERVER_UNREGISTER_DONE = 0x11,
165295489c19Sopenharmony_ci    GATT_CLIENT_CONNECT_DONE = 0x012,
165395489c19Sopenharmony_ci    GATT_CLIENT_CONNECT_CLOSE = 0x13,
165495489c19Sopenharmony_ci    GATT_SERVER_CONNECT_DONE = 0x14,
165595489c19Sopenharmony_ci    GATT_SERVER_CONNECT_CLOSE = 0x15,
165695489c19Sopenharmony_ci    SOCKET_REGISTER_APPLICATION_PKGNAME = 0x20,
165795489c19Sopenharmony_ci    GATT_REGISTER_APPLICATION_PKGNAME = 0x21,
165895489c19Sopenharmony_ci    BLE_CONN_INTERVAL_UPDATE = 0X30,
165995489c19Sopenharmony_ci};
166095489c19Sopenharmony_ci
166195489c19Sopenharmony_cienum BluetoothDecisionEventId : uint8_t {
166295489c19Sopenharmony_ci    INVALID_DECISION_EVENT = 0x00,
166395489c19Sopenharmony_ci    BLE_FASTEST_CONN_DECISION = 0x01,
166495489c19Sopenharmony_ci};
166595489c19Sopenharmony_ci
166695489c19Sopenharmony_cienum BluetoothResourceDecisionResult {
166795489c19Sopenharmony_ci    CONNECTION_REJECT = 0x00,
166895489c19Sopenharmony_ci    CONNECTION_ACCEPT,
166995489c19Sopenharmony_ci    CONNECTION_ACCEPT_WITH_PARAM_ADJUST,
167095489c19Sopenharmony_ci    CONNECTION_PREEMPTION,
167195489c19Sopenharmony_ci};
167295489c19Sopenharmony_ci
167395489c19Sopenharmony_cienum BluetoothSwitchState {
167495489c19Sopenharmony_ci    STATE_ON,
167595489c19Sopenharmony_ci    STATE_OFF,
167695489c19Sopenharmony_ci    STATE_HALF,
167795489c19Sopenharmony_ci};
167895489c19Sopenharmony_ci
167995489c19Sopenharmony_ci#ifdef BLUETOOTH_EXPORT
168095489c19Sopenharmony_ci#define BLUETOOTH_API __attribute__((visibility("default")))
168195489c19Sopenharmony_ci#else
168295489c19Sopenharmony_ci#define BLUETOOTH_API
168395489c19Sopenharmony_ci#endif
168495489c19Sopenharmony_ci}  // namespace bluetooth
168595489c19Sopenharmony_ci}  // namespace OHOS
168695489c19Sopenharmony_ci#endif  // BT_DEF_H
1687