* Copyright (C) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef BT_DEF_H
#define BT_DEF_H
#include <chrono>
#include <string>
#include <vector>
namespace OHOS {
namespace bluetooth {
*
* Interface Return Value Macro Define
*
*********************************************/
constexpr int RET_NO_ERROR = 0;
constexpr int RET_NO_SUPPORT = -1;
constexpr int RET_BAD_PARAM = -2;
constexpr int RET_BAD_STATUS = -3;
constexpr int RET_NO_SPACE = -4;
constexpr int RET_REACH_MAX = -5;
*
* Bluetooth UUID Macro Define
*
*********************************************/
constexpr const char *BLUETOOTH_UUID_BASE_UUID = "00000000-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_A2DP_SINK = "0000110B-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_A2DP_SRC = "0000110A-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_GATT = "00001801-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_AVRCP_CT = "0000110E-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_AVRCP_TG = "0000110C-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_HFP_AG = "0000111F-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_HFP_HF = "0000111E-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_PBAP_PCE = "0000112E-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_PBAP_PSE = "0000112F-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_SPP = "00001101-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_PNP = "00001200-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_HID_HOST = "00001124-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_PAN = "00001116-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_OPP = "00001105-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_HSP_AG = "00001112-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_HSP_HS = "00001108-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_HOGP = "00001812-0000-1000-8000-00805F9B34FB";
constexpr const char *ADV_AUDIO_DIST = "0000110D-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_HEARING_AID = "0000FDF0-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_HID_DEVICE = "00001812-0000-1000-8000-00805F9B34FB";
constexpr const char *BLUETOOTH_UUID_BAS = "0000180F-0000-1000-8000-00805F9B34FB";
*
* Adapter Macro Define
*
*********************************************/
* @brief bt transport define
* use to GetRemoteDevice(),GetPairedDevices()...
*/
enum BTTransport {
ADAPTER_BREDR = 0,
ADAPTER_BLE,
};
* @brief bt adapter/profile state define
* use to GetBtConnectionState(),GetBtProfileConnState(),...
*/
enum BTStateID {
STATE_TURNING_ON,
STATE_TURN_ON,
STATE_TURNING_OFF,
STATE_TURN_OFF,
};
* @brief bluetooth state define
* use to GetBluetoothState()
*
* @since 14
*/
enum class BluetoothState {
STATE_OFF = 0,
STATE_TURNING_ON = 1,
STATE_ON = 2,
STATE_TURNING_OFF = 3,
STATE_BLE_TURNING_ON = 4,
STATE_BLE_ON = 5,
STATE_BLE_TURNING_OFF = 6
};
* @brief connect state define
* use to ConnectionState()...
*/
enum class BTConnectState : int {
CONNECTING,
CONNECTED,
DISCONNECTING,
DISCONNECTED,
};
* @brief reason for gatt disconnection
* use to OnConnectionStateChanged()
*
* @since 20
*/
enum class GattDisconnectReason : int {
CONN_TIMEOUT = 1,
CONN_TERMINATE_PEER_USER = 2,
CONN_TERMINATE_LOCAL_HOST = 3,
CONN_UNKNOWN = 4
};
constexpr const char *GATT_DIS_MSG_EMPTY = "";
constexpr const char *GATT_DIS_MSG_NO_ERROR = "NO_ERROR";
constexpr const char *GATT_DIS_MSG_L2C_FAILURE = "L2C_FAILURE";
constexpr const char *GATT_DIS_MSG_0X08_CONN_TIMEOUT = "0X08_CONN_TIMEOUT";
constexpr const char *GATT_DIS_MSG_0X13_PEER_USER = "0X13_PEER_USER";
constexpr const char *GATT_DIS_MSG_0X16_LOCAL_HOST = "0X16_LOCAL_HOST";
constexpr const char *GATT_DIS_MSG_0X22_LMP_TIMEOUT = "0X22_LMP_TIMEOUT";
constexpr const char *GATT_DIS_MSG_NO_CONNECTED = "NO_CONNECTED";
constexpr const char *GATT_DIS_MSG_NO_CONN_TO_CANCEL = "NO_CONN_TO_CANCEL";
constexpr const char *GATT_DIS_MSG_CONNECT_FAIL = "CONNECT_FAIL";
constexpr const char *GATT_DIS_MSG_CONN_UNKNOWN = "CONN_UNKNOWN";
struct GattDisconnectParam {
int disconnectReason_ = -1;
std::string reasonMessage_ = "";
GattDisconnectParam() : disconnectReason_(-1), reasonMessage_("") {}
GattDisconnectParam(int disconnectReason, std::string reasonMessage)
: disconnectReason_(disconnectReason), reasonMessage_(reasonMessage) {}
};
* @brief The profile in the BLE protocol.
*
* @since 21
*/
enum class BleProfile : int {
GATT = 1,
GATT_CLIENT = 2,
GATT_SERVER = 3
};
* @brief hdap connect state define
* use to HdapConnectionState()...
*/
enum class BTHdapConnectState : int {
CONNECTED,
DISCONNECTED,
UPDATE_CODEC,
};
enum class ConnChangeCause : int {
CONNECT_CHANGE_COMMON_CAUSE = 0,
DISCONNECT_CAUSE_USER_DISCONNECT = 0,
DISCONNECT_CAUSE_CONNECT_FROM_KEYBOARD = 1,
DISCONNECT_CAUSE_CONNECT_FROM_MOUSE = 2,
DISCONNECT_CAUSE_CONNECT_FROM_CAR = 3,
DISCONNECT_TOO_MANY_CONNECTED_DEVICES = 4,
DISCONNECT_CAUSE_CONNECT_FAIL_INTERNAL = 5,
CONNECT_FROM_LOCAL = 1001,
};
* @brief access permission define
* use to
* Get/SetPhonebookPermission(),Get/SetMessagePermission()
*/
enum class BTPermissionType : int {
ACCESS_UNKNOWN,
ACCESS_ALLOWED,
ACCESS_FORBIDDEN,
};
* @brief connection strategy define
* use to
* SetConnectionStrategy(),GetConnectionStrategy()
*/
enum class BTStrategyType : int {
CONNECTION_UNKNOWN,
CONNECTION_ALLOWED,
CONNECTION_FORBIDDEN,
};
* @brief the type of the call
* use to
* ConnectSco(),DisconnectSco()
*/
enum class BTCallType : uint8_t {
CALL_TYPE_CELLULAR = 0,
CALL_TYPE_VIRTUAL = 1,
CALL_TYPE_RECOGNITION = 2,
};
* @brief profile id define
* use to
* GetBtProfileConnState(),GetProfileList()
*/
const uint32_t PROFILE_ID_GATT_CLIENT = 0x00000001;
const uint32_t PROFILE_ID_GATT_SERVER = 0x00000002;
const uint32_t PROFILE_ID_A2DP_SRC = 0x00000004;
const uint32_t PROFILE_ID_A2DP_SINK = 0x00000008;
const uint32_t PROFILE_ID_AVRCP_CT = 0x00000010;
const uint32_t PROFILE_ID_AVRCP_TG = 0x00000020;
const uint32_t PROFILE_ID_HFP_AG = 0x00000040;
const uint32_t PROFILE_ID_HFP_HF = 0x00000080;
const uint32_t PROFILE_ID_MAP_MCE = 0x00000100;
const uint32_t PROFILE_ID_MAP_MSE = 0x00000200;
const uint32_t PROFILE_ID_PBAP_PCE = 0x00000400;
const uint32_t PROFILE_ID_PBAP_PSE = 0x00000800;
const uint32_t PROFILE_ID_SPP = 0x00001000;
const uint32_t PROFILE_ID_DI = 0x00002000;
const uint32_t PROFILE_ID_BLE_ADVERTISER = 0x00004000;
const uint32_t PROFILE_ID_BLE_CENTRAL_MANAGER_SERVER = 0x00008000;
const uint32_t PROFILE_ID_BLE_GATT_MANAGER = 0x00010000;
const uint32_t PROFILE_ID_HID_HOST = 0x00020000;
const uint32_t PROFILE_ID_OPP = 0x00040000;
const uint32_t PROFILE_ID_PAN = 0x00080000;
const uint32_t PROFILE_ID_HOST = 0x00100000;
const uint32_t PROFILE_ID_HEARING_AID = 0x00200000;
const uint32_t PROFILE_ID_HID_DEVICE = 0x00400000;
const uint32_t PROFILE_ID_BAS = 0x00800000;
* @brief default value
* use to
* initialize mac address, name or other values.
*/
constexpr const char *INVALID_MAC_ADDRESS = "00:00:00:00:00:00";
constexpr const char *INVALID_NAME = "";
const uint32_t INVALID_CONTROL_TYPE = 0xFFFFFFFF;
const uint32_t INVALID_CONTROL_TYPE_VAL = 0xFFFFFFFF;
const uint32_t INVALID_CONTROL_OBJECT = 0xFFFFFFFF;
const int INVALID_VALUE = 0;
const int INVALID_TYPE = -1;
const int ADDRESS_LENGTH = 17;
const int ADDRESS_COLON_INDEX = 2;
const int ADDRESS_SEPARATOR_UNIT = 3;
const uint32_t INVALID_DIALOG_TYPE = 0xFFFFFFFF;
* @brief discovery state
* use to
* GetBtScanMode(), SetBtScanMode()
*/
const int DISCOVERY_STARTED = 0x01;
const int DISCOVERYING = 0x02;
const int DISCOVERY_STOPED = 0x03;
* @brief pairing result
* use to
* OnPairStatusChanged()
*/
const int PAIR_NONE = 0x01;
const int PAIR_PAIRING = 0x02;
const int PAIR_PAIRED = 0x03;
enum UnbondCause : int {
PAIR_COMMON_BOND_CAUSE = 0,
UNBOND_CAUSE_USER_REMOVED = 0,
UNBOND_CAUSE_REMOTE_DEVICE_DOWN = 1,
UNBOND_CAUSE_AUTH_FAILURE = 2,
UNBOND_CAUSE_AUTH_REJECTED = 3,
UNBOND_CAUSE_INTERNAL_ERROR = 4,
};
constexpr const char *BOND_MSG_NO_ERROR = "NO_ERROR";
constexpr const char *UNBOND_MSG_MAX_LINK = "MAX_LINK";
constexpr const char *UNBOND_MSG_USER_REMOVED = "USER_REMOVED";
constexpr const char *UNBOND_MSG_NOT_EXIST = "DEVICE_NOT_EXIST";
constexpr const char *UNBOND_MSG_AUTH_FAILURE = "AUTH_FAILURE";
constexpr const char *UNBOND_MSG_AUTH_REJECTED = "AUTH_REJECTED";
constexpr const char *UNBOND_MSG_STATUS_BUSY = "STATUS_BUSY";
constexpr const char *UNBOND_MSG_NOT_READY = "NOT_READY";
constexpr const char *UNBOND_MSG_UNSUPPORTED = "UNSUPPORTED";
constexpr const char *UNBOND_MSG_PARM_INVALID = "PARM_INVALID";
constexpr const char *UNBOND_MSG_JNI_ERROR = "JNI_ERROR";
constexpr const char *UNBOND_MSG_UNKNOWN = "UNKNOWN";
* @brief discoverable mode and connect mode
* use to
* GetBtScanMode(), SetBtScanMode()
*/
const int SCAN_MODE_NONE = 0x00;
const int SCAN_MODE_CONNECTABLE = 0x01;
const int SCAN_MODE_GENERAL_DISCOVERABLE = 0x02;
const int SCAN_MODE_LIMITED_DISCOVERABLE = 0x03;
const int SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE = 0x04;
const int SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE = 0x05;
* @brief bondable mode define
* use to
* GetBondableMode(), SetBondableMode()
*/
const int BONDABLE_MODE_OFF = 0x00;
const int BONDABLE_MODE_ON = 0x01;
* @brief remote device's transport type
* use to
* GetTransportType()
*/
const int BT_TRANSPORT_NONE = -1;
const int BT_TRANSPORT_BREDR = 0;
const int BT_TRANSPORT_BLE = 1;
* @brief remote device type
* use to
* GetDeviceType
*/
const int DEVICE_TYPE_UNKNOWN = -1;
const int DEVICE_TYPE_BREDR = 0;
const int DEVICE_TYPE_LE = 1;
const int DEVICE_TYPE_DUAL_MONO = 2;
inline int DeviceTypeToTransport(int type)
{
switch (type) {
case DEVICE_TYPE_LE:
return BT_TRANSPORT_BLE;
case DEVICE_TYPE_BREDR:
return BT_TRANSPORT_BREDR;
default:
return BT_TRANSPORT_NONE;
}
}
* @brief ACL LINK TYPE.
* use to
* acl connectCallback()
*/
const int LINK_TYPE_UNKNOWN = -1;
const int LINK_TYPE_BREDR = 0;
const int LINK_TYPE_LE = 1;
*
* GATT Macro Define
*
*********************************************/
constexpr uint8_t GATT_TRANSPORT_TYPE_AUTO = 0x0;
constexpr uint8_t GATT_TRANSPORT_TYPE_LE = 0x1;
constexpr uint8_t GATT_TRANSPORT_TYPE_CLASSIC = 0x2;
constexpr uint8_t GATT_TRANSPORT_TYPE_INVALID = 0x3;
constexpr uint8_t GATT_ROLE_MASTER = 0x00;
constexpr uint8_t GATT_ROLE_SLAVE = 0x01;
constexpr uint8_t GATT_ROLE_INVALID = 0xFF;
* @brief user confirm type during paring process.
* use to
* OnPairConfirmed()
*/
enum PinType {
PIN_TYPE_ENTER_PIN_CODE = 0,
PIN_TYPE_ENTER_PASSKEY = 1,
PIN_TYPE_CONFIRM_PASSKEY = 2,
PIN_TYPE_NO_PASSKEY_CONSENT = 3,
PIN_TYPE_NOTIFY_PASSKEY = 4,
PIN_TYPE_DISPLAY_PIN_CODE = 5,
PIN_TYPE_OOB_CONSENT = 6,
PIN_TYPE_PIN_16_DIGITS = 7,
};
* Define GATT Attribute permissions.
*/
enum class GattPermission : uint16_t {
READABLE = 1 << 0,
READ_ENCRYPTED = 1 << 1,
READ_ENCRYPTED_MITM = 1 << 2,
WRITEABLE = 1 << 4,
WRITE_ENCRYPTED = 1 << 5,
WRITE_ENCRYPTED_MITM = 1 << 6,
WRITE_SIGNED = 1 << 7,
WRITE_SIGNED_MITM = 1 << 8,
PERMISSON_MAX = 1 << 9,
};
enum class GattConnectionPriority : int {
BALANCED,
HIGH,
LOW_POWER,
LOW_POWER_WEAK,
LOW_POWER_ENHANCE,
LOW_POWER_ULTRA
};
enum GattStatus {
GATT_DIS_CANCEL = -57,
GATT_MORE_REASON = -56,
OUT_OF_RANGE = -55,
PRC_IN_PROGRESS = -54,
CCC_CFG_ERR = -53,
ALREADY_OPEN = -52,
DUP_REG = -51,
NOT_ENCRYPTED = -50,
ENCRYPED_NO_MITM = -49,
SERVICE_STARTED = -48,
INVALID_CFG = -47,
REMOTE_DEVICE_PENDING = -46,
CMD_STARTED = -45,
REMOTE_DEVICE_ERROR = -44,
DB_FULL = -43,
WRONG_STATE = -42,
NO_RESOURCES = -41,
TOO_SHORT = -40,
VALUE_NOT_ALLOWED = -39,
DATABASE_OUT_OF_SYNC = -38,
INSUF_RESOURCE = -37,
UNSUPPORT_GRP_TYPE = -36,
ERR_UNLIKELY = -35,
INVALID_PDU = -34,
AUTHENTICATION_FAILED = -33,
GATT_CONGESTION = -32,
EMPTY_FILTER = -31,
MAX_FILTERS = -30,
INVALID_REMOTE_DEVICE = -29,
INCLUDE_SERVICE_NOT_FOUND,
REFERENCED_BY_OTHER_SERVICE,
INVALID_CHARACTERISTIC,
INVALID_CHARACTERISTIC_DATA,
INVALID_CHARACTERISTIC_DESCRIPTOR,
INVALID_CHARACTERISTIC_DESCRIPTOR_DATA,
NOT_ENOUGH_HANDLES,
HANDLE_NOT_FOUND,
INVALID_PARAMETER,
INTERNAL_ERROR,
REQUEST_NOT_SUPPORT,
REMOTE_DEVICE_BUSY,
MAX_CONNECTIONS,
MAX_APPLICATIONS,
DEVICE_ALREADY_BIND,
INVALID_HANDLE,
INVALID_OFFSET,
READ_NOT_PERMITTED,
WRITE_NOT_PERMITTED,
INSUFFICIENT_ENCRYPTION,
INSUFFICIENT_AUTHENTICATION,
INSUFFICIENT_AUTHORIZATION,
INSUFFICIENT_ENCRYPTION_KEY_SIZE,
PREPARE_QUEUE_FULL,
ATTRIBUTE_NOT_LONG,
INVALID_ATTRIBUTE_VALUE_LENGTH,
WRITE_REQUEST_REJECTED,
GATT_FAILURE,
GATT_SUCCESS
};
enum BlePhy {
BLE_PHY_1M = 1,
BLE_PHY_2M,
BLE_PHY_CODED
};
enum CodedPhyMode {
BLE_PHY_CODED_NO_PREFERRED,
BLE_PHY_CODED_S2,
BLE_PHY_CODED_S8
};
enum BlePhyMask {
BLE_PHY_1M_MASK = 1,
BLE_PHY_2M_MASK = 2,
BLE_PHY_CODED_MASK = 4
};
inline int ConvertToBlePhyMask(int phy)
{
int outPhy = BLE_PHY_1M_MASK;
switch (phy) {
case BLE_PHY_CODED:
outPhy = BLE_PHY_CODED_MASK;
break;
default:
outPhy = phy;
break;
}
return outPhy;
}
*
* BLE Macro Define
*
*********************************************/
const int BLE_ADV_MIN_INTERVAL = 0x0020;
const int BLE_ADV_MAX_INTERVAL = 0x4000;
const int BLE_ADV_DEFAULT_INTERVAL = 0x03E8;
const uint8_t BLE_LEGACY_ADVERTISING_HANDLE = 0x00;
const uint8_t BLE_INVALID_ADVERTISING_HANDLE = 0xFF;
const int BLE_REPORT_DELAY_MILLIS = 5000;
constexpr int BLE_ADV_INIT_TIMEOUT = 200;
const int BLE_UUID_LEN_16 = 2;
const int BLE_UUID_LEN_32 = 4;
const int BLE_UUID_LEN_128 = 16;
const int DEVICE_NAME_MAX_LEN = 26;
const int BLE_CONNECTION_STATE_DISCONNECTED = 0x00;
const int BLE_CONNECTION_STATE_CONNECTED = 0x01;
const int BLE_CONNECTION_STATE_ENCRYPTED_BREDR = 0x02;
const int BLE_CONNECTION_STATE_ENCRYPTED_LE = 0x04;
const int BLE_PAIR_NONE = 0x01;
const int BLE_PAIR_PAIRING = 0x02;
const int BLE_PAIR_PAIRED = 0x03;
const int BLE_PAIR_CANCELING = 0x04;
const int BLE_ADV_DEFAULT_OP_CODE = 0x00;
const int BLE_ADV_STOP_COMPLETE_OP_CODE = 0x01;
const int BLE_ADV_START_FAILED_OP_CODE = 0x02;
const uint8_t BLE_ADV_DATA_BYTE_FIELD_LEN = 3;
const uint8_t BLE_ADV_DATA_FIELD_TYPE_AND_LEN = 2;
const uint8_t BLE_ONE_BYTE_LEN = 8;
const int8_t BLE_ADV_TX_POWER_ULTRA_LOW_VALUE = -21;
const int8_t BLE_ADV_TX_POWER_LOW_VALUE = -15;
const int8_t BLE_ADV_TX_POWER_MEDIUM_VALUE = -7;
const int8_t BLE_ADV_TX_POWER_HIGH_VALUE = 1;
const uint8_t BLE_ADVERTISEMENT_PHY_NONE = 0x00;
const uint8_t BLE_ADVERTISEMENT_PHY_1M = 0x01;
const uint8_t BLE_ADVERTISEMENT_PHY_2M = 0x02;
const uint8_t BLE_ADVERTISEMENT_PHY_CODED = 0x03;
const uint8_t BLE_LEGACY_SCAN_RESPONSE = 3;
const uint8_t BLE_LEGACY_ADV_SCAN_IND = 1;
const uint8_t BLE_LEGACY_ADV_IND_WITH_EX_ADV = 0x13;
const uint8_t BLE_LEGACY_ADV_NONCONN_IND_WITH_EX_ADV = 0x10;
const uint8_t BLE_ADV_EVT_LEGACY_BIT = 4;
const uint8_t BLE_EX_SCAN_DATE_STATUS_INCOMPLETE_MORE = 0x20;
const uint8_t BLE_EX_SCAN_DATE_STATUS_INCOMPLETE_NO_MORE = 0x40;
typedef enum {
SCAN_MODE_LOW_POWER = 0x00,
SCAN_MODE_BALANCED = 0x01,
SCAN_MODE_LOW_LATENCY = 0x02,
SCAN_MODE_OP_P2_60_3000 = 0x03,
SCAN_MODE_OP_P10_60_600 = 0x04,
SCAN_MODE_OP_P25_60_240 = 0x05,
SCAN_MODE_OP_P100_1000_1000 = 0x06,
SCAN_MODE_OP_P50_100_200 = 0x07,
SCAN_MODE_OP_P10_30_300 = 0x08,
SCAN_MODE_OP_P2_30_1500 = 0x09,
SCAN_MODE_OP_P75_30_40 = 0x0A,
SCAN_MODE_OP_P50_30_60 = 0x0B,
SCAN_MODE_OP_P10_25_250 = 0x0C,
SCAN_MODE_OP_MAX,
} SCAN_MODE;
typedef enum {
REPORT_MODE_NORMAL = 0x01,
REPORT_MODE_BATCH = 0x02,
REPORT_MODE_FENCE_SENSITIVITY_LOW = 0x0A,
REPORT_MODE_FENCE_SENSITIVITY_HIGH = 0x0B,
REPORT_MODE_INVALID
} REPORT_MODE;
typedef enum {
BATCH_SCAN_FORMAT_TRUNCATED = 0x01,
BATCH_SCAN_FORMAT_FULL = 0x02,
} BATCH_SCAN_FORMAT;
typedef enum {
DISCARD_OLDEST = 0x00,
DISCARD_WEAKEST_RSSI = 0x01,
} DISCARD_RULE;
constexpr uint8_t BLE_SCAN_CALLBACK_TYPE_ALL_MATCH = 1;
constexpr uint8_t BLE_SCAN_CALLBACK_TYPE_FIRST_MATCH = 2;
constexpr uint8_t BLE_SCAN_CALLBACK_TYPE_LOST_MATCH = 4;
constexpr uint8_t BLE_SCAN_CALLBACK_TYPE_FIRST_AND_LOST_MATCH = 6;
constexpr int32_t BLE_SCAN_MAX_RSSI_THRESHOLD = 127;
constexpr int32_t BLE_SCAN_MIN_RSSI_THRESHOLD = -128;
typedef enum { SENSITIVITY_MODE_HIGH = 1, SENSITIVITY_MODE_LOW = 2 } SENSITIVITY_MODE;
typedef enum { MATCH_MODE_AGGRESSIVE = 1, MATCH_MODE_STICKY = 2 } MATCH_MODE;
typedef enum { ONE_MATCH_TRACK_ADV = 1, FEW_MATCH_TRACK_ADV = 2, MAX_MATCH_TRACK_ADV = 3 } MATCH_TRACK_ADV_TYPE;
constexpr uint16_t BLE_SCAN_MODE_LOW_POWER_WINDOW_MS = 512;
constexpr uint16_t BLE_SCAN_MODE_LOW_POWER_INTERVAL_MS = 5120;
constexpr uint16_t BLE_SCAN_MODE_BALANCED_WINDOW_MS = 1024;
constexpr uint16_t BLE_SCAN_MODE_BALANCED_INTERVAL_MS = 4096;
constexpr uint16_t BLE_SCAN_MODE_LOW_LATENCY_WINDOW_MS = 4096;
constexpr uint16_t BLE_SCAN_MODE_LOW_LATENCY_INTERVAL_MS = 4096;
constexpr uint16_t BLE_SCAN_MODE_OP_P2_60_3000_WINDOW_MS = 60;
constexpr uint16_t BLE_SCAN_MODE_OP_P2_60_3000_INTERVAL_MS = 3000;
constexpr uint16_t BLE_SCAN_MODE_OP_P10_60_600_WINDOW_MS = 60;
constexpr uint16_t BLE_SCAN_MODE_OP_P10_60_600_INTERVAL_MS = 600;
constexpr uint16_t BLE_SCAN_MODE_OP_P25_60_240_WINDOW_MS = 60;
constexpr uint16_t BLE_SCAN_MODE_OP_P25_60_240_INTERVAL_MS = 240;
constexpr uint16_t BLE_SCAN_MODE_OP_P100_1000_1000_WINDOW_MS = 1000;
constexpr uint16_t BLE_SCAN_MODE_OP_P100_1000_1000_INTERVAL_MS = 1000;
constexpr uint16_t BLE_SCAN_MODE_OP_P50_100_200_WINDOW_MS = 100;
constexpr uint16_t BLE_SCAN_MODE_OP_P50_100_200_INTERVAL_MS = 200;
constexpr uint16_t BLE_SCAN_MODE_OP_P10_30_300_WINDOW_MS = 30;
constexpr uint16_t BLE_SCAN_MODE_OP_P10_30_300_INTERVAL_MS = 300;
constexpr uint16_t BLE_SCAN_MODE_OP_P2_30_1500_WINDOW_MS = 30;
constexpr uint16_t BLE_SCAN_MODE_OP_P2_30_1500_INTERVAL_MS = 1500;
constexpr uint16_t BLE_SCAN_MODE_OP_P75_30_40_WINDOW_MS = 30;
constexpr uint16_t BLE_SCAN_MODE_OP_P75_30_40_INTERVAL_MS = 40;
constexpr uint16_t BLE_SCAN_MODE_OP_P50_30_60_WINDOW_MS = 30;
constexpr uint16_t BLE_SCAN_MODE_OP_P50_30_60_INTERVAL_MS = 60;
constexpr uint16_t BLE_SCAN_MODE_OP_P10_25_250_WINDOW_MS = 25;
constexpr uint16_t BLE_SCAN_MODE_OP_P10_25_250_INTERVAL_MS = 250;
constexpr float BLE_SCAN_UNIT_TIME = 0.625;
void ConvertBleScanMode(int scanMode, uint16_t &outScanWindow, uint16_t &outScanInterval);
constexpr int32_t BLE_LPDEVICE_SCAN_SETTING_VALID_BIT = 0x01;
constexpr int32_t BLE_LPDEVICE_SCAN_FILTER_VALID_BIT = 0x02;
constexpr int32_t BLE_LPDEVICE_ADV_SETTING_VALID_BIT = 0x04;
constexpr int32_t BLE_LPDEVICE_ADVDATA_VALID_BIT = 0x08;
constexpr int32_t BLE_LPDEVICE_RESPDATA_VALID_BIT = 0x10;
constexpr int32_t BLE_LPDEVICE_ADV_DEVICEINFO_VALID_BIT = 0x20;
constexpr int8_t BLE_LPDEVICE_MSG_DEV_INFO = 0x00;
constexpr int8_t BLE_LPDEVICE_MSG_SOFT_FILTER = 0x01;
constexpr int8_t BLE_LPDEVICE_MSG_ADV_PARAM = 0x02;
constexpr int8_t BLE_LPDEVICE_MSG_ADV_DATA = 0x03;
constexpr int8_t BLE_LPDEVICE_MSG_ADV_RSP_DATA = 0x04;
constexpr int8_t BLE_LPDEVICE_MSG_UUID_DATA = 0x0a;
constexpr int8_t BLE_LPDEVICE_MSG_ADV_HANDLE = 0x0b;
constexpr int8_t BLE_LPDEVICE_MSG_SCAN_STATUS = 0x0c;
constexpr int8_t BLE_LPDEVICE_MSG_SCAN_PARAM = 0x0d;
constexpr int8_t BLE_LPDEVICE_MSG_CAPABILITY_QUERY = 0x13;
constexpr int8_t BLE_LPDEVICE_MSG_SCAN_COLLABORATION_QUERY = 0x14;
constexpr int8_t BLE_LPDEVICE_MSG_SCAN_COLLABORATION_RESULT = 0x15;
constexpr int8_t BLE_LPDEVICE_MSG_GATT_CONN_COLLABORATION_QUERY = 0x16;
constexpr int8_t BLE_LPDEVICE_MSG_GATT_CONN_COLLABORATION_RESULT = 0x17;
constexpr int8_t BLE_LPDEVICE_MSG_SET_BLE_BUFFER_SIZE_AND_NUM = 0x18;
constexpr uint8_t BLE_LPDEVICE_MSG_CAPABILITY = 0x01;
constexpr uint8_t BLE_LPDEVICE_MSG_SCAN_COLLABORATION_NOTIFY_STATUS = 0x02;
constexpr uint8_t BLE_LPDEVICE_MSG_GATT_CONN_COLLABORATION_NOTIFY_STATUS = 0x03;
constexpr uint8_t BLE_LPDEVICE_MSG_TYPE_NOTICE_UP_DATA = 0x02;
constexpr int8_t BLE_LPDEVICE_DISABLE_SCAN_IN_LPDEVICE = 0;
constexpr int8_t BLE_LPDEVICE_ENABLE_SCAN_IN_LPDEVICE = 1;
constexpr int8_t BLE_LPDEVICE_DEVICE_TYPE_ALL = 2;
constexpr uint32_t BLE_LPDEVICE_RECOVERY_DOING = 1;
constexpr uint32_t BLE_LPDEVICE_RECOVERY_DONE = 2;
constexpr int32_t BLE_LPDEVICE_HANDLE_RESOURCE_NOT_APPLY = -100;
constexpr uint8_t BLE_DATA_LEN_1 = 1;
constexpr uint8_t BLE_DATA_LEN_2 = 2;
constexpr uint8_t BLE_DATA_LEN_3 = 3;
constexpr uint8_t BLE_DATA_LEN_4 = 4;
constexpr uint8_t BLE_DEVICE_ADDR_LEN = 6;
constexpr uint8_t BLE_ADV_DEVICE_ID_LEN = 8;
constexpr uint8_t BLE_UUID_LEN = 16;
constexpr uint8_t BLE_UUID_HALF_LEN = 8;
constexpr int32_t BLE_SCAN_MAX_NUM = 1000;
constexpr int TRANSPORT_BR_EDR = 0;
constexpr int TRANSPORT_LE = 1;
constexpr int TRANSPORT_DUAL = 2;
constexpr int TRANSPORT_UNKNOWN = 3;
using PHY_TYPE = enum { PHY_LE_1M = 1, PHY_LE_2M = 2, PHY_LE_CODED = 3, PHY_LE_ALL_SUPPORTED = 255 };
using BLE_ADV_TX_POWER_LEVEL = enum {
BLE_ADV_TX_POWER_ULTRA_LOW = 0x00,
BLE_ADV_TX_POWER_LOW = 0x01,
BLE_ADV_TX_POWER_MEDIUM = 0x02,
BLE_ADV_TX_POWER_HIGH = 0x03
};
const uint8_t BLE_ADV_FLAG_NON_LIMIT_DISC = 0x00;
const uint8_t BLE_ADV_FLAG_LIMIT_DISC = 0x01 << 0;
const uint8_t BLE_ADV_FLAG_GEN_DISC = 0x01 << 1;
const uint8_t BLE_ADV_FLAG_BREDR_NOT_SPT = 0x01 << 2;
const uint8_t BLE_ADV_FLAG_DMT_CONTROLLER_SPT = 0x01 << 3;
const uint8_t BLE_ADV_FLAG_DMT_HOST_SPT = 0x01 << 4;
using BLE_BT_DEV_TYPE = enum {
BLE_BT_DEVICE_TYPE_UNKNOWN = -1,
BLE_BT_DEVICE_TYPE_BREDR = 0,
BLE_BT_DEVICE_TYPE_BLE = 1,
BLE_BT_DEVICE_TYPE_DUMO = 2,
};
using BLE_ADDR_TYPE = enum {
BLE_ADDR_TYPE_PUBLIC = 0x00,
BLE_ADDR_TYPE_RANDOM = 0x01,
BLE_ADDR_TYPE_NON_RPA = 0x02,
BLE_ADDR_TYPE_RPA = 0x03,
BLE_ADDR_TYPE_UNKNOWN = 0xFE,
BLE_ADDR_TYPE_ANONYMOUS = 0xFF,
};
using BLE_IO_CAP = enum {
BLE_IO_CAP_OUT = 0x00,
BLE_IO_CAP_IO = 0x01,
BLE_IO_CAP_IN = 0x02,
BLE_IO_CAP_NONE = 0x03,
BLE_IO_CAP_KBDISP = 0x04
};
using BleAdvState = enum {
BLE_ADV_STATE_IDLE,
BLE_ADV_STATE_ADVERTISING,
};
using BLE_ADV_DATA_TYPE = enum {
BLE_AD_TYPE_FLAG = 0x01,
BLE_AD_TYPE_16SRV_PART = 0x02,
BLE_AD_TYPE_16SRV_CMPL = 0x03,
BLE_AD_TYPE_32SRV_PART = 0x04,
BLE_AD_TYPE_32SRV_CMPL = 0x05,
BLE_AD_TYPE_128SRV_PART = 0x06,
BLE_AD_TYPE_128SRV_CMPL = 0x07,
BLE_AD_TYPE_NAME_SHORT = 0x08,
BLE_AD_TYPE_NAME_CMPL = 0x09,
BLE_AD_TYPE_TX_PWR = 0x0A,
BLE_AD_TYPE_DEV_CLASS = 0x0D,
BLE_AD_TYPE_SM_TK = 0x10,
BLE_AD_TYPE_SM_OOB_FLAG = 0x11,
BLE_AD_TYPE_INT_RANGE = 0x12,
BLE_AD_TYPE_SOL_SRV_UUID = 0x14,
BLE_AD_TYPE_128SOL_SRV_UUID = 0x15,
BLE_AD_TYPE_SERVICE_DATA = 0x16,
BLE_AD_TYPE_PUBLIC_TARGET = 0x17,
BLE_AD_TYPE_RANDOM_TARGET = 0x18,
BLE_AD_TYPE_APPEARANCE = 0x19,
BLE_AD_TYPE_ADV_INT = 0x1A,
BLE_AD_TYPE_LE_DEV_ADDR = 0x1b,
BLE_AD_TYPE_LE_ROLE = 0x1c,
BLE_AD_TYPE_SPAIR_C256 = 0x1d,
BLE_AD_TYPE_SPAIR_R256 = 0x1e,
BLE_AD_TYPE_32SOL_SRV_UUID = 0x1f,
BLE_AD_TYPE_32SERVICE_DATA = 0x20,
BLE_AD_TYPE_128SERVICE_DATA = 0x21,
BLE_AD_TYPE_LE_SECURE_CONFIRM = 0x22,
BLE_AD_TYPE_LE_SECURE_RANDOM = 0x23,
BLE_AD_TYPE_URI = 0x24,
BLE_AD_TYPE_INDOOR_POSITION = 0x25,
BLE_AD_TYPE_TRANS_DISC_DATA = 0x26,
BLE_AD_TYPE_LE_SUPPORT_FEATURE = 0x27,
BLE_AD_TYPE_CHAN_MAP_UPDATE = 0x28,
BLE_AD_MANUFACTURER_SPECIFIC_TYPE = 0xFF,
};
*
* Map Define
*
*********************************************/
enum class MapMessageType : int {
EMAIL = 0,
SMS_GSM = 1,
SMS_CDMA = 2,
MMS = 3,
IM = 4,
INVALID = 5
};
enum class MapMessageStatus : int { READ, UNREAD, INVALID };
enum class MapBoolType : int { YES_TYPE, NO_TYPE, INVALID };
enum class MapMsgReceptionStatus : int { COMPLETE, FRACTIONED, NOTIFICATION, INVALID };
enum class MapMsgDeliveryStatus : int { DELIVERED, SENT, UNKNOWN, INVALID };
enum class MapMsgDirection : int { INCOMING, OUTGOING, OUTGOINGDRAFT, OUTGOINGPENDING, INVALID };
enum class MapFractionDeliverType : int { MORE, LAST, INVALID };
enum class MapFractionRequestType : uint8_t { FIRST = 0x00, NEXT = 0x01, INVALID = 0x02 };
enum class MapOnOffType : uint8_t { OFF = 0, ON = 1, INVALID = 3 };
enum class MapCharsetType : uint8_t { NATIVE = 0x00, UTF_8 = 0x01, INVALID = 0x02 };
enum class MapAttachmentType : uint8_t { NO_TYPE = 0x00, HAVE = 0x01, INVALID = 0x02 };
enum class MapStatusIndicatorType : uint8_t {
READ_STATUS = 0x00,
DELETED_STATUS = 0x01,
SET_EXTENDED_DATA = 0x02,
INVALID = 0x03
};
enum class MapStatusValueType : uint8_t { NO_TYPE = 0x00, YES_TYPE = 0x01 };
enum class MapModifyTextType : uint8_t { REPLACE = 0x00, PREPEND = 0x01, INVALID = 0x02 };
enum class MapActionType : int {
GET_UNREAD_MESSAGES,
GET_SUPPORTED_FEATURES,
SEND_MESSAGE,
SET_NOTIFICATION_FILTER,
GET_MESSAGES_LISTING,
GET_MESSAGE,
UPDATE_INBOX,
GET_CONVERSATION_LISTING,
SET_MESSAGE_STATUS,
SET_OWNER_STATUS,
GET_OWNER_STATUS,
GET_MAS_INSTANCE_INFO
};
enum class MapExecuteStatus : int {
SUCCEED = 0,
CONTINUE = 1,
BAD_PARAM = (-1),
BAD_STATUS = (-2),
NOT_SUPPORT = (-3)
};
#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_EMAIL 0x01
#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_SMS_GSM 0x02
#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_SMS_CDMA 0x04
#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_MMS 0x08
#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_IM 0x10
#define MAP_MCE_SUPPORTED_MESSAGE_TYPE_ALL 0x01F
#define MAP_FILTER_MESSAGE_MASK_SMS_GSM 0b00000001
#define MAP_FILTER_MESSAGE_MASK_SMS_CDMA 0b00000010
#define MAP_FILTER_MESSAGE_MASK_EMAIL 0b00000100
#define MAP_FILTER_MESSAGE_MASK_MMS 0b00001000
#define MAP_FILTER_MESSAGE_MASK_IM 0b00010000
#define MAP_FILTER_MESSAGE_MASK_NO_FILTERING 0b00000000
#define MAP_FILTER_READ_STATUS_MASK_UNREAD 0b00000001
#define MAP_FILTER_READ_STATUS_MASK_READ 0b00000010
#define MAP_FILTER_READ_STATUS_MASK_NO_FILTERING 0b00000000
#define MAP_FILTER_PRIORITY_MASK_HIGH 0b00000001
#define MAP_FILTER_PRIORITY_MASK_NO_HIGH 0b00000010
#define MAP_FILTER_PRIORITY_MASK_NO_FILTERING 0b00000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_REQUIRED 0b000000000000000000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_PRESENT_ALL 0b000111111111111111111111
#define MAP_GETMESSAGELIST_PARAMETER_MASK_SUBJECT 0b000000000000000000000001
#define MAP_GETMESSAGELIST_PARAMETER_MASK_DATETIME 0b000000000000000000000010
#define MAP_GETMESSAGELIST_PARAMETER_MASK_SENDER_NAME 0b000000000000000000000100
#define MAP_GETMESSAGELIST_PARAMETER_MASK_SENDER_ADDRESSING 0b000000000000000000001000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_RECIPIENT_NAME 0b000000000000000000010000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_RECIPIENT_ADDRESSING 0b000000000000000000100000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_TYPE 0b000000000000000001000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_SIZE 0b000000000000000010000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_RECEPTION_STATUS 0b000000000000000100000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_TEXT 0b000000000000001000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_ATTACHMENT_SIZE 0b000000000000010000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_PRIORITY 0b000000000000100000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_READ 0b000000000001000000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_SENT 0b000000000010000000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_PROTECTED 0b000000000100000000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_REPLYTO_ADDRESSING 0b000000001000000000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_DELIVERY_STATUS 0b000000010000000000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_CONVERSATION_ID 0b000000100000000000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_CONVERSATION_NAME 0b000001000000000000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_DIRECTION 0b000010000000000000000000
#define MAP_GETMESSAGELIST_PARAMETER_MASK_ATTACHMENT_MIME 0b000100000000000000000000
#define MAP_GETCONV_PARAMETER_MASK_ALL_ON 0b000000000111111111111111
#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_NAME 0b000000000000000000000001
#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_LAST_ACTIVITY 0b000000000000000000000010
#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_READ_STATUS 0b000000000000000000000100
#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_VERSION_COUNTER 0b000000000000000000001000
#define MAP_GETCONV_PARAMETER_MASK_CONVERSATION_SUMMARY 0b000000000000000000010000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANTS 0b000000000000000000100000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_UCI 0b000000000000000001000000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_DISPLAY_NAME 0b000000000000000010000000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_CHAT_STATE 0b000000000000000100000000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_LAST_ACTIVITY 0b000000000000001000000000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_X_BT_UID 0b000000000000010000000000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_NAME 0b000000000000100000000000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_PRESENCE_AVAILABILITY 0b000000000001000000000000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_PRESENCE_TEXT 0b000000000010000000000000
#define MAP_GETCONV_PARAMETER_MASK_PARTICIPANT_PRIORITY 0b000000000100000000000000
#define MAP_NOTIFICATION_FILTER_MASK_ALL_OFF 0b000000000000000000000000
#define MAP_NOTIFICATION_FILTER_MASK_ALL_ON 0b000000000111111111111111
#define MAP_NOTIFICATION_FILTER_MASK_NEW_MESSAGE 0b000000000000000000000001
#define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_DELETED 0b000000000000000000000010
#define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_SHIFT 0b000000000000000000000100
#define MAP_NOTIFICATION_FILTER_MASK_SENDING_SUCCESS 0b000000000000000000001000
#define MAP_NOTIFICATION_FILTER_MASK_SENDING_FAILURE 0b000000000000000000010000
#define MAP_NOTIFICATION_FILTER_MASK_DELIVERY_SUCCESS 0b000000000000000000100000
#define MAP_NOTIFICATION_FILTER_MASK_DELIVERY_FAILURE 0b000000000000000001000000
#define MAP_NOTIFICATION_FILTER_MASK_MEMORY_FULL 0b000000000000000010000000
#define MAP_NOTIFICATION_FILTER_MASK_MEMORY_AVAILABLE 0b000000000000000100000000
#define MAP_NOTIFICATION_FILTER_MASK_READ_STATUS_CHANGED 0b000000000000001000000000
#define MAP_NOTIFICATION_FILTER_MASK_CONVERSATION_CHANGED 0b000000000000010000000000
#define MAP_NOTIFICATION_FILTER_MASK_PARTICIPANT_PRESENCE_CHANGED 0b000000000000100000000000
#define MAP_NOTIFICATION_FILTER_MASK_PARTICIPANT_CHAT_STATE_CHANGED 0b000000000001000000000000
#define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_EXTENDED_DATA_CHANGED 0b000000000010000000000000
#define MAP_NOTIFICATION_FILTER_MASK_MESSAGE_REMOVED 0b000000000100000000000000
#define MAP_SUPPORTED_FEATURES_NOTIFICATION_REGISTRATION 0x00000001
#define MAP_SUPPORTED_FEATURES_NOTIFICATION_FEATURE 0x00000002
#define MAP_SUPPORTED_FEATURES_BROWSING 0x00000004
#define MAP_SUPPORTED_FEATURES_UPLOADING 0x00000008
#define MAP_SUPPORTED_FEATURES_DELETE_FEATURE 0x00000010
#define MAP_SUPPORTED_FEATURES_INSTANCE_INFO_FEATURE 0x00000020
#define MAP_SUPPORTED_FEATURES_EVENT_REPORT_1_1 0x00000040
#define MAP_SUPPORTED_FEATURES_EVENT_REPORT_1_2 0x00000080
#define MAP_SUPPORTED_FEATURES_MESSAGE_FORMAT_1_1 0x00000100
#define MAP_SUPPORTED_FEATURES_MESSAGELIST_FORMAT_1_1 0x00000200
#define MAP_SUPPORTED_FEATURES_PERSISTENT_MESSAGE_HANDLE 0x00000400
#define MAP_SUPPORTED_FEATURES_DATABASE_IDENTIFIER 0x00000800
#define MAP_SUPPORTED_FEATURES_FOLDOR_VERSION_COUNTER 0x00001000
#define MAP_SUPPORTED_FEATURES_CONVERSATION_VERSION_COUNTER 0x00002000
#define MAP_SUPPORTED_FEATURES_PARTICIPANT_PRESENCE_CHANGE_NOTIFICATION 0x00004000
#define MAP_SUPPORTED_FEATURES_PARTICIPANT_CHAT_STATE_CHANGE_NOTIFICATION 0x00008000
#define MAP_SUPPORTED_FEATURES_PBAP_CONTACT_CROSS_REFERENCE 0x00010000
#define MAP_SUPPORTED_FEATURES_NOTIFICATION_FILTER 0x00020000
#define MAP_SUPPORTED_FEATURES_UTC_OFFSET_TIMESTAMP_FORMAT 0x00040000
#define MAP_SUPPORTED_FEATURES_MAPSUPPORTED_FEATURES 0x00080000
#define MAP_SUPPORTED_FEATURES_CONVERSATION_LISTING 0x00100000
#define MAP_SUPPORTED_FEATURES_OWNER_STATUS 0x00200000
#define MAP_SUPPORTED_FEATURES_MESSAGE_FORWARDING 0x00400000
*
* AVRCP Macro Define
*
*********************************************/
#define AVRC_DEFAULT_LABEL (0x00)
#define AVRC_INVALID_LABEL (0x10)
* @brief This enumeration declares the types of the methods.
*
* @since 6
*/
enum AvrcCtActionType : uint8_t {
AVRC_ACTION_TYPE_INVALID = 0x00,
AVRC_ACTION_TYPE_PRESS_BUTTON,
AVRC_ACTION_TYPE_RELEASE_BUTTON,
AVRC_ACTION_TYPE_SET_ADDRESSED_PLAYER,
AVRC_ACTION_TYPE_SET_BROWSED_PLAYER,
AVRC_ACTION_TYPE_GET_CAPABILITIES,
AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_ATTRIBUTES,
AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_VALUES,
AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_CURRENT_VALUE,
AVRC_ACTION_TYPE_SET_PLAYER_APP_SETTING_CURRENT_VALUE,
AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_ATTRIBUTE_TEXT,
AVRC_ACTION_TYPE_GET_PLAYER_APP_SETTING_VALUE_TEXT,
AVRC_ACTION_TYPE_GET_ELEMENT_ATTRIBUTES,
AVRC_ACTION_TYPE_GET_PLAY_STATUS,
AVRC_ACTION_TYPE_PLAY_ITEM,
AVRC_ACTION_TYPE_ADD_TO_NOW_PLAYING,
AVRC_ACTION_TYPE_CHANGE_PATH,
AVRC_ACTION_TYPE_GET_FOLDER_ITEMS,
AVRC_ACTION_TYPE_GET_ITEM_ATTRIBUTES,
AVRC_ACTION_TYPE_GET_TOTAL_NUMBER_OF_ITEMS,
AVRC_ACTION_TYPE_SET_ABSOLUTE_VOLUME,
AVRC_ACTION_TYPE_NOTIFY_PLAYBACK_STATUS_CHANGED,
AVRC_ACTION_TYPE_NOTIFY_TRACK_CHANGED,
AVRC_ACTION_TYPE_NOTIFY_TRACK_REACHED_END,
AVRC_ACTION_TYPE_NOTIFY_TRACK_REACHED_START,
AVRC_ACTION_TYPE_NOTIFY_PLAYBACK_POS_CHANGED,
AVRC_ACTION_TYPE_NOTIFY_PLAYER_APPLICATION_SETTING_CHANGED,
AVRC_ACTION_TYPE_NOTIFY_NOW_PLAYING_CONTENT_CHANGED,
AVRC_ACTION_TYPE_NOTIFY_AVAILABLE_PLAYERS_CHANGED,
AVRC_ACTION_TYPE_NOTIFY_ADDRESSED_PLAYER_CHANGED,
AVRC_ACTION_TYPE_NOTIFY_UIDS_CHANGED,
AVRC_ACTION_TYPE_NOTIFY_VOLUME_CHANGED,
AVRC_ACTION_TYPE_GET_MEDIA_PLAYER_LIST,
};
* @brief This enumeration declares the values of the supported button.
* @see AV/C Panel Subunit Specification 1.23 Section 9.4 PASS THROUGH control command Table 9.21 - Operation id List
*
* @since 6
*/
enum AvrcKeyOperation : uint8_t {
AVRC_KEY_OPERATION_VOLUME_UP = 0x41,
AVRC_KEY_OPERATION_VOLUME_DOWN = 0x42,
AVRC_KEY_OPERATION_MUTE = 0x43,
AVRC_KEY_OPERATION_PLAY = 0x44,
AVRC_KEY_OPERATION_STOP = 0x45,
AVRC_KEY_OPERATION_PAUSE = 0x46,
AVRC_KEY_OPERATION_REWIND = 0x48,
AVRC_KEY_OPERATION_FAST_FORWARD = 0x49,
AVRC_KEY_OPERATION_FORWARD = 0x4B,
AVRC_KEY_OPERATION_BACKWARD = 0x4C,
AVRC_KEY_OPERATION_INVALID = 0x7F,
};
* @brief This enumeration declares the values of the key state.
*
* @since 6
*/
enum AvrcTgKeyState : uint8_t {
AVRC_KEY_STATE_PRESS = 0x00,
AVRC_KEY_STATE_RELEASE = 0x01,
AVRC_KEY_STATE_INVALID,
};
* @brief This enumeration declares the values of the player application setting attributes.
* @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
*
* @since 6
*/
enum AvrcPlayerAttribute : uint8_t {
AVRC_PLAYER_ATTRIBUTE_ILLEGAL = 0x00,
AVRC_PLAYER_ATTRIBUTE_EQUALIZER = 0x01,
AVRC_PLAYER_ATTRIBUTE_REPEAT = 0x02,
AVRC_PLAYER_ATTRIBUTE_SHUFFLE = 0x03,
AVRC_PLAYER_ATTRIBUTE_SCAN = 0x04,
AVRC_PLAYER_ATTRIBUTE_RESERVED_MIN = 0x05,
AVRC_PLAYER_ATTRIBUTE_RESERVED_MAX = 0x7F,
AVRC_PLAYER_ATTRIBUTE_EXTENSION = 0x80,
};
* @brief This enumeration declares the values of the Equalizer ON/OFF status.
* @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
*
* @since 6
*/
enum AvrcEqualizer : uint8_t {
AVRC_EQUALIZER_OFF = 0x01,
AVRC_EQUALIZER_ON,
AVRC_EQUALIZER_INVALID,
};
* @brief This enumeration declares the values of the Repeat Mode status.
* @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
*
* @since 6
*/
enum AvrcRepeat : uint8_t {
AVRC_REPEAT_OFF = 0x01,
AVRC_REPEAT_SINGLE_TRACK,
AVRC_REPEAT_ALL_TRACK,
AVRC_REPEAT_GROUP,
AVRC_REPEAT_INVALID,
};
* @brief This enumeration declares the values of the Shuffle ON/OFF status.
* @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
*
* @since 6
*/
enum AvrcShuffle : uint8_t {
AVRC_SHUFFLE_OFF = 0x01,
AVRC_SHUFFLE_ALL_TRACKS,
AVRC_SHUFFLE_GROUP,
AVRC_SHUFFLE_INVALID,
};
* @brief This enumeration declares the values of the Scan ON/OFF status.
* @see Audio/Video Remote Control 1.6.2 Section 27 Appendix F: list of defined player application settings and values.
*
* @since 6
*/
enum AvrcScan : uint8_t {
AVRC_SCAN_OFF = 0x01,
AVRC_SCAN_ALL_TRACKS,
AVRC_SCAN_GROUP,
AVRC_SCAN_INVALID,
};
* @brief This enumeration declares the values of the play status.
*
* @since 6
*/
enum AvrcPlayStatus : uint32_t {
AVRC_PLAY_STATUS_STOPPED = 0x00,
AVRC_PLAY_STATUS_PLAYING,
AVRC_PLAY_STATUS_PAUSED,
AVRC_PLAY_STATUS_FWD_SEEK,
AVRC_PLAY_STATUS_REV_SEEK,
AVRC_PLAY_STATUS_RESERVED_MIN = 0x05,
AVRC_PLAY_STATUS_RESERVED_MAX = 0xFE,
AVRC_PLAY_STATUS_ERROR = 0xFF,
AVRC_PLAY_STATUS_INVALID_SONG_LENGTH = 0xFFFFFFFF,
AVRC_PLAY_STATUS_INVALID_SONG_POSITION = 0xFFFFFFFF,
};
* @brief This enumeration declares the values of folder direction.
*
* @since 6
*/
enum AvrcFolderDirection : uint8_t {
AVRC_FOLDER_DIRECTION_UP = 0x00,
AVRC_FOLDER_DIRECTION_DOWN = 0x01,
AVRC_FOLDER_DIRECTION_INVALID = 0x02,
};
* @brief This enumeration declares the values of the scope in which the UID of the media element item or folder item.
* @see Audio/Video Remote Control 1.6.2 Section 6.10.1 Scope.
*
* @since 6
*/
enum AvrcMediaScope : uint8_t {
AVRC_MEDIA_SCOPE_PLAYER_LIST = 0x00,
AVRC_MEDIA_SCOPE_VIRTUAL_FILE_SYSTEM,
AVRC_MEDIA_SCOPE_SEARCH,
AVRC_MEDIA_SCOPE_NOW_PLAYING,
AVRC_MEDIA_SCOPE_INVALID,
};
* @brief This enumeration declares the values of the browsable items.
* @see Audio/Video Remote Control 1.6.2 Section 6.10.2 Browsable items.
*
* @since 6
*/
enum AvrcMediaType : uint8_t {
AVRC_MEDIA_TYPE_MEDIA_PLAYER_ITEM = 0x01,
AVRC_MEDIA_TYPE_FOLDER_ITEM,
AVRC_MEDIA_TYPE_MEDIA_ELEMENT_ITEM,
AVRC_MEDIA_TYPE_INVALID,
};
* @brief This enumeration declares the values of the attribute count.
* @see Audio/Video Remote Control 1.6.2 Section 6.10.4.2 GetFolderItems - Attribute Count.
*
* @since 6
*/
enum AvrcAttributeCount {
AVRC_ATTRIBUTE_COUNT_ALL = 0x00,
AVRC_ATTRIBUTE_COUNT_NO = 0xFF,
};
* @brief This enumeration declares the values of the media attribute. These values are used to uniquely identify media
* information.
* @see Audio/Video Remote Control 1.6.2 Section 26 Appendix E: list of media attributes.
*
* @since 6
*/
enum AvrcMediaAttribute : uint8_t {
AVRC_MEDIA_ATTRIBUTE_NOT_USED = 0x00,
AVRC_MEDIA_ATTRIBUTE_TITLE,
AVRC_MEDIA_ATTRIBUTE_ARTIST_NAME,
AVRC_MEDIA_ATTRIBUTE_ALBUM_NAME,
AVRC_MEDIA_ATTRIBUTE_TRACK_NUMBER,
AVRC_MEDIA_ATTRIBUTE_TOTAL_NUMBER_OF_TRACKS,
AVRC_MEDIA_ATTRIBUTE_GENRE,
AVRC_MEDIA_ATTRIBUTE_PLAYING_TIME,
AVRC_MEDIA_ATTRIBUTE_DEFAULT_COVER_ART,
AVRC_MEDIA_ATTRIBUTE_RESERVED,
};
* @brief This enumeration declares the values of the major player type.
* @see Audio/Video Remote Control 1.6.2 Section 6.10.2.1 Media player item - Major Player Type
*
* @since 6
*/
enum AvrcMediaMajorPlayerType : uint8_t {
AVRC_MEDIA_MAJOR_PLAYER_TYPE_AUDIO = 0x01,
AVRC_MEDIA_MAJOR_PLAYER_TYPE_VIDEO = 0x02,
AVRC_MEDIA_MAJOR_PLAYER_TYPE_BROADCASTING_AUDIO = 0x04,
AVRC_MEDIA_MAJOR_PLAYER_TYPE_BROADCASTING_VIDEO = 0x08,
AVRC_MEDIA_MAJOR_PLAYER_TYPE_RESERVED = 0x10
};
* @brief This enumeration declares the values of the major player type.
* @see Audio/Video Remote Control 1.6.2 Section 6.10.2.1 Media player item - Player Sub Type
*
* @since 6
*/
enum AvrcMediaPlayerSubType : uint32_t {
AVRC_MEDIA_PLAYER_SUB_TYPE_AUDIO_BOOK = 0x00000001,
AVRC_MEDIA_PLAYER_SUB_TYPE_PODCAST = 0x00000002,
AVRC_MEDIA_PLAYER_SUB_TYPE_RESERVED = 0x00000004
};
* @brief This enumeration declares the values of character set.
*
* @since 6
*/
enum AvrcMediaCharacterSet : uint16_t {
AVRC_MEDIA_CHARACTER_SET_UTF8 = 0x006A,
};
* @brief This enumeration declares the values of the folder type.
* @see Audio/Video Remote Control 1.6.2 Section 6.10.2.2 Folder item - Folder Type
*
* @since 6
*/
enum AvrcMediaFolderType : uint8_t {
AVRC_MEDIA_FOLDER_TYPE_MIXED = 0x00,
AVRC_MEDIA_FOLDER_TYPE_TITLES,
AVRC_MEDIA_FOLDER_TYPE_ALBUMS,
AVRC_MEDIA_FOLDER_TYPE_ARTISTS,
AVRC_MEDIA_FOLDER_TYPE_GENRES,
AVRC_MEDIA_FOLDER_TYPE_PLAY_LISTS,
AVRC_MEDIA_FOLDER_TYPE_YEARS,
AVRC_MEDIA_FOLDER_TYPE_RESERVED,
};
* @brief This enumeration declares the values of the is playable.
* @see Audio/Video Remote Control 1.6.2 Section 6.10.2.2 Folder item - Is Playable
*
* @since 6
*/
enum AvrcMediaFolderPlayable : uint8_t {
AVRC_MEDIA_FOLDER_PLAYABLE_NO = 0x00,
AVRC_MEDIA_FOLDER_PLAYABLE_YES,
AVRC_MEDIA_FOLDER_PLAYABLE_RESERVED,
};
* @brief This enumeration declares the values of the media type.
* @see Audio/Video Remote Control 1.6.2 Section 6.10.2.3 Media element item - Media Type
*
* @since 6
*/
enum AvrcMediaElementType : uint8_t {
AVRC_MEDIA_ELEMENT_TYPE_AUDIO = 0x00,
AVRC_MEDIA_ELEMENT_TYPE_VIDEO,
AVRC_MEDIA_ELEMENT_TYPE_RESERVED,
};
* @brief This enumeration declares the values of the media type.
*
* @details An Absolute Volume is represented in one octet. The top bit (bit 7) is reserved for future addition (RFA).
* The volume is specified as a percentage of the maximum. The value 0x0 corresponds to 0%. The value 0x7F corresponds
* to 100%. Scaling should be applied to achieve values between these two. The existence of this scale does not impose
* any restriction on the granularity of the volume control scale on the TG.
* @see Audio/Video Remote Control 1.6.2 Section 6.13.1 Absolute Volume
*
* @since 6
*/
enum AvrcAbsoluteVolume : uint8_t {
AVRC_ABSOLUTE_VOLUME_PERCENTAGE_0 = 0x00,
AVRC_ABSOLUTE_VOLUME_PERCENTAGE_100 = 0x7F,
AVRC_ABSOLUTE_VOLUME_INVALID = 0x80,
};
enum DeviceAbsVolumeAbility {
DEVICE_ABSVOL_CLOSE = 0,
DEVICE_ABSVOL_OPEN = 1,
DEVICE_ABSVOL_UNSUPPORT = 2,
DEVICE_ABSVOL_BUTT
};
* @brief This enumeration declares the values of the "EVENT ID".
* @see Audio/Video Remote Control 1.6.2 Section 28 Appendix H: list of defined notification events.
*
* @since 6
*/
enum AvrcEventId : uint8_t {
AVRC_EVENT_ID_PLAYBACK_STATUS_CHANGED = 0x01,
AVRC_EVENT_ID_TRACK_CHANGED,
AVRC_EVENT_ID_TRACK_REACHED_END,
AVRC_EVENT_ID_TRACK_REACHED_START,
AVRC_EVENT_ID_PLAYBACK_POS_CHANGED,
AVRC_EVENT_ID_BATT_STATUS_CHANGED,
AVRC_EVENT_ID_SYSTEM_STATUS_CHANGED,
AVRC_EVENT_ID_PLAYER_APPLICATION_SETTING_CHANGED,
AVRC_EVENT_ID_NOW_PLAYING_CONTENT_CHANGED,
AVRC_EVENT_ID_AVAILABLE_PLAYERS_CHANGED,
AVRC_EVENT_ID_ADDRESSED_PLAYER_CHANGED,
AVRC_EVENT_ID_UIDS_CHANGED,
AVRC_EVENT_ID_VOLUME_CHANGED,
AVRC_EVENT_ID_RESERVED = 0x0E,
};
* @bUnique identifier to identify an element on TG
*
* @since 6
*/
enum AvrcElementIdentifier : uint64_t {
AVRC_ELEMENT_ATTRIBUTES_IDENTIFIER_PLAYING =
0x0000000000000000,
AVRC_ELEMENT_ATTRIBUTES_IDENTIFIER_RESERVED =
0x0000000000000001,
};
* @brief This enumeration declares the allowed values for GetCapabilities Command.
*
* @since 6
*/
enum AvrcCapabilityId : uint8_t {
AVRC_CAPABILITY_COMPANYID = 0x02,
AVRC_CAPABILITY_EVENTID = 0x03,
};
* @brief This enumeration declares the values of playback interval in seconds.
*
* @since 6
*/
enum AvrcPlaybackInterval : uint8_t {
AVRC_PLAYBACK_INTERVAL_1_SEC = 0x01,
AVRC_PLAYBACK_INTERVAL_5_SEC = 0x05,
AVRC_PLAYBACK_INTERVAL_10_SEC = 0x0A,
AVRC_PLAYBACK_INTERVAL_15_SEC = 0x0F,
AVRC_PLAYBACK_INTERVAL_20_SEC = 0x14,
AVRC_PLAYBACK_INTERVAL_25_SEC = 0x19,
AVRC_PLAYBACK_INTERVAL_30_SEC = 0x1E,
};
* @brief This enumeration declares the error / status code of the vendor dependent command frame and the browsing
* command frame.
*
* @since 6
*/
enum AvrcEsCode : uint8_t {
AVRC_ES_CODE_INVALID = 0xFF,
AVRC_ES_CODE_INVALID_COMMAND = 0x00,
AVRC_ES_CODE_INVALID_PARAMETER = 0x01,
AVRC_ES_CODE_PARAMETER_CONTENT_ERROR = 0x02,
AVRC_ES_CODE_INTERNAL_ERROR = 0x03,
AVRC_ES_CODE_NO_ERROR = 0x04,
AVRC_ES_CODE_UID_CHANGED = 0x05,
AVRC_ES_CODE_RESERVED = 0x06,
AVRC_ES_CODE_INVALID_DIRECTION = 0x07,
AVRC_ES_CODE_NOT_A_DIRECTORY = 0x08,
AVRC_ES_CODE_DOES_NOT_EXIST = 0x09,
AVRC_ES_CODE_INVALID_SCOPE = 0x0A,
AVRC_ES_CODE_RANGE_OUT_OF_BOUNDS = 0x0B,
AVRC_ES_CODE_FOLDER_ITEM_IS_NOT_PLAYABLE = 0x0C,
AVRC_ES_CODE_MEDIA_IN_USE = 0x0D,
AVRC_ES_CODE_NOW_PLAYING_LIST_FULL = 0x0E,
AVRC_ES_CODE_SEARCH_NOT_SUPPORTED = 0x0F,
AVRC_ES_CODE_SEARCH_IN_PROGRESS = 0x10,
AVRC_ES_CODE_INVALID_PLAYER_ID = 0x11,
AVRC_ES_CODE_PLAYER_NOT_BROWSABLE = 0x12,
AVRC_ES_CODE_PLAYER_NOT_ADDRESSED = 0x13,
AVRC_ES_CODE_NO_VALID_SEARCH_RESULTS = 0x14,
AVRC_ES_CODE_NO_AVAILABLE_PLAYERS = 0x15,
AVRC_ES_CODE_ADDRESSED_PLAYER_CHANGED = 0x16,
AVRC_ES_CODE_NOTIFICATION_CHANGED = 0xFF,
};
*
* HFP Definitions
*
*********************************************/
* @brief sco connect state define
* use to notify sco connection observers.
*/
enum class HfpScoConnectState : int { SCO_DISCONNECTED = 3, SCO_CONNECTING, SCO_DISCONNECTING, SCO_CONNECTED };
*
* A2DP Definitions
*
*********************************************/
* @brief a2dp optional codec support state define
*
* @since 6
*/
enum A2DP_OPTIONAL_SUPPORT_STATE {
A2DP_OPTIONAL_NOT_SUPPORT,
A2DP_OPTIONAL_SUPPORT,
A2DP_OPTIONAL_SUPPORT_UNKNOWN,
};
* @brief a2dp optional codec enable state define
*
* @since 6
*/
enum A2DP_OPTIONAL_ENABLE_STATE { A2DP_OPTIONAL_DISABLE, A2DP_OPTIONAL_ENABLE, A2DP_OPTIONAL_ENABLE_UNKNOWN };
* @brief a2dp playing state define
*
* @since 6
*/
enum A2DP_PLAYING_STATE { A2DP_NOT_PLAYING, A2DP_IS_PLAYING };
* @brief A2dp codec type enum.
*
* @since 6
*/
enum A2dpUserCodecType : uint8_t {
A2DP_CODEC_TYPE_SBC_USER = 0,
A2DP_CODEC_TYPE_MPEG1_USER = 0x01,
A2DP_CODEC_TYPE_AAC_USER = 0x01 << 1,
A2DP_CODEC_TYPE_ATRAC_USER = 0x01 << 2,
A2DP_CODEC_TYPE_L2HCV2_USER = 0x0A,
A2DP_CODEC_TYPE_L2HCST_USER = 0x0B,
A2DP_CODEC_TYPE_LDAC_USER = 0x10,
A2DP_CODEC_TYPE_NONA2DP_USER = 0xFF
};
* @brief A2dp codec priority enum.
*
* @since 6
*/
enum A2dpUserCodecPriority : uint32_t {
A2DP_CODEC_PRIORITY_DISABLED_USER = 0,
A2DP_CODEC_PRIORITY_DEFAULT_USER,
A2DP_CODEC_PRIORITY_SBC_USER = 1001,
A2DP_CODEC_PRIORITY_AAC_USER = 2001,
A2DP_CODEC_PRIORITY_LDAC_USER = 5001,
A2DP_CODEC_PRIORITY_L2HCST_USER = 8000,
A2DP_CODEC_PRIORITY_L2HCV2_USER = 8001,
A2DP_CODEC_PRIORITY_HIGHEST_USER = 1000 * 1000,
};
* @brief A2dp codec sample rate enum.
*
* @since 6
*/
enum A2dpUserCodecSampleRate : uint32_t {
A2DP_SAMPLE_RATE_NONE_USER = 0x0,
A2DP_SBC_SAMPLE_RATE_48000_USER = 0x1 << 4,
A2DP_SBC_SAMPLE_RATE_44100_USER = 0x1 << 5,
A2DP_SBC_SAMPLE_RATE_32000_USER = 0x1 << 6,
A2DP_SBC_SAMPLE_RATE_16000_USER = 0x1 << 7,
A2DP_SBC_SAMPLE_RATE_MSK_USER = 0xF0,
A2DP_AAC_SAMPLE_RATE_OCTET1_44100_USER = 0x01,
A2DP_AAC_SAMPLE_RATE_OCTET1_32000_USER = 0x01 << 1,
A2DP_AAC_SAMPLE_RATE_OCTET1_24000_USER = 0x01 << 2,
A2DP_AAC_SAMPLE_RATE_OCTET1_22050_USER = 0x01 << 3,
A2DP_AAC_SAMPLE_RATE_OCTET1_16000_USER = 0x01 << 4,
A2DP_AAC_SAMPLE_RATE_OCTET1_12000_USER = 0x01 << 5,
A2DP_AAC_SAMPLE_RATE_OCTET1_11025_USER = 0x01 << 6,
A2DP_AAC_SAMPLE_RATE_OCTET1_8000_USER = 0x01 << 7,
A2DP_AAC_SAMPLE_RATE_OCTET1_MSK_USER = 0xFF,
A2DP_AAC_SAMPLE_RATE_OCTET2_96000_USER = 0x01 << 12,
A2DP_AAC_SAMPLE_RATE_OCTET2_88200_USER = 0x01 << 13,
A2DP_AAC_SAMPLE_RATE_OCTET2_64000_USER = 0x01 << 14,
A2DP_AAC_SAMPLE_RATE_OCTET2_48000_USER = 0x01 << 15,
A2DP_AAC_SAMPLE_RATE_OCTET2_MSK_USER = 0xF0,
A2DP_L2HCV2_SAMPLE_RATE_48000_USER = 0x01 << 1,
A2DP_L2HCV2_SAMPLE_RATE_96000_USER = 0x01 << 3,
A2DP_L2HCV2_SAMPLE_RATE_ALL_MSK_USER = 0x0A,
};
* @brief A2dp codec channel mode enum.
*
* @since 6
*/
enum A2dpUserCodecChannelMode : uint8_t {
A2DP_CHANNEL_MODE_NONE_USER = 0x0,
A2DP_SBC_CHANNEL_MODE_JOINT_STEREO_USER = 0x1,
A2DP_SBC_CHANNEL_MODE_STEREO_USER = 0x1 << 1,
A2DP_SBC_CHANNEL_MODE_DUAL_USER = 0x1 << 2,
A2DP_SBC_CHANNEL_MODE_MONO_USER = 0x1 << 3,
A2DP_SBC_CHANNEL_MODE_MONO_STEREO_USER = 0x0A,
A2DP_SBC_CHANNEL_MODE_MSK_USER = 0x0F,
A2DP_AAC_CHANNEL_MODE_OCTET2_DOUBLE_USER = 0x01 << 2,
A2DP_AAC_CHANNEL_MODE_OCTET2_SINGLE_USER = 0x01 << 3,
A2DP_AAC_CHANNEL_MODE_OCTET2_MSK_USER = 0x0C,
};
* @brief A2dp codec L2HCST bit rate enum.
*
* @since 19
*/
enum A2dpUserL2hcStCodecBitRate : uint32_t {
A2DP_L2HCST_BIT_RATE_DEFAULT = 0x0,
A2DP_L2HCST_BIT_RATE_320K = 0x01,
A2DP_L2HCST_BIT_RATE_640K = 0x01 << 1,
A2DP_L2HCST_BIT_RATE_960K = 0x01 << 2,
A2DP_L2HCST_BIT_RATE_AUTO_RATE = 0x01 << 3,
A2DP_L2HCST_BIT_RATE_96K = 0x01 << 4,
A2DP_L2HCST_BIT_RATE_LOSSLESS = 0x01 << 5,
A2DP_L2HCST_BIT_RATE_128K = 0x01 << 6,
A2DP_L2HCST_BIT_RATE_192K = 0x01 << 7,
A2DP_L2HCST_BIT_RATE_256K = 0x01 << 8,
A2DP_L2HCST_BIT_RATE_480K = 0x01 << 9,
};
* @brief A2dp codec L2HCV2 bit rate enum.
*
* @since 21
*/
enum A2dpUserL2hcV2CodecBitRate : uint32_t {
A2DP_L2HCV2_BIT_RATE_DEFAULT = 0x0,
A2DP_L2HCV2_BIT_RATE_320K = 0x01,
A2DP_L2HCV2_BIT_RATE_640K = 0x01 << 1,
A2DP_L2HCV2_BIT_RATE_960K = 0x01 << 2,
A2DP_L2HCV2_BIT_RATE_AUTO_RATE = 0x01 << 3,
A2DP_L2HCV2_BIT_RATE_1500K = 0x01 << 4,
A2DP_L2HCV2_BIT_RATE_2300K = 0x01 << 5,
};
* @brief A2dp codec frame length enum.
*
* @since 19
*/
enum A2dpUserCodecFramelength : uint8_t {
A2DP_L2HCST_FRAME_LENGTH_5MS = 0x01,
A2DP_L2HCST_FRAME_LENGTH_10MS = 0x01 << 1,
};
* @brief A2dp codec bits per sample enum.
*
* @since 6
*/
enum A2dpUserCodecBitsPerSample : uint8_t {
A2DP_SAMPLE_BITS_NONE_USER = 0x0,
A2DP_SAMPLE_BITS_16_USER = 0x1 << 0,
A2DP_SAMPLE_BITS_24_USER = 0x1 << 1,
A2DP_SAMPLE_BITS_32_USER = 0x1 << 2,
A2DP_SAMPLE_BITS_MSK_USER = 0x06,
A2DP_AAC_SAMPLE_BITS_OCTET3_BIT0_USER = 0x01,
A2DP_AAC_SAMPLE_BITS_OCTET3_BIT1_USER = 0x01 << 1,
A2DP_AAC_SAMPLE_BITS_OCTET3_BIT2_USER = 0x01 << 2,
A2DP_AAC_SAMPLE_BITS_OCTET3_BIT3_USER = 0x01 << 3,
A2DP_AAC_SAMPLE_BITS_OCTET3_BIT4_USER = 0x01 << 4,
A2DP_AAC_SAMPLE_BITS_OCTET3_BIT5_USER = 0x01 << 5,
A2DP_AAC_SAMPLE_BITS_OCTET3_BIT6_USER = 0x01 << 6,
A2DP_AAC_SAMPLE_BITS_OCTET4_BIT0_USER = 0x01,
A2DP_AAC_SAMPLE_BITS_OCTET4_BIT1_USER = 0x01 << 1,
A2DP_AAC_SAMPLE_BITS_OCTET4_BIT2_USER = 0x01 << 2,
A2DP_AAC_SAMPLE_BITS_OCTET4_BIT3_USER = 0x01 << 3,
A2DP_AAC_SAMPLE_BITS_OCTET4_BIT4_USER = 0x01 << 4,
A2DP_AAC_SAMPLE_BITS_OCTET4_BIT5_USER = 0x01 << 5,
A2DP_AAC_SAMPLE_BITS_OCTET4_BIT6_USER = 0x01 << 6,
A2DP_AAC_SAMPLE_BITS_OCTET4_BIT7_USER = 0x01 << 7,
A2DP_AAC_SAMPLE_BITS_OCTET5_BIT0_USER = 0x01,
A2DP_AAC_SAMPLE_BITS_OCTET5_BIT1_USER = 0x01 << 1,
A2DP_AAC_SAMPLE_BITS_OCTET5_BIT2_USER = 0x01 << 2,
A2DP_AAC_SAMPLE_BITS_OCTET5_BIT3_USER = 0x01 << 3,
A2DP_AAC_SAMPLE_BITS_OCTET5_BIT4_USER = 0x01 << 4,
A2DP_AAC_SAMPLE_BITS_OCTET5_BIT5_USER = 0x01 << 5,
A2DP_AAC_SAMPLE_BITS_OCTET5_BIT6_USER = 0x01 << 6,
A2DP_AAC_SAMPLE_BITS_OCTET5_BIT7_USER = 0x01 << 7,
};
* @brief Pbap action Type.
*
* @since 6
*/
enum PbapActionType : uint16_t {
PBAP_ACTION_PULLPHONEBOOKSIZE,
PBAP_ACTION_PULLPHONEBOOK,
PBAP_ACTION_SETPHONEBOOK,
PBAP_ACTION_PULLVCARDLISTINGSIZE,
PBAP_ACTION_PULLVCARDLISTING,
PBAP_ACTION_PULLVCARDENTRY,
PBAP_ACTION_ABORT,
};
#define PBAP_PHONEBOOK_PB u"/telecom/pb.vcf"
#define PBAP_PHONEBOOK_ICH u"/telecom/ich.vcf"
#define PBAP_PHONEBOOK_OCH u"/telecom/och.vcf"
#define PBAP_PHONEBOOK_MCH u"/telecom/mch.vcf"
#define PBAP_PHONEBOOK_CCH u"/telecom/cch.vcf"
#define PBAP_PHONEBOOK_SPD u"/telecom/spd.vcf"
#define PBAP_PHONEBOOK_FAV u"/telecom/fav.vcf"
#define PBAP_PHONEBOOK_PB1 u"/SIM1/telecom/pb.vcf"
#define PBAP_PHONEBOOK_ICH1 u"/SIM1/telecom/ich.vcf"
#define PBAP_PHONEBOOK_OCH1 u"/SIM1/telecom/och.vcf"
#define PBAP_PHONEBOOK_MCH1 u"/SIM1/telecom/mch.vcf"
#define PBAP_PHONEBOOK_CCH1 u"/SIM1/telecom/cch.vcf"
enum PbapOrderType : uint8_t {
PBAP_ORDER_INDEXED = 0x00,
PBAP_ORDER_ALPHANUMERIC = 0x01,
PBAP_ORDER_PHONETIC = 0x02,
};
enum PbapFormatType : uint8_t {
PBAP_FORMAT_VCARD2_1 = 0x00,
PBAP_FORMAT_VCARD3_0 = 0x01,
};
#define PBAP_PROPERTY_VERSION (1ULL << 0)
#define PBAP_PROPERTY_FN (1ULL << 1)
#define PBAP_PROPERTY_N (1ULL << 2)
#define PBAP_PROPERTY_PHOTO (1ULL << 3)
#define PBAP_PROPERTY_BDAY (1ULL << 4)
#define PBAP_PROPERTY_ADR (1ULL << 5)
#define PBAP_PROPERTY_LABEL (1ULL << 6)
#define PBAP_PROPERTY_TEL (1ULL << 7)
#define PBAP_PROPERTY_EMAIL (1ULL << 8)
#define PBAP_PROPERTY_MAILER (1ULL << 9)
#define PBAP_PROPERTY_TZ (1ULL << 10)
#define PBAP_PROPERTY_GEO (1ULL << 11)
#define PBAP_PROPERTY_TITLE (1ULL << 12)
#define PBAP_PROPERTY_ROLE (1ULL << 13)
#define PBAP_PROPERTY_LOGO (1ULL << 14)
#define PBAP_PROPERTY_AGENT (1ULL << 15)
#define PBAP_PROPERTY_ORG (1ULL << 16)
#define PBAP_PROPERTY_NOTE (1ULL << 17)
#define PBAP_PROPERTY_REV (1ULL << 18)
#define PBAP_PROPERTY_SOUND (1ULL << 19)
#define PBAP_PROPERTY_URL (1ULL << 20)
#define PBAP_PROPERTY_UID (1ULL << 21)
#define PBAP_PROPERTY_KEY (1ULL << 22)
#define PBAP_PROPERTY_NICKNAME (1ULL << 23)
#define PBAP_PROPERTY_CATEGORIES (1ULL << 24)
#define PBAP_PROPERTY_PROID (1ULL << 25)
#define PBAP_PROPERTY_CLASS (1ULL << 26)
#define PBAP_PROPERTY_SORT_STRING (1ULL << 27)
#define PBAP_PROPERTY_X_IRMC_CALL_DATETIME (1ULL << 28)
#define PBAP_PROPERTY_X_BT_SPEEDDIALKEY (1ULL << 29)
#define PBAP_PROPERTY_X_BT_UCI (1ULL << 30)
#define PBAP_PROPERTY_X_BT_UID (1ULL << 31)
#define PBAP_PROPERTY_PROPRIENTARY_FILTER (1ULL << 39)
enum PbapSelectorOperatorType : uint8_t {
PBAP_SELECTOR_OPERATOR_OR = 0x00,
PBAP_SELECTOR_OPERATOR_AND = 0x01,
};
enum PbapSearchPropertyType : uint8_t {
PBAP_SEARCH_PROPERTY_NAME = 0x00,
PBAP_SEARCH_PROPERTY_NUMBER = 0x01,
PBAP_SEARCH_PROPERTY_SOUND = 0x02,
};
const uint8_t PBAP_FLAG_GO_TO_ROOT = 0x02;
const uint8_t PBAP_FLAG_GO_DOWN = 0x02;
const uint8_t PBAP_FLAG_GO_UP = 0x03;
constexpr const int32_t VIRTUAL_DEVICE_ADD = 0;
constexpr const int32_t VIRTUAL_DEVICE_REMOVE = 1;
enum PbapResponseCode : uint8_t {
PBAP_CONTINUE = 0x90,
PBAP_SUCCESS = 0xA0,
PBAP_CREATED = 0xA1,
PBAP_PBAP_ACCEPTED = 0xA2,
PBAP_NON_AUTH = 0xA3,
PBAP_NO_CONTENT = 0xA4,
PBAP_RESET_CONTENT = 0xA5,
PBAP_PARTIAL_CONTENT = 0xA6,
PBAP_MULTIPLE_CHOICES = 0xB0,
PBAP_MOVED_PERMANENTLY = 0xB1,
PBAP_MOVED_TEMPORARILY = 0xB2,
PBAP_SEE_OTHER = 0xB3,
PBAP_NOT_MODIFIED = 0xB4,
PBAP_USE_PROXY = 0xB5,
PBAP_BAD_REQUEST = 0xC0,
PBAP_UNAUTHORIZED = 0xC1,
PBAP_PAYMENT_REQUIRED = 0xC2,
PBAP_FORBIDDEN = 0xC3,
PBAP_NOT_FOUND = 0xC4,
PBAP_METHOD_NOT_ALLOWED = 0xC5,
PBAP_NOT_ACCEPTABLE = 0xC6,
PBAP_PROXY_AUTH_REQUIRED = 0xC7,
PBAP_REQUEST_TIME_OUT = 0xC8,
PBAP_CONFLICT = 0xC9,
PBAP_GONE = 0xCA,
PBAP_LENGTH_REQUIRED = 0xCB,
PBAP_PRECONDITION_FAILED = 0xCC,
PBAP_REQUESTED_ENTITY_TOO_LARGE = 0xCD,
PBAP_REQUEST_URL_TOO_LARGE = 0xCE,
PBAP_UNSUPPORTED_MEDIA_TYPE = 0xCF,
PBAP_INTERNAL_SERVER_ERROR = 0xD0,
PBAP_NOT_IMPLEMENTED = 0xD1,
PBAP_BAD_GATEWAY = 0xD2,
PBAP_SERVICE_UNAVAILABLE = 0xD3,
PBAP_GATEWAY_TIMEOUT = 0xD4,
PBAP_HTTP_VERSION_NOT_SUPPORTED = 0xD5,
PBAP_DATABASE_FULL = 0xE0,
PBAP_DATABASE_LOCKED = 0xE1
};
struct CocUpdateSocketParam {
std::string addr;
int32_t minInterval;
int32_t maxInterval;
int32_t peripheralLatency;
int32_t supervisionTimeout;
int32_t minConnEventLen;
int32_t maxConnEventLen;
};
enum UpdateOutputStackAction {
ACTION_WEAR = 0,
ACTION_UNWEAR = 1,
ACTION_ENABLE_FROM_REMOTE = 2,
ACTION_DISABLE_FROM_REMOTE = 3,
ACTION_ENABLE_WEAR_DETECTION = 4,
ACTION_DISABLE_WEAR_DETECTION = 5,
ACTION_USER_OPERATION = 6,
ACTION_STOP_VIRTUAL_CALL = 7,
ACTION_UPDATE_DEVICE_TYPE = 8,
};
enum HfpAgScoStateChangeReason {
HFP_AG_SCO_INVALID = 0,
HFP_AG_SCO_LOCAL_USER_TERMINATED = 1,
HFP_AG_SCO_REMOTE_USER_TERMINATED = 2,
HFP_AG_SCO_LOCAL_USER_SET_UP = 3,
HFP_AG_SCO_REMOTE_USER_SET_UP = 4,
};
enum DeviceType {
DEVICE_TYPE_DEFAULT = 0,
DEVICE_TYPE_CAR = 1,
DEVICE_TYPE_HEADSET = 2,
DEVICE_TYPE_HEARING = 3,
DEVICE_TYPE_GLASSES = 4,
DEVICE_TYPE_WATCH = 5,
DEVICE_TYPE_SPEAKER = 6,
DEVICE_TYPE_OTHERS = 7,
};
enum DeviceInfoType {
DEVICE_INFO_UNKNOWN = -1,
DEVICE_VENDOR_ID = 0,
DEVICE_PRODUCT_ID = 1,
DEVICE_MODEL_ID = 2,
DEVICE_CUSTOM_TYPE = 3,
DEVICE_DEVICE_OF_TYPE = 4
};
enum BluetoothSensingEventId : uint8_t {
INVALID_SENSING_EVENT = 0x00,
SPP_CLIENT_CONNECT_DONE = 0x01,
SPP_SERVER_CONNECT_DONE = 0x02,
SPP_PORT_CLOSE = 0x03,
SPP_SERVER_CLOSE = 0x04,
SPP_SERVER_LISTEN_DONE = 0x05,
GATT_SERVER_REGISTER_DONE = 0x10,
GATT_SERVER_UNREGISTER_DONE = 0x11,
GATT_CLIENT_CONNECT_DONE = 0x012,
GATT_CLIENT_CONNECT_CLOSE = 0x13,
GATT_SERVER_CONNECT_DONE = 0x14,
GATT_SERVER_CONNECT_CLOSE = 0x15,
SOCKET_REGISTER_APPLICATION_PKGNAME = 0x20,
GATT_REGISTER_APPLICATION_PKGNAME = 0x21,
BLE_CONN_INTERVAL_UPDATE = 0X30,
BLE_ADV_STARTED = 0X40,
BLE_ADV_STOPPED = 0X41,
BLE_SCAN_STARTED_EVENT = 0X50,
BLE_SCAN_STOPPED_EVENT = 0X51,
BLE_SCAN_ENHANCE_MODE_STARTED_EVENT = 0x52,
BLE_SCAN_ENHANCE_MODE_STOPPED_EVENT = 0x53,
};
enum BluetoothDecisionEventId : uint8_t {
INVALID_DECISION_EVENT = 0x00,
BLE_FASTEST_CONN_DECISION = 0x01,
};
enum BluetoothResourceDecisionResult {
CONNECTION_REJECT = 0x00,
CONNECTION_ACCEPT,
CONNECTION_ACCEPT_WITH_PARAM_ADJUST,
CONNECTION_PREEMPTION,
};
typedef enum {
BLE_SCAN_ENHANCE_MODE_BALANCED = 0x00,
BLE_SCAN_ENHANCE_MODE_MEDIUM = 0x01,
BLE_SCAN_ENHANCE_MODE_FAST = 0x02,
BLE_SCAN_ENHANCE_MODE_ULTRA_FAST = 0x03,
BLE_SCAN_ENHANCE_MODE_INVALID = 0xFF,
} EnhanceMode;
constexpr int64_t BLE_SCAN_ENHANCE_MODE_MAX_TIMEOUT_MS = 2500;
struct BleScanEnhanceModeImpl {
BleScanEnhanceModeImpl() = default;
BleScanEnhanceModeImpl(bool isEnable, int mode, int64_t timeout)
: isEnable(isEnable), mode(mode), timeout(timeout),
timestamp(std::chrono::duration_cast<std::chrono::milliseconds>
(std::chrono::system_clock::now().time_since_epoch()).count())
{}
~BleScanEnhanceModeImpl() {}
bool isEnable = false;
int mode = BLE_SCAN_ENHANCE_MODE_INVALID;
int64_t timeout = BLE_SCAN_ENHANCE_MODE_MAX_TIMEOUT_MS;
int64_t timestamp = 0;
};
enum BluetoothSwitchState {
STATE_ON,
STATE_OFF,
STATE_HALF,
};
enum BluetoothTransferredSwitchAction {
TRANS_ACTION_ENABLE_BLUETOOTH = 0,
TRANS_ACTION_DISABLE_BLUETOOTH,
TRANS_ACTION_ENABLE_BLUETOOTH_TO_RESTRICT_MODE,
};
enum ControlType {
PLAY = 0,
VIBRATE = 1,
FLASH = 2,
LOCK = 3,
ERASE = 4,
};
enum ControlTypeVal {
DISABLE = 0,
ENABLE = 1,
QUERY = 2,
};
enum ControlObject {
LEFT_EAR = 0,
RIGHT_EAR = 1,
LEFT_RIGHT_EAR = 2,
};
enum class RandomDeviceIdCommand {
ADD = 1,
DELETE,
GET,
IS_VALID
};
enum ProfileConnectionState {
STATE_DISCONNECTED = 0,
STATE_CONNECTING = 1,
STATE_CONNECTED = 2,
STATE_DISCONNECTING = 3
};
enum class HfpFeatureType {
VGS = 1,
VOICE_RECOGNITION,
};
enum DialogBoxType {
BLUETOOTH_SWITCH = 0,
};
enum SetAdvDataType : int32_t {
SET_ADV_DATA_BOTH = 0,
SET_ADV_DATA_ONLY_ADV,
SET_ADV_DATA_ONLY_RSP
};
typedef enum {
INNER_BLE_NO_RANGING_TYPE = 0X00,
INNER_BLE_RANGING_TOUCH = 0X01,
INNER_BLE_RANGING_APPROACH = 0X02,
} BleAppType;
#define INNER_BLE_RANGING_INVALID_ADVPOWER 127
#ifdef BLUETOOTH_EXPORT
#define BLUETOOTH_API __attribute__((visibility("default")))
#else
#define BLUETOOTH_API
#endif
}
}
#endif