bta: use standard types
Use standard types everywhere.
Use standard style for #if statements:
- #if (VAR_NAME == TRUE)
- #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__
Change-Id: Ib86de4de9f14529ecaa4f71597260e3b5785360b
diff --git a/bta/dm/bta_dm_act.cc b/bta/dm/bta_dm_act.cc
index 58d427f..f70ae91 100644
--- a/bta/dm/bta_dm_act.cc
+++ b/bta/dm/bta_dm_act.cc
@@ -49,25 +49,25 @@
#include "gap_api.h"
#endif
-static void bta_dm_inq_results_cb (tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir);
+static void bta_dm_inq_results_cb (tBTM_INQ_RESULTS *p_inq, uint8_t *p_eir);
static void bta_dm_inq_cmpl_cb (void * p_result);
static void bta_dm_service_search_remname_cback (BD_ADDR bd_addr, DEV_CLASS dc, BD_NAME bd_name);
static void bta_dm_remname_cback (tBTM_REMOTE_DEV_NAME *p_remote_name);
static void bta_dm_find_services ( BD_ADDR bd_addr);
static void bta_dm_discover_next_device(void);
-static void bta_dm_sdp_callback (UINT16 sdp_status);
-static UINT8 bta_dm_authorize_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, UINT8 *service_name, UINT8 service_id, BOOLEAN is_originator);
-static UINT8 bta_dm_pin_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, BOOLEAN min_16_digit);
-static UINT8 bta_dm_new_link_key_cback(BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, LINK_KEY key, UINT8 key_type);
-static UINT8 bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev_class,BD_NAME bd_name, int result);
+static void bta_dm_sdp_callback (uint16_t sdp_status);
+static uint8_t bta_dm_authorize_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, uint8_t *service_name, uint8_t service_id, bool is_originator);
+static uint8_t bta_dm_pin_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, bool min_16_digit);
+static uint8_t bta_dm_new_link_key_cback(BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, LINK_KEY key, uint8_t key_type);
+static uint8_t bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev_class,BD_NAME bd_name, int result);
static void bta_dm_local_name_cback(BD_ADDR bd_addr);
-static BOOLEAN bta_dm_check_av(UINT16 event);
+static bool bta_dm_check_av(uint16_t event);
static void bta_dm_bl_change_cback (tBTM_BL_EVENT_DATA *p_data);
-static void bta_dm_policy_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
+static void bta_dm_policy_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
/* Extended Inquiry Response */
-static UINT8 bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data);
+static uint8_t bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data);
static void bta_dm_set_eir (char *local_name);
@@ -77,23 +77,23 @@
static void bta_dm_search_timer_cback(void *data);
static void bta_dm_disable_conn_down_timer_cback(void *data);
-static void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-static void bta_dm_adjust_roles(BOOLEAN delay_role_switch);
+static void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+static void bta_dm_adjust_roles(bool delay_role_switch);
static char *bta_dm_get_remname(void);
static void bta_dm_bond_cancel_complete_cback(tBTM_STATUS result);
-static BOOLEAN bta_dm_read_remote_device_name (BD_ADDR bd_addr,tBT_TRANSPORT transport);
+static bool bta_dm_read_remote_device_name (BD_ADDR bd_addr,tBT_TRANSPORT transport);
static void bta_dm_discover_device(BD_ADDR remote_bd_addr);
static void bta_dm_sys_hw_cback( tBTA_SYS_HW_EVT status );
static void bta_dm_disable_search_and_disc(void);
-#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
- #if ((defined SMP_INCLUDED) && (SMP_INCLUDED == TRUE))
-static UINT8 bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_DATA *p_data);
- #endif
-static void bta_dm_ble_id_key_cback (UINT8 key_type, tBTM_BLE_LOCAL_KEYS *p_key);
- #if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE)
+ #if (SMP_INCLUDED == TRUE)
+static uint8_t bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_DATA *p_data);
+ #endif
+static void bta_dm_ble_id_key_cback (uint8_t key_type, tBTM_BLE_LOCAL_KEYS *p_key);
+ #if (BTA_GATT_INCLUDED == TRUE)
static void bta_dm_gattc_register(void);
static void btm_dm_start_gatt_discovery(BD_ADDR bd_addr);
static void bta_dm_cancel_gatt_discovery(BD_ADDR bd_addr);
@@ -101,7 +101,7 @@
extern tBTA_DM_CONTRL_STATE bta_dm_pm_obtain_controller_state(void);
#endif
-#if BLE_VND_INCLUDED == TRUE
+#if (BLE_VND_INCLUDED == TRUE)
static void bta_dm_ctrl_features_rd_cmpl_cback(tBTM_STATUS result);
#endif
@@ -132,14 +132,14 @@
static void bta_dm_reset_sec_dev_pending(BD_ADDR remote_bd_addr);
static void bta_dm_remove_sec_dev_entry(BD_ADDR remote_bd_addr);
-static void bta_dm_observe_results_cb(tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir);
+static void bta_dm_observe_results_cb(tBTM_INQ_RESULTS *p_inq, uint8_t *p_eir);
static void bta_dm_observe_cmpl_cb(void * p_result);
static void bta_dm_delay_role_switch_cback(void *data);
-extern "C" void sdpu_uuid16_to_uuid128(UINT16 uuid16, UINT8* p_uuid128);
+extern "C" void sdpu_uuid16_to_uuid128(uint16_t uuid16, uint8_t* p_uuid128);
static void bta_dm_disable_timer_cback(void *data);
-const UINT16 bta_service_id_to_uuid_lkup_tbl [BTA_MAX_SERVICE_ID] =
+const uint16_t bta_service_id_to_uuid_lkup_tbl [BTA_MAX_SERVICE_ID] =
{
UUID_SERVCLASS_PNP_INFORMATION, /* Reserved */
UUID_SERVCLASS_SERIAL_PORT, /* BTA_SPP_SERVICE_ID */
@@ -170,7 +170,7 @@
UUID_SERVCLASS_MESSAGE_NOTIFICATION, /* BTA_MN_SERVICE_ID */
UUID_SERVCLASS_HDP_PROFILE, /* BTA_HDP_SERVICE_ID */
UUID_SERVCLASS_PBAP_PCE /* BTA_PCE_SERVICE_ID */
-#if BLE_INCLUDED && BTA_GATT_INCLUDED
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
,UUID_PROTOCOL_ATT /* BTA_GATT_SERVICE_ID */
#endif
};
@@ -182,7 +182,7 @@
* i.e., If you add new Service ID for BTA, the correct security ID of the new service
* from Security service definitions (btm_api.h) should be added to this lookup table.
*/
-const UINT32 bta_service_id_to_btm_srv_id_lkup_tbl [BTA_MAX_SERVICE_ID] =
+const uint32_t bta_service_id_to_btm_srv_id_lkup_tbl [BTA_MAX_SERVICE_ID] =
{
0, /* Reserved */
BTM_SEC_SERVICE_SERIAL_PORT, /* BTA_SPP_SERVICE_ID */
@@ -213,7 +213,7 @@
BTM_SEC_SERVICE_MAP, /* BTA_MN_SERVICE_ID */
BTM_SEC_SERVICE_HDP_SNK, /* BTA_HDP_SERVICE_ID */
BTM_SEC_SERVICE_PBAP /* BTA_PCE_SERVICE_ID */
-#if BLE_INCLUDED && BTA_GATT_INCLUDED
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
,BTM_SEC_SERVICE_ATT /* BTA_GATT_SERVICE_ID */
#endif
@@ -232,8 +232,8 @@
#else
NULL
#endif
-#if BLE_INCLUDED == TRUE
-#if SMP_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
+#if (SMP_INCLUDED == TRUE)
,&bta_dm_ble_smp_cback
#endif
,&bta_dm_ble_id_key_cback
@@ -242,7 +242,7 @@
};
#define MAX_DISC_RAW_DATA_BUF (4096)
-UINT8 g_disc_raw_data_buf[MAX_DISC_RAW_DATA_BUF];
+uint8_t g_disc_raw_data_buf[MAX_DISC_RAW_DATA_BUF];
extern DEV_CLASS local_device_default_class;
extern fixed_queue_t *btu_bta_alarm_queue;
@@ -262,7 +262,7 @@
tBTA_DM_ENABLE enable_event;
/* if already in use, return an error */
- if( bta_dm_cb.is_bta_dm_active == TRUE )
+ if( bta_dm_cb.is_bta_dm_active == true )
{
APPL_TRACE_WARNING("%s Device already started by another application", __func__);
memset(&enable_event, 0, sizeof(tBTA_DM_ENABLE));
@@ -280,7 +280,7 @@
if( p_data->enable.p_sec_cback != NULL )
bta_dm_cb.p_sec_cback = p_data->enable.p_sec_cback;
/* notify BTA DM is now active */
- bta_dm_cb.is_bta_dm_active = TRUE;
+ bta_dm_cb.is_bta_dm_active = true;
/* send a message to BTA SYS */
tBTA_SYS_HW_MSG *sys_enable_event =
@@ -338,8 +338,8 @@
{
DEV_CLASS dev_class;
tBTA_DM_SEC_CBACK *temp_cback;
-#if BLE_INCLUDED == TRUE
- UINT8 key_mask = 0;
+#if (BLE_INCLUDED == TRUE)
+ uint8_t key_mask = 0;
BT_OCTET16 er;
tBTA_BLE_LOCAL_ID_KEYS id_key;
#endif
@@ -364,7 +364,7 @@
/* unregister from SYS */
bta_sys_hw_unregister( BTA_SYS_HW_BLUETOOTH );
/* notify BTA DM is now unactive */
- bta_dm_cb.is_bta_dm_active = FALSE;
+ bta_dm_cb.is_bta_dm_active = false;
}
else
if( status == BTA_SYS_HW_ON_EVT )
@@ -379,7 +379,7 @@
bta_dm_init_cb();
/* and retrieve the callback */
bta_dm_cb.p_sec_cback=temp_cback;
- bta_dm_cb.is_bta_dm_active = TRUE;
+ bta_dm_cb.is_bta_dm_active = true;
/* hw is ready, go on with BTA DM initialization */
alarm_free(bta_dm_search_cb.search_timer);
@@ -400,7 +400,7 @@
memcpy(dev_class, p_bta_dm_cfg->dev_class, sizeof(dev_class));
BTM_SetDeviceClass (dev_class);
-#if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE)
/* load BLE local information: ID keys, ER if available */
bta_dm_co_ble_load_local_keys(&key_mask, er, &id_key);
@@ -412,10 +412,10 @@
{
BTM_BleLoadLocalKeys(BTA_BLE_LOCAL_KEY_TYPE_ID, (tBTM_BLE_LOCAL_KEYS *)&id_key);
}
-#if (defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
+#if (BTA_GATT_INCLUDED == TRUE)
bta_dm_search_cb.conn_id = BTA_GATT_INVALID_CONN_ID;
#endif // (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
-#endif // (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
+#endif // (defined(BLE_INCLUDED) && (BLE_INCLUDED == true))
BTM_SecRegister((tBTM_APPL_INFO*)&bta_security);
BTM_SetDefaultLinkSuperTout(p_bta_dm_cfg->link_timeout);
@@ -424,7 +424,7 @@
BTM_SetDefaultLinkPolicy(bta_dm_cb.cur_policy);
BTM_RegBusyLevelNotif (bta_dm_bl_change_cback, NULL, BTM_BL_UPDATE_MASK|BTM_BL_ROLE_CHG_MASK);
-#if BLE_VND_INCLUDED == TRUE
+#if (BLE_VND_INCLUDED == TRUE)
BTM_BleReadControllerFeatures (bta_dm_ctrl_features_rd_cmpl_cback);
#endif
@@ -468,8 +468,8 @@
UNUSED(p_data);
/* Set l2cap idle timeout to 0 (so BTE immediately disconnects ACL link after last channel is closed) */
- L2CA_SetIdleTimeoutByBdAddr((UINT8 *)BT_BD_ANY, 0, BT_TRANSPORT_BR_EDR);
- L2CA_SetIdleTimeoutByBdAddr((UINT8 *)BT_BD_ANY, 0, BT_TRANSPORT_LE);
+ L2CA_SetIdleTimeoutByBdAddr((uint8_t *)BT_BD_ANY, 0, BT_TRANSPORT_BR_EDR);
+ L2CA_SetIdleTimeoutByBdAddr((uint8_t *)BT_BD_ANY, 0, BT_TRANSPORT_LE);
/* disable all active subsystems */
bta_sys_disable(BTA_SYS_HW_BLUETOOTH);
@@ -479,20 +479,20 @@
bta_dm_disable_pm();
bta_dm_disable_search_and_disc();
- bta_dm_cb.disabling = TRUE;
+ bta_dm_cb.disabling = true;
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
BTM_BleClearBgConnDev();
#endif
if(BTM_GetNumAclLinks()==0)
{
-#if (defined(BTA_DISABLE_DELAY) && BTA_DISABLE_DELAY > 0)
+#if (BTA_DISABLE_DELAY > 0)
/* If BTA_DISABLE_DELAY is defined and greater than zero, then delay the shutdown by
* BTA_DISABLE_DELAY milliseconds
*/
APPL_TRACE_WARNING("%s BTA_DISABLE_DELAY set to %d ms",
- __FUNCTION__, BTA_DISABLE_DELAY);
+ __func__, BTA_DISABLE_DELAY);
alarm_set_on_queue(bta_dm_cb.disable_timer, BTA_DISABLE_DELAY,
bta_dm_disable_conn_down_timer_cback, NULL,
btu_bta_alarm_queue);
@@ -522,9 +522,9 @@
*******************************************************************************/
static void bta_dm_disable_timer_cback(void *data)
{
- UINT8 i;
+ uint8_t i;
tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;
- BOOLEAN trigger_disc = FALSE;
+ bool trigger_disc = false;
uint32_t param = PTR_TO_UINT(data);
APPL_TRACE_EVENT("%s trial %u", __func__, param);
@@ -537,7 +537,7 @@
transport = bta_dm_cb.device_list.peer_device[i].transport;
#endif
btm_remove_acl(bta_dm_cb.device_list.peer_device[i].peer_bdaddr, transport);
- trigger_disc = TRUE;
+ trigger_disc = true;
}
/* Retrigger disable timer in case ACL disconnect failed, DISABLE_EVT still need
@@ -552,7 +552,7 @@
}
else
{
- bta_dm_cb.disabling = FALSE;
+ bta_dm_cb.disabling = false;
bta_sys_remove_uuid(UUID_SERVCLASS_PNP_INFORMATION);
bta_dm_cb.p_sec_cback(BTA_DM_DISABLE_EVT, NULL);
@@ -591,22 +591,22 @@
*******************************************************************************/
void bta_dm_set_visibility(tBTA_DM_MSG *p_data)
{
- UINT16 window, interval;
-#if (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
- UINT16 le_disc_mode = BTM_BleReadDiscoverability();
- UINT16 le_conn_mode = BTM_BleReadConnectability();
-#endif // (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
- UINT16 disc_mode = BTM_ReadDiscoverability(&window, &interval);
- UINT16 conn_mode = BTM_ReadConnectability(&window, &interval);
+ uint16_t window, interval;
+#if (BTA_GATT_INCLUDED == TRUE)
+ uint16_t le_disc_mode = BTM_BleReadDiscoverability();
+ uint16_t le_conn_mode = BTM_BleReadConnectability();
+#endif // BTA_GATT_INCLUDED
+ uint16_t disc_mode = BTM_ReadDiscoverability(&window, &interval);
+ uint16_t conn_mode = BTM_ReadConnectability(&window, &interval);
/* set modes for Discoverability and connectability if not ignore */
if (p_data->set_visibility.disc_mode != (BTA_DM_IGNORE | BTA_DM_LE_IGNORE))
{
-#if (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
+#if (BTA_GATT_INCLUDED == TRUE)
if ((p_data->set_visibility.disc_mode & BTA_DM_LE_IGNORE) == BTA_DM_LE_IGNORE)
p_data->set_visibility.disc_mode =
((p_data->set_visibility.disc_mode & ~BTA_DM_LE_IGNORE) | le_disc_mode);
-#endif // (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
+#endif // BTA_GATT_INCLUDED
if ((p_data->set_visibility.disc_mode & BTA_DM_IGNORE) == BTA_DM_IGNORE)
p_data->set_visibility.disc_mode =
((p_data->set_visibility.disc_mode & ~BTA_DM_IGNORE) | disc_mode);
@@ -618,11 +618,11 @@
if (p_data->set_visibility.conn_mode != (BTA_DM_IGNORE | BTA_DM_LE_IGNORE))
{
-#if (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
+#if (BTA_GATT_INCLUDED == TRUE)
if ((p_data->set_visibility.conn_mode & BTA_DM_LE_IGNORE) == BTA_DM_LE_IGNORE)
p_data->set_visibility.conn_mode =
((p_data->set_visibility.conn_mode & ~BTA_DM_LE_IGNORE) | le_conn_mode);
-#endif // (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
+#endif // BTA_GATT_INCLUDED
if ((p_data->set_visibility.conn_mode & BTA_DM_IGNORE) == BTA_DM_IGNORE)
p_data->set_visibility.conn_mode =
((p_data->set_visibility.conn_mode & ~BTA_DM_IGNORE) | conn_mode);
@@ -637,9 +637,9 @@
{
if (p_data->set_visibility.pair_mode == BTA_DM_NON_PAIRABLE)
- bta_dm_cb.disable_pair_mode = TRUE;
+ bta_dm_cb.disable_pair_mode = true;
else
- bta_dm_cb.disable_pair_mode = FALSE;
+ bta_dm_cb.disable_pair_mode = false;
}
@@ -648,15 +648,15 @@
{
if (p_data->set_visibility.conn_paired_only == BTA_DM_CONN_ALL)
- bta_dm_cb.conn_paired_only = FALSE;
+ bta_dm_cb.conn_paired_only = false;
else
- bta_dm_cb.conn_paired_only = TRUE;
+ bta_dm_cb.conn_paired_only = true;
}
/* Change mode if either mode is not ignore */
if (p_data->set_visibility.pair_mode != BTA_DM_IGNORE || p_data->set_visibility.conn_paired_only != BTA_DM_IGNORE)
- BTM_SetPairableMode((BOOLEAN)(!(bta_dm_cb.disable_pair_mode)),bta_dm_cb.conn_paired_only);
+ BTM_SetPairableMode((bool)(!(bta_dm_cb.disable_pair_mode)),bta_dm_cb.conn_paired_only);
}
@@ -671,7 +671,7 @@
{
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
/* need to remove all pending background connection before unpair */
- BTA_GATTC_CancelOpen(0, bd_addr, FALSE);
+ BTA_GATTC_CancelOpen(0, bd_addr, false);
#endif
BTM_SecDeleteDevice(bd_addr);
@@ -701,7 +701,7 @@
void bta_dm_remove_device(tBTA_DM_MSG *p_data)
{
tBTA_DM_API_REMOVE_DEVICE *p_dev = &p_data->remove_dev;
- BOOLEAN continue_delete_other_dev = FALSE;
+ bool continue_delete_other_dev = false;
if (p_dev == NULL)
return;
@@ -709,28 +709,28 @@
bdcpy(other_address, p_dev->bd_addr);
/* If ACL exists for the device in the remove_bond message*/
- BOOLEAN continue_delete_dev = FALSE;
- UINT8 other_transport = BT_TRANSPORT_INVALID;
+ bool continue_delete_dev = false;
+ uint8_t other_transport = BT_TRANSPORT_INVALID;
if (BTM_IsAclConnectionUp(p_dev->bd_addr, BT_TRANSPORT_LE) ||
BTM_IsAclConnectionUp(p_dev->bd_addr, BT_TRANSPORT_BR_EDR))
{
APPL_TRACE_DEBUG("%s: ACL Up count %d", __func__, bta_dm_cb.device_list.count);
- continue_delete_dev = FALSE;
+ continue_delete_dev = false;
/* Take the link down first, and mark the device for removal when disconnected */
for(int i=0; i < bta_dm_cb.device_list.count; i++)
{
if (!bdcmp(bta_dm_cb.device_list.peer_device[i].peer_bdaddr, p_dev->bd_addr))
{
- UINT8 transport = BT_TRANSPORT_BR_EDR;
+ uint8_t transport = BT_TRANSPORT_BR_EDR;
-#if (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
+#if (BTA_GATT_INCLUDED == TRUE)
transport = bta_dm_cb.device_list.peer_device[i].transport;
-#endif // (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
+#endif // BTA_GATT_INCLUDED
bta_dm_cb.device_list.peer_device[i].conn_state = BTA_DM_UNPAIRING;
btm_remove_acl(p_dev->bd_addr, transport);
-#if (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
+#if (BTA_GATT_INCLUDED == TRUE)
APPL_TRACE_DEBUG("%s:transport = %d", __func__,
bta_dm_cb.device_list.peer_device[i].transport);
@@ -739,7 +739,7 @@
other_transport = BT_TRANSPORT_BR_EDR;
else
other_transport = BT_TRANSPORT_LE;
-#endif // (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
+#endif // BTA_GATT_INCLUDED
break;
}
@@ -747,16 +747,16 @@
}
else
{
- continue_delete_dev = TRUE;
+ continue_delete_dev = true;
}
-#if (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
+#if (BTA_GATT_INCLUDED == TRUE)
// If it is DUMO device and device is paired as different address, unpair that device
// if different address
if ((other_transport && (BTM_ReadConnectedTransportAddress(other_address, other_transport))) ||
(!other_transport && (BTM_ReadConnectedTransportAddress(other_address, BT_TRANSPORT_BR_EDR) ||
BTM_ReadConnectedTransportAddress(other_address, BT_TRANSPORT_LE))))
{
- continue_delete_other_dev = FALSE;
+ continue_delete_other_dev = false;
/* Take the link down first, and mark the device for removal when disconnected */
for(int i=0; i < bta_dm_cb.device_list.count; i++)
{
@@ -771,9 +771,9 @@
else
{
APPL_TRACE_DEBUG("%s: continue to delete the other dev ", __func__);
- continue_delete_other_dev = TRUE;
+ continue_delete_other_dev = true;
}
-#endif
+#endif // BTA_GATT_INCLUDED
/* Delete the device mentioned in the msg */
if (continue_delete_dev)
bta_dm_process_remove_device(p_dev->bd_addr);
@@ -796,33 +796,33 @@
void bta_dm_add_device (tBTA_DM_MSG *p_data)
{
tBTA_DM_API_ADD_DEVICE *p_dev = &p_data->add_dev;
- UINT8 *p_dc = NULL;
- UINT8 *p_lc = NULL;
- UINT32 trusted_services_mask[BTM_SEC_SERVICE_ARRAY_SIZE];
- UINT8 index = 0;
- UINT8 btm_mask_index = 0;
+ uint8_t *p_dc = NULL;
+ uint8_t *p_lc = NULL;
+ uint32_t trusted_services_mask[BTM_SEC_SERVICE_ARRAY_SIZE];
+ uint8_t index = 0;
+ uint8_t btm_mask_index = 0;
memset (trusted_services_mask, 0, sizeof(trusted_services_mask));
/* If not all zeros, the device class has been specified */
if (p_dev->dc_known)
- p_dc = (UINT8 *)p_dev->dc;
+ p_dc = (uint8_t *)p_dev->dc;
if (p_dev->link_key_known)
- p_lc = (UINT8 *)p_dev->link_key;
+ p_lc = (uint8_t *)p_dev->link_key;
if (p_dev->is_trusted)
{
/* covert BTA service mask to BTM mask */
while (p_dev->tm && (index < BTA_MAX_SERVICE_ID))
{
- if (p_dev->tm & (UINT32)(1<<index))
+ if (p_dev->tm & (uint32_t)(1<<index))
{
btm_mask_index = bta_service_id_to_btm_srv_id_lkup_tbl[index] / BTM_SEC_ARRAY_BITS;
- trusted_services_mask[btm_mask_index] |= (UINT32)(1 << (bta_service_id_to_btm_srv_id_lkup_tbl[index] - (UINT32)(btm_mask_index * 32)));
+ trusted_services_mask[btm_mask_index] |= (uint32_t)(1 << (bta_service_id_to_btm_srv_id_lkup_tbl[index] - (uint32_t)(btm_mask_index * 32)));
- p_dev->tm &= (UINT32)(~(1<<index));
+ p_dev->tm &= (uint32_t)(~(1<<index));
}
index++;
@@ -851,7 +851,7 @@
void bta_dm_close_acl(tBTA_DM_MSG *p_data)
{
tBTA_DM_API_REMOVE_ACL *p_remove_acl = &p_data->remove_acl;
- UINT8 index;
+ uint8_t index;
APPL_TRACE_DEBUG("bta_dm_close_acl");
@@ -865,7 +865,7 @@
if (index != bta_dm_cb.device_list.count)
{
if (p_remove_acl->remove_dev)
- bta_dm_cb.device_list.peer_device[index].remove_dev_pending = TRUE;
+ bta_dm_cb.device_list.peer_device[index].remove_dev_pending = true;
}
else
{
@@ -883,7 +883,7 @@
}
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
/* need to remove all pending background connection if any */
- BTA_GATTC_CancelOpen(0, p_remove_acl->bd_addr, FALSE);
+ BTA_GATTC_CancelOpen(0, p_remove_acl->bd_addr, false);
/* remove all cached GATT information */
BTA_GATTC_Refresh(p_remove_acl->bd_addr);
#endif
@@ -906,11 +906,11 @@
APPL_TRACE_DEBUG("%s link type = %d", __func__, link_type);
- for (UINT8 i=0; i < bta_dm_cb.device_list.count; i++)
+ for (uint8_t i=0; i < bta_dm_cb.device_list.count; i++)
{
BD_ADDR addr = {0};
bdcpy(addr, bta_dm_cb.device_list.peer_device[i].peer_bdaddr);
-#if defined (BLE_INCLUDED) && (BLE_INCLUDED == TRUE)
+#if (BLE_INCLUDED == TRUE)
transport = bta_dm_cb.device_list.peer_device[i].transport;
#endif
if ((link_type == BTA_DM_LINK_TYPE_ALL) ||
@@ -959,13 +959,13 @@
}
/* taken care of by memset [above]
- sec_event.auth_cmpl.key_present = FALSE;
- sec_event.auth_cmpl.success = FALSE;
+ sec_event.auth_cmpl.key_present = false;
+ sec_event.auth_cmpl.success = false;
*/
sec_event.auth_cmpl.fail_reason = HCI_ERR_ILLEGAL_COMMAND;
if (status == BTM_SUCCESS)
{
- sec_event.auth_cmpl.success = TRUE;
+ sec_event.auth_cmpl.success = true;
}
else
{
@@ -1016,8 +1016,8 @@
*******************************************************************************/
void bta_dm_pin_reply (tBTA_DM_MSG *p_data)
{
- UINT32 trusted_mask[BTM_SEC_SERVICE_ARRAY_SIZE];
- UINT32 * current_trusted_mask;
+ uint32_t trusted_mask[BTM_SEC_SERVICE_ARRAY_SIZE];
+ uint32_t * current_trusted_mask;
current_trusted_mask = BTM_ReadTrustedMask(p_data->pin_reply.bd_addr);
@@ -1051,11 +1051,11 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_policy_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+static void bta_dm_policy_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
tBTA_DM_PEER_DEVICE *p_dev = NULL;
- UINT16 policy = app_id;
- UINT32 mask = (UINT32)(1 << id);
+ uint16_t policy = app_id;
+ uint32_t mask = (uint32_t)(1 << id);
if(peer_addr)
p_dev = bta_dm_find_peer_device(peer_addr);
@@ -1120,7 +1120,7 @@
{
tBTM_STATUS res = BTM_NOT_AUTHORIZED;
- if(p_data->confirm.accept == TRUE)
+ if(p_data->confirm.accept == true)
res = BTM_SUCCESS;
BTM_ConfirmReqReply(res, p_data->confirm.bd_addr);
}
@@ -1172,7 +1172,7 @@
{
tBTM_STATUS res = BTM_NOT_AUTHORIZED;
- if(p_data->ci_rmt_oob.accept == TRUE)
+ if(p_data->ci_rmt_oob.accept == true)
res = BTM_SUCCESS;
BTM_RemoteOobDataReply(res, p_data->ci_rmt_oob.bd_addr,
p_data->ci_rmt_oob.c, p_data->ci_rmt_oob.r );
@@ -1258,7 +1258,7 @@
bta_sys_sendmsg(p_msg);
} else {
/* flag a search cancel is pending */
- bta_dm_search_cb.cancel_pending = TRUE;
+ bta_dm_search_cb.cancel_pending = true;
}
}
/* If no Service Search going on then issue cancel remote name in case it is active */
@@ -1277,7 +1277,7 @@
bta_sys_sendmsg(p_msg);
}
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
if (bta_dm_search_cb.gatt_disc_active)
{
bta_dm_cancel_gatt_discovery(bta_dm_search_cb.peer_bdaddr);
@@ -1297,7 +1297,7 @@
*******************************************************************************/
void bta_dm_discover (tBTA_DM_MSG *p_data)
{
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
size_t len = sizeof(tBT_UUID) * p_data->discover.num_uuid;
#endif
APPL_TRACE_EVENT("%s services_to_search=0x%04X, sdp_search=%d", __func__,
@@ -1306,7 +1306,7 @@
/* save the search condition */
bta_dm_search_cb.services = p_data->discover.services;
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
bta_dm_gattc_register();
osi_free_and_reset((void **)&bta_dm_search_cb.p_srvc_uuid);
if ((bta_dm_search_cb.num_uuid = p_data->discover.num_uuid) != 0 &&
@@ -1327,7 +1327,7 @@
bta_dm_search_cb.p_btm_inq_info = BTM_InqDbRead (p_data->discover.bd_addr);
bta_dm_search_cb.transport = p_data->discover.transport;
- bta_dm_search_cb.name_discover_done = FALSE;
+ bta_dm_search_cb.name_discover_done = false;
memcpy(&bta_dm_search_cb.uuid, &p_data->discover.uuid, sizeof(tSDP_UUID));
bta_dm_discover_device(p_data->discover.bd_addr);
}
@@ -1370,7 +1370,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_di_disc_callback(UINT16 result)
+static void bta_dm_di_disc_callback(uint16_t result)
{
tBTA_DM_MSG *p_msg = (tBTA_DM_MSG *)osi_malloc(sizeof(tBTA_DM_MSG));
@@ -1422,7 +1422,7 @@
*******************************************************************************/
void bta_dm_di_disc (tBTA_DM_MSG *p_data)
{
- UINT16 result = BTA_FAILURE;
+ uint16_t result = BTA_FAILURE;
bta_dm_search_cb.p_search_cback = p_data->di_disc.p_cback;
bdcpy(bta_dm_search_cb.peer_bdaddr, p_data->di_disc.bd_addr);
@@ -1451,10 +1451,10 @@
**
** Description Initiate to get remote device name
**
-** Returns TRUE if started to get remote name
+** Returns true if started to get remote name
**
*******************************************************************************/
-static BOOLEAN bta_dm_read_remote_device_name (BD_ADDR bd_addr,tBT_TRANSPORT transport)
+static bool bta_dm_read_remote_device_name (BD_ADDR bd_addr,tBT_TRANSPORT transport)
{
tBTM_STATUS btm_status;
@@ -1471,7 +1471,7 @@
{
APPL_TRACE_DEBUG("bta_dm_read_remote_device_name: BTM_ReadRemoteDeviceName is started");
- return (TRUE);
+ return (true);
}
else if ( btm_status == BTM_BUSY )
{
@@ -1481,13 +1481,13 @@
/* adding callback to get notified that current reading remore name done */
BTM_SecAddRmtNameNotifyCallback(&bta_dm_service_search_remname_cback);
- return (TRUE);
+ return (true);
}
else
{
APPL_TRACE_WARNING("bta_dm_read_remote_device_name: BTM_ReadRemoteDeviceName returns 0x%02X", btm_status);
- return (FALSE);
+ return (false);
}
}
@@ -1512,7 +1512,7 @@
if((bta_dm_search_cb.p_btm_inq_info = BTM_InqDbFirst()) != NULL)
{
/* start name and service discovery from the first device on inquiry result */
- bta_dm_search_cb.name_discover_done = FALSE;
+ bta_dm_search_cb.name_discover_done = false;
bta_dm_search_cb.peer_name[0] = 0;
bta_dm_discover_device(bta_dm_search_cb.p_btm_inq_info->results.remote_bd_addr);
} else {
@@ -1542,7 +1542,7 @@
if( p_data->rem_name.result.disc_res.bd_name[0] && bta_dm_search_cb.p_btm_inq_info)
{
- bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name = TRUE;
+ bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name = true;
}
bta_dm_discover_device(bta_dm_search_cb.peer_bdaddr);
@@ -1569,7 +1569,7 @@
{
if( p_data->rem_name.result.disc_res.bd_name[0] )
{
- p_btm_inq_info->appl_knows_rem_name = TRUE;
+ p_btm_inq_info->appl_knows_rem_name = true;
}
}
@@ -1590,18 +1590,18 @@
tSDP_DISC_REC *p_sdp_rec = NULL;
tBTA_DM_MSG *p_msg;
- BOOLEAN scn_found = FALSE;
- UINT16 service = 0xFFFF;
+ bool scn_found = false;
+ uint16_t service = 0xFFFF;
tSDP_PROTOCOL_ELEM pe;
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
tBT_UUID *p_uuid = bta_dm_search_cb.p_srvc_uuid;
tBTA_DM_SEARCH result;
tBT_UUID service_uuid;
#endif
- UINT32 num_uuids = 0;
- UINT8 uuid_list[32][MAX_UUID_SIZE]; // assuming a max of 32 services
+ uint32_t num_uuids = 0;
+ uint8_t uuid_list[32][MAX_UUID_SIZE]; // assuming a max of 32 services
if((p_data->sdp_event.sdp_result == SDP_SUCCESS)
|| (p_data->sdp_event.sdp_result == SDP_NO_RECS_MATCH)
@@ -1618,8 +1618,8 @@
if (p_sdp_rec && SDP_FindProtocolListElemInRec(p_sdp_rec, UUID_PROTOCOL_RFCOMM, &pe))
{
- bta_dm_search_cb.peer_scn = (UINT8) pe.params[0];
- scn_found = TRUE;
+ bta_dm_search_cb.peer_scn = (uint8_t) pe.params[0];
+ scn_found = true;
}
}
else
@@ -1627,7 +1627,7 @@
service = bta_service_id_to_uuid_lkup_tbl[bta_dm_search_cb.service_index-1];
p_sdp_rec = SDP_FindServiceInDb(bta_dm_search_cb.p_sdp_db, service, p_sdp_rec);
}
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
/* finished with BR/EDR services, now we check the result for GATT based service UUID */
if (bta_dm_search_cb.service_index == BTA_MAX_SERVICE_ID)
{
@@ -1674,7 +1674,7 @@
{
if (service != UUID_SERVCLASS_PNP_INFORMATION)
{
- UINT16 tmp_svc = 0xFFFF;
+ uint16_t tmp_svc = 0xFFFF;
bta_dm_search_cb.services_found |=
(tBTA_SERVICE_MASK)(BTA_SERVICE_ID_TO_SERVICE_MASK(bta_dm_search_cb.service_index-1));
tmp_svc = bta_service_id_to_uuid_lkup_tbl[bta_dm_search_cb.service_index-1];
@@ -1688,7 +1688,7 @@
if(bta_dm_search_cb.services == BTA_ALL_SERVICE_MASK &&
bta_dm_search_cb.services_to_search == 0)
{
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
if ( bta_dm_search_cb.service_index == BTA_BLE_SERVICE_ID &&
bta_dm_search_cb.uuid_to_search > 0)
bta_dm_search_cb.uuid_to_search --;
@@ -1703,7 +1703,7 @@
} while (bta_dm_search_cb.service_index <= BTA_MAX_SERVICE_ID);
- APPL_TRACE_DEBUG("%s services_found = %04x", __FUNCTION__,
+ APPL_TRACE_DEBUG("%s services_found = %04x", __func__,
bta_dm_search_cb.services_found);
/* Collect the 128-bit services here and put them into the list */
@@ -1748,7 +1748,7 @@
p_msg->disc_result.result.disc_res.p_uuid_list = NULL;
if (num_uuids > 0) {
p_msg->disc_result.result.disc_res.p_uuid_list =
- (UINT8 *)osi_malloc(num_uuids * MAX_UUID_SIZE);
+ (uint8_t *)osi_malloc(num_uuids * MAX_UUID_SIZE);
memcpy(p_msg->disc_result.result.disc_res.p_uuid_list,
uuid_list, num_uuids * MAX_UUID_SIZE);
}
@@ -1800,7 +1800,7 @@
/* conn failed. No need for timer */
if(p_data->sdp_event.sdp_result == SDP_CONN_FAILED || p_data->sdp_event.sdp_result == SDP_CONN_REJECTED
|| p_data->sdp_event.sdp_result == SDP_SECURITY_ERR)
- bta_dm_search_cb.wait_disc = FALSE;
+ bta_dm_search_cb.wait_disc = false;
/* not able to connect go to next device */
if (bta_dm_search_cb.p_sdp_db)
@@ -1857,7 +1857,7 @@
{
APPL_TRACE_EVENT("%s", __func__);
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
/* if any BR/EDR service discovery has been done, report the event */
if ((bta_dm_search_cb.services & ((BTA_ALL_SERVICE_MASK | BTA_USER_SERVICE_MASK ) & ~BTA_BLE_SERVICE_MASK)))
#endif
@@ -1903,7 +1903,7 @@
else
{
/* wait until link is disconnected or timeout */
- bta_dm_search_cb.sdp_results = TRUE;
+ bta_dm_search_cb.sdp_results = true;
alarm_set_on_queue(bta_dm_search_cb.search_timer,
1000 * (L2CAP_LINK_INACTIVITY_TOUT + 1),
bta_dm_search_timer_cback, NULL,
@@ -1924,7 +1924,7 @@
static void bta_dm_search_timer_cback(UNUSED_ATTR void *data)
{
APPL_TRACE_EVENT("%s", __func__);
- bta_dm_search_cb.wait_disc = FALSE;
+ bta_dm_search_cb.wait_disc = false;
/* proceed with next device */
bta_dm_discover_next_device();
@@ -2101,7 +2101,7 @@
bta_dm_search_cb.services_to_search = 0;
}
} else {
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
/* for LE only profile */
if (bta_dm_search_cb.service_index == BTA_BLE_SERVICE_ID) {
if (bta_dm_search_cb.uuid_to_search > 0 &&
@@ -2158,7 +2158,7 @@
bta_dm_search_cb.service_index = BTA_MAX_SERVICE_ID;
} else {
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
if ((bta_dm_search_cb.service_index == BTA_BLE_SERVICE_ID &&
bta_dm_search_cb.uuid_to_search == 0) ||
bta_dm_search_cb.service_index != BTA_BLE_SERVICE_ID)
@@ -2199,7 +2199,7 @@
/* searching next device on inquiry result */
if((bta_dm_search_cb.p_btm_inq_info = BTM_InqDbNext(bta_dm_search_cb.p_btm_inq_info)) != NULL) {
- bta_dm_search_cb.name_discover_done = FALSE;
+ bta_dm_search_cb.name_discover_done = false;
bta_dm_search_cb.peer_name[0] = 0;
bta_dm_discover_device(bta_dm_search_cb.p_btm_inq_info->results.remote_bd_addr);
} else {
@@ -2228,8 +2228,7 @@
static void bta_dm_discover_device(BD_ADDR remote_bd_addr)
{
tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;
-
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
if (bta_dm_search_cb.transport == BTA_TRANSPORT_UNKNOWN)
{
tBT_DEVICE_TYPE dev_type;
@@ -2265,13 +2264,13 @@
APPL_TRACE_DEBUG("%s appl_knows_rem_name %d", __func__,
bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name);
}
-#if (defined(BLE_INCLUDED) && BLE_INCLUDED == TRUE)
+#if (BLE_INCLUDED == TRUE)
if((bta_dm_search_cb.p_btm_inq_info)
&& (bta_dm_search_cb.p_btm_inq_info->results.device_type == BT_DEVICE_TYPE_BLE)
&& (bta_dm_search_cb.state == BTA_DM_SEARCH_ACTIVE))
{
/* Do not perform RNR for LE devices at inquiry complete*/
- bta_dm_search_cb.name_discover_done = TRUE;
+ bta_dm_search_cb.name_discover_done = true;
}
#endif
/* if name discovery is not done and application needs remote name */
@@ -2279,11 +2278,11 @@
&& (( bta_dm_search_cb.p_btm_inq_info == NULL )
||(bta_dm_search_cb.p_btm_inq_info && (!bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name))))
{
- if (bta_dm_read_remote_device_name(bta_dm_search_cb.peer_bdaddr, transport) == TRUE)
+ if (bta_dm_read_remote_device_name(bta_dm_search_cb.peer_bdaddr, transport) == true)
return;
/* starting name discovery failed */
- bta_dm_search_cb.name_discover_done = TRUE;
+ bta_dm_search_cb.name_discover_done = true;
}
/* if application wants to discover service */
@@ -2293,12 +2292,12 @@
bta_dm_search_cb.service_index = 0;
bta_dm_search_cb.services_found = 0;
bta_dm_search_cb.services_to_search = bta_dm_search_cb.services;
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
bta_dm_search_cb.uuid_to_search = bta_dm_search_cb.num_uuid;
#endif
if ((bta_dm_search_cb.p_btm_inq_info != NULL) &&
bta_dm_search_cb.services != BTA_USER_SERVICE_MASK
- &&(bta_dm_search_cb.sdp_search == FALSE))
+ &&(bta_dm_search_cb.sdp_search == false))
{
/* check if EIR provides the information of supported services */
bta_dm_eir_search_services( &bta_dm_search_cb.p_btm_inq_info->results,
@@ -2313,11 +2312,11 @@
if connection exists, we don't have to wait for ACL
link to go down to start search on next device */
if (BTM_IsAclConnectionUp(bta_dm_search_cb.peer_bdaddr, BT_TRANSPORT_BR_EDR))
- bta_dm_search_cb.wait_disc = FALSE;
+ bta_dm_search_cb.wait_disc = false;
else
- bta_dm_search_cb.wait_disc = TRUE;
+ bta_dm_search_cb.wait_disc = true;
-#if (BLE_INCLUDED == TRUE && (defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
if ( bta_dm_search_cb.p_btm_inq_info )
{
APPL_TRACE_DEBUG("%s p_btm_inq_info 0x%x results.device_type 0x%x services_to_search 0x%x",
@@ -2346,7 +2345,7 @@
else
#endif
{
- bta_dm_search_cb.sdp_results = FALSE;
+ bta_dm_search_cb.sdp_results = false;
bta_dm_find_services(bta_dm_search_cb.peer_bdaddr);
return;
}
@@ -2376,7 +2375,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_sdp_callback (UINT16 sdp_status)
+static void bta_dm_sdp_callback (uint16_t sdp_status)
{
tBTA_DM_SDP_RESULT *p_msg =
@@ -2397,17 +2396,17 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_inq_results_cb (tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir)
+static void bta_dm_inq_results_cb (tBTM_INQ_RESULTS *p_inq, uint8_t *p_eir)
{
tBTA_DM_SEARCH result;
tBTM_INQ_INFO *p_inq_info;
- UINT16 service_class;
+ uint16_t service_class;
bdcpy(result.inq_res.bd_addr, p_inq->remote_bd_addr);
memcpy(result.inq_res.dev_class, p_inq->dev_class, DEV_CLASS_LEN);
BTM_COD_SERVICE_CLASS(service_class, p_inq->dev_class);
- result.inq_res.is_limited = (service_class & BTM_COD_SERVICE_LMTD_DISCOVER)?TRUE:FALSE;
+ result.inq_res.is_limited = (service_class & BTM_COD_SERVICE_LMTD_DISCOVER)?true:false;
result.inq_res.rssi = p_inq->rssi;
#if (BLE_INCLUDED == TRUE)
@@ -2422,8 +2421,8 @@
if((p_inq_info = BTM_InqDbRead(p_inq->remote_bd_addr)) != NULL)
{
- /* initialize remt_name_not_required to FALSE so that we get the name by default */
- result.inq_res.remt_name_not_required = FALSE;
+ /* initialize remt_name_not_required to false so that we get the name by default */
+ result.inq_res.remt_name_not_required = false;
}
@@ -2435,7 +2434,7 @@
/* application indicates if it knows the remote name, inside the callback
copy that to the inquiry data base*/
if(result.inq_res.remt_name_not_required)
- p_inq_info->appl_knows_rem_name = TRUE;
+ p_inq_info->appl_knows_rem_name = true;
}
@@ -2458,11 +2457,11 @@
APPL_TRACE_DEBUG("%s", __func__);
- if (bta_dm_search_cb.cancel_pending == FALSE) {
+ if (bta_dm_search_cb.cancel_pending == false) {
p_msg->inq_cmpl.hdr.event = BTA_DM_INQUIRY_CMPL_EVT;
p_msg->inq_cmpl.num = ((tBTM_INQUIRY_CMPL *)p_result)->num_resp;
} else {
- bta_dm_search_cb.cancel_pending = FALSE;
+ bta_dm_search_cb.cancel_pending = false;
bta_dm_search_cancel_notify(NULL);
p_msg->hdr.event = BTA_DM_SEARCH_CMPL_EVT;
p_msg->hdr.layer_specific = BTA_DM_API_DISCOVER_EVT;
@@ -2542,13 +2541,13 @@
p_remote_name->remote_bd_name);
/* remote name discovery is done but it could be failed */
- bta_dm_search_cb.name_discover_done = TRUE;
+ bta_dm_search_cb.name_discover_done = true;
strlcpy((char*)bta_dm_search_cb.peer_name,
(char*)p_remote_name->remote_bd_name, BD_NAME_LEN);
BTM_SecDeleteRmtNameNotifyCallback(&bta_dm_service_search_remname_cback);
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
if (bta_dm_search_cb.transport == BT_TRANSPORT_LE )
{
GAP_BleReadPeerPrefConnParams (bta_dm_search_cb.peer_bdaddr);
@@ -2574,11 +2573,11 @@
** Returns void
**
*******************************************************************************/
-static UINT8 bta_dm_authorize_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name,
- UINT8 *service_name, UINT8 service_id, BOOLEAN is_originator)
+static uint8_t bta_dm_authorize_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name,
+ uint8_t *service_name, uint8_t service_id, bool is_originator)
{
tBTA_DM_SEC sec_event;
- UINT8 index = 1;
+ uint8_t index = 1;
UNUSED(service_name);
UNUSED(is_originator);
@@ -2586,7 +2585,7 @@
memcpy(sec_event.authorize.dev_class, dev_class, DEV_CLASS_LEN);
strlcpy((char*)sec_event.authorize.bd_name, (char*)bd_name, BD_NAME_LEN);
-#if ( defined(BTA_JV_INCLUDED) && BTA_JV_INCLUDED == TRUE )
+#if (BTA_JV_INCLUDED == TRUE)
sec_event.authorize.service = service_id;
#endif
@@ -2604,7 +2603,7 @@
/* if supported service callback otherwise not authorized */
if(bta_dm_cb.p_sec_cback && (index < BTA_MAX_SERVICE_ID
-#if ( defined(BTA_JV_INCLUDED) && BTA_JV_INCLUDED == TRUE )
+#if (BTA_JV_INCLUDED == TRUE)
/* pass through JV service ID */
|| (service_id >= BTA_FIRST_JV_SERVICE_ID && service_id <= BTA_LAST_JV_SERVICE_ID)
#endif
@@ -2636,7 +2635,7 @@
{
tBTM_REMOTE_DEV_NAME *p_result = (tBTM_REMOTE_DEV_NAME *)p_data;
tBTA_DM_SEC sec_event;
- UINT32 bytes_to_copy;
+ uint32_t bytes_to_copy;
tBTA_DM_SEC_EVT event = bta_dm_cb.pin_evt;
if (BTA_DM_SP_CFM_REQ_EVT == event)
@@ -2693,8 +2692,8 @@
** Returns void
**
*******************************************************************************/
-static UINT8 bta_dm_pin_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name,
- BOOLEAN min_16_digit)
+static uint8_t bta_dm_pin_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name,
+ bool min_16_digit)
{
tBTA_DM_SEC sec_event;
@@ -2731,12 +2730,12 @@
** Returns void
**
*******************************************************************************/
-static UINT8 bta_dm_new_link_key_cback(BD_ADDR bd_addr, DEV_CLASS dev_class,
- BD_NAME bd_name, LINK_KEY key, UINT8 key_type)
+static uint8_t bta_dm_new_link_key_cback(BD_ADDR bd_addr, DEV_CLASS dev_class,
+ BD_NAME bd_name, LINK_KEY key, uint8_t key_type)
{
tBTA_DM_SEC sec_event;
tBTA_DM_AUTH_CMPL *p_auth_cmpl;
- UINT8 event;
+ uint8_t event;
UNUSED(dev_class);
memset (&sec_event, 0, sizeof(tBTA_DM_SEC));
@@ -2752,21 +2751,21 @@
memcpy(p_auth_cmpl->bd_name, bd_name, (BD_NAME_LEN-1));
p_auth_cmpl->bd_name[BD_NAME_LEN-1] = 0;
- p_auth_cmpl->key_present = TRUE;
+ p_auth_cmpl->key_present = true;
p_auth_cmpl->key_type = key_type;
- p_auth_cmpl->success = TRUE;
+ p_auth_cmpl->success = true;
memcpy(p_auth_cmpl->key, key, LINK_KEY_LEN);
sec_event.auth_cmpl.fail_reason = HCI_SUCCESS;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
// Report the BR link key based on the BR/EDR address and type
BTM_ReadDevInfo(bd_addr, &sec_event.auth_cmpl.dev_type, &sec_event.auth_cmpl.addr_type);
#endif
if(bta_dm_cb.p_sec_cback)
bta_dm_cb.p_sec_cback(event, &sec_event);
- // Setting remove_dev_pending flag to FALSE, where it will avoid deleting the
+ // Setting remove_dev_pending flag to false, where it will avoid deleting the
// security device record when the ACL connection link goes down in case of
// reconnection.
if (bta_dm_cb.device_list.count)
@@ -2790,7 +2789,7 @@
** Returns void
**
*******************************************************************************/
-static UINT8 bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev_class,BD_NAME bd_name, int result)
+static uint8_t bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev_class,BD_NAME bd_name, int result)
{
tBTA_DM_SEC sec_event;
UNUSED(dev_class);
@@ -2803,11 +2802,11 @@
memcpy(sec_event.auth_cmpl.bd_name, bd_name, (BD_NAME_LEN-1));
sec_event.auth_cmpl.bd_name[BD_NAME_LEN-1] = 0;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
// Report the BR link key based on the BR/EDR address and type
BTM_ReadDevInfo(bd_addr, &sec_event.auth_cmpl.dev_type, &sec_event.auth_cmpl.addr_type);
#endif
- sec_event.auth_cmpl.fail_reason = (UINT8)result;
+ sec_event.auth_cmpl.fail_reason = (uint8_t)result;
if(bta_dm_cb.p_sec_cback)
bta_dm_cb.p_sec_cback(BTA_DM_AUTH_CMPL_EVT, &sec_event);
@@ -2827,7 +2826,7 @@
** Returns void
**
*******************************************************************************/
-static UINT8 bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data)
+static uint8_t bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data)
{
tBTM_STATUS status = BTM_CMD_STARTED;
tBTA_DM_SEC sec_event;
@@ -2925,7 +2924,7 @@
break;
case BTM_SP_LOC_OOB_EVT:
- bta_dm_co_loc_oob((BOOLEAN)(p_data->loc_oob.status == BTM_SUCCESS),
+ bta_dm_co_loc_oob((bool)(p_data->loc_oob.status == BTM_SUCCESS),
p_data->loc_oob.c, p_data->loc_oob.r);
break;
@@ -2982,7 +2981,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_local_name_cback(UINT8 *p_name)
+static void bta_dm_local_name_cback(uint8_t *p_name)
{
tBTA_DM_SEC sec_event;
UNUSED(p_name);
@@ -3010,20 +3009,20 @@
(tBTA_DM_ACL_CHANGE *)osi_malloc(sizeof(tBTA_DM_ACL_CHANGE));
p_msg->event = p_data->event;
- p_msg->is_new = FALSE;
+ p_msg->is_new = false;
switch (p_msg->event) {
case BTM_BL_CONN_EVT:
- p_msg->is_new = TRUE;
+ p_msg->is_new = true;
bdcpy(p_msg->bd_addr, p_data->conn.p_bda);
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
p_msg->transport = p_data->conn.transport;
p_msg->handle = p_data->conn.handle;
#endif
break;
case BTM_BL_DISCN_EVT:
bdcpy(p_msg->bd_addr, p_data->discn.p_bda);
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
p_msg->transport = p_data->discn.transport;
p_msg->handle = p_data->discn.handle;
#endif
@@ -3074,23 +3073,23 @@
** Description This function checks if AV is active
** if yes, make sure the AV link is master
**
-** Returns BOOLEAN - TRUE, if switch is in progress
+** Returns bool - true, if switch is in progress
**
*******************************************************************************/
-static BOOLEAN bta_dm_check_av(UINT16 event)
+static bool bta_dm_check_av(uint16_t event)
{
- BOOLEAN avoid_roleswitch = FALSE;
- BOOLEAN switching = FALSE;
- UINT8 i;
+ bool avoid_roleswitch = false;
+ bool switching = false;
+ uint8_t i;
tBTA_DM_PEER_DEVICE *p_dev;
-#if defined(BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY) && (BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY == TRUE)
+#if (BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY == TRUE)
/* avoid role switch upon inquiry if a2dp is actively streaming as it
introduces an audioglitch due to FW scheduling delays (unavoidable) */
if (event == BTA_DM_API_SEARCH_EVT)
{
- avoid_roleswitch = TRUE;
+ avoid_roleswitch = true;
}
#endif
@@ -3103,14 +3102,14 @@
APPL_TRACE_WARNING("[%d]: state:%d, info:x%x, avoid_rs %d",
i, p_dev->conn_state, p_dev->info, avoid_roleswitch);
if((p_dev->conn_state == BTA_DM_CONNECTED) && (p_dev->info & BTA_DM_DI_AV_ACTIVE) &&
- (avoid_roleswitch == FALSE))
+ (avoid_roleswitch == false))
{
/* make master and take away the role switch policy */
if(BTM_CMD_STARTED == BTM_SwitchRole (p_dev->peer_bdaddr, HCI_ROLE_MASTER, (tBTM_CMPL_CB *)bta_dm_rs_cback))
{
/* the role switch command is actually sent */
bta_dm_cb.rs_event = event;
- switching = TRUE;
+ switching = true;
}
/* else either already master or can not switch for some reasons */
bta_dm_policy_cback(BTA_SYS_PLCY_CLR, 0, HCI_ENABLE_MASTER_SLAVE_SWITCH, p_dev->peer_bdaddr);
@@ -3134,13 +3133,13 @@
void bta_dm_acl_change(tBTA_DM_MSG *p_data)
{
- UINT8 i;
- UINT8 *p;
+ uint8_t i;
+ uint8_t *p;
tBTA_DM_SEC conn;
- BOOLEAN is_new = p_data->acl_change.is_new;
+ bool is_new = p_data->acl_change.is_new;
BD_ADDR_PTR p_bda = p_data->acl_change.bd_addr;
- BOOLEAN need_policy_change = FALSE;
- BOOLEAN issue_unpair_cb = FALSE;
+ bool need_policy_change = false;
+ bool issue_unpair_cb = false;
tBTA_DM_PEER_DEVICE *p_dev;
memset(&conn, 0, sizeof(tBTA_DM_SEC));
@@ -3171,12 +3170,12 @@
/* more than one connections and the AV connection is role switched to slave
* switch it back to master and remove the switch policy */
BTM_SwitchRole(p_bda, BTM_ROLE_MASTER, NULL);
- need_policy_change = TRUE;
+ need_policy_change = true;
}
else if (p_bta_dm_cfg->avoid_scatter && (p_data->acl_change.new_role == HCI_ROLE_MASTER))
{
/* if the link updated to be master include AV activities, remove the switch policy */
- need_policy_change = TRUE;
+ need_policy_change = true;
}
if(need_policy_change)
@@ -3193,7 +3192,7 @@
}
bta_sys_notify_role_chg(p_data->acl_change.bd_addr, p_data->acl_change.new_role, p_data->acl_change.hci_status);
bdcpy(conn.role_chg.bd_addr, p_bda);
- conn.role_chg.new_role = (UINT8) p_data->acl_change.new_role;
+ conn.role_chg.new_role = (uint8_t) p_data->acl_change.new_role;
if( bta_dm_cb.p_sec_cback )
bta_dm_cb.p_sec_cback(BTA_DM_ROLE_CHG_EVT, (tBTA_DM_SEC *)&conn);
}
@@ -3212,7 +3211,7 @@
for(i=0; i<bta_dm_cb.device_list.count; i++)
{
if (!bdcmp( bta_dm_cb.device_list.peer_device[i].peer_bdaddr, p_bda)
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
&& bta_dm_cb.device_list.peer_device[i].conn_handle == p_data->acl_change.handle
#endif
)
@@ -3227,7 +3226,7 @@
bdcpy(bta_dm_cb.device_list.peer_device[bta_dm_cb.device_list.count].peer_bdaddr, p_bda);
bta_dm_cb.device_list.peer_device[bta_dm_cb.device_list.count].link_policy = bta_dm_cb.cur_policy;
bta_dm_cb.device_list.count++;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
bta_dm_cb.device_list.peer_device[i].conn_handle = p_data->acl_change.handle;
if (p_data->acl_change.transport == BT_TRANSPORT_LE)
bta_dm_cb.device_list.le_count++;
@@ -3242,7 +3241,7 @@
bta_dm_cb.device_list.peer_device[i].pref_role = BTA_ANY_ROLE;
bdcpy(conn.link_up.bd_addr, p_bda);
bta_dm_cb.device_list.peer_device[i].info = BTA_DM_DI_NONE;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
conn.link_up.link_type = p_data->acl_change.transport;
bta_dm_cb.device_list.peer_device[i].transport = p_data->acl_change.transport;
#endif
@@ -3261,7 +3260,7 @@
for(i=0; i<bta_dm_cb.device_list.count; i++)
{
if (bdcmp( bta_dm_cb.device_list.peer_device[i].peer_bdaddr, p_bda)
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
||bta_dm_cb.device_list.peer_device[i].transport != p_data->acl_change.transport
#endif
)
@@ -3270,9 +3269,9 @@
if( bta_dm_cb.device_list.peer_device[i].conn_state == BTA_DM_UNPAIRING )
{
if (BTM_SecDeleteDevice(bta_dm_cb.device_list.peer_device[i].peer_bdaddr))
- issue_unpair_cb = TRUE;
+ issue_unpair_cb = true;
- APPL_TRACE_DEBUG("%s: Unpairing: issue unpair CB = %d ",__FUNCTION__, issue_unpair_cb);
+ APPL_TRACE_DEBUG("%s: Unpairing: issue unpair CB = %d ",__func__, issue_unpair_cb);
}
conn.link_down.is_removed = bta_dm_cb.device_list.peer_device[i].remove_dev_pending;
@@ -3285,7 +3284,7 @@
}
if(bta_dm_cb.device_list.count)
bta_dm_cb.device_list.count--;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
if ((p_data->acl_change.transport == BT_TRANSPORT_LE) &&
(bta_dm_cb.device_list.le_count))
bta_dm_cb.device_list.le_count--;
@@ -3294,7 +3293,7 @@
if(bta_dm_search_cb.wait_disc && !bdcmp(bta_dm_search_cb.peer_bdaddr, p_bda))
{
- bta_dm_search_cb.wait_disc = FALSE;
+ bta_dm_search_cb.wait_disc = false;
if(bta_dm_search_cb.sdp_results)
{
@@ -3324,14 +3323,14 @@
BTM_SecDeleteDevice(p_bda);
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
/* need to remove all pending background connection */
- BTA_GATTC_CancelOpen(0, p_bda, FALSE);
+ BTA_GATTC_CancelOpen(0, p_bda, false);
/* remove all cached GATT information */
BTA_GATTC_Refresh(p_bda);
#endif
}
bdcpy(conn.link_down.bd_addr, p_bda);
- conn.link_down.status = (UINT8) btm_get_acl_disc_reason_code();
+ conn.link_down.status = (uint8_t) btm_get_acl_disc_reason_code();
if( bta_dm_cb.p_sec_cback )
{
bta_dm_cb.p_sec_cback(BTA_DM_LINK_DOWN_EVT, &conn);
@@ -3340,7 +3339,7 @@
}
}
- bta_dm_adjust_roles(TRUE);
+ bta_dm_adjust_roles(true);
}
/*******************************************************************************
@@ -3369,7 +3368,7 @@
sys_enable_event->hw_module = BTA_SYS_HW_BLUETOOTH;
bta_sys_sendmsg(sys_enable_event);
- bta_dm_cb.disabling = FALSE;
+ bta_dm_cb.disabling = false;
}
/*******************************************************************************
@@ -3382,9 +3381,9 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+static void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
- UINT8 j;
+ uint8_t j;
tBTA_PREF_ROLES role;
tBTA_DM_PEER_DEVICE *p_dev;
@@ -3441,7 +3440,7 @@
excessive switch requests when individual profile busy/idle status
changes */
if ((status != BTA_SYS_CONN_BUSY) && (status != BTA_SYS_CONN_IDLE))
- bta_dm_adjust_roles(FALSE);
+ bta_dm_adjust_roles(false);
}
/*******************************************************************************
@@ -3456,14 +3455,14 @@
static void bta_dm_delay_role_switch_cback(UNUSED_ATTR void *data)
{
APPL_TRACE_EVENT("%s: initiating Delayed RS", __func__);
- bta_dm_adjust_roles(FALSE);
+ bta_dm_adjust_roles(false);
}
/*******************************************************************************
**
** Function bta_dm_reset_sec_dev_pending
**
-** Description Setting the remove device pending status to FALSE from
+** Description Setting the remove device pending status to false from
** security device DB, when the link key notification
** event comes.
**
@@ -3476,7 +3475,7 @@
{
if (bdcmp(bta_dm_cb.device_list.peer_device[i].peer_bdaddr, remote_bd_addr) == 0)
{
- bta_dm_cb.device_list.peer_device[i].remove_dev_pending = FALSE;
+ bta_dm_cb.device_list.peer_device[i].remove_dev_pending = false;
return;
}
}
@@ -3495,12 +3494,12 @@
*******************************************************************************/
static void bta_dm_remove_sec_dev_entry(BD_ADDR remote_bd_addr)
{
- UINT16 index = 0;
+ uint16_t index = 0;
if ( BTM_IsAclConnectionUp(remote_bd_addr, BT_TRANSPORT_LE) ||
BTM_IsAclConnectionUp(remote_bd_addr, BT_TRANSPORT_BR_EDR))
{
APPL_TRACE_DEBUG("%s ACL is not down. Schedule for Dev Removal when ACL closes",
- __FUNCTION__);
+ __func__);
for (index = 0; index < bta_dm_cb.device_list.count; index ++)
{
if (!bdcmp( bta_dm_cb.device_list.peer_device[index].peer_bdaddr, remote_bd_addr))
@@ -3508,11 +3507,11 @@
}
if (index != bta_dm_cb.device_list.count)
{
- bta_dm_cb.device_list.peer_device[index].remove_dev_pending = TRUE;
+ bta_dm_cb.device_list.peer_device[index].remove_dev_pending = true;
}
else
{
- APPL_TRACE_ERROR(" %s Device does not exist in DB", __FUNCTION__);
+ APPL_TRACE_ERROR(" %s Device does not exist in DB", __func__);
}
}
else
@@ -3520,7 +3519,7 @@
BTM_SecDeleteDevice (remote_bd_addr);
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
/* need to remove all pending background connection */
- BTA_GATTC_CancelOpen(0, remote_bd_addr, FALSE);
+ BTA_GATTC_CancelOpen(0, remote_bd_addr, false);
/* remove all cached GATT information */
BTA_GATTC_Refresh(remote_bd_addr);
#endif
@@ -3538,15 +3537,15 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_adjust_roles(BOOLEAN delay_role_switch)
+static void bta_dm_adjust_roles(bool delay_role_switch)
{
- UINT8 i;
- BOOLEAN set_master_role = FALSE;
-#if BLE_INCLUDED == TRUE
- UINT8 br_count = bta_dm_cb.device_list.count - bta_dm_cb.device_list.le_count;
+ uint8_t i;
+ bool set_master_role = false;
+#if (BLE_INCLUDED == TRUE)
+ uint8_t br_count = bta_dm_cb.device_list.count - bta_dm_cb.device_list.le_count;
#else
- UINT8 br_count = bta_dm_cb.device_list.count;
+ uint8_t br_count = bta_dm_cb.device_list.count;
#endif
if (br_count)
{
@@ -3558,14 +3557,14 @@
{
L2CA_SetDesireRole (HCI_ROLE_MASTER);
- set_master_role = TRUE;
+ set_master_role = true;
}
for(i=0; i<bta_dm_cb.device_list.count; i++)
{
if (bta_dm_cb.device_list.peer_device[i].conn_state == BTA_DM_CONNECTED
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
&& bta_dm_cb.device_list.peer_device[i].transport == BT_TRANSPORT_BR_EDR
#endif
)
@@ -3574,7 +3573,7 @@
&& (p_bta_dm_rm_cfg[0].cfg == BTA_DM_PARTIAL_SCATTERNET))
{
L2CA_SetDesireRole (HCI_ROLE_MASTER);
- set_master_role = TRUE;
+ set_master_role = true;
}
if((bta_dm_cb.device_list.peer_device[i].pref_role == BTA_MASTER_ROLE_ONLY)
@@ -3588,7 +3587,7 @@
delayed to avoid the collision with link encryption setup */
if (bta_dm_cb.device_list.peer_device[i].pref_role != BTA_SLAVE_ROLE_ONLY &&
- delay_role_switch == FALSE)
+ delay_role_switch == false)
{
BTM_SwitchRole (bta_dm_cb.device_list.peer_device[i].peer_bdaddr,
HCI_ROLE_MASTER, NULL);
@@ -3707,29 +3706,29 @@
*******************************************************************************/
static void bta_dm_set_eir (char *local_name)
{
- UINT8 *p;
- UINT8 *p_length;
+ uint8_t *p;
+ uint8_t *p_length;
#if (BTA_EIR_CANNED_UUID_LIST != TRUE)
- UINT8 *p_type;
- UINT8 max_num_uuid;
+ uint8_t *p_type;
+ uint8_t max_num_uuid;
#if (BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0)
- UINT8 custom_uuid_idx;
+ uint8_t custom_uuid_idx;
#endif // BTA_EIR_SERVER_NUM_CUSTOM_UUID
#endif // BTA_EIR_CANNED_UUID_LIST
#if (BTM_EIR_DEFAULT_FEC_REQUIRED == FALSE)
- UINT8 free_eir_length = HCI_EXT_INQ_RESPONSE_LEN;
+ uint8_t free_eir_length = HCI_EXT_INQ_RESPONSE_LEN;
#else // BTM_EIR_DEFAULT_FEC_REQUIRED
- UINT8 free_eir_length = HCI_DM5_PACKET_SIZE;
+ uint8_t free_eir_length = HCI_DM5_PACKET_SIZE;
#endif // BTM_EIR_DEFAULT_FEC_REQUIRED
- UINT8 num_uuid;
- UINT8 data_type;
- UINT8 local_name_len;
+ uint8_t num_uuid;
+ uint8_t data_type;
+ uint8_t local_name_len;
/* wait until complete to disable */
if (alarm_is_scheduled(bta_dm_cb.disable_timer))
return;
-#if ( BTA_EIR_CANNED_UUID_LIST != TRUE )
+#if (BTA_EIR_CANNED_UUID_LIST != TRUE)
/* if local name is not provided, get it from controller */
if( local_name == NULL )
{
@@ -3742,7 +3741,7 @@
/* Allocate a buffer to hold HCI command */
BT_HDR *p_buf = (BT_HDR *)osi_malloc(BTM_CMD_BUF_SIZE);
- p = (UINT8 *)p_buf + BTM_HCI_EIR_OFFSET;
+ p = (uint8_t *)p_buf + BTM_HCI_EIR_OFFSET;
memset(p, 0x00, HCI_EXT_INQ_RESPONSE_LEN );
@@ -3765,7 +3764,7 @@
max_num_uuid = (free_eir_length - 2)/LEN_UUID_16;
data_type = BTM_GetEirSupportedServices( bta_dm_cb.eir_uuid, &p,
max_num_uuid, &num_uuid );
- p = (UINT8 *)p_buf + BTM_HCI_EIR_OFFSET; /* reset p */
+ p = (uint8_t *)p_buf + BTM_HCI_EIR_OFFSET; /* reset p */
#endif // BTA_EIR_CANNED_UUID_LIST
/* if UUID doesn't fit remaing space, shorten local name */
@@ -3817,7 +3816,7 @@
free_eir_length -= num_uuid * LEN_UUID_16;
}
}
-#else /* (BTA_EIR_CANNED_UUID_LIST == TRUE) */
+#else /* (BTA_EIR_CANNED_UUID_LIST == true) */
/* if UUID list is dynamic */
if ( free_eir_length >= 2)
{
@@ -3859,9 +3858,9 @@
UINT8_TO_STREAM(p_type, data_type);
free_eir_length -= num_uuid * LEN_UUID_16 + 2;
}
-#endif /* (BTA_EIR_CANNED_UUID_LIST == TRUE) */
+#endif /* (BTA_EIR_CANNED_UUID_LIST == true) */
-#if ( BTA_EIR_CANNED_UUID_LIST != TRUE )&&(BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0)
+#if (BTA_EIR_CANNED_UUID_LIST != TRUE && BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0)
/* Adding 32-bit UUID list */
if ( free_eir_length >= 2)
{
@@ -3927,7 +3926,7 @@
UINT8_TO_STREAM(p_type, data_type);
free_eir_length -= num_uuid * LEN_UUID_128 + 2;
}
-#endif /* ( BTA_EIR_CANNED_UUID_LIST != TRUE )&&(BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0) */
+#endif /* ( BTA_EIR_CANNED_UUID_LIST != true )&&(BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0) */
/* if Flags are provided in configuration */
if(( p_bta_dm_eir_cfg->bta_dm_eir_flag_len > 0 )
@@ -4002,7 +4001,7 @@
APPL_TRACE_DEBUG(" with services_to_search=0x%08X", *p_services_to_search);
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
/* always do GATT based service discovery by SDP instead of from EIR */
/* if GATT based service is also to be put in EIR, need to modify this */
while (service_index < (BTA_MAX_SERVICE_ID - 1))
@@ -4063,7 +4062,7 @@
** Returns None
**
*******************************************************************************/
-void bta_dm_eir_update_uuid(UINT16 uuid16, BOOLEAN adding)
+void bta_dm_eir_update_uuid(uint16_t uuid16, bool adding)
{
/* if this UUID is not advertised in EIR */
if( !BTM_HasEirService( p_bta_dm_eir_cfg->uuid_mask, uuid16 ))
@@ -4155,7 +4154,7 @@
{
tBTA_STATUS bta_status = BTA_SUCCESS;
tBTA_DM_ENCRYPT_CBACK *p_callback = NULL;
- UINT8 i ;
+ uint8_t i ;
UNUSED(p_ref_data);
for (i=0; i<bta_dm_cb.device_list.count; i++)
@@ -4208,7 +4207,7 @@
*******************************************************************************/
void bta_dm_set_encryption (tBTA_DM_MSG *p_data)
{
- UINT8 i ;
+ uint8_t i ;
APPL_TRACE_DEBUG("bta_dm_set_encryption"); //todo
if (!p_data->set_encryption.p_callback)
@@ -4253,7 +4252,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_observe_results_cb (tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir)
+static void bta_dm_observe_results_cb (tBTM_INQ_RESULTS *p_inq, uint8_t *p_eir)
{
;
tBTA_DM_SEARCH result;
@@ -4272,8 +4271,8 @@
if((p_inq_info = BTM_InqDbRead(p_inq->remote_bd_addr)) != NULL)
{
- /* initialize remt_name_not_required to FALSE so that we get the name by default */
- result.inq_res.remt_name_not_required = FALSE;
+ /* initialize remt_name_not_required to false so that we get the name by default */
+ result.inq_res.remt_name_not_required = false;
}
if(bta_dm_search_cb.p_scan_cback)
@@ -4284,7 +4283,7 @@
/* application indicates if it knows the remote name, inside the callback
copy that to the inquiry data base*/
if(result.inq_res.remt_name_not_required)
- p_inq_info->appl_knows_rem_name = TRUE;
+ p_inq_info->appl_knows_rem_name = true;
}
}
@@ -4322,7 +4321,7 @@
** Returns void
**
*******************************************************************************/
-static UINT8 bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_DATA *p_data)
+static uint8_t bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_DATA *p_data)
{
tBTM_STATUS status = BTM_SUCCESS;
tBTA_DM_SEC sec_event;
@@ -4396,7 +4395,7 @@
case BTM_LE_COMPLT_EVT:
bdcpy(sec_event.auth_cmpl.bd_addr, bda);
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
BTM_ReadDevInfo(bda, &sec_event.auth_cmpl.dev_type, &sec_event.auth_cmpl.addr_type);
#endif
p_name = BTM_SecReadDevName(bda);
@@ -4407,16 +4406,16 @@
if (p_data->complt.reason != 0)
{
- sec_event.auth_cmpl.fail_reason = BTA_DM_AUTH_CONVERT_SMP_CODE(((UINT8)p_data->complt.reason));
+ sec_event.auth_cmpl.fail_reason = BTA_DM_AUTH_CONVERT_SMP_CODE(((uint8_t)p_data->complt.reason));
/* delete this device entry from Sec Dev DB */
bta_dm_remove_sec_dev_entry (bda);
}
else
{
- sec_event.auth_cmpl.success = TRUE;
+ sec_event.auth_cmpl.success = true;
/* We also register for Service Changed right after connect. */
if (!p_data->complt.smp_over_br)
- GATT_ConfigServiceChangeCCC(bda, TRUE, BT_TRANSPORT_LE);
+ GATT_ConfigServiceChangeCCC(bda, true, BT_TRANSPORT_LE);
}
if (bta_dm_cb.p_sec_cback)
@@ -4432,7 +4431,7 @@
}
return status;
}
-#endif /* SMP_INCLUDED == TRUE */
+#endif /* SMP_INCLUDED == true */
/*******************************************************************************
**
@@ -4444,9 +4443,9 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_ble_id_key_cback (UINT8 key_type, tBTM_BLE_LOCAL_KEYS *p_key)
+static void bta_dm_ble_id_key_cback (uint8_t key_type, tBTM_BLE_LOCAL_KEYS *p_key)
{
- UINT8 evt;
+ uint8_t evt;
tBTA_DM_SEC dm_key;
switch (key_type)
@@ -4666,7 +4665,7 @@
}
}
-#if BLE_PRIVACY_SPT == TRUE
+#if (BLE_PRIVACY_SPT == TRUE)
/*******************************************************************************
**
** Function bta_dm_ble_config_local_privacy
@@ -4698,11 +4697,11 @@
{
/*Save the callback to be called when a scan results are available */
bta_dm_search_cb.p_scan_cback = p_data->ble_observe.p_cback;
- if ((status = BTM_BleObserve(TRUE, p_data->ble_observe.duration,
+ if ((status = BTM_BleObserve(true, p_data->ble_observe.duration,
bta_dm_observe_results_cb, bta_dm_observe_cmpl_cb))!= BTM_CMD_STARTED)
{
tBTA_DM_SEARCH data;
- APPL_TRACE_WARNING(" %s BTM_BleObserve failed. status %d",__FUNCTION__,status);
+ APPL_TRACE_WARNING(" %s BTM_BleObserve failed. status %d",__func__,status);
data.inq_cmpl.num_resps = 0;
if (bta_dm_search_cb.p_scan_cback)
{
@@ -4713,7 +4712,7 @@
else
{
bta_dm_search_cb.p_scan_cback = NULL;
- BTM_BleObserve(FALSE, 0, NULL,NULL );
+ BTM_BleObserve(false, 0, NULL,NULL );
}
}
/*******************************************************************************
@@ -4793,7 +4792,7 @@
if (BTM_SetBleDataLength(p_data->ble_set_data_length.remote_bda,
p_data->ble_set_data_length.tx_data_length) != BTM_SUCCESS)
{
- APPL_TRACE_ERROR("%s failed", __FUNCTION__);
+ APPL_TRACE_ERROR("%s failed", __func__);
}
}
@@ -5074,7 +5073,7 @@
{
memset(&track_adv_data, 0, sizeof(tBTA_DM_BLE_TRACK_ADV_DATA));
track_adv_data.advertiser_info_present = NO_ADV_INFO_PRESENT; /* Indicates failure */
- track_adv_data.client_if = (UINT8)p_data->ble_track_advert.ref_value;
+ track_adv_data.client_if = (uint8_t)p_data->ble_track_advert.ref_value;
p_data->ble_track_advert.p_track_adv_cback(&track_adv_data);
}
}
@@ -5119,7 +5118,7 @@
}
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
/*******************************************************************************
**
** Function bta_ble_scan_pf_cmpl
@@ -5127,7 +5126,7 @@
** Description ADV payload filtering operation complete callback
**
**
-** Returns TRUE if handled, otherwise FALSE.
+** Returns true if handled, otherwise false.
**
*******************************************************************************/
static void bta_ble_scan_cfg_cmpl(tBTM_BLE_PF_ACTION action, tBTM_BLE_SCAN_COND_OP cfg_op,
@@ -5299,7 +5298,7 @@
bta_ble_energy_info_cmpl(0, 0, 0, 0, btm_status);
}
-#if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
+#if (BTA_GATT_INCLUDED == TRUE)
#ifndef BTA_DM_GATT_CLOSE_DELAY_TOUT
#define BTA_DM_GATT_CLOSE_DELAY_TOUT 1000
#endif
@@ -5334,7 +5333,7 @@
** Parameters:
**
*******************************************************************************/
-static void btm_dm_start_disc_gatt_services (UINT16 conn_id)
+static void btm_dm_start_disc_gatt_services (uint16_t conn_id)
{
tBT_UUID *p_uuid = bta_dm_search_cb.p_srvc_uuid +
bta_dm_search_cb.num_uuid - bta_dm_search_cb.uuid_to_search;
@@ -5385,7 +5384,7 @@
}
else
{
- APPL_TRACE_ERROR("%s out of room to accomodate more service ids ble_raw_size = %d ble_raw_used = %d", __FUNCTION__,bta_dm_search_cb.ble_raw_size, bta_dm_search_cb.ble_raw_used );
+ APPL_TRACE_ERROR("%s out of room to accomodate more service ids ble_raw_size = %d ble_raw_used = %d", __func__,bta_dm_search_cb.ble_raw_size, bta_dm_search_cb.ble_raw_used );
}
LOG_INFO(LOG_TAG, "%s service_id_uuid_len=%d ", __func__, service_id.uuid.len);
@@ -5410,7 +5409,7 @@
** Parameters:
**
*******************************************************************************/
-static void bta_dm_gatt_disc_complete(UINT16 conn_id, tBTA_GATT_STATUS status)
+static void bta_dm_gatt_disc_complete(uint16_t conn_id, tBTA_GATT_STATUS status)
{
APPL_TRACE_DEBUG("%s conn_id = %d", __func__, conn_id);
@@ -5464,7 +5463,7 @@
bdcpy(bta_dm_search_cb.pending_close_bda,
bta_dm_search_cb.peer_bdaddr);
}
- bta_dm_search_cb.gatt_disc_active = FALSE;
+ bta_dm_search_cb.gatt_disc_active = false;
}
}
@@ -5499,7 +5498,7 @@
*******************************************************************************/
void btm_dm_start_gatt_discovery (BD_ADDR bd_addr)
{
- bta_dm_search_cb.gatt_disc_active = TRUE;
+ bta_dm_search_cb.gatt_disc_active = true;
/* connection is already open */
if (bdcmp(bta_dm_search_cb.pending_close_bda, bd_addr) == 0 &&
@@ -5510,7 +5509,7 @@
btm_dm_start_disc_gatt_services(bta_dm_search_cb.conn_id);
}
else
- BTA_GATTC_Open(bta_dm_search_cb.client_if, bd_addr, TRUE, BTA_GATT_TRANSPORT_LE);
+ BTA_GATTC_Open(bta_dm_search_cb.client_if, bd_addr, true, BTA_GATT_TRANSPORT_LE);
}
/*******************************************************************************
@@ -5526,7 +5525,7 @@
{
if (bta_dm_search_cb.conn_id == BTA_GATT_INVALID_CONN_ID)
{
- BTA_GATTC_CancelOpen(bta_dm_search_cb.client_if, bd_addr, TRUE);
+ BTA_GATTC_CancelOpen(bta_dm_search_cb.client_if, bd_addr, true);
}
bta_dm_gatt_disc_complete(bta_dm_search_cb.conn_id, (tBTA_GATT_STATUS) BTA_GATT_ERROR);
@@ -5543,8 +5542,8 @@
*******************************************************************************/
void bta_dm_proc_open_evt(tBTA_GATTC_OPEN *p_data)
{
- UINT8 *p1;
- UINT8 *p2;
+ uint8_t *p1;
+ uint8_t *p2;
p1 = bta_dm_search_cb.peer_bdaddr;
p2 = p_data->remote_bda;
@@ -5616,7 +5615,7 @@
(bta_dm_search_cb.state != BTA_DM_SEARCH_ACTIVE) &&
!memcmp(p_data->close.remote_bda, bta_dm_search_cb.peer_bdaddr, BD_ADDR_LEN))
{
- bta_dm_gatt_disc_complete((UINT16)BTA_GATT_INVALID_CONN_ID, (tBTA_GATT_STATUS) BTA_GATT_ERROR);
+ bta_dm_gatt_disc_complete((uint16_t)BTA_GATT_INVALID_CONN_ID, (tBTA_GATT_STATUS) BTA_GATT_ERROR);
}
break;
@@ -5627,7 +5626,7 @@
#endif /* BTA_GATT_INCLUDED */
-#if BLE_VND_INCLUDED == TRUE
+#if (BLE_VND_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_dm_ctrl_features_rd_cmpl_cback
@@ -5639,7 +5638,7 @@
*******************************************************************************/
static void bta_dm_ctrl_features_rd_cmpl_cback(tBTM_STATUS result)
{
- APPL_TRACE_DEBUG("%s status = %d ", __FUNCTION__, result);
+ APPL_TRACE_DEBUG("%s status = %d ", __func__, result);
if (result == BTM_SUCCESS)
{
if(bta_dm_cb.p_sec_cback)
@@ -5647,7 +5646,7 @@
}
else
{
- APPL_TRACE_ERROR("%s Ctrl BLE feature read failed: status :%d",__FUNCTION__, result);
+ APPL_TRACE_ERROR("%s Ctrl BLE feature read failed: status :%d",__func__, result);
}
}
diff --git a/bta/dm/bta_dm_api.cc b/bta/dm/bta_dm_api.cc
index 9b9dc5d..89edcfd 100644
--- a/bta/dm/bta_dm_api.cc
+++ b/bta/dm/bta_dm_api.cc
@@ -178,7 +178,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, UINT8 pairable_mode, UINT8 conn_filter )
+void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, uint8_t pairable_mode, uint8_t conn_filter )
{
tBTA_DM_API_SET_VISIBILITY *p_msg =
(tBTA_DM_API_SET_VISIBILITY *)osi_malloc(sizeof(tBTA_DM_MSG));
@@ -248,7 +248,7 @@
**
*******************************************************************************/
void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
- tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search)
+ tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search)
{
tBTA_DM_API_DISCOVER *p_msg =
(tBTA_DM_API_DISCOVER *)osi_calloc(sizeof(tBTA_DM_API_DISCOVER));
@@ -274,7 +274,7 @@
**
*******************************************************************************/
void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID *uuid,
- tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search)
+ tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search)
{
tBTA_DM_API_DISCOVER *p_msg =
(tBTA_DM_API_DISCOVER *)osi_malloc(sizeof(tBTA_DM_API_DISCOVER));
@@ -285,7 +285,7 @@
p_msg->p_cback = p_cback;
p_msg->sdp_search = sdp_search;
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
p_msg->num_uuid = 0;
p_msg->p_uuid = NULL;
#endif
@@ -373,7 +373,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmPinReply(BD_ADDR bd_addr, BOOLEAN accept, UINT8 pin_len, UINT8 *p_pin)
+void BTA_DmPinReply(BD_ADDR bd_addr, bool accept, uint8_t pin_len, uint8_t *p_pin)
{
tBTA_DM_API_PIN_REPLY *p_msg =
@@ -422,7 +422,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmConfirm(BD_ADDR bd_addr, BOOLEAN accept)
+void BTA_DmConfirm(BD_ADDR bd_addr, bool accept)
{
tBTA_DM_API_CONFIRM *p_msg =
(tBTA_DM_API_CONFIRM *)osi_malloc(sizeof(tBTA_DM_API_CONFIRM));
@@ -446,8 +446,8 @@
**
*******************************************************************************/
void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class, LINK_KEY link_key,
- tBTA_SERVICE_MASK trusted_mask, BOOLEAN is_trusted,
- UINT8 key_type, tBTA_IO_CAP io_cap, UINT8 pin_length)
+ tBTA_SERVICE_MASK trusted_mask, bool is_trusted,
+ uint8_t key_type, tBTA_IO_CAP io_cap, uint8_t pin_length)
{
tBTA_DM_API_ADD_DEVICE *p_msg =
(tBTA_DM_API_ADD_DEVICE *)osi_calloc(sizeof(tBTA_DM_API_ADD_DEVICE));
@@ -459,14 +459,14 @@
p_msg->io_cap = io_cap;
if (link_key) {
- p_msg->link_key_known = TRUE;
+ p_msg->link_key_known = true;
p_msg->key_type = key_type;
memcpy(p_msg->link_key, link_key, LINK_KEY_LEN);
}
/* Load device class if specified */
if (dev_class) {
- p_msg->dc_known = TRUE;
+ p_msg->dc_known = true;
memcpy(p_msg->dc, dev_class, DEV_CLASS_LEN);
}
@@ -513,13 +513,13 @@
** Returns None
**
*******************************************************************************/
-extern const UINT16 bta_service_id_to_uuid_lkup_tbl [];
-void BTA_GetEirService( UINT8 *p_eir, tBTA_SERVICE_MASK *p_services )
+extern const uint16_t bta_service_id_to_uuid_lkup_tbl [];
+void BTA_GetEirService( uint8_t *p_eir, tBTA_SERVICE_MASK *p_services )
{
- UINT8 xx, yy;
- UINT8 num_uuid, max_num_uuid = 32;
- UINT8 uuid_list[32*LEN_UUID_16];
- UINT16 *p_uuid16 = (UINT16 *)uuid_list;
+ uint8_t xx, yy;
+ uint8_t num_uuid, max_num_uuid = 32;
+ uint8_t uuid_list[32*LEN_UUID_16];
+ uint16_t *p_uuid16 = (uint16_t *)uuid_list;
tBTA_SERVICE_MASK mask;
BTM_GetEirUuidList( p_eir, LEN_UUID_16, &num_uuid, uuid_list, max_num_uuid);
@@ -557,7 +557,7 @@
** Returns 0 if the device is NOT connected.
**
*******************************************************************************/
-UINT16 BTA_DmGetConnectionState(const BD_ADDR bd_addr )
+uint16_t BTA_DmGetConnectionState(const BD_ADDR bd_addr )
{
tBTA_DM_PEER_DEVICE * p_dev = bta_dm_find_peer_device(bd_addr);
return (p_dev && p_dev->conn_state == BTA_DM_CONNECTED);
@@ -577,7 +577,7 @@
**
*******************************************************************************/
tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
- UINT32 *p_handle )
+ uint32_t *p_handle )
{
tBTA_STATUS status = BTA_FAILURE;
@@ -640,7 +640,7 @@
*******************************************************************************/
void BTA_DmAddBleKey (BD_ADDR bd_addr, tBTA_LE_KEY_VALUE *p_le_key, tBTA_LE_KEY_TYPE key_type)
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_ADD_BLEKEY *p_msg =
(tBTA_DM_API_ADD_BLEKEY *)osi_calloc(sizeof(tBTA_DM_API_ADD_BLEKEY));
@@ -671,7 +671,7 @@
*******************************************************************************/
void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, tBT_DEVICE_TYPE dev_type)
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_ADD_BLE_DEVICE *p_msg =
(tBTA_DM_API_ADD_BLE_DEVICE *)osi_calloc(sizeof(tBTA_DM_API_ADD_BLE_DEVICE));
@@ -698,9 +698,9 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, BOOLEAN accept, UINT32 passkey)
+void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, bool accept, uint32_t passkey)
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_PASSKEY_REPLY *p_msg =
(tBTA_DM_API_PASSKEY_REPLY *)osi_calloc(sizeof(tBTA_DM_API_PASSKEY_REPLY));
@@ -727,9 +727,9 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmBleConfirmReply(BD_ADDR bd_addr, BOOLEAN accept)
+void BTA_DmBleConfirmReply(BD_ADDR bd_addr, bool accept)
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_CONFIRM *p_msg =
(tBTA_DM_API_CONFIRM *)osi_calloc(sizeof(tBTA_DM_API_CONFIRM));
@@ -755,7 +755,7 @@
*******************************************************************************/
void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res)
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_SEC_GRANT *p_msg =
(tBTA_DM_API_BLE_SEC_GRANT *)osi_calloc(sizeof(tBTA_DM_API_BLE_SEC_GRANT));
@@ -787,10 +787,10 @@
**
*******************************************************************************/
void BTA_DmSetBlePrefConnParams(const BD_ADDR bd_addr,
- UINT16 min_conn_int, UINT16 max_conn_int,
- UINT16 slave_latency, UINT16 supervision_tout )
+ uint16_t min_conn_int, uint16_t max_conn_int,
+ uint16_t slave_latency, uint16_t supervision_tout )
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_CONN_PARAMS *p_msg =
(tBTA_DM_API_BLE_CONN_PARAMS *)osi_calloc(sizeof(tBTA_DM_API_BLE_CONN_PARAMS));
@@ -818,9 +818,9 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmSetBleConnScanParams(UINT32 scan_interval, UINT32 scan_window)
+void BTA_DmSetBleConnScanParams(uint32_t scan_interval, uint32_t scan_window)
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_SCAN_PARAMS *p_msg =
(tBTA_DM_API_BLE_SCAN_PARAMS *)osi_calloc(sizeof(tBTA_DM_API_BLE_SCAN_PARAMS));
@@ -829,7 +829,7 @@
p_msg->scan_window = scan_window;
bta_sys_sendmsg(p_msg);
-#endif // BLE_INCLUDED == TRUE
+#endif // BLE_INCLUDED == true
}
/*******************************************************************************
@@ -848,9 +848,9 @@
**
*******************************************************************************/
-#if BLE_INCLUDED == TRUE
-void BTA_DmSetBleScanParams(tGATT_IF client_if, UINT32 scan_interval,
- UINT32 scan_window, tBLE_SCAN_MODE scan_mode,
+#if (BLE_INCLUDED == TRUE)
+void BTA_DmSetBleScanParams(tGATT_IF client_if, uint32_t scan_interval,
+ uint32_t scan_window, tBLE_SCAN_MODE scan_mode,
tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback)
{
tBTA_DM_API_BLE_SCAN_PARAMS *p_msg =
@@ -865,7 +865,7 @@
bta_sys_sendmsg(p_msg);
}
-#endif // BLE_INCLUDED == TRUE
+#endif // BLE_INCLUDED == true
/*******************************************************************************
**
@@ -879,10 +879,10 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmSetBleAdvParams (UINT16 adv_int_min, UINT16 adv_int_max,
+void BTA_DmSetBleAdvParams (uint16_t adv_int_min, uint16_t adv_int_max,
tBLE_BD_ADDR *p_dir_bda)
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_ADV_PARAMS *p_msg =
(tBTA_DM_API_BLE_ADV_PARAMS *)osi_calloc(sizeof(tBTA_DM_API_BLE_ADV_PARAMS));
@@ -905,7 +905,7 @@
** BLE ADV data management API
********************************************************************************/
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleSetAdvConfig
@@ -975,9 +975,9 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_DmBleSetStorageParams(UINT8 batch_scan_full_max,
- UINT8 batch_scan_trunc_max,
- UINT8 batch_scan_notify_threshold,
+extern void BTA_DmBleSetStorageParams(uint8_t batch_scan_full_max,
+ uint8_t batch_scan_trunc_max,
+ uint8_t batch_scan_notify_threshold,
tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback,
tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback,
tBTA_BLE_SCAN_REP_CBACK* p_rep_cback,
@@ -1017,7 +1017,7 @@
**
*******************************************************************************/
extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode,
- UINT32 scan_interval, UINT32 scan_window,
+ uint32_t scan_interval, uint32_t scan_window,
tBTA_BLE_DISCARD_RULE discard_rule,
tBLE_ADDR_TYPE addr_type,
tBTA_DM_BLE_REF_VALUE ref_value)
@@ -1113,7 +1113,7 @@
/*******************************************************************************
** BLE ADV data management API
********************************************************************************/
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
**
@@ -1126,7 +1126,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_DmBleBroadcast (BOOLEAN start)
+extern void BTA_DmBleBroadcast (bool start)
{
tBTA_DM_API_BLE_OBSERVE *p_msg =
(tBTA_DM_API_BLE_OBSERVE *)osi_calloc(sizeof(tBTA_DM_API_BLE_OBSERVE));
@@ -1156,7 +1156,7 @@
*******************************************************************************/
void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type, tBTA_DM_BLE_SEL_CBACK *p_select_cback)
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_SET_BG_CONN_TYPE *p_msg =
(tBTA_DM_API_BLE_SET_BG_CONN_TYPE *)osi_calloc(sizeof(tBTA_DM_API_BLE_SET_BG_CONN_TYPE));
@@ -1177,9 +1177,9 @@
** Returns void
**
*******************************************************************************/
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
static void bta_dm_discover_send_msg(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
- tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search,
+ tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search,
tBTA_TRANSPORT transport)
{
const size_t len = p_services ?
@@ -1194,7 +1194,7 @@
p_msg->transport = transport;
if (p_services != NULL) {
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
p_msg->services = p_services->srvc_mask;
p_msg->num_uuid = p_services->num_uuid;
if (p_services->num_uuid != 0) {
@@ -1226,10 +1226,10 @@
**
*******************************************************************************/
void BTA_DmDiscoverByTransport(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
- tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search,
+ tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search,
tBTA_TRANSPORT transport)
{
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
bta_dm_discover_send_msg(bd_addr, p_services, p_cback, sdp_search, transport);
#endif
}
@@ -1251,9 +1251,9 @@
**
*******************************************************************************/
void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
- tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search)
+ tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search)
{
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
bta_dm_discover_send_msg(bd_addr, p_services, p_cback, sdp_search, BTA_TRANSPORT_UNKNOWN);
#endif
@@ -1280,7 +1280,7 @@
*******************************************************************************/
void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services, tBTA_DM_SEARCH_CBACK *p_cback)
{
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
const size_t len = p_services ?
(sizeof(tBTA_DM_API_SEARCH) + sizeof(tBT_UUID) * p_services->num_uuid)
: sizeof(tBTA_DM_API_SEARCH);
@@ -1326,11 +1326,11 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmBleUpdateConnectionParam(BD_ADDR bd_addr, UINT16 min_int,
- UINT16 max_int, UINT16 latency,
- UINT16 timeout)
+void BTA_DmBleUpdateConnectionParam(BD_ADDR bd_addr, uint16_t min_int,
+ uint16_t max_int, uint16_t latency,
+ uint16_t timeout)
{
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_UPDATE_CONN_PARAM *p_msg =
(tBTA_DM_API_UPDATE_CONN_PARAM *)osi_calloc(sizeof(tBTA_DM_API_UPDATE_CONN_PARAM));
@@ -1356,9 +1356,9 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmBleConfigLocalPrivacy(BOOLEAN privacy_enable)
+void BTA_DmBleConfigLocalPrivacy(bool privacy_enable)
{
-#if BLE_INCLUDED == TRUE && BLE_PRIVACY_SPT == TRUE
+#if (BLE_INCLUDED == TRUE && BLE_PRIVACY_SPT == TRUE)
tBTA_DM_API_LOCAL_PRIVACY *p_msg =
(tBTA_DM_API_LOCAL_PRIVACY *)osi_calloc(sizeof(tBTA_DM_API_ENABLE_PRIVACY));
@@ -1371,7 +1371,7 @@
#endif
}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
**
** Function BTA_BleEnableAdvInstance
@@ -1421,7 +1421,7 @@
** Returns BTA_SUCCESS if command started sucessfully; otherwise failure.
**
*******************************************************************************/
-void BTA_BleUpdateAdvInstParam (UINT8 inst_id, tBTA_BLE_ADV_PARAMS *p_params)
+void BTA_BleUpdateAdvInstParam (uint8_t inst_id, tBTA_BLE_ADV_PARAMS *p_params)
{
const size_t len = sizeof(tBTA_BLE_ADV_PARAMS) +
sizeof(tBTA_DM_API_BLE_MULTI_ADV_PARAM);
@@ -1455,7 +1455,7 @@
** Returns BTA_SUCCESS if command started sucessfully; otherwise failure.
**
*******************************************************************************/
-void BTA_BleCfgAdvInstData (UINT8 inst_id, BOOLEAN is_scan_rsp,
+void BTA_BleCfgAdvInstData (uint8_t inst_id, bool is_scan_rsp,
tBTA_BLE_AD_MASK data_mask,
tBTA_BLE_ADV_DATA *p_data)
{
@@ -1482,7 +1482,7 @@
** Returns BTA_SUCCESS if command started sucessfully; otherwise failure.
**
*******************************************************************************/
-void BTA_BleDisableAdvInstance(UINT8 inst_id)
+void BTA_BleDisableAdvInstance(uint8_t inst_id)
{
tBTA_DM_API_BLE_MULTI_ADV_DISABLE *p_msg =
(tBTA_DM_API_BLE_MULTI_ADV_DISABLE *)osi_calloc(sizeof(tBTA_DM_API_BLE_MULTI_ADV_DISABLE));
@@ -1519,13 +1519,13 @@
tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
tBTA_DM_BLE_REF_VALUE ref_value)
{
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
tBTA_DM_API_CFG_FILTER_COND *p_msg;
APPL_TRACE_API ("BTA_DmBleCfgFilterCondition: %d, %d", action, cond_type);
- UINT16 len = sizeof(tBTA_DM_API_CFG_FILTER_COND) +
+ uint16_t len = sizeof(tBTA_DM_API_CFG_FILTER_COND) +
sizeof(tBTA_DM_BLE_PF_COND_PARAM);
- UINT8 *p;
+ uint8_t *p;
if (NULL != p_cond)
{
@@ -1536,11 +1536,11 @@
/* Length of pattern and pattern mask and other elements in */
/* tBTA_DM_BLE_PF_MANU_COND */
len += ((p_cond->manu_data.data_len) * 2) +
- sizeof(UINT16) + sizeof(UINT16) + sizeof(UINT8);
+ sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint8_t);
break;
case BTA_DM_BLE_PF_LOCAL_NAME:
- len += ((p_cond->local_name.data_len) + sizeof(UINT8));
+ len += ((p_cond->local_name.data_len) + sizeof(uint8_t));
break;
case BTM_BLE_PF_SRVC_UUID:
@@ -1564,7 +1564,7 @@
p_msg->p_cond_param = (tBTA_DM_BLE_PF_COND_PARAM *)(p_msg + 1);
memcpy(p_msg->p_cond_param, p_cond, sizeof(tBTA_DM_BLE_PF_COND_PARAM));
- p = (UINT8 *)(p_msg->p_cond_param + 1);
+ p = (uint8_t *)(p_msg->p_cond_param + 1);
if (cond_type == BTA_DM_BLE_PF_SRVC_DATA_PATTERN ||
cond_type == BTA_DM_BLE_PF_MANU_DATA) {
@@ -1598,7 +1598,7 @@
p_cond->srvc_uuid.p_target_addr->type;
memcpy(p_msg->p_cond_param->srvc_uuid.p_target_addr->bda,
p_cond->srvc_uuid.p_target_addr->bda, BD_ADDR_LEN);
- p = (UINT8 *)(p_msg->p_cond_param->srvc_uuid.p_target_addr + 1);
+ p = (uint8_t *)(p_msg->p_cond_param->srvc_uuid.p_target_addr + 1);
}
if (p_cond->srvc_uuid.p_uuid_mask) {
p_msg->p_cond_param->srvc_uuid.p_uuid_mask = (tBTA_DM_BLE_PF_COND_MASK *)p;
@@ -1637,14 +1637,14 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmBleScanFilterSetup(UINT8 action,
+void BTA_DmBleScanFilterSetup(uint8_t action,
tBTA_DM_BLE_PF_FILT_INDEX filt_index,
tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params,
tBLE_BD_ADDR *p_target,
tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback,
tBTA_DM_BLE_REF_VALUE ref_value)
{
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
const size_t len = sizeof(tBTA_DM_API_SCAN_FILTER_PARAM_SETUP) +
sizeof(tBLE_BD_ADDR);
tBTA_DM_API_SCAN_FILTER_PARAM_SETUP *p_msg =
@@ -1716,10 +1716,10 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmEnableScanFilter(UINT8 action, tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
+void BTA_DmEnableScanFilter(uint8_t action, tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
tBTA_DM_BLE_REF_VALUE ref_value)
{
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
const size_t len = sizeof(tBTA_DM_API_ENABLE_SCAN_FILTER) +
sizeof(tBLE_BD_ADDR);
tBTA_DM_API_ENABLE_SCAN_FILTER *p_msg =
@@ -1756,8 +1756,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmBleUpdateConnectionParams(const BD_ADDR bd_addr, UINT16 min_int, UINT16 max_int,
- UINT16 latency, UINT16 timeout)
+void BTA_DmBleUpdateConnectionParams(const BD_ADDR bd_addr, uint16_t min_int, uint16_t max_int,
+ uint16_t latency, uint16_t timeout)
{
tBTA_DM_API_UPDATE_CONN_PARAM *p_msg =
(tBTA_DM_API_UPDATE_CONN_PARAM *)osi_calloc(sizeof(tBTA_DM_API_UPDATE_CONN_PARAM));
@@ -1782,7 +1782,7 @@
**
**
*******************************************************************************/
-void BTA_DmBleSetDataLength(BD_ADDR remote_device, UINT16 tx_data_length)
+void BTA_DmBleSetDataLength(BD_ADDR remote_device, uint16_t tx_data_length)
{
tBTA_DM_API_BLE_SET_DATA_LENGTH *p_msg =
(tBTA_DM_API_BLE_SET_DATA_LENGTH *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_DATA_LENGTH));
@@ -1847,7 +1847,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_DmCloseACL(BD_ADDR bd_addr, BOOLEAN remove_dev, tBTA_TRANSPORT transport)
+void BTA_DmCloseACL(BD_ADDR bd_addr, bool remove_dev, tBTA_TRANSPORT transport)
{
tBTA_DM_API_REMOVE_ACL *p_msg =
(tBTA_DM_API_REMOVE_ACL *)osi_calloc(sizeof(tBTA_DM_API_REMOVE_ACL));
@@ -1862,7 +1862,7 @@
bta_sys_sendmsg(p_msg);
}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleObserve
@@ -1878,7 +1878,7 @@
** Returns void.
**
*******************************************************************************/
-extern void BTA_DmBleObserve(BOOLEAN start, UINT8 duration,
+extern void BTA_DmBleObserve(bool start, uint8_t duration,
tBTA_DM_SEARCH_CBACK *p_results_cb)
{
tBTA_DM_API_BLE_OBSERVE *p_msg =
@@ -1926,7 +1926,7 @@
if (cmn_ble_vsc_cb.max_filter > 0)
{
btm_ble_adv_filter_cleanup();
-#if BLE_PRIVACY_SPT == TRUE
+#if (BLE_PRIVACY_SPT == TRUE)
btm_ble_resolving_list_cleanup ();
#endif
}
diff --git a/bta/dm/bta_dm_cfg.cc b/bta/dm/bta_dm_cfg.cc
index 744a6fc..f690d1e 100644
--- a/bta/dm/bta_dm_cfg.cc
+++ b/bta/dm/bta_dm_cfg.cc
@@ -44,7 +44,7 @@
#define BTA_DM_LINK_TIMEOUT 8000
#endif
-/* TRUE to avoid scatternet when av is streaming (be the master) */
+/* true to avoid scatternet when av is streaming (be the master) */
#ifndef BTA_DM_AVOID_SCATTER_A2DP
#define BTA_DM_AVOID_SCATTER_A2DP TRUE
#endif
@@ -67,7 +67,7 @@
BTA_DM_PAGE_TIMEOUT,
/* link supervision timeout in 625uS*/
BTA_DM_LINK_TIMEOUT,
- /* TRUE to avoid scatternet when av is streaming (be the master) */
+ /* true to avoid scatternet when av is streaming (be the master) */
BTA_DM_AVOID_SCATTER_A2DP
};
@@ -117,7 +117,7 @@
tBTA_DM_RM *p_bta_dm_rm_cfg = (tBTA_DM_RM *)&bta_dm_rm_cfg;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
# define BTA_DM_NUM_PM_ENTRY 23 /* number of entries in bta_dm_pm_cfg except the first */
# define BTA_DM_NUM_PM_SPEC 15 /* number of entries in bta_dm_pm_spec */
#else
@@ -149,7 +149,7 @@
{BTA_ID_PAN, BTUI_PAN_ID_PANU, 9}, /* PANU spec table */
{BTA_ID_PAN, BTUI_PAN_ID_NAP, 10}, /* NAP spec table */
{BTA_ID_HS, BTA_ALL_APP_ID, 11} /* HS spec table */
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
,{BTA_ID_GATTC, BTA_ALL_APP_ID, 13} /* gattc spec table */
,{BTA_ID_GATTS, BTA_ALL_APP_ID, 14} /* gatts spec table */
#endif
@@ -405,7 +405,7 @@
}
}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/* GATTC : 13 */
,{
(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
@@ -535,7 +535,7 @@
/* The performance impact of EIR packet size
**
-** When BTM_EIR_DEFAULT_FEC_REQUIRED is TRUE,
+** When BTM_EIR_DEFAULT_FEC_REQUIRED is true,
** 1 to 17 bytes, DM1 is used and most robust.
** 18 to 121 bytes, DM3 is used but impacts inquiry scan time with large number
** of devices.(almost double with 150 users)
@@ -544,7 +544,7 @@
** 225 to 240 bytes, DH5 is used without FEC but it not recommended.
** (same reason of DM5)
**
-** When BTM_EIR_DEFAULT_FEC_REQUIRED is FALSE,
+** When BTM_EIR_DEFAULT_FEC_REQUIRED is false,
** 1 to 27 bytes, DH1 is used but only robust at short range.
** 28 to 183 bytes, DH3 is used but only robust at short range and impacts inquiry
** scan time with large number of devices.
@@ -553,7 +553,7 @@
#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
/* for example */
-const UINT8 bta_dm_eir_uuid16_list[] = { 0x08, 0x11, /* Headset */
+const uint8_t bta_dm_eir_uuid16_list[] = { 0x08, 0x11, /* Headset */
0x1E, 0x11, /* Handsfree */
0x0E, 0x11, /* AV Remote Control */
0x0B, 0x11, /* Audio Sink */
@@ -568,7 +568,7 @@
/* room for all UUID list then local name is shortened to this length */
#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
8,
- (UINT8 *)bta_dm_eir_uuid16_list,
+ (uint8_t *)bta_dm_eir_uuid16_list,
#else // BTA_EIR_CANNED_UUID_LIST
{ /* mask of UUID list in EIR */
0xFFFFFFFF, /* LSB is the first UUID of the first 32 UUIDs in BTM_EIR_UUID_LKUP_TBL */
diff --git a/bta/dm/bta_dm_ci.cc b/bta/dm/bta_dm_ci.cc
index 04a9328..87e4b4c 100644
--- a/bta/dm/bta_dm_ci.cc
+++ b/bta/dm/bta_dm_ci.cc
@@ -68,7 +68,7 @@
** Returns void
**
*******************************************************************************/
-void bta_dm_ci_rmt_oob(BOOLEAN accept, BD_ADDR bd_addr, BT_OCTET16 c, BT_OCTET16 r)
+void bta_dm_ci_rmt_oob(bool accept, BD_ADDR bd_addr, BT_OCTET16 c, BT_OCTET16 r)
{
tBTA_DM_CI_RMT_OOB *p_msg =
(tBTA_DM_CI_RMT_OOB *)osi_malloc(sizeof(tBTA_DM_CI_RMT_OOB));
@@ -98,7 +98,7 @@
** Returns void
**
*******************************************************************************/
-void bta_dm_sco_ci_data_ready(UINT16 event, UINT16 sco_handle)
+void bta_dm_sco_ci_data_ready(uint16_t event, uint16_t sco_handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
diff --git a/bta/dm/bta_dm_int.h b/bta/dm/bta_dm_int.h
index dfac16a..4268a1f 100644
--- a/bta/dm/bta_dm_int.h
+++ b/bta/dm/bta_dm_int.h
@@ -26,8 +26,8 @@
#include "bt_target.h"
-#if (BLE_INCLUDED == TRUE && (defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
- #include "bta_gatt_api.h"
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#include "bta_gatt_api.h"
#endif
@@ -37,9 +37,9 @@
*****************************************************************************/
-#define BTA_COPY_DEVICE_CLASS(coddst, codsrc) {((UINT8 *)(coddst))[0] = ((UINT8 *)(codsrc))[0]; \
- ((UINT8 *)(coddst))[1] = ((UINT8 *)(codsrc))[1]; \
- ((UINT8 *)(coddst))[2] = ((UINT8 *)(codsrc))[2];}
+#define BTA_COPY_DEVICE_CLASS(coddst, codsrc) {((uint8_t *)(coddst))[0] = ((uint8_t *)(codsrc))[0]; \
+ ((uint8_t *)(coddst))[1] = ((uint8_t *)(codsrc))[1]; \
+ ((uint8_t *)(coddst))[2] = ((uint8_t *)(codsrc))[2];}
#define BTA_DM_MSG_LEN 50
@@ -78,7 +78,7 @@
BTA_DM_CI_RMT_OOB_EVT,
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
BTA_DM_API_ADD_BLEKEY_EVT,
BTA_DM_API_ADD_BLEDEVICE_EVT,
BTA_DM_API_BLE_PASSKEY_REPLY_EVT,
@@ -90,7 +90,7 @@
BTA_DM_API_BLE_SCAN_PARAM_EVT,
BTA_DM_API_BLE_OBSERVE_EVT,
BTA_DM_API_UPDATE_CONN_PARAM_EVT,
-#if BLE_PRIVACY_SPT == TRUE
+#if (BLE_PRIVACY_SPT == TRUE)
BTA_DM_API_LOCAL_PRIVACY_EVT,
#endif
BTA_DM_API_BLE_ADV_PARAM_EVT,
@@ -99,7 +99,7 @@
BTA_DM_API_BLE_BROADCAST_EVT,
BTA_DM_API_SET_DATA_LENGTH_EVT,
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
BTA_DM_API_CFG_FILTER_COND_EVT,
BTA_DM_API_SCAN_FILTER_SETUP_EVT,
BTA_DM_API_SCAN_FILTER_ENABLE_EVT,
@@ -163,8 +163,8 @@
BT_HDR hdr;
tBTA_DM_DISC disc_mode;
tBTA_DM_CONN conn_mode;
- UINT8 pair_mode;
- UINT8 conn_paired_only;
+ uint8_t pair_mode;
+ uint8_t conn_paired_only;
} tBTA_DM_API_SET_VISIBILITY;
enum
@@ -173,7 +173,7 @@
BTA_DM_RS_OK, /* the role switch result - successful */
BTA_DM_RS_FAIL /* the role switch result - failed */
};
-typedef UINT8 tBTA_DM_RS_RES;
+typedef uint8_t tBTA_DM_RS_RES;
/* data type for BTA_DM_API_SEARCH_EVT */
typedef struct
@@ -183,8 +183,8 @@
tBTA_SERVICE_MASK services;
tBTA_DM_SEARCH_CBACK * p_cback;
tBTA_DM_RS_RES rs_res;
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
- UINT8 num_uuid;
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+ uint8_t num_uuid;
tBT_UUID *p_uuid;
#endif
} tBTA_DM_API_SEARCH;
@@ -196,10 +196,10 @@
BD_ADDR bd_addr;
tBTA_SERVICE_MASK services;
tBTA_DM_SEARCH_CBACK * p_cback;
- BOOLEAN sdp_search;
+ bool sdp_search;
tBTA_TRANSPORT transport;
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
- UINT8 num_uuid;
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+ uint8_t num_uuid;
tBT_UUID *p_uuid;
#endif
tSDP_UUID uuid;
@@ -211,7 +211,7 @@
BT_HDR hdr;
BD_ADDR bd_addr;
tBTA_DISCOVERY_DB *p_sdp_db;
- UINT32 len;
+ uint32_t len;
tBTA_DM_SEARCH_CBACK * p_cback;
}tBTA_DM_API_DI_DISC;
@@ -236,9 +236,9 @@
{
BT_HDR hdr;
BD_ADDR bd_addr;
- BOOLEAN accept;
- UINT8 pin_len;
- UINT8 p_pin[PIN_CODE_LEN];
+ bool accept;
+ uint8_t pin_len;
+ uint8_t p_pin[PIN_CODE_LEN];
} tBTA_DM_API_PIN_REPLY;
/* data type for BTA_DM_API_LOC_OOB_EVT */
@@ -252,7 +252,7 @@
{
BT_HDR hdr;
BD_ADDR bd_addr;
- BOOLEAN accept;
+ bool accept;
} tBTA_DM_API_CONFIRM;
/* data type for BTA_DM_CI_IO_REQ_EVT */
@@ -272,7 +272,7 @@
BD_ADDR bd_addr;
BT_OCTET16 c;
BT_OCTET16 r;
- BOOLEAN accept;
+ bool accept;
} tBTA_DM_CI_RMT_OOB;
/* data type for BTA_DM_REMT_NAME_EVT */
@@ -294,14 +294,14 @@
typedef struct
{
BT_HDR hdr;
- UINT8 num;
+ uint8_t num;
} tBTA_DM_INQUIRY_CMPL;
/* data type for BTA_DM_SDP_RESULT_EVT */
typedef struct
{
BT_HDR hdr;
- UINT16 sdp_result;
+ uint16_t sdp_result;
} tBTA_DM_SDP_RESULT;
/* data type for BTA_DM_ACL_CHANGE_EVT */
@@ -309,14 +309,14 @@
{
BT_HDR hdr;
tBTM_BL_EVENT event;
- UINT8 busy_level;
- UINT8 busy_level_flags;
- BOOLEAN is_new;
- UINT8 new_role;
+ uint8_t busy_level;
+ uint8_t busy_level_flags;
+ bool is_new;
+ uint8_t new_role;
BD_ADDR bd_addr;
- UINT8 hci_status;
-#if BLE_INCLUDED == TRUE
- UINT16 handle;
+ uint8_t hci_status;
+#if (BLE_INCLUDED == TRUE)
+ uint16_t handle;
tBT_TRANSPORT transport;
#endif
} tBTA_DM_ACL_CHANGE;
@@ -328,8 +328,8 @@
BT_HDR hdr;
BD_ADDR bd_addr;
tBTM_PM_STATUS status;
- UINT16 value;
- UINT8 hci_status;
+ uint16_t value;
+ uint8_t hci_status;
} tBTA_DM_PM_BTM_STATUS;
@@ -350,14 +350,14 @@
DEV_CLASS dc;
LINK_KEY link_key;
tBTA_SERVICE_MASK tm;
- BOOLEAN is_trusted;
- UINT8 key_type;
+ bool is_trusted;
+ uint8_t key_type;
tBTA_IO_CAP io_cap;
- BOOLEAN link_key_known;
- BOOLEAN dc_known;
+ bool link_key_known;
+ bool dc_known;
BD_NAME bd_name;
- UINT8 features[BTA_FEATURE_BYTES_PER_PAGE * (BTA_EXT_FEATURES_PAGE_MAX + 1)];
- UINT8 pin_length;
+ uint8_t features[BTA_FEATURE_BYTES_PER_PAGE * (BTA_EXT_FEATURES_PAGE_MAX + 1)];
+ uint8_t pin_length;
} tBTA_DM_API_ADD_DEVICE;
/* data type for BTA_DM_API_REMOVE_ACL_EVT */
@@ -385,7 +385,7 @@
BD_ADDR bd_addr;
} tBTA_DM_API_SET_ENCRYPTION;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
typedef struct
{
BT_HDR hdr;
@@ -408,8 +408,8 @@
{
BT_HDR hdr;
BD_ADDR bd_addr;
- BOOLEAN accept;
- UINT32 passkey;
+ bool accept;
+ uint32_t passkey;
}tBTA_DM_API_PASSKEY_REPLY;
typedef struct
@@ -432,10 +432,10 @@
{
BT_HDR hdr;
BD_ADDR peer_bda;
- UINT16 conn_int_min;
- UINT16 conn_int_max;
- UINT16 supervision_tout;
- UINT16 slave_latency;
+ uint16_t conn_int_min;
+ uint16_t conn_int_max;
+ uint16_t supervision_tout;
+ uint16_t slave_latency;
}tBTA_DM_API_BLE_CONN_PARAMS;
@@ -443,14 +443,14 @@
{
BT_HDR hdr;
BD_ADDR peer_bda;
- BOOLEAN privacy_enable;
+ bool privacy_enable;
}tBTA_DM_API_ENABLE_PRIVACY;
typedef struct
{
BT_HDR hdr;
- BOOLEAN privacy_enable;
+ bool privacy_enable;
}tBTA_DM_API_LOCAL_PRIVACY;
/* set scan parameter for BLE connections */
@@ -458,8 +458,8 @@
{
BT_HDR hdr;
tBTA_GATTC_IF client_if;
- UINT32 scan_int;
- UINT32 scan_window;
+ uint32_t scan_int;
+ uint32_t scan_window;
tBLE_SCAN_MODE scan_mode;
tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback;
}tBTA_DM_API_BLE_SCAN_PARAMS;
@@ -468,16 +468,16 @@
typedef struct
{
BT_HDR hdr;
- UINT16 scan_int;
- UINT16 scan_window;
+ uint16_t scan_int;
+ uint16_t scan_window;
} tBTA_DM_API_BLE_CONN_SCAN_PARAMS;
/* Data type for start/stop observe */
typedef struct
{
BT_HDR hdr;
- BOOLEAN start;
- UINT16 duration;
+ bool start;
+ uint16_t duration;
tBTA_DM_SEARCH_CBACK * p_cback;
}tBTA_DM_API_BLE_OBSERVE;
@@ -485,22 +485,22 @@
{
BT_HDR hdr;
BD_ADDR remote_bda;
- UINT16 tx_data_length;
+ uint16_t tx_data_length;
}tBTA_DM_API_BLE_SET_DATA_LENGTH;
/* set adv parameter for BLE advertising */
typedef struct
{
BT_HDR hdr;
- UINT16 adv_int_min;
- UINT16 adv_int_max;
+ uint16_t adv_int_min;
+ uint16_t adv_int_max;
tBLE_BD_ADDR *p_dir_bda;
}tBTA_DM_API_BLE_ADV_PARAMS;
typedef struct
{
BT_HDR hdr;
- BOOLEAN enable;
+ bool enable;
}tBTA_DM_API_BLE_FEATURE;
@@ -516,15 +516,15 @@
typedef struct
{
BT_HDR hdr;
- UINT8 inst_id;
+ uint8_t inst_id;
tBTA_BLE_ADV_PARAMS *p_params;
}tBTA_DM_API_BLE_MULTI_ADV_PARAM;
typedef struct
{
BT_HDR hdr;
- UINT8 inst_id;
- BOOLEAN is_scan_rsp;
+ uint8_t inst_id;
+ bool is_scan_rsp;
tBTA_BLE_AD_MASK data_mask;
tBTA_BLE_ADV_DATA data;
}tBTA_DM_API_BLE_MULTI_ADV_DATA;
@@ -532,13 +532,13 @@
typedef struct
{
BT_HDR hdr;
- UINT8 inst_id;
+ uint8_t inst_id;
}tBTA_DM_API_BLE_MULTI_ADV_DISABLE;
typedef struct
{
BT_HDR hdr;
- UINT32 data_mask;
+ uint32_t data_mask;
tBTA_BLE_ADV_DATA adv_cfg;
tBTA_SET_ADV_DATA_CMPL_CBACK *p_adv_data_cback;
}tBTA_DM_API_SET_ADV_CONFIG;
@@ -546,9 +546,9 @@
typedef struct
{
BT_HDR hdr;
- UINT8 batch_scan_full_max;
- UINT8 batch_scan_trunc_max;
- UINT8 batch_scan_notify_threshold;
+ uint8_t batch_scan_full_max;
+ uint8_t batch_scan_trunc_max;
+ uint8_t batch_scan_notify_threshold;
tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback;
tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback;
tBTA_BLE_SCAN_REP_CBACK *p_read_rep_cback;
@@ -559,8 +559,8 @@
{
BT_HDR hdr;
tBTA_BLE_BATCH_SCAN_MODE scan_mode;
- UINT32 scan_int;
- UINT32 scan_window;
+ uint32_t scan_int;
+ uint32_t scan_window;
tBTA_BLE_DISCARD_RULE discard_rule;
tBLE_ADDR_TYPE addr_type;
tBTA_DM_BLE_REF_VALUE ref_value;
@@ -599,7 +599,7 @@
{
BT_HDR hdr;
BD_ADDR bd_addr;
- BOOLEAN remove_dev;
+ bool remove_dev;
tBTA_TRANSPORT transport;
}tBTA_DM_API_REMOVE_ACL;
@@ -615,13 +615,13 @@
{
BT_HDR hdr;
BD_ADDR bd_addr;
- UINT16 min_int;
- UINT16 max_int;
- UINT16 latency;
- UINT16 timeout;
+ uint16_t min_int;
+ uint16_t max_int;
+ uint16_t latency;
+ uint16_t timeout;
}tBTA_DM_API_UPDATE_CONN_PARAM;
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
typedef struct
{
BT_HDR hdr;
@@ -636,7 +636,7 @@
typedef struct
{
BT_HDR hdr;
- UINT8 action;
+ uint8_t action;
tBTA_DM_BLE_PF_STATUS_CBACK *p_filt_status_cback;
tBTA_DM_BLE_REF_VALUE ref_value;
}tBTA_DM_API_ENABLE_SCAN_FILTER;
@@ -644,7 +644,7 @@
typedef struct
{
BT_HDR hdr;
- UINT8 action;
+ uint8_t action;
tBTA_DM_BLE_PF_FILT_INDEX filt_index;
tBTA_DM_BLE_PF_FILT_PARAMS filt_params;
tBLE_BD_ADDR *p_target;
@@ -703,7 +703,7 @@
tBTA_DM_API_SET_ENCRYPTION set_encryption;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_ADD_BLEKEY add_ble_key;
tBTA_DM_API_ADD_BLE_DEVICE add_ble_device;
tBTA_DM_API_PASSKEY_REPLY ble_passkey_reply;
@@ -717,7 +717,7 @@
tBTA_DM_API_LOCAL_PRIVACY ble_local_privacy;
tBTA_DM_API_BLE_ADV_PARAMS ble_set_adv_params;
tBTA_DM_API_SET_ADV_CONFIG ble_set_adv_data;
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
tBTA_DM_API_SCAN_FILTER_PARAM_SETUP ble_scan_filt_param_setup;
tBTA_DM_API_CFG_FILTER_COND ble_cfg_filter_cond;
tBTA_DM_API_ENABLE_SCAN_FILTER ble_enable_scan_filt;
@@ -749,7 +749,7 @@
#define BTA_DM_NOT_CONNECTED 0
#define BTA_DM_CONNECTED 1
#define BTA_DM_UNPAIRING 2
-typedef UINT8 tBTA_DM_CONN_STATE;
+typedef uint8_t tBTA_DM_CONN_STATE;
#define BTA_DM_DI_NONE 0x00 /* nothing special */
@@ -758,21 +758,21 @@
#define BTA_DM_DI_SET_SNIFF 0x01 /* set this bit if call BTM_SetPowerMode(sniff) */
#define BTA_DM_DI_INT_SNIFF 0x02 /* set this bit if call BTM_SetPowerMode(sniff) & enter sniff mode */
#define BTA_DM_DI_ACP_SNIFF 0x04 /* set this bit if peer init sniff */
-typedef UINT8 tBTA_DM_DEV_INFO;
+typedef uint8_t tBTA_DM_DEV_INFO;
/* set power mode request type */
#define BTA_DM_PM_RESTART 1
#define BTA_DM_PM_NEW_REQ 2
#define BTA_DM_PM_EXECUTE 3
-typedef UINT8 tBTA_DM_PM_REQ;
+typedef uint8_t tBTA_DM_PM_REQ;
typedef struct
{
BD_ADDR peer_bdaddr;
- UINT16 link_policy;
+ uint16_t link_policy;
tBTA_DM_CONN_STATE conn_state;
tBTA_PREF_ROLES pref_role;
- BOOLEAN in_use;
+ bool in_use;
tBTA_DM_DEV_INFO info;
tBTA_DM_ENCRYPT_CBACK *p_encrypt_cback;
#if (BTM_SSR_INCLUDED == TRUE)
@@ -780,9 +780,9 @@
#endif
tBTA_DM_PM_ACTION pm_mode_attempted;
tBTA_DM_PM_ACTION pm_mode_failed;
- BOOLEAN remove_dev_pending;
-#if BLE_INCLUDED == TRUE
- UINT16 conn_handle;
+ bool remove_dev_pending;
+#if (BLE_INCLUDED == TRUE)
+ uint16_t conn_handle;
tBT_TRANSPORT transport;
#endif
} tBTA_DM_PEER_DEVICE;
@@ -794,9 +794,9 @@
typedef struct
{
tBTA_DM_PEER_DEVICE peer_device[BTA_DM_NUM_PEER_DEVICE];
- UINT8 count;
-#if BLE_INCLUDED == TRUE
- UINT8 le_count;
+ uint8_t count;
+#if (BLE_INCLUDED == TRUE)
+ uint8_t le_count;
#endif
} tBTA_DM_ACTIVE_LINK;
@@ -805,9 +805,9 @@
{
BD_ADDR peer_bdaddr;
tBTA_SYS_ID id;
- UINT8 app_id;
+ uint8_t app_id;
tBTA_SYS_CONN_STATUS state;
- BOOLEAN new_request;
+ bool new_request;
} tBTA_DM_SRVCS;
@@ -818,7 +818,7 @@
typedef struct
{
- UINT8 count;
+ uint8_t count;
tBTA_DM_SRVCS conn_srvc[BTA_DM_NUM_CONN_SRVS];
} tBTA_DM_CONNECTED_SRVCS;
@@ -835,12 +835,12 @@
*/
alarm_t * timer[BTA_DM_PM_MODE_TIMER_MAX];
- UINT8 srvc_id[BTA_DM_PM_MODE_TIMER_MAX];
- UINT8 pm_action[BTA_DM_PM_MODE_TIMER_MAX];
- UINT8 active; /* number of active timer */
+ uint8_t srvc_id[BTA_DM_PM_MODE_TIMER_MAX];
+ uint8_t pm_action[BTA_DM_PM_MODE_TIMER_MAX];
+ uint8_t active; /* number of active timer */
BD_ADDR peer_bdaddr;
- BOOLEAN in_use;
+ bool in_use;
} tBTA_PM_TIMER;
extern tBTA_DM_CONNECTED_SRVCS bta_dm_conn_srvcs;
@@ -850,10 +850,10 @@
/* DM control block */
typedef struct
{
- BOOLEAN is_bta_dm_active;
+ bool is_bta_dm_active;
tBTA_DM_ACTIVE_LINK device_list;
tBTA_DM_SEC_CBACK *p_sec_cback;
-#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE)
tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback;
tBTA_DM_BLE_PF_CFG_CBACK *p_scan_filt_cfg_cback;
tBTA_DM_BLE_PF_STATUS_CBACK *p_scan_filt_status_cback;
@@ -861,35 +861,35 @@
tBTA_BLE_MULTI_ADV_CBACK *p_multi_adv_cback;
tBTA_BLE_ENERGY_INFO_CBACK *p_energy_info_cback;
#endif
- UINT16 state;
- BOOLEAN disabling;
+ uint16_t state;
+ bool disabling;
alarm_t *disable_timer;
- UINT32 wbt_sdp_handle; /* WIDCOMM Extensions SDP record handle */
- UINT8 wbt_scn; /* WIDCOMM Extensions SCN */
- UINT8 num_master_only;
- UINT8 pm_id;
+ uint32_t wbt_sdp_handle; /* WIDCOMM Extensions SDP record handle */
+ uint8_t wbt_scn; /* WIDCOMM Extensions SCN */
+ uint8_t num_master_only;
+ uint8_t pm_id;
tBTA_PM_TIMER pm_timer[BTA_DM_NUM_PM_TIMER];
- UINT32 role_policy_mask; /* the bits set indicates the modules that wants to remove role switch from the default link policy */
- UINT16 cur_policy; /* current default link policy */
- UINT16 rs_event; /* the event waiting for role switch */
- UINT8 cur_av_count; /* current AV connecions */
- BOOLEAN disable_pair_mode; /* disable pair mode or not */
- BOOLEAN conn_paired_only; /* allow connectable to paired device only or not */
+ uint32_t role_policy_mask; /* the bits set indicates the modules that wants to remove role switch from the default link policy */
+ uint16_t cur_policy; /* current default link policy */
+ uint16_t rs_event; /* the event waiting for role switch */
+ uint8_t cur_av_count; /* current AV connecions */
+ bool disable_pair_mode; /* disable pair mode or not */
+ bool conn_paired_only; /* allow connectable to paired device only or not */
tBTA_DM_API_SEARCH search_msg;
- UINT16 page_scan_interval;
- UINT16 page_scan_window;
- UINT16 inquiry_scan_interval;
- UINT16 inquiry_scan_window;
+ uint16_t page_scan_interval;
+ uint16_t page_scan_window;
+ uint16_t inquiry_scan_interval;
+ uint16_t inquiry_scan_window;
/* Storage for pin code request parameters */
BD_ADDR pin_bd_addr;
DEV_CLASS pin_dev_class;
tBTA_DM_SEC_EVT pin_evt;
- UINT32 num_val; /* the numeric value for comparison. If just_works, do not show this number to UI */
- BOOLEAN just_works; /* TRUE, if "Just Works" association model */
-#if ( BTA_EIR_CANNED_UUID_LIST != TRUE )
+ uint32_t num_val; /* the numeric value for comparison. If just_works, do not show this number to UI */
+ bool just_works; /* true, if "Just Works" association model */
+#if (BTA_EIR_CANNED_UUID_LIST != TRUE)
/* store UUID list for EIR */
- UINT32 eir_uuid[BTM_EIR_SERVICE_ARRAY_SIZE];
+ uint32_t eir_uuid[BTM_EIR_SERVICE_ARRAY_SIZE];
#if (BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0)
tBT_UUID custom_uuid[BTA_EIR_SERVER_NUM_CUSTOM_UUID];
#endif
@@ -912,32 +912,32 @@
tBTA_SERVICE_MASK services_to_search;
tBTA_SERVICE_MASK services_found;
tSDP_DISCOVERY_DB * p_sdp_db;
- UINT16 state;
+ uint16_t state;
BD_ADDR peer_bdaddr;
- BOOLEAN name_discover_done;
+ bool name_discover_done;
BD_NAME peer_name;
alarm_t * search_timer;
- UINT8 service_index;
+ uint8_t service_index;
tBTA_DM_MSG * p_search_queue; /* search or discover commands during search cancel stored here */
- BOOLEAN wait_disc;
- BOOLEAN sdp_results;
+ bool wait_disc;
+ bool sdp_results;
tSDP_UUID uuid;
- UINT8 peer_scn;
- BOOLEAN sdp_search;
- BOOLEAN cancel_pending; /* inquiry cancel is pending */
+ uint8_t peer_scn;
+ bool sdp_search;
+ bool cancel_pending; /* inquiry cancel is pending */
tBTA_TRANSPORT transport;
-#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE)
tBTA_DM_SEARCH_CBACK * p_scan_cback;
-#if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
+#if (BTA_GATT_INCLUDED == TRUE)
tBTA_GATTC_IF client_if;
- UINT8 num_uuid;
+ uint8_t num_uuid;
tBT_UUID *p_srvc_uuid;
- UINT8 uuid_to_search;
- BOOLEAN gatt_disc_active;
- UINT16 conn_id;
- UINT8 * p_ble_rawdata;
- UINT32 ble_raw_size;
- UINT32 ble_raw_used;
+ uint8_t uuid_to_search;
+ bool gatt_disc_active;
+ uint16_t conn_id;
+ uint8_t * p_ble_rawdata;
+ uint32_t ble_raw_size;
+ uint32_t ble_raw_used;
alarm_t * gatt_close_timer; /* GATT channel close delay timer */
BD_ADDR pending_close_bda; /* pending GATT channel remote device address */
#endif
@@ -950,8 +950,8 @@
typedef struct
{
tSDP_DISCOVERY_DB * p_di_db; /* pointer to the DI discovery database */
- UINT8 di_num; /* total local DI record number */
- UINT32 di_handle[BTA_DI_NUM_MAX]; /* local DI record handle, the first one is primary record */
+ uint8_t di_num; /* total local DI record number */
+ uint32_t di_handle[BTA_DI_NUM_MAX]; /* local DI record handle, the first one is primary record */
}tBTA_DM_DI_CB;
/* DM search state */
@@ -970,21 +970,21 @@
typedef struct
{
DEV_CLASS dev_class; /* local device class */
- UINT16 policy_settings; /* link policy setting hold, sniff, park, MS switch */
- UINT16 page_timeout; /* timeout for page in slots */
- UINT16 link_timeout; /* link supervision timeout in slots */
- BOOLEAN avoid_scatter; /* TRUE to avoid scatternet when av is streaming (be the master) */
+ uint16_t policy_settings; /* link policy setting hold, sniff, park, MS switch */
+ uint16_t page_timeout; /* timeout for page in slots */
+ uint16_t link_timeout; /* link supervision timeout in slots */
+ bool avoid_scatter; /* true to avoid scatternet when av is streaming (be the master) */
} tBTA_DM_CFG;
-extern const UINT32 bta_service_id_to_btm_srv_id_lkup_tbl[];
+extern const uint32_t bta_service_id_to_btm_srv_id_lkup_tbl[];
typedef struct
{
- UINT8 id;
- UINT8 app_id;
- UINT8 cfg;
+ uint8_t id;
+ uint8_t app_id;
+ uint8_t cfg;
} tBTA_DM_RM ;
@@ -994,9 +994,9 @@
typedef struct
{
- UINT8 id;
- UINT8 app_id;
- UINT8 spec_idx; /* index of spec table to use */
+ uint8_t id;
+ uint8_t app_id;
+ uint8_t spec_idx; /* index of spec table to use */
} tBTA_DM_PM_CFG;
@@ -1005,16 +1005,16 @@
{
tBTA_DM_PM_ACTION power_mode;
- UINT16 timeout;
+ uint16_t timeout;
} tBTA_DM_PM_ACTN;
typedef struct
{
- UINT8 allow_mask; /* mask of sniff/hold/park modes to allow */
+ uint8_t allow_mask; /* mask of sniff/hold/park modes to allow */
#if (BTM_SSR_INCLUDED == TRUE)
- UINT8 ssr; /* set SSR on conn open/unpark */
+ uint8_t ssr; /* set SSR on conn open/unpark */
#endif
tBTA_DM_PM_ACTN actn_tbl [BTA_DM_PM_NUM_EVTS][2];
@@ -1022,19 +1022,19 @@
typedef struct
{
- UINT16 max_lat;
- UINT16 min_rmt_to;
- UINT16 min_loc_to;
+ uint16_t max_lat;
+ uint16_t min_rmt_to;
+ uint16_t min_loc_to;
} tBTA_DM_SSR_SPEC;
typedef struct
{
- UINT16 manufacturer;
- UINT16 lmp_sub_version;
- UINT8 lmp_version;
+ uint16_t manufacturer;
+ uint16_t lmp_sub_version;
+ uint8_t lmp_version;
}tBTA_DM_LMP_VER_INFO;
-extern const UINT16 bta_service_id_to_uuid_lkup_tbl [];
+extern const uint16_t bta_service_id_to_uuid_lkup_tbl [];
extern tBTA_DM_PM_CFG *p_bta_dm_pm_cfg;
extern tBTA_DM_PM_SPEC *p_bta_dm_pm_spec;
@@ -1048,7 +1048,7 @@
extern tBTA_DM_EIR_CONF *p_bta_dm_eir_cfg;
/* DM control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_DM_CB bta_dm_cb;
#else
extern tBTA_DM_CB *bta_dm_cb_ptr;
@@ -1056,7 +1056,7 @@
#endif
/* DM search control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_DM_SEARCH_CB bta_dm_search_cb;
#else
extern tBTA_DM_SEARCH_CB *bta_dm_search_cb_ptr;
@@ -1064,16 +1064,16 @@
#endif
/* DI control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_DM_DI_CB bta_dm_di_cb;
#else
extern tBTA_DM_DI_CB *bta_dm_di_cb_ptr;
#define bta_dm_di_cb (*bta_dm_di_cb_ptr)
#endif
-extern BOOLEAN bta_dm_sm_execute(BT_HDR *p_msg);
+extern bool bta_dm_sm_execute(BT_HDR *p_msg);
extern void bta_dm_sm_disable( void );
-extern BOOLEAN bta_dm_search_sm_execute(BT_HDR *p_msg);
+extern bool bta_dm_search_sm_execute(BT_HDR *p_msg);
extern void bta_dm_search_sm_disable( void );
@@ -1098,7 +1098,7 @@
extern void bta_dm_pm_timer(tBTA_DM_MSG *p_data);
extern void bta_dm_add_ampkey (tBTA_DM_MSG *p_data);
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
extern void bta_dm_add_blekey (tBTA_DM_MSG *p_data);
extern void bta_dm_add_ble_device (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_passkey_reply (tBTA_DM_MSG *p_data);
@@ -1118,7 +1118,7 @@
extern void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data);
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
extern void bta_dm_cfg_filter_cond (tBTA_DM_MSG *p_data);
extern void bta_dm_scan_filter_param_setup (tBTA_DM_MSG *p_data);
extern void bta_dm_enable_scan_filter(tBTA_DM_MSG *p_data);
@@ -1145,7 +1145,7 @@
extern void bta_dm_init_pm(void);
extern void bta_dm_disable_pm(void);
-extern UINT8 bta_dm_get_av_count(void);
+extern uint8_t bta_dm_get_av_count(void);
extern void bta_dm_search_start (tBTA_DM_MSG *p_data);
extern void bta_dm_search_cancel (tBTA_DM_MSG *p_data);
extern void bta_dm_discover (tBTA_DM_MSG *p_data);
@@ -1169,7 +1169,7 @@
extern "C" void bta_dm_pm_active(BD_ADDR peer_addr);
-void bta_dm_eir_update_uuid(UINT16 uuid16, BOOLEAN adding);
+void bta_dm_eir_update_uuid(uint16_t uuid16, bool adding);
extern void bta_dm_enable_test_mode(tBTA_DM_MSG *p_data);
extern void bta_dm_disable_test_mode(tBTA_DM_MSG *p_data);
diff --git a/bta/dm/bta_dm_main.cc b/bta/dm/bta_dm_main.cc
index e6d791a..50c622c 100644
--- a/bta/dm/bta_dm_main.cc
+++ b/bta/dm/bta_dm_main.cc
@@ -31,7 +31,7 @@
** Constants and types
*****************************************************************************/
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_DM_CB bta_dm_cb;
tBTA_DM_SEARCH_CB bta_dm_search_cb;
tBTA_DM_DI_CB bta_dm_di_cb;
@@ -76,7 +76,7 @@
bta_dm_ci_rmt_oob_act, /* 22 BTA_DM_CI_RMT_OOB_EVT */
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
bta_dm_add_blekey, /* BTA_DM_API_ADD_BLEKEY_EVT */
bta_dm_add_ble_device, /* BTA_DM_API_ADD_BLEDEVICE_EVT */
bta_dm_ble_passkey_reply, /* BTA_DM_API_BLE_PASSKEY_REPLY_EVT */
@@ -88,7 +88,7 @@
bta_dm_ble_set_scan_params, /* BTA_DM_API_BLE_SCAN_PARAM_EVT */
bta_dm_ble_observe,
bta_dm_ble_update_conn_params, /* BTA_DM_API_UPDATE_CONN_PARAM_EVT */
-#if BLE_PRIVACY_SPT == TRUE
+#if (BLE_PRIVACY_SPT == TRUE)
bta_dm_ble_config_local_privacy, /* BTA_DM_API_LOCAL_PRIVACY_EVT */
#endif
bta_dm_ble_set_adv_params, /* BTA_DM_API_BLE_ADV_PARAM_EVT */
@@ -96,7 +96,7 @@
bta_dm_ble_set_scan_rsp, /* BTA_DM_API_BLE_SET_SCAN_RSPT */
bta_dm_ble_broadcast, /* BTA_DM_API_BLE_BROADCAST_EVT */
bta_dm_ble_set_data_length, /* BTA_DM_API_SET_DATA_LENGTH_EVT */
-#if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
bta_dm_cfg_filter_cond, /* BTA_DM_API_CFG_FILTER_COND_EVT */
bta_dm_scan_filter_param_setup, /* BTA_DM_API_SCAN_FILTER_SETUP_EVT */
bta_dm_enable_scan_filter, /* BTA_DM_API_SCAN_FILTER_ENABLE_EVT */
@@ -144,7 +144,7 @@
BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, /* 15 bta_dm_search_cancel_transac_cmpl */
BTA_DM_DISC_RMT_NAME, /* 16 bta_dm_disc_rmt_name */
BTA_DM_API_DI_DISCOVER, /* 17 bta_dm_di_disc */
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
BTA_DM_CLOSE_GATT_CONN, /* 18 bta_dm_close_gatt_conn */
#endif
BTA_DM_SEARCH_NUM_ACTIONS /* 19 */
@@ -173,7 +173,7 @@
bta_dm_search_cancel_transac_cmpl, /* 15 BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL */
bta_dm_disc_rmt_name, /* 16 BTA_DM_DISC_RMT_NAME */
bta_dm_di_disc /* 17 BTA_DM_API_DI_DISCOVER */
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
,bta_dm_close_gatt_conn
#endif
};
@@ -187,7 +187,7 @@
/* state table for listen state */
-const UINT8 bta_dm_search_idle_st_table[][BTA_DM_SEARCH_NUM_COLS] =
+const uint8_t bta_dm_search_idle_st_table[][BTA_DM_SEARCH_NUM_COLS] =
{
/* Event Action 1 Action 2 Next State */
@@ -200,11 +200,11 @@
/* SEARCH_CMPL_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
/* DISCV_RES_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
/* API_DI_DISCOVER_EVT */ {BTA_DM_API_DI_DISCOVER, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/* DISC_CLOSE_TOUT_EVT */ ,{BTA_DM_CLOSE_GATT_CONN, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE}
#endif
};
-const UINT8 bta_dm_search_search_active_st_table[][BTA_DM_SEARCH_NUM_COLS] =
+const uint8_t bta_dm_search_search_active_st_table[][BTA_DM_SEARCH_NUM_COLS] =
{
/* Event Action 1 Action 2 Next State */
@@ -217,13 +217,13 @@
/* SEARCH_CMPL_EVT */ {BTA_DM_SEARCH_CMPL, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
/* DISCV_RES_EVT */ {BTA_DM_SEARCH_RESULT, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE},
/* API_DI_DISCOVER_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/* DISC_CLOSE_TOUT_EVT */ ,{BTA_DM_CLOSE_GATT_CONN, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE}
#endif
};
-const UINT8 bta_dm_search_search_cancelling_st_table[][BTA_DM_SEARCH_NUM_COLS] =
+const uint8_t bta_dm_search_search_cancelling_st_table[][BTA_DM_SEARCH_NUM_COLS] =
{
/* Event Action 1 Action 2 Next State */
@@ -236,13 +236,13 @@
/* SEARCH_CMPL_EVT */ {BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, BTA_DM_SEARCH_CANCEL_CMPL, BTA_DM_SEARCH_IDLE},
/* DISCV_RES_EVT */ {BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, BTA_DM_SEARCH_CANCEL_CMPL, BTA_DM_SEARCH_IDLE},
/* API_DI_DISCOVER_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_CANCELLING}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/* DISC_CLOSE_TOUT_EVT */ ,{BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_CANCELLING}
#endif
};
-const UINT8 bta_dm_search_disc_active_st_table[][BTA_DM_SEARCH_NUM_COLS] =
+const uint8_t bta_dm_search_disc_active_st_table[][BTA_DM_SEARCH_NUM_COLS] =
{
/* Event Action 1 Action 2 Next State */
@@ -256,12 +256,12 @@
/* DISCV_RES_EVT */ {BTA_DM_DISC_RESULT, BTA_DM_SEARCH_IGNORE, BTA_DM_DISCOVER_ACTIVE},
/* API_DI_DISCOVER_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_DISCOVER_ACTIVE}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/* DISC_CLOSE_TOUT_EVT */ ,{BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_DISCOVER_ACTIVE}
#endif
};
-typedef const UINT8 (*tBTA_DM_ST_TBL)[BTA_DM_SEARCH_NUM_COLS];
+typedef const uint8_t (*tBTA_DM_ST_TBL)[BTA_DM_SEARCH_NUM_COLS];
/* state table */
const tBTA_DM_ST_TBL bta_dm_search_st_tbl[] = {
@@ -298,9 +298,9 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_dm_sm_execute(BT_HDR *p_msg)
+bool bta_dm_sm_execute(BT_HDR *p_msg)
{
- UINT16 event = p_msg->event & 0x00ff;
+ uint16_t event = p_msg->event & 0x00ff;
APPL_TRACE_EVENT("bta_dm_sm_execute event:0x%x", event);
@@ -310,7 +310,7 @@
(*bta_dm_action[event])( (tBTA_DM_MSG*) p_msg);
}
- return TRUE;
+ return true;
}
/*******************************************************************************
@@ -340,10 +340,10 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_dm_search_sm_execute(BT_HDR *p_msg)
+bool bta_dm_search_sm_execute(BT_HDR *p_msg)
{
tBTA_DM_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
int i;
APPL_TRACE_EVENT("bta_dm_search_sm_execute state:%d, event:0x%x",
@@ -367,6 +367,6 @@
break;
}
}
- return TRUE;
+ return true;
}
diff --git a/bta/dm/bta_dm_pm.cc b/bta/dm/bta_dm_pm.cc
index dbc56ed..7d55fa1 100644
--- a/bta/dm/bta_dm_pm.cc
+++ b/bta/dm/bta_dm_pm.cc
@@ -35,22 +35,22 @@
extern fixed_queue_t *btu_bta_alarm_queue;
-static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
+static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
static void bta_dm_pm_set_mode(BD_ADDR peer_addr, tBTA_DM_PM_ACTION pm_mode,
tBTA_DM_PM_REQ pm_req);
static void bta_dm_pm_timer_cback(void *data);
-static void bta_dm_pm_btm_cback(BD_ADDR bd_addr, tBTM_PM_STATUS status, UINT16 value, UINT8 hci_status);
-static BOOLEAN bta_dm_pm_park(BD_ADDR peer_addr);
-static BOOLEAN bta_dm_pm_sniff(tBTA_DM_PEER_DEVICE *p_peer_dev, UINT8 index);
-static BOOLEAN bta_dm_pm_is_sco_active ();
+static void bta_dm_pm_btm_cback(BD_ADDR bd_addr, tBTM_PM_STATUS status, uint16_t value, uint8_t hci_status);
+static bool bta_dm_pm_park(BD_ADDR peer_addr);
+static bool bta_dm_pm_sniff(tBTA_DM_PEER_DEVICE *p_peer_dev, uint8_t index);
+static bool bta_dm_pm_is_sco_active ();
static int bta_dm_get_sco_index();
-static void bta_dm_pm_hid_check(BOOLEAN bScoActive);
-static void bta_dm_pm_set_sniff_policy(tBTA_DM_PEER_DEVICE *p_dev, BOOLEAN bDisable);
+static void bta_dm_pm_hid_check(bool bScoActive);
+static void bta_dm_pm_set_sniff_policy(tBTA_DM_PEER_DEVICE *p_dev, bool bDisable);
static void bta_dm_pm_stop_timer_by_index(tBTA_PM_TIMER *p_timer,
- UINT8 timer_idx);
+ uint8_t timer_idx);
#if (BTM_SSR_INCLUDED == TRUE)
-#if (defined BTA_HH_INCLUDED && BTA_HH_INCLUDED == TRUE)
+#if (BTA_HH_INCLUDED == TRUE)
#include "../hh/bta_hh_int.h"
/* BTA_DM_PM_SSR1 will be dedicated for HH SSR setting entry, no other profile can use it */
#define BTA_DM_PM_SSR_HH BTA_DM_PM_SSR1
@@ -134,9 +134,9 @@
** Returns number of av connections
**
*******************************************************************************/
-UINT8 bta_dm_get_av_count(void)
+uint8_t bta_dm_get_av_count(void)
{
- UINT8 count = 0;
+ uint8_t count = 0;
for (int i = 0; i < bta_dm_conn_srvcs.count; i++)
{
if (bta_dm_conn_srvcs.conn_srvc[i].id == BTA_ID_AV)
@@ -192,7 +192,7 @@
** Returns index of the power mode delay timer
**
*******************************************************************************/
-static UINT8 bta_pm_action_to_timer_idx(UINT8 pm_action)
+static uint8_t bta_pm_action_to_timer_idx(uint8_t pm_action)
{
if (pm_action == BTA_DM_PM_SUSPEND)
return BTA_DM_PM_SUSPEND_TIMER_IDX;
@@ -215,9 +215,9 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_pm_stop_timer_by_mode(BD_ADDR peer_addr, UINT8 power_mode)
+static void bta_dm_pm_stop_timer_by_mode(BD_ADDR peer_addr, uint8_t power_mode)
{
- const UINT8 timer_idx = bta_pm_action_to_timer_idx(power_mode);
+ const uint8_t timer_idx = bta_pm_action_to_timer_idx(power_mode);
if (timer_idx == BTA_DM_PM_MODE_TIMER_MAX)
return;
@@ -251,7 +251,7 @@
** Returns index of the power mode delay timer
**
*******************************************************************************/
-static void bta_dm_pm_stop_timer_by_srvc_id(BD_ADDR peer_addr, UINT8 srvc_id)
+static void bta_dm_pm_stop_timer_by_srvc_id(BD_ADDR peer_addr, uint8_t srvc_id)
{
for (int i = 0; i < BTA_DM_NUM_PM_TIMER; i++)
{
@@ -280,11 +280,11 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_pm_start_timer(tBTA_PM_TIMER *p_timer, UINT8 timer_idx,
- period_ms_t timeout_ms, UINT8 srvc_id,
- UINT8 pm_action)
+static void bta_dm_pm_start_timer(tBTA_PM_TIMER *p_timer, uint8_t timer_idx,
+ period_ms_t timeout_ms, uint8_t srvc_id,
+ uint8_t pm_action)
{
- p_timer->in_use = TRUE;
+ p_timer->in_use = true;
if (p_timer->srvc_id[timer_idx] == BTA_ID_MAX)
p_timer->active++;
@@ -310,7 +310,7 @@
**
*******************************************************************************/
static void bta_dm_pm_stop_timer_by_index(tBTA_PM_TIMER *p_timer,
- UINT8 timer_idx)
+ uint8_t timer_idx)
{
if ((p_timer == NULL) || (timer_idx >= BTA_DM_PM_MODE_TIMER_MAX))
return;
@@ -326,7 +326,7 @@
p_timer->active--;
if (p_timer->active == 0)
- p_timer->in_use = FALSE;
+ p_timer->in_use = false;
}
/*******************************************************************************
@@ -339,11 +339,11 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+static void bta_dm_pm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
- UINT8 i,j;
- UINT8 *p = NULL;
+ uint8_t i,j;
+ uint8_t *p = NULL;
tBTA_DM_PEER_DEVICE *p_dev;
tBTA_DM_PM_REQ pm_req = BTA_DM_PM_NEW_REQ;
@@ -396,7 +396,7 @@
&& (bta_dm_conn_srvcs.conn_srvc[j].app_id == app_id )
&& !bdcmp(bta_dm_conn_srvcs.conn_srvc[j].peer_bdaddr, peer_addr))
{
- bta_dm_conn_srvcs.conn_srvc[j].new_request = TRUE;
+ bta_dm_conn_srvcs.conn_srvc[j].new_request = true;
break;
}
@@ -435,7 +435,7 @@
/* fill in a new cb */
bta_dm_conn_srvcs.conn_srvc[j].id = id;
bta_dm_conn_srvcs.conn_srvc[j].app_id = app_id;
- bta_dm_conn_srvcs.conn_srvc[j].new_request = TRUE;
+ bta_dm_conn_srvcs.conn_srvc[j].new_request = true;
bdcpy(bta_dm_conn_srvcs.conn_srvc[j].peer_bdaddr, peer_addr);
APPL_TRACE_WARNING("new conn_srvc id:%d, app_id:%d", id, app_id);
@@ -465,7 +465,7 @@
#if (BTM_SSR_INCLUDED == TRUE)
if(p_bta_dm_ssr_spec[index].max_lat
-#if (defined BTA_HH_INCLUDED && BTA_HH_INCLUDED == TRUE)
+#if (BTA_HH_INCLUDED == TRUE)
|| index == BTA_DM_PM_SSR_HH
#endif
)
@@ -503,9 +503,9 @@
( ((status == BTA_SYS_SCO_OPEN) || (status == BTA_SYS_SCO_CLOSE)) ||
((status == BTA_SYS_CONN_OPEN) && (id == BTA_ID_HH) && bta_dm_pm_is_sco_active()) ) )
{
- BOOLEAN bScoActive;
+ bool bScoActive;
if (status == BTA_SYS_CONN_OPEN)
- bScoActive = TRUE;
+ bScoActive = true;
else
bScoActive = (status == BTA_SYS_SCO_OPEN);
@@ -532,7 +532,7 @@
tBTA_DM_PM_ACTION pm_action = BTA_DM_PM_NO_ACTION;
period_ms_t timeout_ms = 0;
- UINT8 i,j;
+ uint8_t i,j;
tBTA_DM_PM_ACTION failed_pm = 0;
tBTA_DM_PEER_DEVICE *p_peer_device = NULL;
tBTA_DM_PM_ACTION allowed_modes = 0;
@@ -541,8 +541,8 @@
tBTA_DM_PM_SPEC *p_pm_spec;
tBTA_DM_PM_ACTN *p_act0, *p_act1;
tBTA_DM_SRVCS *p_srvcs = NULL;
- BOOLEAN timer_started = FALSE;
- UINT8 timer_idx, available_timer = BTA_DM_PM_MODE_TIMER_MAX;
+ bool timer_started = false;
+ uint8_t timer_idx, available_timer = BTA_DM_PM_MODE_TIMER_MAX;
period_ms_t remaining_ms = 0;
if(!bta_dm_cb.device_list.count)
@@ -593,7 +593,7 @@
if (pm_req != BTA_DM_PM_NEW_REQ || p_srvcs->new_request)
{
- p_srvcs->new_request = FALSE;
+ p_srvcs->new_request = false;
timeout_ms = p_act0->timeout;
}
}
@@ -655,7 +655,7 @@
timer_idx, timeout_ms,
p_srvcs->id, pm_action);
}
- timer_started = TRUE;
+ timer_started = true;
}
break;
}
@@ -678,7 +678,7 @@
bta_dm_pm_start_timer(&bta_dm_cb.pm_timer[available_timer],
timer_idx, timeout_ms,
p_srvcs->id, pm_action);
- timer_started = TRUE;
+ timer_started = true;
}
}
/* no more timers */
@@ -707,7 +707,7 @@
if (p_peer_device->link_policy & HCI_ENABLE_SNIFF_MODE)
{
p_peer_device->pm_mode_attempted = BTA_DM_PM_SNIFF;
- bta_dm_pm_sniff(p_peer_device, (UINT8)(pm_action & 0x0F) );
+ bta_dm_pm_sniff(p_peer_device, (uint8_t)(pm_action & 0x0F) );
}
else
{
@@ -726,10 +726,10 @@
** Description Switch to park mode.
**
**
-** Returns TRUE if park attempted, FALSE otherwise.
+** Returns true if park attempted, false otherwise.
**
*******************************************************************************/
-static BOOLEAN bta_dm_pm_park(BD_ADDR peer_addr)
+static bool bta_dm_pm_park(BD_ADDR peer_addr)
{
tBTM_PM_MODE mode = BTM_PM_STS_ACTIVE;
@@ -741,7 +741,7 @@
{
BTM_SetPowerMode (bta_dm_cb.pm_id, peer_addr, &p_bta_dm_pm_md[BTA_DM_PM_PARK_IDX]);
}
- return TRUE;
+ return true;
}
@@ -752,16 +752,16 @@
** Description Switch to sniff mode.
**
**
-** Returns TRUE if sniff attempted, FALSE otherwise.
+** Returns true if sniff attempted, false otherwise.
**
*******************************************************************************/
-static BOOLEAN bta_dm_pm_sniff(tBTA_DM_PEER_DEVICE *p_peer_dev, UINT8 index)
+static bool bta_dm_pm_sniff(tBTA_DM_PEER_DEVICE *p_peer_dev, uint8_t index)
{
tBTM_PM_MODE mode = BTM_PM_STS_ACTIVE;
tBTM_PM_PWR_MD pwr_md;
tBTM_STATUS status;
#if (BTM_SSR_INCLUDED == TRUE)
- UINT8 *p_rem_feat = NULL;
+ uint8_t *p_rem_feat = NULL;
#endif
BTM_ReadPowerMode(p_peer_dev->peer_bdaddr, &mode);
@@ -785,7 +785,7 @@
if ((mode == BTM_PM_MD_SNIFF) && (p_peer_dev->info & BTA_DM_DI_ACP_SNIFF))
{
APPL_TRACE_DEBUG("%s: already in remote initiate sniff", __func__);
- return TRUE;
+ return true;
}
#endif
/* if the current mode is not sniff, issue the sniff command.
@@ -812,7 +812,7 @@
p_peer_dev->info &= ~(BTA_DM_DI_INT_SNIFF|BTA_DM_DI_ACP_SNIFF|BTA_DM_DI_SET_SNIFF);
}
}
- return TRUE;
+ return true;
}
/*******************************************************************************
@@ -828,7 +828,7 @@
static void bta_dm_pm_ssr(BD_ADDR peer_addr)
{
tBTA_DM_SSR_SPEC *p_spec, *p_spec_cur;
- UINT8 i,j;
+ uint8_t i,j;
int ssr = BTA_DM_PM_SSR0;
/* go through the connected services */
@@ -854,7 +854,7 @@
p_spec_cur = &p_bta_dm_ssr_spec[p_bta_dm_pm_spec[p_bta_dm_pm_cfg[j].spec_idx].ssr];
p_spec = &p_bta_dm_ssr_spec[ssr];
-#if (defined BTA_HH_INCLUDED && BTA_HH_INCLUDED == TRUE)
+#if (BTA_HH_INCLUDED == TRUE)
/* HH has the per connection SSR preference, already read the SSR params from BTA HH */
if (p_bta_dm_pm_spec[p_bta_dm_pm_cfg[j].spec_idx].ssr == BTA_DM_PM_SSR_HH)
{
@@ -930,7 +930,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_dm_pm_btm_cback(BD_ADDR bd_addr, tBTM_PM_STATUS status, UINT16 value, UINT8 hci_status)
+static void bta_dm_pm_btm_cback(BD_ADDR bd_addr, tBTM_PM_STATUS status, uint16_t value, uint8_t hci_status)
{
tBTA_DM_PM_BTM_STATUS *p_buf =
(tBTA_DM_PM_BTM_STATUS *)osi_malloc(sizeof(tBTA_DM_PM_BTM_STATUS));
@@ -956,7 +956,7 @@
*******************************************************************************/
static void bta_dm_pm_timer_cback(void *data)
{
- UINT8 i, j;
+ uint8_t i, j;
alarm_t *alarm = (alarm_t *)data;
for (i=0; i<BTA_DM_NUM_PM_TIMER; i++)
@@ -975,7 +975,7 @@
}
}
if (bta_dm_cb.pm_timer[i].active == 0)
- bta_dm_cb.pm_timer[i].in_use = FALSE;
+ bta_dm_cb.pm_timer[i].in_use = false;
if (j < BTA_DM_PM_MODE_TIMER_MAX)
break;
}
@@ -1145,20 +1145,20 @@
**
** Description Loop through connected services for HFP+State=SCO
**
-** Returns BOOLEAN. TRUE if SCO active, else FALSE
+** Returns bool. true if SCO active, else false
**
*******************************************************************************/
-static BOOLEAN bta_dm_pm_is_sco_active ()
+static bool bta_dm_pm_is_sco_active ()
{
int j;
- BOOLEAN bScoActive = FALSE;
+ bool bScoActive = false;
for(j=0; j<bta_dm_conn_srvcs.count ; j++)
{
/* check if an entry already present */
if ( (bta_dm_conn_srvcs.conn_srvc[j].id == BTA_ID_AG ) && (bta_dm_conn_srvcs.conn_srvc[j].state == BTA_SYS_SCO_OPEN) )
{
- bScoActive = TRUE;
+ bScoActive = true;
break;
}
}
@@ -1200,7 +1200,7 @@
** Returns None
**
*******************************************************************************/
-static void bta_dm_pm_hid_check(BOOLEAN bScoActive)
+static void bta_dm_pm_hid_check(bool bScoActive)
{
int j;
@@ -1232,9 +1232,9 @@
** Returns None
**
*******************************************************************************/
-static void bta_dm_pm_set_sniff_policy(tBTA_DM_PEER_DEVICE *p_dev, BOOLEAN bDisable)
+static void bta_dm_pm_set_sniff_policy(tBTA_DM_PEER_DEVICE *p_dev, bool bDisable)
{
- UINT16 policy_setting;
+ uint16_t policy_setting;
if (!p_dev)
return;
@@ -1263,7 +1263,7 @@
}
-#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_dm_pm_obtain_controller_state
diff --git a/bta/dm/bta_dm_sco.cc b/bta/dm/bta_dm_sco.cc
index 109140a..99f1e5c 100644
--- a/bta/dm/bta_dm_sco.cc
+++ b/bta/dm/bta_dm_sco.cc
@@ -32,7 +32,7 @@
#if (BTM_SCO_HCI_INCLUDED == TRUE)
#ifndef BTA_DM_SCO_DEBUG
-#define BTA_DM_SCO_DEBUG FALSE
+#define BTA_DM_SCO_DEBUG false
#endif
/*****************************************************************************
** Constants
@@ -48,24 +48,24 @@
** Data types for PCM Resampling utility
*****************************************************************************/
-typedef INT32 (*PCONVERT_TO_BT_FILTERED) (UINT8 *pSrc, void *pDst, UINT32 dwSrcSamples,
- UINT32 dwSrcSps,INT32 *pLastCurPos, UINT8 *pOverlapArea);
-typedef INT32 (*PCONVERT_TO_BT_NOFILTER) (void *pSrc, void *pDst, UINT32 dwSrcSamples,
- UINT32 dwSrcSps);
+typedef int32_t (*PCONVERT_TO_BT_FILTERED) (uint8_t *pSrc, void *pDst, uint32_t dwSrcSamples,
+ uint32_t dwSrcSps,int32_t *pLastCurPos, uint8_t *pOverlapArea);
+typedef int32_t (*PCONVERT_TO_BT_NOFILTER) (void *pSrc, void *pDst, uint32_t dwSrcSamples,
+ uint32_t dwSrcSps);
typedef struct
{
- UINT8 overlap_area[BTA_DM_PCM_OVERLAP_SIZE * 4];
- UINT32 cur_pos; /* current position */
- UINT32 src_sps; /* samples per second (source audio data) */
+ uint8_t overlap_area[BTA_DM_PCM_OVERLAP_SIZE * 4];
+ uint32_t cur_pos; /* current position */
+ uint32_t src_sps; /* samples per second (source audio data) */
PCONVERT_TO_BT_FILTERED filter; /* the action function to do the
conversion 44100, 22050, 11025*/
PCONVERT_TO_BT_NOFILTER nofilter; /* the action function to do
the conversion 48000, 32000, 16000*/
- UINT32 bits; /* number of bits per pcm sample */
- UINT32 n_channels; /* number of channels (i.e. mono(1), stereo(2)...) */
- UINT32 sample_size;
- UINT32 can_be_filtered;
- UINT32 divisor;
+ uint32_t bits; /* number of bits per pcm sample */
+ uint32_t n_channels; /* number of channels (i.e. mono(1), stereo(2)...) */
+ uint32_t sample_size;
+ uint32_t can_be_filtered;
+ uint32_t divisor;
} tBTA_DM_PCM_RESAMPLE_CB;
tBTA_DM_PCM_RESAMPLE_CB bta_dm_pcm_cb;
@@ -85,7 +85,7 @@
//
#define CONVERT_44100_TO_BLUETOOTH(pStart, pEnd) \
{ \
- INT32 out1, out2, out3, out4, out5; \
+ int32_t out1, out2, out3, out4, out5; \
SRC_TYPE *pS = (SRC_TYPE *)pStart; \
SRC_TYPE *pSEnd = (SRC_TYPE *)pEnd; \
\
@@ -128,7 +128,7 @@
out5 = out1 + out2 - out3 - out4; \
\
CHECK_SATURATION16(out5); \
- *psBtOut++ = (INT16)out5; \
+ *psBtOut++ = (int16_t)out5; \
\
pS += SRC_CHANNELS; \
} \
@@ -139,7 +139,7 @@
//
#define CONVERT_22050_TO_BLUETOOTH(pStart, pEnd) \
{ \
- INT32 out1, out2, out3, out4, out5; \
+ int32_t out1, out2, out3, out4, out5; \
SRC_TYPE *pS = (SRC_TYPE *)pStart; \
SRC_TYPE *pSEnd = (SRC_TYPE *)pEnd; \
\
@@ -181,7 +181,7 @@
out5 = out1 - out2 + out3 - out4; \
\
CHECK_SATURATION16(out5); \
- *psBtOut++ = (INT16)out5; \
+ *psBtOut++ = (int16_t)out5; \
\
pS += SRC_CHANNELS; \
} \
@@ -192,7 +192,7 @@
//
#define CONVERT_11025_TO_BLUETOOTH(pStart, pEnd) \
{ \
- INT32 out1; \
+ int32_t out1; \
SRC_TYPE *pS = (SRC_TYPE *)pStart; \
SRC_TYPE *pSEnd = (SRC_TYPE *)pEnd; \
\
@@ -219,7 +219,7 @@
out1 = out1 / 30000; \
\
CHECK_SATURATION16(out1); \
- *psBtOut++ = (INT16)out1; \
+ *psBtOut++ = (int16_t)out1; \
\
pS += SRC_CHANNELS; \
} \
@@ -232,21 +232,21 @@
#undef SRC_SAMPLE
#undef SRC_TYPE
-#define SRC_TYPE UINT8
+#define SRC_TYPE uint8_t
#define SRC_CHANNELS 1
#define SRC_SAMPLE(x) ((pS[x] - 0x80) << 8)
/*****************************************************************************
** Local Function
*****************************************************************************/
-INT32 Convert_8M_ToBT_Filtered (UINT8 *pSrc, void *pDst, UINT32 dwSrcSamples,
- UINT32 dwSrcSps, INT32 *pLastCurPos, UINT8 *pOverlapArea)
+int32_t Convert_8M_ToBT_Filtered (uint8_t *pSrc, void *pDst, uint32_t dwSrcSamples,
+ uint32_t dwSrcSps, int32_t *pLastCurPos, uint8_t *pOverlapArea)
{
- INT32 CurrentPos = *pLastCurPos;
+ int32_t CurrentPos = *pLastCurPos;
SRC_TYPE *pIn, *pInEnd;
SRC_TYPE *pOv, *pOvEnd;
- INT16 *psBtOut = (INT16 *)pDst;
-#if BTA_DM_SCO_DEBUG
+ int16_t *psBtOut = (int16_t *)pDst;
+#if (BTA_DM_SCO_DEBUG == TRUE)
APPL_TRACE_DEBUG("Convert_8M_ToBT_Filtered, CurrentPos %d\n", CurrentPos);
#endif
memcpy (pOverlapArea + (BTA_DM_PCM_OVERLAP_SIZE * 2), pSrc, BTA_DM_PCM_OVERLAP_SIZE * 2);
@@ -279,15 +279,15 @@
*pLastCurPos = CurrentPos;
- return (psBtOut - (INT16 *)pDst);
+ return (psBtOut - (int16_t *)pDst);
}
-INT32 Convert_8M_ToBT_NoFilter (void *pSrc, void *pDst, UINT32 dwSrcSamples, UINT32 dwSrcSps)
+int32_t Convert_8M_ToBT_NoFilter (void *pSrc, void *pDst, uint32_t dwSrcSamples, uint32_t dwSrcSps)
{
- INT32 CurrentPos;
- UINT8 *pbSrc = (UINT8 *)pSrc;
- INT16 *psDst = (INT16 *)pDst;
- INT16 sWorker;
+ int32_t CurrentPos;
+ uint8_t *pbSrc = (uint8_t *)pSrc;
+ int16_t *psDst = (int16_t *)pDst;
+ int16_t sWorker;
// start at dwSpsSrc / 2, decrement by 8000
//
@@ -311,7 +311,7 @@
}
}
- return (psDst - (INT16 *)pDst);
+ return (psDst - (int16_t *)pDst);
}
@@ -321,17 +321,17 @@
#undef SRC_SAMPLE
#undef SRC_TYPE
-#define SRC_TYPE INT16
+#define SRC_TYPE int16_t
#define SRC_CHANNELS 1
#define SRC_SAMPLE(x) pS[x]
-INT32 Convert_16M_ToBT_Filtered (UINT8 *pSrc, void *pDst, UINT32 dwSrcSamples,
- UINT32 dwSrcSps, INT32 *pLastCurPos, UINT8 *pOverlapArea)
+int32_t Convert_16M_ToBT_Filtered (uint8_t *pSrc, void *pDst, uint32_t dwSrcSamples,
+ uint32_t dwSrcSps, int32_t *pLastCurPos, uint8_t *pOverlapArea)
{
- INT32 CurrentPos = *pLastCurPos;
+ int32_t CurrentPos = *pLastCurPos;
SRC_TYPE *pIn, *pInEnd;
SRC_TYPE *pOv, *pOvEnd;
- INT16 *psBtOut = (INT16 *)pDst;
+ int16_t *psBtOut = (int16_t *)pDst;
memcpy (pOverlapArea + (BTA_DM_PCM_OVERLAP_SIZE * 2), pSrc, BTA_DM_PCM_OVERLAP_SIZE * 2);
@@ -362,14 +362,14 @@
*pLastCurPos = CurrentPos;
- return (psBtOut - (INT16 *)pDst);
+ return (psBtOut - (int16_t *)pDst);
}
-INT32 Convert_16M_ToBT_NoFilter (void *pSrc, void *pDst, UINT32 dwSrcSamples, UINT32 dwSrcSps)
+int32_t Convert_16M_ToBT_NoFilter (void *pSrc, void *pDst, uint32_t dwSrcSamples, uint32_t dwSrcSps)
{
- INT32 CurrentPos;
- INT16 *psSrc = (INT16 *)pSrc;
- INT16 *psDst = (INT16 *)pDst;
+ int32_t CurrentPos;
+ int16_t *psSrc = (int16_t *)pSrc;
+ int16_t *psDst = (int16_t *)pDst;
// start at dwSpsSrc / 2, decrement by 8000
//
@@ -389,7 +389,7 @@
}
}
- return (psDst - (INT16 *)pDst);
+ return (psDst - (int16_t *)pDst);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -398,19 +398,19 @@
#undef SRC_SAMPLE
#undef SRC_TYPE
-#define SRC_TYPE UINT8
+#define SRC_TYPE uint8_t
#define SRC_CHANNELS 2
#define SRC_SAMPLE(x) ((((pS[x * 2] - 0x80) << 8) + ((pS[(x * 2) + 1] - 0x80) << 8)) >> 1)
-INT32 Convert_8S_ToBT_Filtered (UINT8 *pSrc, void *pDst, UINT32 dwSrcSamples,
- UINT32 dwSrcSps, INT32 *pLastCurPos, UINT8 *pOverlapArea)
+int32_t Convert_8S_ToBT_Filtered (uint8_t *pSrc, void *pDst, uint32_t dwSrcSamples,
+ uint32_t dwSrcSps, int32_t *pLastCurPos, uint8_t *pOverlapArea)
{
- INT32 CurrentPos = *pLastCurPos;
+ int32_t CurrentPos = *pLastCurPos;
SRC_TYPE *pIn, *pInEnd;
SRC_TYPE *pOv, *pOvEnd;
- INT16 *psBtOut = (INT16 *)pDst;
+ int16_t *psBtOut = (int16_t *)pDst;
-#if BTA_DM_SCO_DEBUG
+#if (BTA_DM_SCO_DEBUG == TRUE)
APPL_TRACE_DEBUG("Convert_8S_ToBT_Filtered CurrentPos %d, SRC_TYPE %d, SRC_CHANNELS %d, \
dwSrcSamples %d, dwSrcSps %d", CurrentPos, sizeof (SRC_TYPE), SRC_CHANNELS, \
dwSrcSamples, dwSrcSps);
@@ -444,15 +444,15 @@
*pLastCurPos = CurrentPos;
- return (psBtOut - (INT16 *)pDst);
+ return (psBtOut - (int16_t *)pDst);
}
-INT32 Convert_8S_ToBT_NoFilter (void *pSrc, void *pDst, UINT32 dwSrcSamples, UINT32 dwSrcSps)
+int32_t Convert_8S_ToBT_NoFilter (void *pSrc, void *pDst, uint32_t dwSrcSamples, uint32_t dwSrcSps)
{
- INT32 CurrentPos;
- UINT8 *pbSrc = (UINT8 *)pSrc;
- INT16 *psDst = (INT16 *)pDst;
- INT16 sWorker, sWorker2;
+ int32_t CurrentPos;
+ uint8_t *pbSrc = (uint8_t *)pSrc;
+ int16_t *psDst = (int16_t *)pDst;
+ int16_t sWorker, sWorker2;
// start at dwSpsSrc / 2, decrement by 8000
//
@@ -485,7 +485,7 @@
}
}
- return (psDst - (INT16 *)pDst);
+ return (psDst - (int16_t *)pDst);
}
@@ -495,17 +495,17 @@
#undef SRC_SAMPLE
#undef SRC_TYPE
-#define SRC_TYPE INT16
+#define SRC_TYPE int16_t
#define SRC_CHANNELS 2
#define SRC_SAMPLE(x) ((pS[x * 2] + pS[(x * 2) + 1]) >> 1)
-INT32 Convert_16S_ToBT_Filtered (UINT8 *pSrc, void *pDst, UINT32 dwSrcSamples,
- UINT32 dwSrcSps, INT32 *pLastCurPos, UINT8 *pOverlapArea)
+int32_t Convert_16S_ToBT_Filtered (uint8_t *pSrc, void *pDst, uint32_t dwSrcSamples,
+ uint32_t dwSrcSps, int32_t *pLastCurPos, uint8_t *pOverlapArea)
{
- INT32 CurrentPos = *pLastCurPos;
+ int32_t CurrentPos = *pLastCurPos;
SRC_TYPE *pIn, *pInEnd;
SRC_TYPE *pOv, *pOvEnd;
- INT16 *psBtOut = (INT16 *)pDst;
+ int16_t *psBtOut = (int16_t *)pDst;
memcpy (pOverlapArea + (BTA_DM_PCM_OVERLAP_SIZE * 2), pSrc, BTA_DM_PCM_OVERLAP_SIZE * 2);
@@ -536,15 +536,15 @@
*pLastCurPos = CurrentPos;
- return (psBtOut - (INT16 *)pDst);
+ return (psBtOut - (int16_t *)pDst);
}
-INT32 Convert_16S_ToBT_NoFilter (void *pSrc, void *pDst, UINT32 dwSrcSamples, UINT32 dwSrcSps)
+int32_t Convert_16S_ToBT_NoFilter (void *pSrc, void *pDst, uint32_t dwSrcSamples, uint32_t dwSrcSps)
{
- INT32 CurrentPos;
- INT16 *psSrc = (INT16 *)pSrc;
- INT16 *psDst = (INT16 *)pDst;
- INT16 sWorker;
+ int32_t CurrentPos;
+ int16_t *psSrc = (int16_t *)pSrc;
+ int16_t *psDst = (int16_t *)pDst;
+ int16_t sWorker;
// start at dwSpsSrc / 2, decrement by 8000
//
@@ -570,7 +570,7 @@
}
}
- return (psDst - (INT16 *)pDst);
+ return (psDst - (int16_t *)pDst);
}
/*******************************************************************************
@@ -587,7 +587,7 @@
** Returns none
**
*******************************************************************************/
-void BTA_DmPcmInitSamples (UINT32 src_sps, UINT32 bits, UINT32 n_channels)
+void BTA_DmPcmInitSamples (uint32_t src_sps, uint32_t bits, uint32_t n_channels)
{
tBTA_DM_PCM_RESAMPLE_CB *p_cb = &bta_dm_pcm_cb;
@@ -607,7 +607,7 @@
else
p_cb->can_be_filtered = 0;
-#if BTA_DM_SCO_DEBUG
+#if (BTA_DM_SCO_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_dm_pcm_init_samples: n_channels = %d bits = %d", n_channels, bits);
#endif
if(n_channels == 1)
@@ -641,7 +641,7 @@
}
}
-#if BTA_DM_SCO_DEBUG
+#if (BTA_DM_SCO_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_pcm_init_dwn_sample: cur_pos %d, src_sps %d", \
p_cb->cur_pos, p_cb->src_sps);
APPL_TRACE_DEBUG("bta_pcm_init_dwn_sample: bits %d, n_channels %d, sample_size %d, ", \
@@ -665,20 +665,20 @@
** the converted PCM samples.
**
**
-** Returns INT32: number of samples converted.
+** Returns int32_t: number of samples converted.
**
**************************************************************************************/
-INT32 BTA_DmPcmResample (void *p_src, UINT32 in_bytes, void *p_dst)
+int32_t BTA_DmPcmResample (void *p_src, uint32_t in_bytes, void *p_dst)
{
- UINT32 out_sample;
+ uint32_t out_sample;
-#if BTA_DM_SCO_DEBUG
+#if (BTA_DM_SCO_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_pcm_resample : insamples %d", (in_bytes / bta_dm_pcm_cb.divisor));
#endif
if(bta_dm_pcm_cb.can_be_filtered)
{
out_sample = (*bta_dm_pcm_cb.filter) (p_src, p_dst, (in_bytes / bta_dm_pcm_cb.divisor),
- bta_dm_pcm_cb.src_sps, (INT32 *) &bta_dm_pcm_cb.cur_pos, bta_dm_pcm_cb.overlap_area);
+ bta_dm_pcm_cb.src_sps, (int32_t *) &bta_dm_pcm_cb.cur_pos, bta_dm_pcm_cb.overlap_area);
}
else
{
@@ -686,7 +686,7 @@
(in_bytes / bta_dm_pcm_cb.divisor), bta_dm_pcm_cb.src_sps);
}
-#if BTA_DM_SCO_DEBUG
+#if (BTA_DM_SCO_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_pcm_resample : outsamples %d", out_sample);
#endif