Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4e78f10 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Reland BTM: Clean up unused header definition

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I00c4014c7f570f0b0811296fea3cedda04e37978
parent f1d7be31
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -202,18 +202,8 @@ typedef struct { void* p_param; } tBTM_BLE_CONN_REQ;

/* LE state request */
#define BTM_BLE_STATE_INVALID 0
#define BTM_BLE_STATE_CONN_ADV 1
#define BTM_BLE_STATE_INIT 2
#define BTM_BLE_STATE_MASTER 3
#define BTM_BLE_STATE_SLAVE 4
#define BTM_BLE_STATE_LO_DUTY_DIR_ADV 5
#define BTM_BLE_STATE_HI_DUTY_DIR_ADV 6
#define BTM_BLE_STATE_NON_CONN_ADV 7
#define BTM_BLE_STATE_PASSIVE_SCAN 8
#define BTM_BLE_STATE_ACTIVE_SCAN 9
#define BTM_BLE_STATE_SCAN_ADV 10
#define BTM_BLE_STATE_MAX 11
typedef uint8_t tBTM_BLE_STATE;

#define BTM_BLE_STATE_CONN_ADV_BIT 0x0001
#define BTM_BLE_STATE_INIT_BIT 0x0002
@@ -231,8 +221,6 @@ typedef uint16_t tBTM_BLE_STATE_MASK;
#define BTM_BLE_STATE_ALL_ADV_MASK                                  \
  (BTM_BLE_STATE_CONN_ADV_BIT | BTM_BLE_STATE_LO_DUTY_DIR_ADV_BIT | \
   BTM_BLE_STATE_HI_DUTY_DIR_ADV_BIT | BTM_BLE_STATE_SCAN_ADV_BIT)
#define BTM_BLE_STATE_ALL_SCAN_MASK \
  (BTM_BLE_STATE_PASSIVE_SCAN_BIT | BTM_BLE_STATE_ACTIVE_SCAN_BIT)
#define BTM_BLE_STATE_ALL_CONN_MASK \
  (BTM_BLE_STATE_MASTER_BIT | BTM_BLE_STATE_SLAVE_BIT)

