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