@@ -262,10 +250,6 @@ typedef struct {
  3 /* BLE privacy mixed mode, broadcom propietary mode */
typedef uint8_t tBTM_PRIVACY_MODE;

/* data length change event callback */
typedef void(tBTM_DATA_LENGTH_CHANGE_CBACK)(uint16_t max_tx_length,
                                            uint16_t max_rx_length);

/* Define BLE Device Management control structure
*/
typedef struct {
+0 −6
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ extern void btm_cont_rswitch(tACL_CONN* p, tBTM_SEC_DEV_REC* p_dev_rec,
                             uint8_t hci_status);

extern uint8_t btm_handle_to_acl_index(uint16_t hci_handle);
extern void btm_read_link_policy_complete(uint8_t* p);

extern void btm_read_rssi_timeout(void* data);
extern void btm_read_rssi_complete(uint8_t* p);
@@ -104,7 +103,6 @@ extern void btm_read_automatic_flush_timeout_complete(uint8_t* p);
extern void btm_read_tx_power_timeout(void* data);
extern void btm_read_tx_power_complete(uint8_t* p, bool is_ble);

extern void btm_read_link_quality_timeout(void* data);
extern void btm_read_link_quality_complete(uint8_t* p);

extern tBTM_STATUS btm_set_packet_types(tACL_CONN* p, uint16_t pkt_types);
@@ -145,7 +143,6 @@ extern void btm_pm_proc_ssr_evt(uint8_t* p, uint16_t evt_len);
extern tBTM_STATUS btm_read_power_mode_state(const RawAddress& remote_bda,
                                             tBTM_PM_STATE* pmState);
extern void btm_sco_chk_pend_unpark(uint8_t hci_status, uint16_t hci_handle);
extern void btm_qos_setup_timeout(void* data);
extern void btm_qos_setup_complete(uint8_t status, uint16_t handle,
                                   FLOW_SPEC* p_flow);

@@ -229,7 +226,6 @@ extern tBTM_STATUS btm_sec_mx_access_request(const RawAddress& bd_addr,
extern void btm_sec_conn_req(const RawAddress& bda, uint8_t* dc);
extern void btm_create_conn_cancel_complete(uint8_t* p);

extern void btm_read_inq_tx_power_timeout(void* data);
extern void btm_read_inq_tx_power_complete(uint8_t* p);

extern void btm_sec_init(uint8_t sec_mode);
@@ -264,7 +260,6 @@ extern void btm_sec_set_peer_sec_caps(tACL_CONN* p_acl_cb,
extern void btm_sec_clear_ble_keys(tBTM_SEC_DEV_REC* p_dev_rec);
extern bool btm_sec_is_a_bonded_dev(const RawAddress& bda);
extern void btm_consolidate_dev(tBTM_SEC_DEV_REC* p_target_rec);
extern bool btm_sec_is_le_capable_dev(const RawAddress& bda);
extern bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec,
                                     const RawAddress& new_pseudo_addr);
extern tBTM_SEC_SERV_REC* btm_sec_find_first_serv(CONNECTION_TYPE conn_type,
@@ -279,7 +274,6 @@ extern void btm_rem_oob_req(uint8_t* p);
extern void btm_read_local_oob_complete(uint8_t* p);

extern void btm_acl_resubmit_page(void);
extern void btm_acl_reset_paging(void);
extern void btm_acl_paging(BT_HDR* p, const RawAddress& dest);
extern uint8_t btm_sec_clr_service_by_psm(uint16_t psm);
extern void btm_sec_clr_temp_auth_service(const RawAddress& bda);
+0 −41
Original line number Diff line number Diff line
@@ -243,10 +243,7 @@ typedef struct {
  tBTM_INQ_TYPE scan_type;

  RawAddress remname_bda; /* Name of bd addr for active remote name request */
#define BTM_RMT_NAME_INACTIVE 0
#define BTM_RMT_NAME_EXT 0x1 /* Initiated through API */
#define BTM_RMT_NAME_SEC 0x2 /* Initiated internally by security manager */
#define BTM_RMT_NAME_INQ 0x4 /* Remote name initiated internally by inquiry */
  bool remname_active; /* State of a remote name request by external API */

  tBTM_CMPL_CB* p_inq_cmpl_cb;
@@ -282,7 +279,6 @@ typedef struct {
  2 /* Sets the new filter (or turns off filtering) in this state */
#define BTM_INQ_ACTIVE_STATE \
  3 /* Actual inquiry or periodic inquiry is in progress */
#define BTM_INQ_REMNAME_STATE 4 /* Remote name requests are active  */

  uint8_t state;      /* Current state that the inquiry process is in */
  uint8_t inq_active; /* Bit Mask indicating type of inquiry is active */
@@ -297,8 +293,6 @@ typedef struct {

#define BTM_SEC_INVALID_HANDLE 0xFFFF

typedef uint8_t* BTM_BD_NAME_PTR; /* Pointer to Device name */

/* Security callback is called by this unit when security
 *   procedures are completed.  Parameters are
 *              BD Address of remote
@@ -316,8 +310,6 @@ typedef void(tBTM_SCO_IND_CBACK)(uint16_t sco_inx);
#define BTM_ESCO_PKT_TYPE_MASK \
  (ESCO_PKT_TYPES_MASK_HV1 | ESCO_PKT_TYPES_MASK_HV2 | ESCO_PKT_TYPES_MASK_HV3)

#define BTM_SCO_2_ESCO(scotype) \
  ((uint16_t)(((scotype)&BTM_SCO_PKT_TYPE_MASK) >> 5))
#define BTM_ESCO_2_SCO(escotype) \
  ((uint16_t)(((escotype)&BTM_ESCO_PKT_TYPE_MASK) << 5))

@@ -332,8 +324,6 @@ typedef void(tBTM_SCO_IND_CBACK)(uint16_t sco_inx);
  (ESCO_PKT_TYPES_MASK_NO_2_EV3 | ESCO_PKT_TYPES_MASK_NO_3_EV3 | \
   ESCO_PKT_TYPES_MASK_NO_2_EV5 | ESCO_PKT_TYPES_MASK_NO_3_EV5)

#define BTM_SCO_ROUTE_UNKNOWN 0xff

/* Define the structure that contains (e)SCO data */
typedef struct {
  tBTM_ESCO_CBACK* p_esco_cback; /* Callback for eSCO events     */
@@ -603,35 +593,6 @@ enum {
};
typedef uint8_t tBTM_PM_STATE;

enum {
  BTM_PM_SET_MODE_EVT, /* Set power mode API is called. */
  BTM_PM_UPDATE_EVT,
  BTM_PM_RD_MODE_EVT /* Read power mode API is called. */
};
typedef uint8_t tBTM_PM_EVENT;

typedef struct {
  uint16_t event;
  uint16_t len;
  uint8_t link_ind;
} tBTM_PM_MSG_DATA;

typedef struct {
  uint8_t hci_status;
  uint8_t mode;
  uint16_t interval;
} tBTM_PM_MD_CHG_DATA;

typedef struct {
  uint8_t pm_id; /* the entity that calls SetPowerMode API */
  tBTM_PM_PWR_MD* p_pmd;
} tBTM_PM_SET_MD_DATA;

typedef struct {
  void* p_data;
  uint8_t link_ind;
} tBTM_PM_SM_DATA;

typedef struct {
  tBTM_PM_PWR_MD req_mode[BTM_MAX_PM_RECORDS + 1]; /* the desired mode and
                                                      parameters of the
@@ -716,8 +677,6 @@ typedef struct {
  tBTM_BLE_SEC_ACT sec_act;
} tBTM_SEC_QUEUE_ENTRY;

#define CONN_ORIENT_TERM false
#define CONN_ORIENT_ORIG true
typedef bool CONNECTION_TYPE;

// Bluetooth Quality Report - Report receiver
+0 −213
Original line number Diff line number Diff line
@@ -56,26 +56,9 @@ enum {

typedef uint8_t tBTM_STATUS;

/*************************
 *  Device Control Types
 *************************/
#define BTM_DEVICE_ROLE_BR 0x01
#define BTM_DEVICE_ROLE_DUAL 0x02
#define BTM_MAX_DEVICE_ROLE BTM_DEVICE_ROLE_DUAL
typedef uint8_t tBTM_DEVICE_ROLE;

/* Device name of peer (may be truncated to save space in BTM database) */
typedef uint8_t tBTM_BD_NAME[BTM_MAX_REM_BD_NAME_LEN + 1];

/* Structure returned with local version information */
typedef struct {
  uint8_t hci_version;
  uint16_t hci_revision;
  uint8_t lmp_version;
  uint16_t manufacturer;
  uint16_t lmp_subversion;
} tBTM_VERSION_INFO;

/* Structure returned with Vendor Specific Command complete callback */
typedef struct {
  uint16_t opcode;
@@ -83,8 +66,6 @@ typedef struct {
  uint8_t* p_param_buf;
} tBTM_VSC_CMPL;

#define BTM_VSC_CMPL_DATA_SIZE \
  (BTM_MAX_VENDOR_SPECIFIC_LEN + sizeof(tBTM_VSC_CMPL))
/**************************************************
 *  Device Control and General Callback Functions
 **************************************************/
@@ -117,12 +98,6 @@ typedef void(tBTM_CMPL_CB)(void* p1);
 */
typedef void(tBTM_VSC_CMPL_CB)(tBTM_VSC_CMPL* p1);

/* Callback for apps to check connection and inquiry filters.
 * Parameters are the BD Address of remote and the Dev Class of remote. If the
 * app returns none zero, the connection or inquiry result will be dropped.
*/
typedef uint8_t(tBTM_FILTER_CB)(const RawAddress& bd_addr, DEV_CLASS dc);

/*****************************************************************************
 *  DEVICE DISCOVERY - Inquiry, Remote Name, Discovery, Class of Device
 ****************************************************************************/
@@ -220,120 +195,40 @@ typedef uint8_t(tBTM_FILTER_CB)(const RawAddress& bd_addr, DEV_CLASS dc);
/* Filter on device addr */
#define BTM_FILTER_COND_BD_ADDR HCI_FILTER_COND_BD_ADDR

/* State of the remote name retrieval during inquiry operations.
 * Used in the tBTM_INQ_INFO structure, and returned in the
 * BTM_InqDbRead, BTM_InqDbFirst, and BTM_InqDbNext functions.
 * The name field is valid when the state returned is
 * BTM_INQ_RMT_NAME_DONE */
#define BTM_INQ_RMT_NAME_EMPTY 0
#define BTM_INQ_RMT_NAME_PENDING 1
#define BTM_INQ_RMT_NAME_DONE 2
#define BTM_INQ_RMT_NAME_FAILED 3

/*********************************
 *** Class of Device constants ***
 *********************************/
#define BTM_FORMAT_TYPE_1 0x00

/****************************
 * minor device class field
 ****************************/

/* 0x00 is used as unclassified for all minor device classes */
#define BTM_COD_MINOR_UNCLASSIFIED 0x00

/* minor device class field for Computer Major Class */
/* #define BTM_COD_MINOR_UNCLASSIFIED       0x00    */
#define BTM_COD_MINOR_DESKTOP_WORKSTATION 0x04
#define BTM_COD_MINOR_SERVER_COMPUTER 0x08
#define BTM_COD_MINOR_LAPTOP 0x0C
#define BTM_COD_MINOR_HANDHELD_PC_PDA 0x10 /* clam shell */
#define BTM_COD_MINOR_PALM_SIZE_PC_PDA 0x14
#define BTM_COD_MINOR_WEARABLE_COMPUTER 0x18 /* watch sized */

/* minor device class field for Phone Major Class */
/* #define BTM_COD_MINOR_UNCLASSIFIED       0x00    */
#define BTM_COD_MINOR_CELLULAR 0x04
#define BTM_COD_MINOR_CORDLESS 0x08
#define BTM_COD_MINOR_SMART_PHONE 0x0C
/* wired modem or voice gatway */
#define BTM_COD_MINOR_WIRED_MDM_V_GTWY 0x10
#define BTM_COD_MINOR_ISDN_ACCESS 0x14

/* minor device class field for LAN Access Point Major Class */
/* Load Factor Field bit 5-7 */
#define BTM_COD_MINOR_FULLY_AVAILABLE 0x00
#define BTM_COD_MINOR_1_17_UTILIZED 0x20
#define BTM_COD_MINOR_17_33_UTILIZED 0x40
#define BTM_COD_MINOR_33_50_UTILIZED 0x60
#define BTM_COD_MINOR_50_67_UTILIZED 0x80
#define BTM_COD_MINOR_67_83_UTILIZED 0xA0
#define BTM_COD_MINOR_83_99_UTILIZED 0xC0
#define BTM_COD_MINOR_NO_SERVICE_AVAILABLE 0xE0
/* sub-Field bit 2-4 */
/* #define BTM_COD_MINOR_UNCLASSIFIED       0x00    */

/* minor device class field for Audio/Video Major Class */
/* #define BTM_COD_MINOR_UNCLASSIFIED       0x00    */
#define BTM_COD_MINOR_CONFM_HEADSET 0x04
#define BTM_COD_MINOR_CONFM_HANDSFREE 0x08
#define BTM_COD_MINOR_MICROPHONE 0x10
#define BTM_COD_MINOR_LOUDSPEAKER 0x14
#define BTM_COD_MINOR_HEADPHONES 0x18
#define BTM_COD_MINOR_PORTABLE_AUDIO 0x1C
#define BTM_COD_MINOR_CAR_AUDIO 0x20
#define BTM_COD_MINOR_SET_TOP_BOX 0x24
#define BTM_COD_MINOR_HIFI_AUDIO 0x28
#define BTM_COD_MINOR_VCR 0x2C
#define BTM_COD_MINOR_VIDEO_CAMERA 0x30
#define BTM_COD_MINOR_CAMCORDER 0x34
#define BTM_COD_MINOR_VIDEO_MONITOR 0x38
#define BTM_COD_MINOR_VIDDISP_LDSPKR 0x3C
#define BTM_COD_MINOR_VIDEO_CONFERENCING 0x40
#define BTM_COD_MINOR_GAMING_TOY 0x48

/* minor device class field for Peripheral Major Class */
/* Bits 6-7 independently specify mouse, keyboard, or combo mouse/keyboard */
#define BTM_COD_MINOR_KEYBOARD 0x40
#define BTM_COD_MINOR_POINTING 0x80
#define BTM_COD_MINOR_COMBO 0xC0
/* Bits 2-5 OR'd with selection from bits 6-7 */
/* #define BTM_COD_MINOR_UNCLASSIFIED       0x00    */
#define BTM_COD_MINOR_JOYSTICK 0x04
#define BTM_COD_MINOR_GAMEPAD 0x08
#define BTM_COD_MINOR_REMOTE_CONTROL 0x0C
#define BTM_COD_MINOR_SENSING_DEVICE 0x10
#define BTM_COD_MINOR_DIGITIZING_TABLET 0x14
#define BTM_COD_MINOR_CARD_READER 0x18 /* e.g. SIM card reader */
#define BTM_COD_MINOR_DIGITAL_PAN 0x1C
#define BTM_COD_MINOR_HAND_SCANNER 0x20
#define BTM_COD_MINOR_HAND_GESTURAL_INPUT 0x24

/* minor device class field for Imaging Major Class */
/* Bits 5-7 independently specify display, camera, scanner, or printer */
#define BTM_COD_MINOR_DISPLAY 0x10
#define BTM_COD_MINOR_CAMERA 0x20
#define BTM_COD_MINOR_SCANNER 0x40
#define BTM_COD_MINOR_PRINTER 0x80
/* Bits 2-3 Reserved */
/* #define BTM_COD_MINOR_UNCLASSIFIED       0x00    */

/* minor device class field for Wearable Major Class */
/* Bits 2-7 meaningful    */
#define BTM_COD_MINOR_WRIST_WATCH 0x04
#define BTM_COD_MINOR_PAGER 0x08
#define BTM_COD_MINOR_JACKET 0x0C
#define BTM_COD_MINOR_HELMET 0x10
#define BTM_COD_MINOR_GLASSES 0x14

/* minor device class field for Toy Major Class */
/* Bits 2-7 meaningful    */
#define BTM_COD_MINOR_ROBOT 0x04
#define BTM_COD_MINOR_VEHICLE 0x08
#define BTM_COD_MINOR_DOLL_ACTION_FIGURE 0x0C
#define BTM_COD_MINOR_CONTROLLER 0x10
#define BTM_COD_MINOR_GAME 0x14

/* minor device class field for Health Major Class */
/* Bits 2-7 meaningful    */
#define BTM_COD_MINOR_BLOOD_MONITOR 0x04
@@ -342,26 +237,17 @@ typedef uint8_t(tBTM_FILTER_CB)(const RawAddress& bd_addr, DEV_CLASS dc);
#define BTM_COD_MINOR_GLUCOSE_METER 0x10
#define BTM_COD_MINOR_PULSE_OXIMETER 0x14
#define BTM_COD_MINOR_HEART_PULSE_MONITOR 0x18
#define BTM_COD_MINOR_HEALTH_DATA_DISPLAY 0x1C
#define BTM_COD_MINOR_STEP_COUNTER 0x20
#define BTM_COD_MINOR_BODY_COM_ANALYZER 0x24
#define BTM_COD_MINOR_PEAK_FLOW_MONITOR 0x28
#define BTM_COD_MINOR_MEDICATION_MONITOR 0x2C
#define BTM_COD_MINOR_KNEE_PROSTHESIS 0x30
#define BTM_COD_MINOR_ANKLE_PROSTHESIS 0x34

/***************************
 * major device class field
 ***************************/
#define BTM_COD_MAJOR_MISCELLANEOUS 0x00
#define BTM_COD_MAJOR_COMPUTER 0x01
#define BTM_COD_MAJOR_PHONE 0x02
#define BTM_COD_MAJOR_LAN_ACCESS_PT 0x03
#define BTM_COD_MAJOR_AUDIO 0x04
#define BTM_COD_MAJOR_PERIPHERAL 0x05
#define BTM_COD_MAJOR_IMAGING 0x06
#define BTM_COD_MAJOR_WEARABLE 0x07
#define BTM_COD_MAJOR_TOY 0x08
#define BTM_COD_MAJOR_HEALTH 0x09
#define BTM_COD_MAJOR_UNCLASSIFIED 0x1F

@@ -379,8 +265,6 @@ typedef uint8_t(tBTM_FILTER_CB)(const RawAddress& bd_addr, DEV_CLASS dc);
#define BTM_COD_SERVICE_INFORMATION 0x8000

/* class of device field macros */
#define BTM_COD_FORMAT_TYPE(u8, pd) \
  { (u8) = (pd)[2] & 0x03; }
#define BTM_COD_MINOR_CLASS(u8, pd) \
  { (u8) = (pd)[2] & 0xFC; }
#define BTM_COD_MAJOR_CLASS(u8, pd) \
@@ -401,7 +285,6 @@ typedef uint8_t(tBTM_FILTER_CB)(const RawAddress& bd_addr, DEV_CLASS dc);
  }

/* the COD masks */
#define BTM_COD_FORMAT_TYPE_MASK 0x03
#define BTM_COD_MINOR_CLASS_MASK 0xFC
#define BTM_COD_MAJOR_CLASS_MASK 0x1F
#define BTM_COD_SERVICE_CLASS_LO_B 0x00E0
@@ -516,24 +399,6 @@ typedef uint8_t tBTM_EIR_SEARCH_RESULT;
/* 0xFF */
#define BTM_EIR_MANUFACTURER_SPECIFIC_TYPE HCI_EIR_MANUFACTURER_SPECIFIC_TYPE

/* the following EIR tags are defined to OOB, not regular EIR data */
/* 6 bytes */
#define BTM_EIR_OOB_BD_ADDR_TYPE HCI_EIR_OOB_BD_ADDR_TYPE
/* 3 bytes */
#define BTM_EIR_OOB_COD_TYPE HCI_EIR_OOB_COD_TYPE
/* 16 bytes */
#define BTM_EIR_OOB_SSP_HASH_C_TYPE HCI_EIR_OOB_SSP_HASH_C_TYPE
/* 16 bytes */
#define BTM_EIR_OOB_SSP_RAND_R_TYPE HCI_EIR_OOB_SSP_RAND_R_TYPE

/* include 2 bytes length & 6 bytes bd_addr */
#define BTM_OOB_MANDATORY_SIZE 8
#define BTM_OOB_DATA_LEN_SIZE 2
#define BTM_OOB_BD_ADDR_SIZE 6
#define BTM_OOB_COD_SIZE BT_OOB_COD_SIZE
#define BTM_OOB_HASH_C_SIZE BT_OOB_HASH_C_SIZE
#define BTM_OOB_RAND_R_SIZE BT_OOB_RAND_R_SIZE

#define BTM_BLE_SEC_NONE 0
/* encrypt the link using current key */
#define BTM_BLE_SEC_ENCRYPT 1
@@ -686,12 +551,6 @@ typedef struct {
/****************************************
 *  Device Discovery Callback Functions
 ****************************************/
/* Callback function for asynchronous notifications when the BTM inquiry DB
 * changes. First param is inquiry database, second is if added to or removed
 * from the inquiry database.
*/
typedef void(tBTM_INQ_DB_CHANGE_CB)(void* p1, bool is_new);

/* Callback function for notifications when the BTM gets inquiry response.
 * First param is inquiry results database, second is pointer of EIR.
*/
@@ -705,12 +564,6 @@ typedef void(tBTM_INQ_RESULTS_CB)(tBTM_INQ_RESULTS* p_inq_results,
 *  ACL Constants
 ******************/

/* ACL modes */
#define BTM_ACL_MODE_NORMAL HCI_MODE_ACTIVE
#define BTM_ACL_MODE_HOLD HCI_MODE_HOLD
#define BTM_ACL_MODE_SNIFF HCI_MODE_SNIFF
#define BTM_ACL_MODE_PARK HCI_MODE_PARK

/* Returned with structure in role switch callback (tBTM_ROLE_SWITCH_CMPL) */
#define BTM_ROLE_MASTER HCI_ROLE_MASTER
#define BTM_ROLE_SLAVE HCI_ROLE_SLAVE
@@ -823,8 +676,6 @@ enum {
typedef uint8_t tBTM_BL_EVENT;
typedef uint16_t tBTM_BL_EVENT_MASK;

#define BTM_BL_CONN_MASK 0x0001
#define BTM_BL_DISCN_MASK 0x0002
#define BTM_BL_UPDATE_MASK 0x0004
#define BTM_BL_ROLE_CHG_MASK 0x0008

@@ -890,17 +741,6 @@ typedef union {
*/
typedef void(tBTM_BL_CHANGE_CB)(tBTM_BL_EVENT_DATA* p_data);

/***************************
 *  ACL Callback Functions
 ***************************/
/* Callback function for notifications when the BTM ACL connection DB
 * changes. First param is BD address, second is if added or removed.
 * Registered through BTM_AclRegisterForChanges call.
*/
typedef void(tBTM_ACL_DB_CHANGE_CB)(const RawAddress& p_bda, DEV_CLASS p_dc,
                                    BD_NAME p_bdn, uint8_t* features,
                                    bool is_new, uint16_t handle,
                                    tBT_TRANSPORT transport);
/*****************************************************************************
 *  SCO CHANNEL MANAGEMENT
 ****************************************************************************/
@@ -915,20 +755,12 @@ typedef void(tBTM_ACL_DB_CHANGE_CB)(const RawAddress& p_bda, DEV_CLASS p_dc,
/* Define an invalid SCO disconnect reason */
#define BTM_INVALID_SCO_DISC_REASON 0xFFFF

/* Define first active SCO index */
#define BTM_FIRST_ACTIVE_SCO_INDEX BTM_MAX_SCO_LINKS

#define BTM_SCO_LINK_ONLY_MASK \
  (ESCO_PKT_TYPES_MASK_HV1 | ESCO_PKT_TYPES_MASK_HV2 | ESCO_PKT_TYPES_MASK_HV3)

#define BTM_ESCO_LINK_ONLY_MASK \
  (ESCO_PKT_TYPES_MASK_EV3 | ESCO_PKT_TYPES_MASK_EV4 | ESCO_PKT_TYPES_MASK_EV5)

#define BTM_SCO_LINK_ALL_PKT_MASK \
  (BTM_SCO_LINK_ONLY_MASK | BTM_ESCO_LINK_ONLY_MASK)

#define BTM_VALID_SCO_ALL_PKT_TYPE HCI_VALID_SCO_ALL_PKT_TYPE

/***************
 *  SCO Types
 ***************/
@@ -959,20 +791,12 @@ typedef uint16_t tBTM_SCO_CODEC_TYPE;
/*******************
 * SCO Data Status
 *******************/
enum {
  BTM_SCO_DATA_CORRECT,
  BTM_SCO_DATA_PAR_ERR,
  BTM_SCO_DATA_NONE,
  BTM_SCO_DATA_PAR_LOST
};
typedef uint8_t tBTM_SCO_DATA_FLAG;

/***************************
 *  SCO Callback Functions
 ***************************/
typedef void(tBTM_SCO_CB)(uint16_t sco_inx);
typedef void(tBTM_SCO_DATA_CB)(uint16_t sco_inx, BT_HDR* p_data,
                               tBTM_SCO_DATA_FLAG status);

/***************
 *  eSCO Types
@@ -1087,17 +911,11 @@ typedef void(tBTM_ESCO_CBACK)(tBTM_ESCO_EVT event, tBTM_ESCO_EVT_DATA* p_data);
#define BTM_SEC_FLAG_LKEY_KNOWN 0x10
#define BTM_SEC_FLAG_LKEY_AUTHED 0x20

/* PIN types */
#define BTM_PIN_TYPE_VARIABLE HCI_PIN_TYPE_VARIABLE
#define BTM_PIN_TYPE_FIXED HCI_PIN_TYPE_FIXED

/* Link Key types used to generate the new link key.
 * returned in link key notification callback function
*/
#define BTM_LKEY_TYPE_COMBINATION HCI_LKEY_TYPE_COMBINATION
#define BTM_LKEY_TYPE_LOCAL_UNIT HCI_LKEY_TYPE_LOCAL_UNIT
#define BTM_LKEY_TYPE_REMOTE_UNIT HCI_LKEY_TYPE_REMOTE_UNIT
#define BTM_LKEY_TYPE_DEBUG_COMB HCI_LKEY_TYPE_DEBUG_COMB
#define BTM_LKEY_TYPE_UNAUTH_COMB HCI_LKEY_TYPE_UNAUTH_COMB
#define BTM_LKEY_TYPE_AUTH_COMB HCI_LKEY_TYPE_AUTH_COMB
#define BTM_LKEY_TYPE_CHANGED_COMB HCI_LKEY_TYPE_CHANGED_COMB
@@ -1133,39 +951,23 @@ typedef uint8_t tBTM_LINK_KEY_TYPE;
#define BTM_SEC_SERVICE_LAN_ACCESS 2
#define BTM_SEC_SERVICE_DUN 3
#define BTM_SEC_SERVICE_IRMC_SYNC 4
#define BTM_SEC_SERVICE_IRMC_SYNC_CMD 5
#define BTM_SEC_SERVICE_OBEX 6
#define BTM_SEC_SERVICE_OBEX_FTP 7
#define BTM_SEC_SERVICE_HEADSET 8
#define BTM_SEC_SERVICE_CORDLESS 9
#define BTM_SEC_SERVICE_INTERCOM 10
#define BTM_SEC_SERVICE_FAX 11
#define BTM_SEC_SERVICE_HEADSET_AG 12
#define BTM_SEC_SERVICE_PNP_INFO 13
#define BTM_SEC_SERVICE_GEN_NET 14
#define BTM_SEC_SERVICE_GEN_FILE 15
#define BTM_SEC_SERVICE_GEN_AUDIO 16
#define BTM_SEC_SERVICE_GEN_TEL 17
#define BTM_SEC_SERVICE_CTP_DATA 18
#define BTM_SEC_SERVICE_HCRP_CTRL 19
#define BTM_SEC_SERVICE_HCRP_DATA 20
#define BTM_SEC_SERVICE_HCRP_NOTIF 21
#define BTM_SEC_SERVICE_BPP_JOB 22
#define BTM_SEC_SERVICE_BPP_STATUS 23
#define BTM_SEC_SERVICE_BPP_REF 24
#define BTM_SEC_SERVICE_BNEP_PANU 25
#define BTM_SEC_SERVICE_BNEP_GN 26
#define BTM_SEC_SERVICE_BNEP_NAP 27
#define BTM_SEC_SERVICE_HF_HANDSFREE 28
#define BTM_SEC_SERVICE_AG_HANDSFREE 29
#define BTM_SEC_SERVICE_TE_PHONE_ACCESS 30
#define BTM_SEC_SERVICE_ME_PHONE_ACCESS 31

#define BTM_SEC_SERVICE_HIDH_SEC_CTRL 32
#define BTM_SEC_SERVICE_HIDH_NOSEC_CTRL 33
#define BTM_SEC_SERVICE_HIDH_INTR 34
#define BTM_SEC_SERVICE_BIP 35
#define BTM_SEC_SERVICE_BIP_REF 36
#define BTM_SEC_SERVICE_AVDTP 37
#define BTM_SEC_SERVICE_AVDTP_NOSEC 38
#define BTM_SEC_SERVICE_AVCTP 39
@@ -1174,11 +976,7 @@ typedef uint8_t tBTM_LINK_KEY_TYPE;
#define BTM_SEC_SERVICE_RFC_MUX 42
#define BTM_SEC_SERVICE_AVCTP_BROWSE 43
#define BTM_SEC_SERVICE_MAP 44
#define BTM_SEC_SERVICE_MAP_NOTIF 45
#define BTM_SEC_SERVICE_MCAP_CTRL 46
#define BTM_SEC_SERVICE_MCAP_DATA 47
#define BTM_SEC_SERVICE_HDP_SNK 48
#define BTM_SEC_SERVICE_HDP_SRC 49
#define BTM_SEC_SERVICE_ATT 50
#define BTM_SEC_SERVICE_HIDD_SEC_CTRL 51
#define BTM_SEC_SERVICE_HIDD_NOSEC_CTRL 52
@@ -1197,15 +995,6 @@ typedef uint8_t tBTM_LINK_KEY_TYPE;
 * Security Services MACROS handle array of uint32_t bits for more than 32
 * trusted services
 ******************************************************************************/
/* MACRO to set the security service bit mask in a bit stream */
#define BTM_SEC_SET_SERVICE(p, service)                              \
  (((uint32_t*)(p))[(((uint32_t)(service)) / BTM_SEC_ARRAY_BITS)] |= \
   ((uint32_t)1 << (((uint32_t)(service)) % BTM_SEC_ARRAY_BITS)))

/* MACRO to clear the security service bit mask in a bit stream */
#define BTM_SEC_CLR_SERVICE(p, service)                              \
  (((uint32_t*)(p))[(((uint32_t)(service)) / BTM_SEC_ARRAY_BITS)] &= \
   ~((uint32_t)1 << (((uint32_t)(service)) % BTM_SEC_ARRAY_BITS)))

/* MACRO to check the security service bit mask in a bit stream (Returns true or
 * false) */
@@ -1313,7 +1102,6 @@ typedef uint8_t tBTM_SP_EVT;
typedef uint8_t tBTM_IO_CAP;

#define BTM_MAX_PASSKEY_VAL (999999)
#define BTM_MIN_PASSKEY_VAL (0)

/* MITM Protection Not Required - Single Profile/non-bonding Numeric comparison
 * with automatic accept allowed */
@@ -1336,7 +1124,6 @@ typedef uint8_t tBTM_IO_CAP;

/* this bit is ORed with BTM_AUTH_SP_* when IO exchange for dedicated bonding */
#define BTM_AUTH_DD_BOND 2
#define BTM_AUTH_GB_BIT 4 /* the genernal bonding bit */
#define BTM_AUTH_BONDS 6  /* the general/dedicated bonding bits  */
#define BTM_AUTH_YN_BIT 1 /* this is the Yes or No bit  */

+0 −60

File changed.

Preview size limit exceeded, changes collapsed.