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/ag/bta_ag_act.c b/bta/ag/bta_ag_act.c
index f53ff72..c0eaebb 100644
--- a/bta/ag/bta_ag_act.c
+++ b/bta/ag/bta_ag_act.c
@@ -44,13 +44,13 @@
/* maximum AT command length */
#define BTA_AG_CMD_MAX 512
-const UINT16 bta_ag_uuid[BTA_AG_NUM_IDX] =
+const uint16_t bta_ag_uuid[BTA_AG_NUM_IDX] =
{
UUID_SERVCLASS_HEADSET_AUDIO_GATEWAY,
UUID_SERVCLASS_AG_HANDSFREE
};
-const UINT8 bta_ag_sec_id[BTA_AG_NUM_IDX] =
+const uint8_t bta_ag_sec_id[BTA_AG_NUM_IDX] =
{
BTM_SEC_SERVICE_HEADSET_AG,
BTM_SEC_SERVICE_AG_HANDSFREE
@@ -68,8 +68,8 @@
BTA_HFP_SERVICE_MASK
};
-typedef void (*tBTA_AG_ATCMD_CBACK)(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
- char *p_arg, INT16 int_arg);
+typedef void (*tBTA_AG_ATCMD_CBACK)(tBTA_AG_SCB *p_scb, uint16_t cmd, uint8_t arg_type,
+ char *p_arg, int16_t int_arg);
const tBTA_AG_ATCMD_CBACK bta_ag_at_cback_tbl[BTA_AG_NUM_IDX] =
{
@@ -157,7 +157,7 @@
void bta_ag_deregister(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
/* set dealloc */
- p_scb->dealloc = TRUE;
+ p_scb->dealloc = true;
/* remove sdp records */
bta_ag_del_records(p_scb, p_data);
@@ -182,7 +182,7 @@
void bta_ag_start_dereg(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
/* set dealloc */
- p_scb->dealloc = TRUE;
+ p_scb->dealloc = true;
/* remove sdp records */
bta_ag_del_records(p_scb, p_data);
@@ -242,7 +242,7 @@
*******************************************************************************/
void bta_ag_disc_int_res(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
- UINT16 event = BTA_AG_DISC_FAIL_EVT;
+ uint16_t event = BTA_AG_DISC_FAIL_EVT;
APPL_TRACE_DEBUG ("bta_ag_disc_int_res: Status: %d", p_data->disc_result.status);
@@ -382,12 +382,12 @@
p_scb->conn_handle = 0;
p_scb->conn_service = 0;
p_scb->peer_features = 0;
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
p_scb->peer_codecs = BTA_AG_CODEC_CVSD;
p_scb->sco_codec = BTA_AG_CODEC_CVSD;
#endif
p_scb->role = 0;
- p_scb->svc_conn = FALSE;
+ p_scb->svc_conn = false;
p_scb->hsp_version = HSP_VERSION_1_2;
/*Clear the BD address*/
bdcpy(p_scb->peer_addr, bd_addr_null);
@@ -419,17 +419,17 @@
/* reinitialize stuff */
p_scb->conn_service = 0;
p_scb->peer_features = 0;
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
p_scb->peer_codecs = BTA_AG_CODEC_CVSD;
p_scb->sco_codec = BTA_AG_CODEC_CVSD;
/* Clear these flags upon SLC teardown */
- p_scb->codec_updated = FALSE;
- p_scb->codec_fallback = FALSE;
+ p_scb->codec_updated = false;
+ p_scb->codec_fallback = false;
p_scb->codec_msbc_settings = BTA_AG_SCO_MSBC_SETTINGS_T2;
#endif
p_scb->role = 0;
p_scb->post_sco = BTA_AG_POST_SCO_NONE;
- p_scb->svc_conn = FALSE;
+ p_scb->svc_conn = false;
p_scb->hsp_version = HSP_VERSION_1_2;
bta_ag_at_reinit(&p_scb->at_cb);
@@ -452,7 +452,7 @@
(*bta_ag_cb.p_cback)(BTA_AG_CLOSE_EVT, (tBTA_AG *) &close);
/* if not deregistering (deallocating) reopen registered servers */
- if (p_scb->dealloc == FALSE)
+ if (p_scb->dealloc == false)
{
/* Clear peer bd_addr so instance can be reused */
bdcpy(p_scb->peer_addr, bd_addr_null);
@@ -505,10 +505,10 @@
void bta_ag_rfc_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
/* initialize AT feature variables */
- p_scb->clip_enabled = FALSE;
- p_scb->ccwa_enabled = FALSE;
- p_scb->cmer_enabled = FALSE;
- p_scb->cmee_enabled = FALSE;
+ p_scb->clip_enabled = false;
+ p_scb->ccwa_enabled = false;
+ p_scb->cmer_enabled = false;
+ p_scb->cmee_enabled = false;
p_scb->inband_enabled = ((p_scb->features & BTA_AG_FEAT_INBAND) == BTA_AG_FEAT_INBAND);
/* set up AT command interpreter */
@@ -548,7 +548,7 @@
*******************************************************************************/
void bta_ag_rfc_acp_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
- UINT16 lcid;
+ uint16_t lcid;
int i;
tBTA_AG_SCB *ag_scb, *other_scb;
BD_ADDR dev_addr;
@@ -640,7 +640,7 @@
*******************************************************************************/
void bta_ag_rfc_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
- UINT16 len;
+ uint16_t len;
char buf[BTA_AG_RFC_READ_MAX];
UNUSED(p_data);
@@ -817,7 +817,7 @@
if (!p_scb->svc_conn)
{
/* set state variable */
- p_scb->svc_conn = TRUE;
+ p_scb->svc_conn = true;
/* Clear AT+BIA mask from previous SLC if any. */
p_scb->bia_masked_out = 0;
@@ -829,7 +829,7 @@
evt.hdr.app_id = p_scb->app_id;
evt.peer_feat = p_scb->peer_features;
bdcpy(evt.bd_addr, p_scb->peer_addr);
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
evt.peer_codec = p_scb->peer_codecs;
#endif
@@ -854,7 +854,7 @@
*******************************************************************************/
void bta_ag_ci_rx_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
- UINT16 len;
+ uint16_t len;
tBTA_AG_CI_RX_WRITE *p_rx_write_msg = (tBTA_AG_CI_RX_WRITE *)p_data;
char *p_data_area = (char *)(p_rx_write_msg+1); /* Point to data area after header */
@@ -907,7 +907,7 @@
*******************************************************************************/
void bta_ag_setcodec(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
tBTA_AG_PEER_CODEC codec_type = p_data->api_setcodec.codec;
tBTA_AG_VAL val;
@@ -927,7 +927,7 @@
(codec_type == BTA_AG_CODEC_CVSD))
{
p_scb->sco_codec = codec_type;
- p_scb->codec_updated = TRUE;
+ p_scb->codec_updated = true;
val.num = codec_type;
val.hdr.status = BTA_AG_SUCCESS;
APPL_TRACE_DEBUG("bta_ag_setcodec: Updated codec type %d", codec_type);
diff --git a/bta/ag/bta_ag_api.c b/bta/ag/bta_ag_api.c
index 117924c..83a92c3 100644
--- a/bta/ag/bta_ag_api.c
+++ b/bta/ag/bta_ag_api.c
@@ -108,7 +108,7 @@
**
*******************************************************************************/
void BTA_AgRegister(tBTA_SERVICE_MASK services, tBTA_SEC sec_mask,tBTA_AG_FEAT features,
- const char * p_service_names[], UINT8 app_id)
+ const char * p_service_names[], uint8_t app_id)
{
tBTA_AG_API_REGISTER *p_buf =
(tBTA_AG_API_REGISTER *)osi_malloc(sizeof(tBTA_AG_API_REGISTER));
@@ -138,7 +138,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgDeregister(UINT16 handle)
+void BTA_AgDeregister(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -161,7 +161,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgOpen(UINT16 handle, BD_ADDR bd_addr, tBTA_SEC sec_mask, tBTA_SERVICE_MASK services)
+void BTA_AgOpen(uint16_t handle, BD_ADDR bd_addr, tBTA_SEC sec_mask, tBTA_SERVICE_MASK services)
{
tBTA_AG_API_OPEN *p_buf =
(tBTA_AG_API_OPEN *)osi_malloc(sizeof(tBTA_AG_API_OPEN));
@@ -186,7 +186,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgClose(UINT16 handle)
+void BTA_AgClose(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -207,7 +207,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgAudioOpen(UINT16 handle)
+void BTA_AgAudioOpen(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -228,7 +228,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgAudioClose(UINT16 handle)
+void BTA_AgAudioClose(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -250,7 +250,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgResult(UINT16 handle, tBTA_AG_RES result, tBTA_AG_RES_DATA *p_data)
+void BTA_AgResult(uint16_t handle, tBTA_AG_RES result, tBTA_AG_RES_DATA *p_data)
{
tBTA_AG_API_RESULT *p_buf =
(tBTA_AG_API_RESULT *)osi_malloc(sizeof(tBTA_AG_API_RESULT));
@@ -276,7 +276,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgSetCodec(UINT16 handle, tBTA_AG_PEER_CODEC codec)
+void BTA_AgSetCodec(uint16_t handle, tBTA_AG_PEER_CODEC codec)
{
tBTA_AG_API_SETCODEC *p_buf =
(tBTA_AG_API_SETCODEC *)osi_malloc(sizeof(tBTA_AG_API_SETCODEC));
diff --git a/bta/ag/bta_ag_at.c b/bta/ag/bta_ag_at.c
index 8201e86..bcc0a58 100644
--- a/bta/ag/bta_ag_at.c
+++ b/bta/ag/bta_ag_at.c
@@ -79,10 +79,10 @@
******************************************************************************/
void bta_ag_process_at(tBTA_AG_AT_CB *p_cb)
{
- UINT16 idx;
- UINT8 arg_type;
+ uint16_t idx;
+ uint8_t arg_type;
char *p_arg;
- INT16 int_arg = 0;
+ int16_t int_arg = 0;
/* loop through at command table looking for match */
for (idx = 0; p_cb->p_at_tbl[idx].p_cmd[0] != 0; idx++)
{
@@ -140,11 +140,11 @@
p_cb->p_at_tbl[idx].fmt == BTA_AG_AT_INT)
{
int_arg = utl_str2int(p_arg);
- if (int_arg < (INT16) p_cb->p_at_tbl[idx].min ||
- int_arg > (INT16) p_cb->p_at_tbl[idx].max)
+ if (int_arg < (int16_t) p_cb->p_at_tbl[idx].min ||
+ int_arg > (int16_t) p_cb->p_at_tbl[idx].max)
{
/* arg out of range; error */
- (*p_cb->p_err_cback)(p_cb->p_user, FALSE, NULL);
+ (*p_cb->p_err_cback)(p_cb->p_user, false, NULL);
}
else
{
@@ -160,13 +160,13 @@
/* else error */
else
{
- (*p_cb->p_err_cback)(p_cb->p_user, FALSE, NULL);
+ (*p_cb->p_err_cback)(p_cb->p_user, false, NULL);
}
}
/* else no match call error callback */
else
{
- (*p_cb->p_err_cback)(p_cb->p_user, TRUE, p_cb->p_cmd_buf);
+ (*p_cb->p_err_cback)(p_cb->p_user, true, p_cb->p_cmd_buf);
}
}
@@ -182,7 +182,7 @@
** Returns void
**
******************************************************************************/
-void bta_ag_at_parse(tBTA_AG_AT_CB *p_cb, char *p_buf, UINT16 len)
+void bta_ag_at_parse(tBTA_AG_AT_CB *p_cb, char *p_buf, uint16_t len)
{
int i = 0;
char* p_save;
@@ -223,7 +223,7 @@
else if( p_cb->p_cmd_buf[p_cb->cmd_pos] == 0x1A || p_cb->p_cmd_buf[p_cb->cmd_pos] == 0x1B )
{
p_cb->p_cmd_buf[++p_cb->cmd_pos] = 0;
- (*p_cb->p_err_cback)(p_cb->p_user, TRUE, p_cb->p_cmd_buf);
+ (*p_cb->p_err_cback)(p_cb->p_user, true, p_cb->p_cmd_buf);
p_cb->cmd_pos = 0;
}
else
diff --git a/bta/ag/bta_ag_at.h b/bta/ag/bta_ag_at.h
index 90d7b0f..bc4043f 100644
--- a/bta/ag/bta_ag_at.h
+++ b/bta/ag/bta_ag_at.h
@@ -47,18 +47,18 @@
typedef struct
{
const char *p_cmd; /* AT command string */
- UINT8 arg_type; /* allowable argument type syntax */
- UINT8 fmt; /* whether arg is int or string */
- UINT8 min; /* minimum value for int arg */
- INT16 max; /* maximum value for int arg */
+ uint8_t arg_type; /* allowable argument type syntax */
+ uint8_t fmt; /* whether arg is int or string */
+ uint8_t min; /* minimum value for int arg */
+ int16_t max; /* maximum value for int arg */
} tBTA_AG_AT_CMD;
/* callback function executed when command is parsed */
-typedef void (tBTA_AG_AT_CMD_CBACK)(void *p_user, UINT16 cmd, UINT8 arg_type,
- char *p_arg, INT16 int_arg);
+typedef void (tBTA_AG_AT_CMD_CBACK)(void *p_user, uint16_t cmd, uint8_t arg_type,
+ char *p_arg, int16_t int_arg);
/* callback function executed to send "ERROR" result code */
-typedef void (tBTA_AG_AT_ERR_CBACK)(void *p_user, BOOLEAN unknown, char *p_arg);
+typedef void (tBTA_AG_AT_ERR_CBACK)(void *p_user, bool unknown, char *p_arg);
/* AT command parsing control block */
typedef struct
@@ -68,9 +68,9 @@
tBTA_AG_AT_ERR_CBACK *p_err_cback; /* error callback */
void *p_user; /* user-defined data */
char *p_cmd_buf; /* temp parsing buffer */
- UINT16 cmd_pos; /* position in temp buffer */
- UINT16 cmd_max_len; /* length of temp buffer to allocate */
- UINT8 state; /* parsing state */
+ uint16_t cmd_pos; /* position in temp buffer */
+ uint16_t cmd_max_len; /* length of temp buffer to allocate */
+ uint8_t state; /* parsing state */
} tBTA_AG_AT_CB;
/*****************************************************************************
@@ -115,7 +115,7 @@
** Returns void
**
*****************************************************************************/
-extern void bta_ag_at_parse(tBTA_AG_AT_CB *p_cb, char *p_buf, UINT16 len);
+extern void bta_ag_at_parse(tBTA_AG_AT_CB *p_cb, char *p_buf, uint16_t len);
#endif /* BTA_AG_AT_H */
diff --git a/bta/ag/bta_ag_ci.c b/bta/ag/bta_ag_ci.c
index 968cb1b..3798615 100644
--- a/bta/ag/bta_ag_ci.c
+++ b/bta/ag/bta_ag_ci.c
@@ -40,9 +40,9 @@
** Returns void
**
******************************************************************************/
-void bta_ag_ci_rx_write(UINT16 handle, char *p_data, UINT16 len)
+void bta_ag_ci_rx_write(uint16_t handle, char *p_data, uint16_t len)
{
- UINT16 len_remaining = len;
+ uint16_t len_remaining = len;
char *p_data_area;
if (len > (RFCOMM_DATA_BUF_SIZE - sizeof(tBTA_AG_CI_RX_WRITE) - 1))
@@ -79,7 +79,7 @@
** Returns void
**
******************************************************************************/
-void bta_ag_ci_slc_ready(UINT16 handle)
+void bta_ag_ci_slc_ready(uint16_t handle)
{
tBTA_AG_DATA *p_buf = (tBTA_AG_DATA *)osi_malloc(sizeof(tBTA_AG_DATA));
diff --git a/bta/ag/bta_ag_cmd.c b/bta/ag/bta_ag_cmd.c
index 2ab9f51..04d8a48 100644
--- a/bta/ag/bta_ag_cmd.c
+++ b/bta/ag/bta_ag_cmd.c
@@ -55,22 +55,22 @@
#define BTA_AG_CLIP_TYPE_DEFAULT 129
#define BTA_AG_CLIP_TYPE_VOIP 255
-#if defined(BTA_AG_MULTI_RESULT_INCLUDED) && (BTA_AG_MULTI_RESULT_INCLUDED == TRUE)
+#if (BTA_AG_MULTI_RESULT_INCLUDED == TRUE)
#define BTA_AG_AT_MULTI_LEN 2
#define AT_SET_RES_CB(res_cb, c, p, i) {res_cb.code = c; res_cb.p_arg = p; res_cb.int_arg = i;}
/* type for AT result code block */
typedef struct
{
- UINT8 code;
+ uint8_t code;
char *p_arg;
- INT16 int_arg;
+ int16_t int_arg;
} tBTA_AG_RESULT_CB;
/* type for multiple AT result codes block */
typedef struct
{
- UINT8 num_result;
+ uint8_t num_result;
tBTA_AG_RESULT_CB res_cb[BTA_AG_AT_MULTI_LEN];
} tBTA_AG_MULTI_RESULT_CB;
#endif
@@ -160,7 +160,7 @@
typedef struct
{
const char *p_res; /* AT result string */
- UINT8 fmt; /* whether argument is int or string */
+ uint8_t fmt; /* whether argument is int or string */
} tBTA_AG_RESULT;
/* AT result code argument types */
@@ -197,7 +197,7 @@
BTA_AG_RES_UNAT
};
-#if defined(BTA_HSP_RESULT_REPLACE_COLON) && (BTA_HSP_RESULT_REPLACE_COLON == TRUE)
+#if (BTA_HSP_RESULT_REPLACE_COLON == TRUE)
#define COLON_IDX_4_VGSVGM 4
#endif
/* AT result code constant table (Indexed by result code) */
@@ -272,7 +272,7 @@
};
/* translation of API result code values to internal values */
-const UINT8 bta_ag_trans_result[] =
+const uint8_t bta_ag_trans_result[] =
{
BTA_AG_RES_VGS, /* BTA_AG_SPK_RES */
BTA_AG_RES_VGM, /* BTA_AG_MIC_RES */
@@ -298,7 +298,7 @@
};
/* callsetup indicator value lookup table */
-const UINT8 bta_ag_callsetup_ind_tbl[] =
+const uint8_t bta_ag_callsetup_ind_tbl[] =
{
0, /* BTA_AG_SPK_RES */
0, /* BTA_AG_MIC_RES */
@@ -332,14 +332,14 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_send_result(tBTA_AG_SCB *p_scb, UINT8 code, char *p_arg,
- INT16 int_arg)
+static void bta_ag_send_result(tBTA_AG_SCB *p_scb, uint8_t code, char *p_arg,
+ int16_t int_arg)
{
- char buf[BTA_AG_AT_MAX_LEN + 16];
- char *p = buf;
- UINT16 len;
+ char buf[BTA_AG_AT_MAX_LEN + 16];
+ char *p = buf;
+ uint16_t len;
-#if defined(BTA_AG_RESULT_DEBUG) && (BTA_AG_RESULT_DEBUG == TRUE)
+#if (BTA_AG_RESULT_DEBUG == TRUE)
memset(buf, NULL, sizeof(buf));
#endif
/* init with \r\n */
@@ -348,7 +348,7 @@
/* copy result code string */
strlcpy(p, bta_ag_result_tbl[code].p_res, sizeof(buf) - 2);
-#if defined(BTA_HSP_RESULT_REPLACE_COLON) && (BTA_HSP_RESULT_REPLACE_COLON == TRUE)
+#if (BTA_HSP_RESULT_REPLACE_COLON == TRUE)
if(p_scb->conn_service == BTA_AG_HSP)
{
/* If HSP then ":"symbol should be changed as "=" for HSP compatibility */
@@ -358,7 +358,7 @@
case BTA_AG_RES_VGM:
if(*(p+COLON_IDX_4_VGSVGM) == ':')
{
- #if defined(BTA_AG_RESULT_DEBUG) && (BTA_AG_RESULT_DEBUG == TRUE)
+ #if (BTA_AG_RESULT_DEBUG == TRUE)
APPL_TRACE_DEBUG("[HSP] ':'symbol is changed as '=' for HSP compatibility");
#endif
*(p+COLON_IDX_4_VGSVGM) = '=';
@@ -372,7 +372,7 @@
/* copy argument if any */
if (bta_ag_result_tbl[code].fmt == BTA_AG_RES_FMT_INT)
{
- p += utl_itoa((UINT16) int_arg, p);
+ p += utl_itoa((uint16_t) int_arg, p);
}
else if (bta_ag_result_tbl[code].fmt == BTA_AG_RES_FMT_STR)
{
@@ -384,15 +384,15 @@
*p++ = '\r';
*p++ = '\n';
-#if defined(BTA_AG_RESULT_DEBUG) && (BTA_AG_RESULT_DEBUG == TRUE)
+#if (BTA_AG_RESULT_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_ag_send_result: %s", buf);
#endif
/* send to RFCOMM */
- PORT_WriteData(p_scb->conn_handle, buf, (UINT16) (p - buf), &len);
+ PORT_WriteData(p_scb->conn_handle, buf, (uint16_t) (p - buf), &len);
}
-#if defined(BTA_AG_MULTI_RESULT_INCLUDED) && (BTA_AG_MULTI_RESULT_INCLUDED == TRUE)
+#if (BTA_AG_MULTI_RESULT_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_ag_send_multi_result
@@ -405,10 +405,10 @@
*******************************************************************************/
static void bta_ag_send_multi_result(tBTA_AG_SCB *p_scb, tBTA_AG_MULTI_RESULT_CB *m_res_cb)
{
- char buf[BTA_AG_AT_MAX_LEN * BTA_AG_AT_MULTI_LEN + 16];
- char *p = buf;
- UINT16 len;
- UINT8 res_idx = 0;
+ char buf[BTA_AG_AT_MAX_LEN * BTA_AG_AT_MULTI_LEN + 16];
+ char *p = buf;
+ uint16_t len;
+ uint8_t res_idx = 0;
if((!m_res_cb) || (m_res_cb->num_result == 0) || (m_res_cb->num_result > BTA_AG_AT_MULTI_LEN))
{
@@ -416,7 +416,7 @@
return;
}
-#if defined(BTA_AG_RESULT_DEBUG) && (BTA_AG_RESULT_DEBUG == TRUE)
+#if (BTA_AG_RESULT_DEBUG == TRUE)
memset(buf, NULL, sizeof(buf));
#endif
@@ -433,7 +433,7 @@
/* copy argument if any */
if (bta_ag_result_tbl[m_res_cb->res_cb[res_idx].code].fmt == BTA_AG_RES_FMT_INT)
{
- p += utl_itoa((UINT16) m_res_cb->res_cb[res_idx].int_arg, p);
+ p += utl_itoa((uint16_t) m_res_cb->res_cb[res_idx].int_arg, p);
}
else if (bta_ag_result_tbl[m_res_cb->res_cb[res_idx].code].fmt == BTA_AG_RES_FMT_STR)
{
@@ -448,12 +448,12 @@
res_idx++;
}
-#if defined(BTA_AG_RESULT_DEBUG) && (BTA_AG_RESULT_DEBUG == TRUE)
+#if (BTA_AG_RESULT_DEBUG == TRUE)
APPL_TRACE_DEBUG("send_result: %s", buf);
#endif
/* send to RFCOMM */
- PORT_WriteData(p_scb->conn_handle, buf, (UINT16) (p - buf), &len);
+ PORT_WriteData(p_scb->conn_handle, buf, (uint16_t) (p - buf), &len);
}
#endif
@@ -483,7 +483,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_send_error(tBTA_AG_SCB *p_scb, INT16 errcode)
+static void bta_ag_send_error(tBTA_AG_SCB *p_scb, int16_t errcode)
{
/* If HFP and extended audio gateway error codes are enabled */
if (p_scb->conn_service == BTA_AG_HFP && p_scb->cmee_enabled)
@@ -502,14 +502,14 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_send_ind(tBTA_AG_SCB *p_scb, UINT16 id, UINT16 value, BOOLEAN on_demand)
+static void bta_ag_send_ind(tBTA_AG_SCB *p_scb, uint16_t id, uint16_t value, bool on_demand)
{
char str[12];
char *p = str;
/* If the indicator is masked out, just return */
/* Mandatory indicators can not be masked out. */
- if ((p_scb->bia_masked_out & ((UINT32)1 << id)) &&
+ if ((p_scb->bia_masked_out & ((uint32_t)1 << id)) &&
((id != BTA_AG_IND_CALL) && (id != BTA_AG_IND_CALLSETUP) && (id != BTA_AG_IND_CALLHELD)))
return;
@@ -517,56 +517,56 @@
/* If it was requested by app, transmit CIEV even if it is duplicate. */
if (id == BTA_AG_IND_CALL)
{
- if ((value == p_scb->call_ind) && (on_demand == FALSE))
+ if ((value == p_scb->call_ind) && (on_demand == false))
return;
- p_scb->call_ind = (UINT8)value;
+ p_scb->call_ind = (uint8_t)value;
}
- if ((id == BTA_AG_IND_CALLSETUP) && (on_demand == FALSE))
+ if ((id == BTA_AG_IND_CALLSETUP) && (on_demand == false))
{
if (value == p_scb->callsetup_ind)
return;
- p_scb->callsetup_ind = (UINT8)value;
+ p_scb->callsetup_ind = (uint8_t)value;
}
- if ((id == BTA_AG_IND_SERVICE) && (on_demand == FALSE))
+ if ((id == BTA_AG_IND_SERVICE) && (on_demand == false))
{
if (value == p_scb->service_ind)
return;
- p_scb->service_ind = (UINT8)value;
+ p_scb->service_ind = (uint8_t)value;
}
- if ((id == BTA_AG_IND_SIGNAL) && (on_demand == FALSE))
+ if ((id == BTA_AG_IND_SIGNAL) && (on_demand == false))
{
if (value == p_scb->signal_ind)
return;
- p_scb->signal_ind = (UINT8)value;
+ p_scb->signal_ind = (uint8_t)value;
}
- if ((id == BTA_AG_IND_ROAM) && (on_demand == FALSE))
+ if ((id == BTA_AG_IND_ROAM) && (on_demand == false))
{
if (value == p_scb->roam_ind)
return;
- p_scb->roam_ind = (UINT8)value;
+ p_scb->roam_ind = (uint8_t)value;
}
- if ((id == BTA_AG_IND_BATTCHG) && (on_demand == FALSE))
+ if ((id == BTA_AG_IND_BATTCHG) && (on_demand == false))
{
if (value == p_scb->battchg_ind)
return;
- p_scb->battchg_ind = (UINT8)value;
+ p_scb->battchg_ind = (uint8_t)value;
}
- if ((id == BTA_AG_IND_CALLHELD) && (on_demand == FALSE))
+ if ((id == BTA_AG_IND_CALLHELD) && (on_demand == false))
{
/* call swap could result in sending callheld=1 multiple times */
if ((value != 1) && (value == p_scb->callheld_ind))
return;
- p_scb->callheld_ind = (UINT8)value;
+ p_scb->callheld_ind = (uint8_t)value;
}
if (p_scb->cmer_enabled)
@@ -585,12 +585,12 @@
** Description Parse AT+CMER parameter string.
**
**
-** Returns TRUE if parsed ok, FALSE otherwise.
+** Returns true if parsed ok, false otherwise.
**
*******************************************************************************/
-static BOOLEAN bta_ag_parse_cmer(char *p_s, BOOLEAN *p_enabled)
+static bool bta_ag_parse_cmer(char *p_s, bool *p_enabled)
{
- INT16 n[4] = {-1, -1, -1, -1};
+ int16_t n[4] = {-1, -1, -1, -1};
int i;
char *p;
@@ -612,15 +612,15 @@
/* process values */
if (n[0] < 0 || n[3] < 0)
{
- return FALSE;
+ return false;
}
if ((n[0] == 3) && ((n[3] == 1) || (n[3] == 0)))
{
- *p_enabled = (BOOLEAN) n[3];
+ *p_enabled = (bool) n[3];
}
- return TRUE;
+ return true;
}
/*******************************************************************************
@@ -634,10 +634,10 @@
if idx doesn't exist/1st character of argument is not a digit
**
*******************************************************************************/
-static UINT8 bta_ag_parse_chld(tBTA_AG_SCB *p_scb, char *p_s)
+static uint8_t bta_ag_parse_chld(tBTA_AG_SCB *p_scb, char *p_s)
{
- UINT8 retval = 0;
- INT16 idx = -1;
+ uint8_t retval = 0;
+ int16_t idx = -1;
UNUSED(p_scb);
if (!isdigit(p_s[0]))
@@ -651,7 +651,7 @@
idx = utl_str2int(&p_s[1]);
if (idx != -1 && idx < 255)
{
- retval = (UINT8)idx;
+ retval = (uint8_t)idx;
}
else
{
@@ -662,7 +662,7 @@
return (retval);
}
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_ag_parse_bac
@@ -675,8 +675,8 @@
static tBTA_AG_PEER_CODEC bta_ag_parse_bac(tBTA_AG_SCB *p_scb, char *p_s)
{
tBTA_AG_PEER_CODEC retval = BTA_AG_CODEC_NONE;
- UINT16 uuid_codec;
- BOOLEAN cont = FALSE; /* Continue processing */
+ uint16_t uuid_codec;
+ bool cont = false; /* Continue processing */
char *p;
while(p_s)
@@ -688,10 +688,10 @@
if (*p != 0)
{
*p = 0;
- cont = TRUE;
+ cont = true;
}
else
- cont = FALSE;
+ cont = false;
uuid_codec = utl_str2int(p_s);
switch(uuid_codec)
@@ -727,10 +727,10 @@
static void bta_ag_process_unat_res(char *unat_result)
{
- UINT8 str_leng;
- UINT8 i = 0;
- UINT8 j = 0;
- UINT8 pairs_of_nl_cr;
+ uint8_t str_leng;
+ uint8_t i = 0;
+ uint8_t j = 0;
+ uint8_t pairs_of_nl_cr;
char trim_data[BTA_AG_AT_MAX_LEN];
@@ -776,16 +776,16 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_ag_inband_enabled(tBTA_AG_SCB *p_scb)
+bool bta_ag_inband_enabled(tBTA_AG_SCB *p_scb)
{
/* if feature is enabled and no other scbs connected */
if (p_scb->inband_enabled && !bta_ag_other_scb_open(p_scb))
{
- return TRUE;
+ return true;
}
else
{
- return FALSE;
+ return false;
}
}
@@ -801,8 +801,8 @@
*******************************************************************************/
void bta_ag_send_call_inds(tBTA_AG_SCB *p_scb, tBTA_AG_RES result)
{
- UINT8 call = p_scb->call_ind;
- UINT8 callsetup;
+ uint8_t call = p_scb->call_ind;
+ uint8_t callsetup;
/* set new call and callsetup values based on BTA_AgResult */
callsetup = bta_ag_callsetup_ind_tbl[result];
@@ -822,8 +822,8 @@
}
/* Send indicator function tracks if the values have actually changed */
- bta_ag_send_ind(p_scb, BTA_AG_IND_CALL, call, FALSE);
- bta_ag_send_ind(p_scb, BTA_AG_IND_CALLSETUP, callsetup, FALSE);
+ bta_ag_send_ind(p_scb, BTA_AG_IND_CALL, call, false);
+ bta_ag_send_ind(p_scb, BTA_AG_IND_CALLSETUP, callsetup, false);
}
/*******************************************************************************
@@ -836,8 +836,8 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_at_hsp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
- char *p_arg, INT16 int_arg)
+void bta_ag_at_hsp_cback(tBTA_AG_SCB *p_scb, uint16_t cmd, uint8_t arg_type,
+ char *p_arg, int16_t int_arg)
{
tBTA_AG_VAL val;
@@ -849,7 +849,7 @@
val.hdr.handle = bta_ag_scb_to_idx(p_scb);
val.hdr.app_id = p_scb->app_id;
- val.num = (UINT16) int_arg;
+ val.num = (uint16_t) int_arg;
strlcpy(val.str, p_arg, BTA_AG_AT_MAX_LEN);
/* call callback with event */
@@ -866,15 +866,15 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
- char *p_arg, INT16 int_arg)
+void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, uint16_t cmd, uint8_t arg_type,
+ char *p_arg, int16_t int_arg)
{
- tBTA_AG_VAL val;
+ tBTA_AG_VAL val;
tBTA_AG_EVT event;
- tBTA_AG_SCB *ag_scb;
- UINT32 i, ind_id;
- UINT32 bia_masked_out;
-#if (BTM_WBS_INCLUDED == TRUE )
+ tBTA_AG_SCB *ag_scb;
+ uint32_t i, ind_id;
+ uint32_t bia_masked_out;
+#if (BTM_WBS_INCLUDED == TRUE)
tBTA_AG_PEER_CODEC codec_type, codec_sent;
#endif
if (p_arg == NULL)
@@ -947,7 +947,7 @@
case BTA_AG_HF_CMD_CCWA:
/* store setting */
- p_scb->ccwa_enabled = (BOOLEAN) int_arg;
+ p_scb->ccwa_enabled = (bool) int_arg;
/* send OK */
bta_ag_send_ok(p_scb);
@@ -1031,7 +1031,7 @@
case BTA_AG_HF_CMD_CLIP:
/* store setting, send OK */
- p_scb->clip_enabled = (BOOLEAN) int_arg;
+ p_scb->clip_enabled = (bool) int_arg;
bta_ag_send_ok(p_scb);
break;
@@ -1089,11 +1089,11 @@
case BTA_AG_HF_CMD_BRSF:
/* store peer features */
- p_scb->peer_features = (UINT16) int_arg;
+ p_scb->peer_features = (uint16_t) int_arg;
/* send BRSF, send OK */
bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL,
- (INT16) (p_scb->features & BTA_AG_BSRF_FEAT_SPEC));
+ (int16_t) (p_scb->features & BTA_AG_BSRF_FEAT_SPEC));
bta_ag_send_ok(p_scb);
break;
@@ -1153,7 +1153,7 @@
if (p_scb->features & BTA_AG_FEAT_EXTERR)
{
/* store setting */
- p_scb->cmee_enabled = (BOOLEAN) int_arg;
+ p_scb->cmee_enabled = (bool) int_arg;
/* send OK */
bta_ag_send_ok(p_scb);
@@ -1179,9 +1179,9 @@
continue;
if (val.str[i] == '0')
- bia_masked_out |= ((UINT32)1 << ind_id);
+ bia_masked_out |= ((uint32_t)1 << ind_id);
else if (val.str[i] == '1')
- bia_masked_out &= ~((UINT32)1 << ind_id);
+ bia_masked_out &= ~((uint32_t)1 << ind_id);
else
break;
@@ -1208,7 +1208,7 @@
}
break;
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
case BTA_AG_HF_CMD_BAC:
bta_ag_send_ok(p_scb);
@@ -1216,7 +1216,7 @@
if((p_scb->peer_features & BTA_AG_PEER_FEAT_CODEC) && (p_scb->features & BTA_AG_FEAT_CODEC))
{
p_scb->peer_codecs = bta_ag_parse_bac(p_scb, p_arg);
- p_scb->codec_updated = TRUE;
+ p_scb->codec_updated = true;
if (p_scb->peer_codecs & BTA_AG_CODEC_MSBC)
{
@@ -1265,9 +1265,9 @@
codec_sent = p_scb->sco_codec;
if(codec_type == codec_sent)
- bta_ag_sco_codec_nego(p_scb, TRUE);
+ bta_ag_sco_codec_nego(p_scb, true);
else
- bta_ag_sco_codec_nego(p_scb, FALSE);
+ bta_ag_sco_codec_nego(p_scb, false);
/* send final codec info to callback */
val.num = codec_sent;
@@ -1301,7 +1301,7 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_at_err_cback(tBTA_AG_SCB *p_scb, BOOLEAN unknown, char *p_arg)
+void bta_ag_at_err_cback(tBTA_AG_SCB *p_scb, bool unknown, char *p_arg)
{
tBTA_AG_VAL val;
@@ -1339,7 +1339,7 @@
*******************************************************************************/
void bta_ag_hsp_result(tBTA_AG_SCB *p_scb, tBTA_AG_API_RESULT *p_result)
{
- UINT8 code = bta_ag_trans_result[p_result->result];
+ uint8_t code = bta_ag_trans_result[p_result->result];
APPL_TRACE_DEBUG("bta_ag_hsp_result : res = %d", p_result->result);
@@ -1451,7 +1451,7 @@
*******************************************************************************/
void bta_ag_hfp_result(tBTA_AG_SCB *p_scb, tBTA_AG_API_RESULT *p_result)
{
- UINT8 code = bta_ag_trans_result[p_result->result];
+ uint8_t code = bta_ag_trans_result[p_result->result];
APPL_TRACE_DEBUG("bta_ag_hfp_result : res = %d", p_result->result);
@@ -1683,7 +1683,7 @@
break;
case BTA_AG_IND_RES:
- bta_ag_send_ind(p_scb, p_result->data.ind.id, p_result->data.ind.value, FALSE);
+ bta_ag_send_ind(p_scb, p_result->data.ind.id, p_result->data.ind.value, false);
break;
case BTA_AG_BVRA_RES:
@@ -1737,7 +1737,7 @@
}
}
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_ag_send_bcs
@@ -1749,7 +1749,7 @@
*******************************************************************************/
void bta_ag_send_bcs(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
- UINT16 codec_uuid;
+ uint16_t codec_uuid;
if (p_scb->codec_fallback)
{
@@ -1790,7 +1790,7 @@
{
UNUSED(p_data);
-#if defined(BTA_AG_MULTI_RESULT_INCLUDED) && (BTA_AG_MULTI_RESULT_INCLUDED == TRUE)
+#if (BTA_AG_MULTI_RESULT_INCLUDED == TRUE)
tBTA_AG_MULTI_RESULT_CB m_res_cb;
if (p_scb->conn_service == BTA_AG_HFP && p_scb->clip_enabled && p_scb->clip[0] != 0)
diff --git a/bta/ag/bta_ag_int.h b/bta/ag/bta_ag_int.h
index a95f0a8..acde78f 100644
--- a/bta/ag/bta_ag_int.h
+++ b/bta/ag/bta_ag_int.h
@@ -31,12 +31,12 @@
/* Send RING & CLIP in one AT cmd */
#ifndef BTA_AG_MULTI_RESULT_INCLUDED
-#define BTA_AG_MULTI_RESULT_INCLUDED FALSE
+#define BTA_AG_MULTI_RESULT_INCLUDED FALSE
#endif
/* Replace : in VGS and VGM for HSP */
#ifndef BTA_HSP_RESULT_REPLACE_COLON
-#define BTA_HSP_RESULT_REPLACE_COLON TRUE
+#define BTA_HSP_RESULT_REPLACE_COLON TRUE
#endif
/*****************************************************************************
@@ -133,7 +133,7 @@
{
BTA_AG_SCO_SHUTDOWN_ST, /* no sco listening, all sco connections closed */
BTA_AG_SCO_LISTEN_ST, /* sco listening */
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
BTA_AG_SCO_CODEC_ST, /* sco codec negotiation */
#endif
BTA_AG_SCO_OPENING_ST, /* sco connection opening */
@@ -166,7 +166,7 @@
tBTA_SERVICE_MASK services;
tBTA_SEC sec_mask;
tBTA_AG_FEAT features;
- UINT8 app_id;
+ uint8_t app_id;
} tBTA_AG_API_REGISTER;
/* data type for BTA_AG_API_OPEN_EVT */
@@ -197,14 +197,14 @@
typedef struct
{
BT_HDR hdr;
- UINT16 status;
+ uint16_t status;
} tBTA_AG_DISC_RESULT;
/* data type for RFCOMM events */
typedef struct
{
BT_HDR hdr;
- UINT16 port_handle;
+ uint16_t port_handle;
} tBTA_AG_RFC;
/* data type for BTA_AG_CI_RX_WRITE_EVT */
@@ -222,7 +222,7 @@
tBTA_AG_API_REGISTER api_register;
tBTA_AG_API_OPEN api_open;
tBTA_AG_API_RESULT api_result;
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
tBTA_AG_API_SETCODEC api_setcodec;
#endif
tBTA_AG_DISC_RESULT disc_result;
@@ -233,8 +233,8 @@
/* type for each profile */
typedef struct
{
- UINT32 sdp_handle;
- UINT8 scn;
+ uint32_t sdp_handle;
+ uint8_t scn;
} tBTA_AG_PROFILE;
#if (BTM_WBS_INCLUDED == TRUE)
@@ -249,43 +249,43 @@
typedef struct
{
char clip[BTA_AG_AT_MAX_LEN+1]; /* number string used for CLIP */
- UINT16 serv_handle[BTA_AG_NUM_IDX]; /* RFCOMM server handles */
+ uint16_t serv_handle[BTA_AG_NUM_IDX]; /* RFCOMM server handles */
tBTA_AG_AT_CB at_cb; /* AT command interpreter */
BD_ADDR peer_addr; /* peer bd address */
tSDP_DISCOVERY_DB *p_disc_db; /* pointer to discovery database */
tBTA_SERVICE_MASK reg_services; /* services specified in register API */
tBTA_SERVICE_MASK open_services; /* services specified in open API */
- UINT16 conn_handle; /* RFCOMM handle of connected service */
+ uint16_t conn_handle; /* RFCOMM handle of connected service */
tBTA_SEC serv_sec_mask; /* server security mask */
tBTA_SEC cli_sec_mask; /* client security mask */
tBTA_AG_FEAT features; /* features registered by application */
tBTA_AG_PEER_FEAT peer_features; /* peer device features */
- UINT16 peer_version; /* profile version of peer device */
- UINT16 hsp_version; /* HSP profile version */
- UINT16 sco_idx; /* SCO handle */
- BOOLEAN in_use; /* scb in use */
- BOOLEAN dealloc; /* TRUE if service shutting down */
- BOOLEAN clip_enabled; /* set to TRUE if HF enables CLIP reporting */
- BOOLEAN ccwa_enabled; /* set to TRUE if HF enables CCWA reporting */
- BOOLEAN cmer_enabled; /* set to TRUE if HF enables CMER reporting */
- BOOLEAN cmee_enabled; /* set to TRUE if HF enables CME ERROR reporting */
- BOOLEAN inband_enabled; /* set to TRUE if inband ring enabled */
- BOOLEAN svc_conn; /* set to TRUE when service level connection up */
- UINT8 state; /* state machine state */
- UINT8 conn_service; /* connected service */
- UINT8 peer_scn; /* peer scn */
- UINT8 app_id; /* application id */
- UINT8 role; /* initiator/acceptor role */
- UINT8 post_sco; /* action to perform after sco event */
- UINT8 call_ind; /* CIEV call indicator value */
- UINT8 callsetup_ind; /* CIEV callsetup indicator value */
- UINT8 service_ind; /* CIEV service indicator value */
- UINT8 signal_ind; /* CIEV signal indicator value */
- UINT8 roam_ind; /* CIEV roam indicator value */
- UINT8 battchg_ind; /* CIEV battery charge indicator value */
- UINT8 callheld_ind; /* CIEV call held indicator value */
- BOOLEAN retry_with_sco_only; /* indicator to try with SCO only when eSCO fails */
- UINT32 bia_masked_out; /* indicators HF does not want us to send */
+ uint16_t peer_version; /* profile version of peer device */
+ uint16_t hsp_version; /* HSP profile version */
+ uint16_t sco_idx; /* SCO handle */
+ bool in_use; /* scb in use */
+ bool dealloc; /* true if service shutting down */
+ bool clip_enabled; /* set to true if HF enables CLIP reporting */
+ bool ccwa_enabled; /* set to true if HF enables CCWA reporting */
+ bool cmer_enabled; /* set to true if HF enables CMER reporting */
+ bool cmee_enabled; /* set to true if HF enables CME ERROR reporting */
+ bool inband_enabled; /* set to true if inband ring enabled */
+ bool svc_conn; /* set to true when service level connection up */
+ uint8_t state; /* state machine state */
+ uint8_t conn_service; /* connected service */
+ uint8_t peer_scn; /* peer scn */
+ uint8_t app_id; /* application id */
+ uint8_t role; /* initiator/acceptor role */
+ uint8_t post_sco; /* action to perform after sco event */
+ uint8_t call_ind; /* CIEV call indicator value */
+ uint8_t callsetup_ind; /* CIEV callsetup indicator value */
+ uint8_t service_ind; /* CIEV service indicator value */
+ uint8_t signal_ind; /* CIEV signal indicator value */
+ uint8_t roam_ind; /* CIEV roam indicator value */
+ uint8_t battchg_ind; /* CIEV battery charge indicator value */
+ uint8_t callheld_ind; /* CIEV call held indicator value */
+ bool retry_with_sco_only; /* indicator to try with SCO only when eSCO fails */
+ uint32_t bia_masked_out; /* indicators HF does not want us to send */
alarm_t *collision_timer;
alarm_t *ring_timer;
#if (BTM_WBS_INCLUDED == TRUE)
@@ -293,8 +293,8 @@
tBTA_AG_PEER_CODEC peer_codecs; /* codecs for eSCO supported by the peer */
tBTA_AG_PEER_CODEC sco_codec; /* codec to be used for eSCO connection */
tBTA_AG_PEER_CODEC inuse_codec; /* codec being used for the current SCO connection */
- BOOLEAN codec_updated; /* set to TRUE whenever the app updates codec type */
- BOOLEAN codec_fallback; /* If sco nego fails for mSBC, fallback to CVSD */
+ bool codec_updated; /* set to true whenever the app updates codec type */
+ bool codec_fallback; /* If sco nego fails for mSBC, fallback to CVSD */
tBTA_AG_SCO_MSBC_SETTINGS codec_msbc_settings; /* settings to be used for the impending eSCO */
#endif
@@ -306,9 +306,9 @@
tBTM_ESCO_CONN_REQ_EVT_DATA conn_data; /* SCO data for pending conn request */
tBTA_AG_SCB *p_curr_scb; /* SCB associated with SCO connection */
tBTA_AG_SCB *p_xfer_scb; /* SCB associated with SCO transfer */
- UINT16 cur_idx; /* SCO handle */
- UINT8 state; /* SCO state variable */
- BOOLEAN param_updated; /* if params were updated to non-default */
+ uint16_t cur_idx; /* SCO handle */
+ uint8_t state; /* SCO state variable */
+ bool param_updated; /* if params were updated to non-default */
tBTM_ESCO_PARAMS params; /* ESCO parameters */
} tBTA_AG_SCO_CB;
@@ -328,12 +328,12 @@
*****************************************************************************/
/* constant lookup tables */
-extern const UINT16 bta_ag_uuid[BTA_AG_NUM_IDX];
-extern const UINT8 bta_ag_sec_id[BTA_AG_NUM_IDX];
+extern const uint16_t bta_ag_uuid[BTA_AG_NUM_IDX];
+extern const uint8_t bta_ag_sec_id[BTA_AG_NUM_IDX];
extern const tBTA_AG_AT_CMD *bta_ag_at_tbl[BTA_AG_NUM_IDX];
/* control block declaration */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_AG_CB bta_ag_cb;
#else
extern tBTA_AG_CB *bta_ag_cb_ptr;
@@ -349,47 +349,47 @@
/* main functions */
extern void bta_ag_scb_dealloc(tBTA_AG_SCB *p_scb);
-extern UINT16 bta_ag_scb_to_idx(tBTA_AG_SCB *p_scb);
-extern tBTA_AG_SCB *bta_ag_scb_by_idx(UINT16 idx);
-extern UINT8 bta_ag_service_to_idx(tBTA_SERVICE_MASK services);
-extern UINT16 bta_ag_idx_by_bdaddr(BD_ADDR peer_addr);
-extern BOOLEAN bta_ag_other_scb_open(tBTA_AG_SCB *p_curr_scb);
-extern BOOLEAN bta_ag_scb_open(tBTA_AG_SCB *p_curr_scb);
+extern uint16_t bta_ag_scb_to_idx(tBTA_AG_SCB *p_scb);
+extern tBTA_AG_SCB *bta_ag_scb_by_idx(uint16_t idx);
+extern uint8_t bta_ag_service_to_idx(tBTA_SERVICE_MASK services);
+extern uint16_t bta_ag_idx_by_bdaddr(BD_ADDR peer_addr);
+extern bool bta_ag_other_scb_open(tBTA_AG_SCB *p_curr_scb);
+extern bool bta_ag_scb_open(tBTA_AG_SCB *p_curr_scb);
extern tBTA_AG_SCB *bta_ag_get_other_idle_scb (tBTA_AG_SCB *p_curr_scb);
-extern void bta_ag_sm_execute(tBTA_AG_SCB *p_scb, UINT16 event, tBTA_AG_DATA *p_data);
-extern BOOLEAN bta_ag_hdl_event(BT_HDR *p_msg);
-extern void bta_ag_collision_cback (tBTA_SYS_CONN_STATUS status, UINT8 id,
- UINT8 app_id, BD_ADDR peer_addr);
+extern void bta_ag_sm_execute(tBTA_AG_SCB *p_scb, uint16_t event, tBTA_AG_DATA *p_data);
+extern bool bta_ag_hdl_event(BT_HDR *p_msg);
+extern void bta_ag_collision_cback (tBTA_SYS_CONN_STATUS status, uint8_t id,
+ uint8_t app_id, BD_ADDR peer_addr);
extern void bta_ag_resume_open (tBTA_AG_SCB *p_scb);
/* SDP functions */
-extern BOOLEAN bta_ag_add_record(UINT16 service_uuid, char *p_service_name, UINT8 scn,
- tBTA_AG_FEAT features, UINT32 sdp_handle);
+extern bool bta_ag_add_record(uint16_t service_uuid, char *p_service_name, uint8_t scn,
+ tBTA_AG_FEAT features, uint32_t sdp_handle);
extern void bta_ag_create_records(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_del_records(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
-extern BOOLEAN bta_ag_sdp_find_attr(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK service);
+extern bool bta_ag_sdp_find_attr(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK service);
extern void bta_ag_do_disc(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK service);
extern void bta_ag_free_db(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
/* RFCOMM functions */
extern void bta_ag_start_servers(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK services);
extern void bta_ag_close_servers(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK services);
-extern BOOLEAN bta_ag_is_server_closed (tBTA_AG_SCB *p_scb);
+extern bool bta_ag_is_server_closed (tBTA_AG_SCB *p_scb);
extern void bta_ag_rfc_do_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_rfc_do_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
/* SCO functions */
-extern BOOLEAN bta_ag_sco_is_open(tBTA_AG_SCB *p_scb);
-extern BOOLEAN bta_ag_sco_is_opening(tBTA_AG_SCB *p_scb);
+extern bool bta_ag_sco_is_open(tBTA_AG_SCB *p_scb);
+extern bool bta_ag_sco_is_opening(tBTA_AG_SCB *p_scb);
extern void bta_ag_sco_conn_rsp(tBTA_AG_SCB *p_scb, tBTM_ESCO_CONN_REQ_EVT_DATA *p_data);
/* AT command functions */
-extern void bta_ag_at_hsp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
- char *p_arg, INT16 int_arg);
-extern void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
- char *p_arg, INT16 int_arg);
-extern void bta_ag_at_err_cback(tBTA_AG_SCB *p_scb, BOOLEAN unknown, char *p_arg);
-extern BOOLEAN bta_ag_inband_enabled(tBTA_AG_SCB *p_scb);
+extern void bta_ag_at_hsp_cback(tBTA_AG_SCB *p_scb, uint16_t cmd, uint8_t arg_type,
+ char *p_arg, int16_t int_arg);
+extern void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, uint16_t cmd, uint8_t arg_type,
+ char *p_arg, int16_t int_arg);
+extern void bta_ag_at_err_cback(tBTA_AG_SCB *p_scb, bool unknown, char *p_arg);
+extern bool bta_ag_inband_enabled(tBTA_AG_SCB *p_scb);
extern void bta_ag_send_call_inds(tBTA_AG_SCB *p_scb, tBTA_AG_RES result);
/* Action functions */
@@ -410,8 +410,8 @@
extern void bta_ag_sco_listen(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_sco_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_sco_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
-#if (BTM_WBS_INCLUDED == TRUE )
-extern void bta_ag_sco_codec_nego(tBTA_AG_SCB *p_scb, BOOLEAN result);
+#if (BTM_WBS_INCLUDED == TRUE)
+extern void bta_ag_sco_codec_nego(tBTA_AG_SCB *p_scb, bool result);
extern void bta_ag_codec_negotiate (tBTA_AG_SCB *p_scb);
#endif
extern void bta_ag_sco_shutdown(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
@@ -422,12 +422,12 @@
extern void bta_ag_svc_conn_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_result(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_setcodec(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
extern void bta_ag_send_bcs(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
#endif
extern void bta_ag_send_ring(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_ci_sco_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
-extern void bta_ag_set_esco_param(BOOLEAN set_reset, tBTM_ESCO_PARAMS *param);
+extern void bta_ag_set_esco_param(bool set_reset, tBTM_ESCO_PARAMS *param);
extern void bta_ag_ci_rx_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
extern void bta_ag_rcvd_slc_ready(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data);
#endif /* BTA_AG_INT_H */
diff --git a/bta/ag/bta_ag_main.c b/bta/ag/bta_ag_main.c
index 3abd1ef..293163b 100644
--- a/bta/ag/bta_ag_main.c
+++ b/bta/ag/bta_ag_main.c
@@ -38,9 +38,9 @@
extern fixed_queue_t *btu_bta_alarm_queue;
-#if BTA_AG_DEBUG == TRUE
-static char *bta_ag_evt_str(UINT16 event, tBTA_AG_RES result);
-static char *bta_ag_state_str(UINT8 state);
+#if (BTA_AG_DEBUG == TRUE)
+static char *bta_ag_evt_str(uint16_t event, tBTA_AG_RES result);
+static char *bta_ag_state_str(uint8_t state);
#endif
/* state machine states */
@@ -138,7 +138,7 @@
#define BTA_AG_NUM_COLS 3 /* number of columns in state tables */
/* state table for init state */
-const UINT8 bta_ag_st_init[][BTA_AG_NUM_COLS] =
+const uint8_t bta_ag_st_init[][BTA_AG_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* API_REGISTER_EVT */ {BTA_AG_REGISTER, BTA_AG_IGNORE, BTA_AG_INIT_ST},
@@ -167,7 +167,7 @@
};
/* state table for opening state */
-const UINT8 bta_ag_st_opening[][BTA_AG_NUM_COLS] =
+const uint8_t bta_ag_st_opening[][BTA_AG_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* API_REGISTER_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPENING_ST},
@@ -196,7 +196,7 @@
};
/* state table for open state */
-const UINT8 bta_ag_st_open[][BTA_AG_NUM_COLS] =
+const uint8_t bta_ag_st_open[][BTA_AG_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* API_REGISTER_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_OPEN_ST},
@@ -225,7 +225,7 @@
};
/* state table for closing state */
-const UINT8 bta_ag_st_closing[][BTA_AG_NUM_COLS] =
+const uint8_t bta_ag_st_closing[][BTA_AG_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* API_REGISTER_EVT */ {BTA_AG_IGNORE, BTA_AG_IGNORE, BTA_AG_CLOSING_ST},
@@ -254,7 +254,7 @@
};
/* type for state table */
-typedef const UINT8 (*tBTA_AG_ST_TBL)[BTA_AG_NUM_COLS];
+typedef const uint8_t (*tBTA_AG_ST_TBL)[BTA_AG_NUM_COLS];
/* state table */
const tBTA_AG_ST_TBL bta_ag_st_tbl[] =
@@ -294,10 +294,10 @@
if (!p_scb->in_use)
{
/* initialize variables */
- p_scb->in_use = TRUE;
+ p_scb->in_use = true;
p_scb->sco_idx = BTM_INVALID_SCO_INDEX;
-#if (BTM_WBS_INCLUDED == TRUE )
- p_scb->codec_updated = FALSE;
+#if (BTM_WBS_INCLUDED == TRUE)
+ p_scb->codec_updated = false;
p_scb->peer_codecs = BTA_AG_CODEC_CVSD;
p_scb->sco_codec = BTA_AG_CODEC_CVSD;
#endif
@@ -336,8 +336,8 @@
*******************************************************************************/
void bta_ag_scb_dealloc(tBTA_AG_SCB *p_scb)
{
- UINT8 idx;
- BOOLEAN allocated = FALSE;
+ uint8_t idx;
+ bool allocated = false;
APPL_TRACE_DEBUG("bta_ag_scb_dealloc %d", bta_ag_scb_to_idx(p_scb));
@@ -359,7 +359,7 @@
{
if (bta_ag_cb.scb[idx].in_use)
{
- allocated = TRUE;
+ allocated = true;
break;
}
}
@@ -382,10 +382,10 @@
** Returns Index of scb.
**
*******************************************************************************/
-UINT16 bta_ag_scb_to_idx(tBTA_AG_SCB *p_scb)
+uint16_t bta_ag_scb_to_idx(tBTA_AG_SCB *p_scb)
{
/* use array arithmetic to determine index */
- return ((UINT16) (p_scb - bta_ag_cb.scb)) + 1;
+ return ((uint16_t) (p_scb - bta_ag_cb.scb)) + 1;
}
/*******************************************************************************
@@ -398,7 +398,7 @@
** Returns Pointer to scb or NULL if not allocated.
**
*******************************************************************************/
-tBTA_AG_SCB *bta_ag_scb_by_idx(UINT16 idx)
+tBTA_AG_SCB *bta_ag_scb_by_idx(uint16_t idx)
{
tBTA_AG_SCB *p_scb;
@@ -430,7 +430,7 @@
** Returns Profile ndex of scb.
**
*******************************************************************************/
-UINT8 bta_ag_service_to_idx(tBTA_SERVICE_MASK services)
+uint8_t bta_ag_service_to_idx(tBTA_SERVICE_MASK services)
{
if (services & BTA_HFP_SERVICE_MASK)
{
@@ -452,10 +452,10 @@
** Returns Index of SCB or zero if none found.
**
*******************************************************************************/
-UINT16 bta_ag_idx_by_bdaddr(BD_ADDR peer_addr)
+uint16_t bta_ag_idx_by_bdaddr(BD_ADDR peer_addr)
{
tBTA_AG_SCB *p_scb = &bta_ag_cb.scb[0];
- UINT16 i;
+ uint16_t i;
if (peer_addr != NULL)
{
@@ -480,10 +480,10 @@
** Description Check whether any other scb is in open state.
**
**
-** Returns TRUE if another scb is in open state, FALSE otherwise.
+** Returns true if another scb is in open state, false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_ag_other_scb_open(tBTA_AG_SCB *p_curr_scb)
+bool bta_ag_other_scb_open(tBTA_AG_SCB *p_curr_scb)
{
tBTA_AG_SCB *p_scb = &bta_ag_cb.scb[0];
int i;
@@ -492,13 +492,13 @@
{
if (p_scb->in_use && p_scb != p_curr_scb && p_scb->state == BTA_AG_OPEN_ST)
{
- return TRUE;
+ return true;
}
}
/* no other scb found */
APPL_TRACE_DEBUG("No other ag scb open");
- return FALSE;
+ return false;
}
/*******************************************************************************
@@ -508,17 +508,17 @@
** Description Check whether given scb is in open state.
**
**
-** Returns TRUE if scb is in open state, FALSE otherwise.
+** Returns true if scb is in open state, false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_ag_scb_open(tBTA_AG_SCB *p_curr_scb)
+bool bta_ag_scb_open(tBTA_AG_SCB *p_curr_scb)
{
if (p_curr_scb && p_curr_scb->in_use && p_curr_scb->state == BTA_AG_OPEN_ST)
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*******************************************************************************
@@ -534,7 +534,7 @@
tBTA_AG_SCB *bta_ag_get_other_idle_scb (tBTA_AG_SCB *p_curr_scb)
{
tBTA_AG_SCB *p_scb = &bta_ag_cb.scb[0];
- UINT8 xx;
+ uint8_t xx;
for (xx = 0; xx < BTA_AG_NUM_SCB; xx++, p_scb++)
{
@@ -580,10 +580,10 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_collision_cback (tBTA_SYS_CONN_STATUS status, UINT8 id,
- UINT8 app_id, BD_ADDR peer_addr)
+void bta_ag_collision_cback (tBTA_SYS_CONN_STATUS status, uint8_t id,
+ uint8_t app_id, BD_ADDR peer_addr)
{
- UINT16 handle;
+ uint16_t handle;
tBTA_AG_SCB *p_scb;
UNUSED(status);
UNUSED(app_id);
@@ -705,9 +705,9 @@
static void bta_ag_api_disable(tBTA_AG_DATA *p_data)
{
/* deregister all scbs in use */
- tBTA_AG_SCB *p_scb = &bta_ag_cb.scb[0];
- BOOLEAN do_dereg = FALSE;
- int i;
+ tBTA_AG_SCB *p_scb = &bta_ag_cb.scb[0];
+ bool do_dereg = false;
+ int i;
if (!bta_sys_is_register (BTA_ID_AG))
{
@@ -723,7 +723,7 @@
if (p_scb->in_use)
{
bta_ag_sm_execute(p_scb, BTA_AG_API_DEREGISTER_EVT, p_data);
- do_dereg = TRUE;
+ do_dereg = true;
}
}
@@ -810,15 +810,15 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_sm_execute(tBTA_AG_SCB *p_scb, UINT16 event, tBTA_AG_DATA *p_data)
+void bta_ag_sm_execute(tBTA_AG_SCB *p_scb, uint16_t event, tBTA_AG_DATA *p_data)
{
tBTA_AG_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
int i;
-#if BTA_AG_DEBUG == TRUE
- UINT16 in_event = event;
- UINT8 in_state = p_scb->state;
+#if (BTA_AG_DEBUG == TRUE)
+ uint16_t in_event = event;
+ uint8_t in_state = p_scb->state;
/* Ignore displaying of AT results when not connected (Ignored in state machine) */
if (in_event != BTA_AG_API_RESULT_EVT || p_scb->state == BTA_AG_OPEN_ST)
@@ -858,7 +858,7 @@
break;
}
}
-#if BTA_AG_DEBUG == TRUE
+#if (BTA_AG_DEBUG == TRUE)
if (p_scb->state != in_state)
{
APPL_TRACE_EVENT("BTA AG State Change: [%s] -> [%s] after Event [%s]",
@@ -876,10 +876,10 @@
** Description Data gateway main event handling function.
**
**
-** Returns BOOLEAN
+** Returns bool
**
*******************************************************************************/
-BOOLEAN bta_ag_hdl_event(BT_HDR *p_msg)
+bool bta_ag_hdl_event(BT_HDR *p_msg)
{
tBTA_AG_SCB *p_scb;
@@ -915,11 +915,11 @@
}
break;
}
- return TRUE;
+ return true;
}
-#if BTA_AG_DEBUG == TRUE
-static char *bta_ag_evt_str(UINT16 event, tBTA_AG_RES result)
+#if (BTA_AG_DEBUG == TRUE)
+static char *bta_ag_evt_str(uint16_t event, tBTA_AG_RES result)
{
switch (event)
{
@@ -1001,7 +1001,7 @@
}
}
-static char *bta_ag_state_str(UINT8 state)
+static char *bta_ag_state_str(uint8_t state)
{
switch (state)
{
diff --git a/bta/ag/bta_ag_rfc.c b/bta/ag/bta_ag_rfc.c
index d3f2705..a399e9b 100644
--- a/bta/ag/bta_ag_rfc.c
+++ b/bta/ag/bta_ag_rfc.c
@@ -39,17 +39,17 @@
#define BTA_AG_PORT_EV_MASK PORT_EV_RXCHAR
/* each scb has its own rfcomm callbacks */
-void bta_ag_port_cback_1(UINT32 code, UINT16 port_handle);
-void bta_ag_port_cback_2(UINT32 code, UINT16 port_handle);
-void bta_ag_port_cback_3(UINT32 code, UINT16 port_handle);
+void bta_ag_port_cback_1(uint32_t code, uint16_t port_handle);
+void bta_ag_port_cback_2(uint32_t code, uint16_t port_handle);
+void bta_ag_port_cback_3(uint32_t code, uint16_t port_handle);
-void bta_ag_mgmt_cback_1(UINT32 code, UINT16 port_handle);
-void bta_ag_mgmt_cback_2(UINT32 code, UINT16 port_handle);
-void bta_ag_mgmt_cback_3(UINT32 code, UINT16 port_handle);
+void bta_ag_mgmt_cback_1(uint32_t code, uint16_t port_handle);
+void bta_ag_mgmt_cback_2(uint32_t code, uint16_t port_handle);
+void bta_ag_mgmt_cback_3(uint32_t code, uint16_t port_handle);
-int bta_ag_data_cback_1(UINT16 port_handle, void *p_data, UINT16 len);
-int bta_ag_data_cback_2(UINT16 port_handle, void *p_data, UINT16 len);
-int bta_ag_data_cback_3(UINT16 port_handle, void *p_data, UINT16 len);
+int bta_ag_data_cback_1(uint16_t port_handle, void *p_data, uint16_t len);
+int bta_ag_data_cback_2(uint16_t port_handle, void *p_data, uint16_t len);
+int bta_ag_data_cback_3(uint16_t port_handle, void *p_data, uint16_t len);
/* rfcomm callback function tables */
typedef tPORT_CALLBACK *tBTA_AG_PORT_CBACK;
@@ -85,7 +85,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_port_cback(UINT32 code, UINT16 port_handle, UINT16 handle)
+static void bta_ag_port_cback(uint32_t code, uint16_t port_handle, uint16_t handle)
{
tBTA_AG_SCB *p_scb;
UNUSED(code);
@@ -117,12 +117,12 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_mgmt_cback(UINT32 code, UINT16 port_handle, UINT16 handle)
+static void bta_ag_mgmt_cback(uint32_t code, uint16_t port_handle, uint16_t handle)
{
- tBTA_AG_SCB *p_scb;
- UINT16 event;
- UINT8 i;
- BOOLEAN found_handle = FALSE;
+ tBTA_AG_SCB *p_scb;
+ uint16_t event;
+ uint8_t i;
+ bool found_handle = false;
APPL_TRACE_DEBUG("ag_mgmt_cback : code = %d, port_handle = %d, handle = %d",
code, port_handle, handle);
@@ -141,14 +141,14 @@
if (p_scb->conn_handle) /* Outgoing connection */
{
if (port_handle == p_scb->conn_handle)
- found_handle = TRUE;
+ found_handle = true;
}
else /* Incoming connection */
{
for (i = 0; i < BTA_AG_NUM_IDX; i++)
{
if (port_handle == p_scb->serv_handle[i])
- found_handle = TRUE;
+ found_handle = true;
}
}
@@ -188,12 +188,12 @@
** Returns void
**
*******************************************************************************/
-static int bta_ag_data_cback(UINT16 port_handle, void *p_data, UINT16 len, UINT16 handle)
+static int bta_ag_data_cback(uint16_t port_handle, void *p_data, uint16_t len, uint16_t handle)
{
UNUSED(port_handle);
/* call data call-out directly */
- bta_ag_co_tx_write(handle, (UINT8 *) p_data, len);
+ bta_ag_co_tx_write(handle, (uint8_t *) p_data, len);
return 0;
}
@@ -209,12 +209,12 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_mgmt_cback_1(UINT32 code, UINT16 handle) {bta_ag_mgmt_cback(code, handle, 1);}
-void bta_ag_mgmt_cback_2(UINT32 code, UINT16 handle) {bta_ag_mgmt_cback(code, handle, 2);}
-void bta_ag_mgmt_cback_3(UINT32 code, UINT16 handle) {bta_ag_mgmt_cback(code, handle, 3);}
-void bta_ag_port_cback_1(UINT32 code, UINT16 handle) {bta_ag_port_cback(code, handle, 1);}
-void bta_ag_port_cback_2(UINT32 code, UINT16 handle) {bta_ag_port_cback(code, handle, 2);}
-void bta_ag_port_cback_3(UINT32 code, UINT16 handle) {bta_ag_port_cback(code, handle, 3);}
+void bta_ag_mgmt_cback_1(uint32_t code, uint16_t handle) {bta_ag_mgmt_cback(code, handle, 1);}
+void bta_ag_mgmt_cback_2(uint32_t code, uint16_t handle) {bta_ag_mgmt_cback(code, handle, 2);}
+void bta_ag_mgmt_cback_3(uint32_t code, uint16_t handle) {bta_ag_mgmt_cback(code, handle, 3);}
+void bta_ag_port_cback_1(uint32_t code, uint16_t handle) {bta_ag_port_cback(code, handle, 1);}
+void bta_ag_port_cback_2(uint32_t code, uint16_t handle) {bta_ag_port_cback(code, handle, 2);}
+void bta_ag_port_cback_3(uint32_t code, uint16_t handle) {bta_ag_port_cback(code, handle, 3);}
/*******************************************************************************
**
@@ -227,15 +227,15 @@
** Returns void
**
*******************************************************************************/
-int bta_ag_data_cback_1(UINT16 port_handle, void *p_data, UINT16 len)
+int bta_ag_data_cback_1(uint16_t port_handle, void *p_data, uint16_t len)
{
return bta_ag_data_cback(port_handle, p_data, len, 1);
}
-int bta_ag_data_cback_2(UINT16 port_handle, void *p_data, UINT16 len)
+int bta_ag_data_cback_2(uint16_t port_handle, void *p_data, uint16_t len)
{
return bta_ag_data_cback(port_handle, p_data, len, 2);
}
-int bta_ag_data_cback_3(UINT16 port_handle, void *p_data, UINT16 len)
+int bta_ag_data_cback_3(uint16_t port_handle, void *p_data, uint16_t len)
{
return bta_ag_data_cback(port_handle, p_data, len, 3);
}
@@ -250,9 +250,9 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_setup_port(tBTA_AG_SCB *p_scb, UINT16 handle)
+void bta_ag_setup_port(tBTA_AG_SCB *p_scb, uint16_t handle)
{
- UINT16 i = bta_ag_scb_to_idx(p_scb) - 1;
+ uint16_t i = bta_ag_scb_to_idx(p_scb) - 1;
/* set up data callback if using pass through mode */
if (bta_ag_cb.parse_mode == BTA_AG_PASS_THROUGH)
@@ -285,11 +285,11 @@
/* if service is set in mask */
if (services & 1)
{
- BTM_SetSecurityLevel(FALSE, "", bta_ag_sec_id[i], p_scb->serv_sec_mask,
+ BTM_SetSecurityLevel(false, "", bta_ag_sec_id[i], p_scb->serv_sec_mask,
BT_PSM_RFCOMM, BTM_SEC_PROTO_RFCOMM, bta_ag_cb.profile[i].scn);
bta_ag_port_status = RFCOMM_CreateConnection(bta_ag_uuid[i], bta_ag_cb.profile[i].scn,
- TRUE, BTA_AG_MTU, (UINT8 *) bd_addr_any, &(p_scb->serv_handle[i]),
+ true, BTA_AG_MTU, (uint8_t *) bd_addr_any, &(p_scb->serv_handle[i]),
bta_ag_mgmt_cback_tbl[bta_ag_scb_to_idx(p_scb) - 1]);
if( bta_ag_port_status == PORT_SUCCESS )
@@ -335,21 +335,21 @@
**
** Function bta_ag_is_server_closed
**
-** Description Returns TRUE if all servers are closed.
+** Description Returns true if all servers are closed.
**
**
-** Returns TRUE if all servers are closed, FALSE otherwise
+** Returns true if all servers are closed, false otherwise
**
*******************************************************************************/
-BOOLEAN bta_ag_is_server_closed (tBTA_AG_SCB *p_scb)
+bool bta_ag_is_server_closed (tBTA_AG_SCB *p_scb)
{
- UINT8 xx;
- BOOLEAN is_closed = TRUE;
+ uint8_t xx;
+ bool is_closed = true;
for (xx = 0; xx < BTA_AG_NUM_IDX; xx++)
{
if (p_scb->serv_handle[xx] != 0)
- is_closed = FALSE;
+ is_closed = false;
}
return is_closed;
@@ -367,11 +367,11 @@
*******************************************************************************/
void bta_ag_rfc_do_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
- BTM_SetSecurityLevel(TRUE, "", bta_ag_sec_id[p_scb->conn_service],
+ BTM_SetSecurityLevel(true, "", bta_ag_sec_id[p_scb->conn_service],
p_scb->cli_sec_mask, BT_PSM_RFCOMM, BTM_SEC_PROTO_RFCOMM, p_scb->peer_scn);
if (RFCOMM_CreateConnection(bta_ag_uuid[p_scb->conn_service], p_scb->peer_scn,
- FALSE, BTA_AG_MTU, p_scb->peer_addr, &(p_scb->conn_handle),
+ false, BTA_AG_MTU, p_scb->peer_addr, &(p_scb->conn_handle),
bta_ag_mgmt_cback_tbl[bta_ag_scb_to_idx(p_scb) - 1]) == PORT_SUCCESS)
{
bta_ag_setup_port(p_scb, p_scb->conn_handle);
diff --git a/bta/ag/bta_ag_sco.c b/bta/ag/bta_ag_sco.c
index 2a5341b..fbbb1d7 100644
--- a/bta/ag/bta_ag_sco.c
+++ b/bta/ag/bta_ag_sco.c
@@ -26,7 +26,7 @@
#include "bta_api.h"
#include "bta_ag_api.h"
#include "bta_ag_co.h"
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
#include "bta_dm_co.h"
#endif
#include "bta_ag_int.h"
@@ -45,9 +45,9 @@
extern fixed_queue_t *btu_bta_alarm_queue;
-#if BTA_AG_SCO_DEBUG == TRUE
-static char *bta_ag_sco_evt_str(UINT8 event);
-static char *bta_ag_sco_state_str(UINT8 state);
+#if (BTA_AG_SCO_DEBUG == TRUE)
+static char *bta_ag_sco_evt_str(uint8_t event);
+static char *bta_ag_sco_state_str(uint8_t state);
#endif
#define BTA_AG_NO_EDR_ESCO (BTM_SCO_PKT_TYPES_MASK_NO_2_EV3 | \
@@ -61,7 +61,7 @@
BTA_AG_SCO_LISTEN_E, /* listen request */
BTA_AG_SCO_OPEN_E, /* open request */
BTA_AG_SCO_XFER_E, /* transfer request */
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
BTA_AG_SCO_CN_DONE_E, /* codec negotiation done */
BTA_AG_SCO_REOPEN_E, /* Retry with other codec when failed */
#endif
@@ -72,7 +72,7 @@
BTA_AG_SCO_CI_DATA_E /* SCO data ready */
};
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
#define BTA_AG_NUM_CODECS 3
#define BTA_AG_ESCO_SETTING_IDX_CVSD 0 /* eSCO setting for CVSD */
#define BTA_AG_ESCO_SETTING_IDX_T1 1 /* eSCO setting for mSBC T1 */
@@ -152,9 +152,9 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_sco_conn_cback(UINT16 sco_idx)
+static void bta_ag_sco_conn_cback(uint16_t sco_idx)
{
- UINT16 handle;
+ uint16_t handle;
tBTA_AG_SCB *p_scb;
/* match callback to scb; first check current sco scb */
@@ -195,9 +195,9 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_sco_disc_cback(UINT16 sco_idx)
+static void bta_ag_sco_disc_cback(uint16_t sco_idx)
{
- UINT16 handle = 0;
+ uint16_t handle = 0;
APPL_TRACE_DEBUG ("bta_ag_sco_disc_cback(): sco_idx: 0x%x p_cur_scb: 0x%08x sco.state: %d", sco_idx, bta_ag_cb.sco.p_curr_scb, bta_ag_cb.sco.state);
@@ -220,14 +220,14 @@
if (handle != 0)
{
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
- tBTM_STATUS status = BTM_ConfigScoPath(BTM_SCO_ROUTE_PCM, NULL, NULL, TRUE);
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
+ tBTM_STATUS status = BTM_ConfigScoPath(BTM_SCO_ROUTE_PCM, NULL, NULL, true);
APPL_TRACE_DEBUG("bta_ag_sco_disc_cback sco close config status = %d", status);
/* SCO clean up here */
bta_dm_sco_co_close();
#endif
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/* Restore settings */
if(bta_ag_cb.sco.p_curr_scb->inuse_codec == BTA_AG_CODEC_MSBC)
{
@@ -246,7 +246,7 @@
else
{
APPL_TRACE_DEBUG("Fallback to CVSD settings");
- bta_ag_cb.sco.p_curr_scb->codec_fallback = TRUE;
+ bta_ag_cb.sco.p_curr_scb->codec_fallback = true;
}
}
}
@@ -271,7 +271,7 @@
}
}
}
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_ag_sco_read_cback
@@ -282,7 +282,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_sco_read_cback (UINT16 sco_inx, BT_HDR *p_data, tBTM_SCO_DATA_FLAG status)
+static void bta_ag_sco_read_cback (uint16_t sco_inx, BT_HDR *p_data, tBTM_SCO_DATA_FLAG status)
{
if (status != BTM_SCO_DATA_CORRECT)
{
@@ -298,15 +298,15 @@
** Function bta_ag_remove_sco
**
** Description Removes the specified SCO from the system.
-** If only_active is TRUE, then SCO is only removed if connected
+** If only_active is true, then SCO is only removed if connected
**
-** Returns BOOLEAN - TRUE if Sco removal was started
+** Returns bool - true if Sco removal was started
**
*******************************************************************************/
-static BOOLEAN bta_ag_remove_sco(tBTA_AG_SCB *p_scb, BOOLEAN only_active)
+static bool bta_ag_remove_sco(tBTA_AG_SCB *p_scb, bool only_active)
{
- BOOLEAN removed_started = FALSE;
- tBTM_STATUS status;
+ bool removed_started = false;
+ tBTM_STATUS status;
if (p_scb->sco_idx != BTM_INVALID_SCO_INDEX)
{
@@ -321,7 +321,7 @@
/* Sco is connected; set current control block */
bta_ag_cb.sco.p_curr_scb = p_scb;
- removed_started = TRUE;
+ removed_started = true;
}
/* If no connection reset the sco handle */
else if ( (status == BTM_SUCCESS) || (status == BTM_UNKNOWN_ADDR) )
@@ -347,8 +347,8 @@
static void bta_ag_esco_connreq_cback(tBTM_ESCO_EVT event, tBTM_ESCO_EVT_DATA *p_data)
{
tBTA_AG_SCB *p_scb;
- UINT16 handle;
- UINT16 sco_inx = p_data->conn_evt.sco_inx;
+ uint16_t handle;
+ uint16_t sco_inx = p_data->conn_evt.sco_inx;
/* Only process connection requests */
if (event == BTM_ESCO_CONN_REQ_EVT)
@@ -375,7 +375,7 @@
bta_ag_cb.sco.conn_data = p_data->conn_evt;
bta_ag_cb.sco.state = BTA_AG_SCO_OPEN_XFER_ST;
- if (!bta_ag_remove_sco(bta_ag_cb.sco.p_curr_scb, TRUE))
+ if (!bta_ag_remove_sco(bta_ag_cb.sco.p_curr_scb, true))
{
APPL_TRACE_ERROR("bta_ag_esco_connreq_cback: Nothing to remove so accept Conn Request (sco_inx 0x%04x)", sco_inx);
bta_ag_cb.sco.p_xfer_scb = NULL;
@@ -412,7 +412,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_cback_sco(tBTA_AG_SCB *p_scb, UINT8 event)
+static void bta_ag_cback_sco(tBTA_AG_SCB *p_scb, uint8_t event)
{
tBTA_AG_HDR sco;
@@ -433,19 +433,19 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_create_sco(tBTA_AG_SCB *p_scb, BOOLEAN is_orig)
+static void bta_ag_create_sco(tBTA_AG_SCB *p_scb, bool is_orig)
{
tBTM_STATUS status;
- UINT8 *p_bd_addr = NULL;
+ uint8_t *p_bd_addr = NULL;
tBTM_ESCO_PARAMS params;
-#if (BTM_WBS_INCLUDED == TRUE )
- tBTA_AG_PEER_CODEC esco_codec = BTM_SCO_CODEC_CVSD;
+#if (BTM_WBS_INCLUDED == TRUE)
+ tBTA_AG_PEER_CODEC esco_codec = BTM_SCO_CODEC_CVSD;
int codec_index = 0;
#endif
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
tBTM_SCO_ROUTE_TYPE sco_route;
tBTA_CODEC_INFO codec_info = {BTA_SCO_CODEC_PCM};
- UINT32 pcm_sample_rate;
+ uint32_t pcm_sample_rate;
#endif
/* Make sure this sco handle is not already in use */
@@ -456,7 +456,7 @@
return;
}
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
if ((p_scb->sco_codec == BTM_SCO_CODEC_MSBC) &&
!p_scb->codec_fallback &&
!p_scb->retry_with_sco_only)
@@ -464,10 +464,10 @@
if (p_scb->codec_fallback)
{
- p_scb->codec_fallback = FALSE;
+ p_scb->codec_fallback = false;
/* Force AG to send +BCS for the next audio connection. */
- p_scb->codec_updated = TRUE;
+ p_scb->codec_updated = true;
}
/* If WBS included, use CVSD by default, index is 0 for CVSD by initialization */
@@ -519,20 +519,20 @@
if((params.packet_types & BTM_ESCO_LINK_ONLY_MASK)
||!((params.packet_types & ~(BTM_ESCO_LINK_ONLY_MASK | BTM_SCO_LINK_ONLY_MASK)) ^ BTA_AG_NO_EDR_ESCO))
{
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
if (esco_codec != BTA_AG_CODEC_MSBC)
{
- p_scb->retry_with_sco_only = TRUE;
- APPL_TRACE_API("Setting retry_with_sco_only to TRUE");
+ p_scb->retry_with_sco_only = true;
+ APPL_TRACE_API("Setting retry_with_sco_only to true");
}
else /* Do not use SCO when using mSBC */
{
- p_scb->retry_with_sco_only = FALSE;
- APPL_TRACE_API("Setting retry_with_sco_only to FALSE");
+ p_scb->retry_with_sco_only = false;
+ APPL_TRACE_API("Setting retry_with_sco_only to false");
}
#else
- p_scb->retry_with_sco_only = TRUE;
- APPL_TRACE_API("Setting retry_with_sco_only to TRUE");
+ p_scb->retry_with_sco_only = true;
+ APPL_TRACE_API("Setting retry_with_sco_only to true");
#endif
}
}
@@ -540,7 +540,7 @@
{
if(p_scb->retry_with_sco_only)
APPL_TRACE_API("retrying with SCO only");
- p_scb->retry_with_sco_only = FALSE;
+ p_scb->retry_with_sco_only = false;
BTM_SetEScoMode(BTM_LINK_TYPE_SCO, ¶ms);
}
@@ -550,7 +550,7 @@
/* tell sys to stop av if any */
bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/* Allow any platform specific pre-SCO set up to take place */
bta_ag_co_audio_state(bta_ag_scb_to_idx(p_scb), p_scb->app_id, SCO_STATE_SETUP,
esco_codec);
@@ -568,7 +568,7 @@
bta_ag_co_audio_state(bta_ag_scb_to_idx(p_scb), p_scb->app_id, SCO_STATE_SETUP);
#endif
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
#if (BTM_WBS_INCLUDED == TRUE)
if (esco_codec == BTA_AG_CODEC_MSBC)
pcm_sample_rate = BTA_DM_SCO_SAMP_RATE_16K;
@@ -580,14 +580,14 @@
#endif
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
/* initialize SCO setup, no voice setting for AG, data rate <==> sample rate */
- BTM_ConfigScoPath(sco_route, bta_ag_sco_read_cback, NULL, TRUE);
+ BTM_ConfigScoPath(sco_route, bta_ag_sco_read_cback, NULL, true);
#endif
bta_ag_cb.sco.cur_idx = p_scb->sco_idx;
}
else
- p_scb->retry_with_sco_only = FALSE;
+ p_scb->retry_with_sco_only = false;
p_bd_addr = p_scb->peer_addr;
@@ -610,7 +610,7 @@
is_orig, p_scb->sco_idx, status, params.packet_types);
}
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_ag_attempt_msbc_safe_settings
@@ -618,16 +618,16 @@
** Description Checks if ESCO connection needs to be attempted using mSBC T1(safe) settings
**
**
-** Returns TRUE if T1 settings has to be used, FALSE otherwise
+** Returns true if T1 settings has to be used, false otherwise
**
*******************************************************************************/
-BOOLEAN bta_ag_attempt_msbc_safe_settings(tBTA_AG_SCB *p_scb)
+bool bta_ag_attempt_msbc_safe_settings(tBTA_AG_SCB *p_scb)
{
if (p_scb->svc_conn && p_scb->sco_codec == BTM_SCO_CODEC_MSBC &&
p_scb->codec_msbc_settings == BTA_AG_SCO_MSBC_SETTINGS_T1)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
}
/*******************************************************************************
@@ -645,7 +645,7 @@
tBTA_AG_SCB *p_scb = (tBTA_AG_SCB *)data;
/* Announce that codec negotiation failed. */
- bta_ag_sco_codec_nego(p_scb, FALSE);
+ bta_ag_sco_codec_nego(p_scb, false);
/* call app callback */
bta_ag_cback_sco(p_scb, BTA_AG_AUDIO_CLOSE_EVT);
@@ -686,10 +686,10 @@
{
/* use same codec type as previous SCO connection, skip codec negotiation */
APPL_TRACE_DEBUG("use same codec type as previous SCO connection,skip codec negotiation");
- bta_ag_sco_codec_nego(p_scb, TRUE);
+ bta_ag_sco_codec_nego(p_scb, true);
}
}
-#endif /* (BTM_WBS_INCLUDED == TRUE ) */
+#endif /* (BTM_WBS_INCLUDED == TRUE) */
/*******************************************************************************
**
@@ -701,17 +701,17 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_sco_event(tBTA_AG_SCB *p_scb, UINT8 event)
+static void bta_ag_sco_event(tBTA_AG_SCB *p_scb, uint8_t event)
{
tBTA_AG_SCO_CB *p_sco = &bta_ag_cb.sco;
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
tBTA_AG_SCB *p_cn_scb = NULL; /* For codec negotiation */
#endif
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
BT_HDR *p_buf;
#endif
-#if BTA_AG_SCO_DEBUG == TRUE
- UINT8 in_state = p_sco->state;
+#if (BTA_AG_SCO_DEBUG == TRUE)
+ uint8_t in_state = p_sco->state;
APPL_TRACE_EVENT("BTA ag sco evt (hdl 0x%04x): State %d (%s), Event %d (%s)",
p_scb->sco_idx,
@@ -722,10 +722,10 @@
p_scb->sco_idx, p_sco->state, event);
#endif
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
if (event == BTA_AG_SCO_CI_DATA_E)
{
- while (TRUE)
+ while (true)
{
bta_dm_sco_co_out_data(&p_buf);
if (p_buf)
@@ -750,7 +750,7 @@
{
case BTA_AG_SCO_LISTEN_E:
/* create sco listen connection */
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
p_sco->state = BTA_AG_SCO_LISTEN_ST;
break;
@@ -765,27 +765,27 @@
{
case BTA_AG_SCO_LISTEN_E:
/* create sco listen connection (Additional channel) */
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
break;
case BTA_AG_SCO_OPEN_E:
/* remove listening connection */
- bta_ag_remove_sco(p_scb, FALSE);
+ bta_ag_remove_sco(p_scb, false);
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/* start codec negotiation */
p_sco->state = BTA_AG_SCO_CODEC_ST;
p_cn_scb = p_scb;
#else
/* create sco connection to peer */
- bta_ag_create_sco(p_scb, TRUE);
+ bta_ag_create_sco(p_scb, true);
p_sco->state = BTA_AG_SCO_OPENING_ST;
#endif
break;
case BTA_AG_SCO_SHUTDOWN_E:
/* remove listening connection */
- bta_ag_remove_sco(p_scb, FALSE);
+ bta_ag_remove_sco(p_scb, false);
if (p_scb == p_sco->p_curr_scb)
p_sco->p_curr_scb = NULL;
@@ -805,7 +805,7 @@
case BTA_AG_SCO_CONN_CLOSE_E:
/* sco failed; create sco listen connection */
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
p_sco->state = BTA_AG_SCO_LISTEN_ST;
break;
@@ -815,18 +815,18 @@
}
break;
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
case BTA_AG_SCO_CODEC_ST:
switch (event)
{
case BTA_AG_SCO_LISTEN_E:
/* create sco listen connection (Additional channel) */
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
break;
case BTA_AG_SCO_CN_DONE_E:
/* create sco connection to peer */
- bta_ag_create_sco(p_scb, TRUE);
+ bta_ag_create_sco(p_scb, true);
p_sco->state = BTA_AG_SCO_OPENING_ST;
break;
@@ -838,7 +838,7 @@
case BTA_AG_SCO_SHUTDOWN_E:
/* remove listening connection */
- bta_ag_remove_sco(p_scb, FALSE);
+ bta_ag_remove_sco(p_scb, false);
if (p_scb == p_sco->p_curr_scb)
p_sco->p_curr_scb = NULL;
@@ -857,7 +857,7 @@
case BTA_AG_SCO_CONN_CLOSE_E:
/* sco failed; create sco listen connection */
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
p_sco->state = BTA_AG_SCO_LISTEN_ST;
break;
@@ -876,7 +876,7 @@
/* create sco listen connection (Additional channel) */
if (p_scb != p_sco->p_curr_scb)
{
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
}
break;
@@ -903,7 +903,7 @@
if (p_scb != p_sco->p_curr_scb)
{
/* remove listening connection */
- bta_ag_remove_sco(p_scb, FALSE);
+ bta_ag_remove_sco(p_scb, false);
}
else
p_sco->state = BTA_AG_SCO_SHUTTING_ST;
@@ -916,7 +916,7 @@
case BTA_AG_SCO_CONN_CLOSE_E:
/* sco failed; create sco listen connection */
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
p_sco->state = BTA_AG_SCO_LISTEN_ST;
break;
@@ -945,7 +945,7 @@
if (p_scb != p_sco->p_curr_scb)
{
/* remove listening connection */
- bta_ag_remove_sco(p_scb, FALSE);
+ bta_ag_remove_sco(p_scb, false);
}
else
p_sco->state = BTA_AG_SCO_SHUTTING_ST;
@@ -954,7 +954,7 @@
case BTA_AG_SCO_CONN_OPEN_E:
/* close sco connection */
- bta_ag_remove_sco(p_scb, TRUE);
+ bta_ag_remove_sco(p_scb, true);
p_sco->state = BTA_AG_SCO_CLOSING_ST;
break;
@@ -976,14 +976,14 @@
{
case BTA_AG_SCO_CLOSE_E:
/* close sco connection */
- bta_ag_remove_sco(p_scb, TRUE);
+ bta_ag_remove_sco(p_scb, true);
p_sco->state = BTA_AG_SCO_CLOSING_ST;
break;
case BTA_AG_SCO_SHUTDOWN_E:
/* remove all connection */
- bta_ag_remove_sco(p_scb, FALSE);
+ bta_ag_remove_sco(p_scb, false);
p_sco->state = BTA_AG_SCO_SHUTTING_ST;
break;
@@ -991,7 +991,7 @@
case BTA_AG_SCO_CONN_CLOSE_E:
/* closed sco; place in listen mode and
accept the transferred connection */
- bta_ag_create_sco(p_scb, FALSE); /* Back into listen mode */
+ bta_ag_create_sco(p_scb, false); /* Back into listen mode */
/* Accept sco connection with xfer scb */
bta_ag_sco_conn_rsp(p_sco->p_xfer_scb, &p_sco->conn_data);
@@ -1015,13 +1015,13 @@
/* create sco listen connection (Additional channel) */
if (p_scb != p_sco->p_curr_scb)
{
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
}
break;
case BTA_AG_SCO_XFER_E:
/* close current sco connection */
- bta_ag_remove_sco(p_sco->p_curr_scb, TRUE);
+ bta_ag_remove_sco(p_sco->p_curr_scb, true);
/* save xfer scb */
p_sco->p_xfer_scb = p_scb;
@@ -1031,7 +1031,7 @@
case BTA_AG_SCO_CLOSE_E:
/* close sco connection if active */
- if (bta_ag_remove_sco(p_scb, TRUE))
+ if (bta_ag_remove_sco(p_scb, true))
{
p_sco->state = BTA_AG_SCO_CLOSING_ST;
}
@@ -1039,7 +1039,7 @@
case BTA_AG_SCO_SHUTDOWN_E:
/* remove all listening connections */
- bta_ag_remove_sco(p_scb, FALSE);
+ bta_ag_remove_sco(p_scb, false);
/* If SCO was active on this scb, close it */
if (p_scb == p_sco->p_curr_scb)
@@ -1050,7 +1050,7 @@
case BTA_AG_SCO_CONN_CLOSE_E:
/* peer closed sco; create sco listen connection */
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
p_sco->state = BTA_AG_SCO_LISTEN_ST;
break;
@@ -1067,7 +1067,7 @@
/* create sco listen connection (Additional channel) */
if (p_scb != p_sco->p_curr_scb)
{
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
}
break;
@@ -1087,7 +1087,7 @@
if (p_scb != p_sco->p_curr_scb)
{
/* remove listening connection */
- bta_ag_remove_sco(p_scb, FALSE);
+ bta_ag_remove_sco(p_scb, false);
}
else
p_sco->state = BTA_AG_SCO_SHUTTING_ST;
@@ -1096,7 +1096,7 @@
case BTA_AG_SCO_CONN_CLOSE_E:
/* peer closed sco; create sco listen connection */
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
p_sco->state = BTA_AG_SCO_LISTEN_ST;
break;
@@ -1119,13 +1119,13 @@
break;
case BTA_AG_SCO_CONN_CLOSE_E:
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/* start codec negotiation */
p_sco->state = BTA_AG_SCO_CODEC_ST;
p_cn_scb = p_scb;
#else
/* open sco connection */
- bta_ag_create_sco(p_scb, TRUE);
+ bta_ag_create_sco(p_scb, true);
p_sco->state = BTA_AG_SCO_OPENING_ST;
#endif
break;
@@ -1134,7 +1134,7 @@
/* create sco listen connection (Additional channel) */
if (p_scb != p_sco->p_curr_scb)
{
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
}
break;
@@ -1150,7 +1150,7 @@
case BTA_AG_SCO_CONN_OPEN_E:
/* close sco connection so headset can be transferred
Probably entered this state from "opening state" */
- bta_ag_remove_sco(p_scb, TRUE);
+ bta_ag_remove_sco(p_scb, true);
break;
case BTA_AG_SCO_CLOSE_E:
@@ -1171,17 +1171,17 @@
/* closed sco; place old sco in listen mode,
take current sco out of listen, and
create originating sco for current */
- bta_ag_create_sco(p_scb, FALSE);
- bta_ag_remove_sco(p_sco->p_xfer_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
+ bta_ag_remove_sco(p_sco->p_xfer_scb, false);
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/* start codec negotiation */
p_sco->state = BTA_AG_SCO_CODEC_ST;
p_cn_scb = p_sco->p_xfer_scb;
p_sco->p_xfer_scb = NULL;
#else
/* create sco connection to peer */
- bta_ag_create_sco(p_sco->p_xfer_scb, TRUE);
+ bta_ag_create_sco(p_sco->p_xfer_scb, true);
p_sco->p_xfer_scb = NULL;
p_sco->state = BTA_AG_SCO_OPENING_ST;
#endif
@@ -1198,7 +1198,7 @@
{
case BTA_AG_SCO_CONN_OPEN_E:
/* close sco connection; wait for conn close event */
- bta_ag_remove_sco(p_scb, TRUE);
+ bta_ag_remove_sco(p_scb, true);
break;
case BTA_AG_SCO_CONN_CLOSE_E:
@@ -1216,7 +1216,7 @@
then create listen sco connection for it as scb still open */
if (bta_ag_scb_open(p_scb))
{
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
p_sco->state = BTA_AG_SCO_LISTEN_ST;
}
@@ -1231,7 +1231,7 @@
/* create sco listen connection (Additional channel) */
if (p_scb != p_sco->p_curr_scb)
{
- bta_ag_create_sco(p_scb, FALSE);
+ bta_ag_create_sco(p_scb, false);
}
break;
@@ -1261,7 +1261,7 @@
default:
break;
}
-#if BTA_AG_SCO_DEBUG == TRUE
+#if (BTA_AG_SCO_DEBUG == TRUE)
if (p_sco->state != in_state)
{
APPL_TRACE_EVENT("BTA AG SCO State Change: [%s] -> [%s] after Event [%s]",
@@ -1271,7 +1271,7 @@
}
#endif
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
if (p_cn_scb)
{
bta_ag_codec_negotiate(p_cn_scb);
@@ -1286,10 +1286,10 @@
** Description Check if sco is open for this scb.
**
**
-** Returns TRUE if sco open for this scb, FALSE otherwise.
+** Returns true if sco open for this scb, false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_ag_sco_is_open(tBTA_AG_SCB *p_scb)
+bool bta_ag_sco_is_open(tBTA_AG_SCB *p_scb)
{
return ((bta_ag_cb.sco.state == BTA_AG_SCO_OPEN_ST) &&
(bta_ag_cb.sco.p_curr_scb == p_scb));
@@ -1302,12 +1302,12 @@
** Description Check if sco is in Opening state.
**
**
-** Returns TRUE if sco is in Opening state for this scb, FALSE otherwise.
+** Returns true if sco is in Opening state for this scb, false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_ag_sco_is_opening(tBTA_AG_SCB *p_scb)
+bool bta_ag_sco_is_opening(tBTA_AG_SCB *p_scb)
{
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
return (((bta_ag_cb.sco.state == BTA_AG_SCO_OPENING_ST) ||
(bta_ag_cb.sco.state == BTA_AG_SCO_OPENING_ST)) &&
(bta_ag_cb.sco.p_curr_scb == p_scb));
@@ -1345,7 +1345,7 @@
*******************************************************************************/
void bta_ag_sco_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
- UINT8 event;
+ uint8_t event;
UNUSED(p_data);
/* if another scb using sco, this is a transfer */
@@ -1377,7 +1377,7 @@
UNUSED(p_data);
/* if scb is in use */
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/* sco_idx is not allocated in SCO_CODEC_ST, we still need to move to listening state. */
if ((p_scb->sco_idx != BTM_INVALID_SCO_INDEX) || (bta_ag_cb.sco.state == BTA_AG_SCO_CODEC_ST))
#else
@@ -1389,7 +1389,7 @@
}
}
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/*******************************************************************************
**
@@ -1401,12 +1401,12 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_sco_codec_nego(tBTA_AG_SCB *p_scb, BOOLEAN result)
+void bta_ag_sco_codec_nego(tBTA_AG_SCB *p_scb, bool result)
{
- if(result == TRUE)
+ if(result == true)
{
/* Subsequent sco connection will skip codec negotiation */
- p_scb->codec_updated = FALSE;
+ p_scb->codec_updated = false;
bta_ag_sco_event(p_scb, BTA_AG_SCO_CN_DONE_E);
}
@@ -1457,7 +1457,7 @@
bta_ag_co_audio_state(bta_ag_scb_to_idx(p_scb), p_scb->app_id, SCO_STATE_ON);
#endif
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
/* open SCO codec if SCO is routed through transport */
bta_dm_sco_co_open(bta_ag_scb_to_idx(p_scb), BTA_SCO_OUT_PKT_SIZE, BTA_AG_CI_SCO_DATA_EVT);
#endif
@@ -1465,7 +1465,7 @@
/* call app callback */
bta_ag_cback_sco(p_scb, BTA_AG_AUDIO_OPEN_EVT);
- p_scb->retry_with_sco_only = FALSE;
+ p_scb->retry_with_sco_only = false;
#if (BTM_WBS_INCLUDED == TRUE)
/* reset to mSBC T2 settings as the preferred */
p_scb->codec_msbc_settings = BTA_AG_SCO_MSBC_SETTINGS_T2;
@@ -1484,7 +1484,7 @@
*******************************************************************************/
void bta_ag_sco_conn_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
- UINT16 handle = bta_ag_scb_to_idx(p_scb);
+ uint16_t handle = bta_ag_scb_to_idx(p_scb);
UNUSED(p_data);
/* clear current scb */
@@ -1502,14 +1502,14 @@
else if (p_scb->retry_with_sco_only && p_scb->svc_conn)
{
/* retry_with_sco_only is set when AG is initiator and connection failed for eSCO */
- bta_ag_create_sco(p_scb, TRUE);
+ bta_ag_create_sco(p_scb, true);
}
#else
/* retry_with_sco_only, will be set only when AG is initiator
** and AG is first trying to establish an eSCO connection */
if (p_scb->retry_with_sco_only && p_scb->svc_conn)
{
- bta_ag_create_sco(p_scb, TRUE);
+ bta_ag_create_sco(p_scb, true);
}
#endif
else
@@ -1540,7 +1540,7 @@
p_scb->codec_msbc_settings = BTA_AG_SCO_MSBC_SETTINGS_T2;
#endif
}
- p_scb->retry_with_sco_only = FALSE;
+ p_scb->retry_with_sco_only = false;
}
/*******************************************************************************
@@ -1556,10 +1556,10 @@
void bta_ag_sco_conn_rsp(tBTA_AG_SCB *p_scb, tBTM_ESCO_CONN_REQ_EVT_DATA *p_data)
{
tBTM_ESCO_PARAMS resp;
- UINT8 hci_status = HCI_SUCCESS;
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+ uint8_t hci_status = HCI_SUCCESS;
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
tBTA_CODEC_INFO codec_info = {BTA_SCO_CODEC_PCM};
- UINT32 pcm_sample_rate;
+ uint32_t pcm_sample_rate;
#endif
if (bta_ag_cb.sco.state == BTA_AG_SCO_LISTEN_ST ||
@@ -1598,7 +1598,7 @@
/* tell sys to stop av if any */
bta_sys_sco_use(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
-#if (BTM_WBS_INCLUDED == FALSE )
+#if (BTM_WBS_INCLUDED == FALSE)
/* Allow any platform specific pre-SCO set up to take place */
bta_ag_co_audio_state(bta_ag_scb_to_idx(p_scb), p_scb->app_id, SCO_STATE_SETUP);
#else
@@ -1608,18 +1608,18 @@
BTA_AG_CODEC_CVSD);
#endif
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
pcm_sample_rate = BTA_DM_SCO_SAMP_RATE_8K;
/* initialize SCO setup, no voice setting for AG, data rate <==> sample rate */
BTM_ConfigScoPath(bta_dm_sco_co_init(pcm_sample_rate, pcm_sample_rate, &codec_info, p_scb->app_id),
- bta_ag_sco_read_cback, NULL, TRUE);
+ bta_ag_sco_read_cback, NULL, true);
#endif
}
else
hci_status = HCI_ERR_HOST_REJECT_DEVICE;
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
/* If SCO open was initiated from HS, it must be CVSD */
p_scb->inuse_codec = BTA_AG_CODEC_NONE;
#endif
@@ -1642,7 +1642,7 @@
UNUSED(p_scb);
UNUSED(p_data);
-#if (BTM_SCO_HCI_INCLUDED == TRUE )
+#if (BTM_SCO_HCI_INCLUDED == TRUE)
bta_ag_sco_event(p_scb, BTA_AG_SCO_CI_DATA_E);
#endif
}
@@ -1657,16 +1657,16 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_set_esco_param(BOOLEAN set_reset, tBTM_ESCO_PARAMS *param)
+void bta_ag_set_esco_param(bool set_reset, tBTM_ESCO_PARAMS *param)
{
- if(set_reset == FALSE) /* reset the parameters to default */
+ if(set_reset == false) /* reset the parameters to default */
{
- bta_ag_cb.sco.param_updated = FALSE;
+ bta_ag_cb.sco.param_updated = false;
APPL_TRACE_DEBUG("bta_ag_set_esco_param : Resetting ESCO parameters to default");
}
else
{
- bta_ag_cb.sco.param_updated = TRUE;
+ bta_ag_cb.sco.param_updated = true;
bta_ag_cb.sco.params = *param;
APPL_TRACE_DEBUG("bta_ag_set_esco_param : Setting ESCO parameters");
}
@@ -1676,8 +1676,8 @@
** Debugging functions
*******************************************************************************/
-#if BTA_AG_SCO_DEBUG == TRUE
-static char *bta_ag_sco_evt_str(UINT8 event)
+#if (BTA_AG_SCO_DEBUG == TRUE)
+static char *bta_ag_sco_evt_str(uint8_t event)
{
switch (event)
{
@@ -1687,7 +1687,7 @@
return "Open Request";
case BTA_AG_SCO_XFER_E:
return "Transfer Request";
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
case BTA_AG_SCO_CN_DONE_E:
return "Codec Negotiation Done";
case BTA_AG_SCO_REOPEN_E:
@@ -1708,7 +1708,7 @@
}
}
-static char *bta_ag_sco_state_str(UINT8 state)
+static char *bta_ag_sco_state_str(uint8_t state)
{
switch (state)
{
@@ -1716,7 +1716,7 @@
return "Shutdown";
case BTA_AG_SCO_LISTEN_ST:
return "Listening";
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
case BTA_AG_SCO_CODEC_ST:
return "Codec Negotiation";
#endif
diff --git a/bta/ag/bta_ag_sdp.c b/bta/ag/bta_ag_sdp.c
index cb5bd80..e503e76 100644
--- a/bta/ag/bta_ag_sdp.c
+++ b/bta/ag/bta_ag_sdp.c
@@ -45,9 +45,9 @@
#endif
/* declare sdp callback functions */
-void bta_ag_sdp_cback_1(UINT16 status);
-void bta_ag_sdp_cback_2(UINT16 status);
-void bta_ag_sdp_cback_3(UINT16 status);
+void bta_ag_sdp_cback_1(uint16_t status);
+void bta_ag_sdp_cback_2(uint16_t status);
+void bta_ag_sdp_cback_3(uint16_t status);
/* SDP callback function table */
typedef tSDP_DISC_CMPL_CB *tBTA_AG_SDP_CBACK;
@@ -68,12 +68,12 @@
** Returns void
**
*******************************************************************************/
-static void bta_ag_sdp_cback(UINT16 status, UINT8 idx)
+static void bta_ag_sdp_cback(uint16_t status, uint8_t idx)
{
- UINT16 event;
+ uint16_t event;
tBTA_AG_SCB *p_scb;
- APPL_TRACE_DEBUG("bta_ag_sdp_cback status:0x%x", status);
+ APPL_TRACE_DEBUG("%s status:0x%x", __func__, status);
if ((p_scb = bta_ag_scb_by_idx(idx)) != NULL)
{
@@ -108,9 +108,9 @@
** Returns void
**
*******************************************************************************/
-void bta_ag_sdp_cback_1(UINT16 status) {bta_ag_sdp_cback(status, 1);}
-void bta_ag_sdp_cback_2(UINT16 status) {bta_ag_sdp_cback(status, 2);}
-void bta_ag_sdp_cback_3(UINT16 status) {bta_ag_sdp_cback(status, 3);}
+void bta_ag_sdp_cback_1(uint16_t status) {bta_ag_sdp_cback(status, 1);}
+void bta_ag_sdp_cback_2(uint16_t status) {bta_ag_sdp_cback(status, 2);}
+void bta_ag_sdp_cback_3(uint16_t status) {bta_ag_sdp_cback(status, 3);}
/******************************************************************************
**
@@ -121,24 +121,24 @@
** calling this function the application must call
** SDP_CreateRecord() to create an SDP record.
**
-** Returns TRUE if function execution succeeded,
-** FALSE if function execution failed.
+** Returns true if function execution succeeded,
+** false if function execution failed.
**
******************************************************************************/
-BOOLEAN bta_ag_add_record(UINT16 service_uuid, char *p_service_name, UINT8 scn,
- tBTA_AG_FEAT features, UINT32 sdp_handle)
+bool bta_ag_add_record(uint16_t service_uuid, char *p_service_name, uint8_t scn,
+ tBTA_AG_FEAT features, uint32_t sdp_handle)
{
tSDP_PROTOCOL_ELEM proto_elem_list[BTA_AG_NUM_PROTO_ELEMS];
- UINT16 svc_class_id_list[BTA_AG_NUM_SVC_ELEMS];
- UINT16 browse_list[] = {UUID_SERVCLASS_PUBLIC_BROWSE_GROUP};
- UINT16 version;
- UINT16 profile_uuid;
- UINT8 network;
- BOOLEAN result = TRUE;
- BOOLEAN codec_supported = FALSE;
- UINT8 buf[2];
+ uint16_t svc_class_id_list[BTA_AG_NUM_SVC_ELEMS];
+ uint16_t browse_list[] = {UUID_SERVCLASS_PUBLIC_BROWSE_GROUP};
+ uint16_t version;
+ uint16_t profile_uuid;
+ uint8_t network;
+ bool result = true;
+ bool codec_supported = false;
+ uint8_t buf[2];
- APPL_TRACE_DEBUG("bta_ag_add_record uuid: %x", service_uuid);
+ APPL_TRACE_DEBUG("%s uuid: %x", __func__, service_uuid);
memset( proto_elem_list, 0 , BTA_AG_NUM_PROTO_ELEMS*sizeof(tSDP_PROTOCOL_ELEM));
@@ -172,7 +172,7 @@
if (p_service_name != NULL && p_service_name[0] != 0)
{
result &= SDP_AddAttribute(sdp_handle, ATTR_ID_SERVICE_NAME, TEXT_STR_DESC_TYPE,
- (UINT32)(strlen(p_service_name)+1), (UINT8 *) p_service_name);
+ (uint32_t)(strlen(p_service_name)+1), (uint8_t *) p_service_name);
}
/* add features and network */
@@ -183,7 +183,7 @@
UINT_DESC_TYPE, 1, &network);
if (features & BTA_AG_FEAT_CODEC)
- codec_supported = TRUE;
+ codec_supported = true;
features &= BTA_AG_SDP_FEAT_SPEC;
@@ -265,7 +265,7 @@
continue;
}
- if (p->in_use && p->dealloc == FALSE)
+ if (p->in_use && p->dealloc == false)
{
others |= p->reg_services;
}
@@ -299,16 +299,16 @@
** for requested service.
**
**
-** Returns TRUE if results found, FALSE otherwise.
+** Returns true if results found, false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_ag_sdp_find_attr(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK service)
+bool bta_ag_sdp_find_attr(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK service)
{
tSDP_DISC_REC *p_rec = NULL;
tSDP_DISC_ATTR *p_attr;
tSDP_PROTOCOL_ELEM pe;
- UINT16 uuid;
- BOOLEAN result = FALSE;
+ uint16_t uuid;
+ bool result = false;
if (service & BTA_HFP_SERVICE_MASK)
{
@@ -326,7 +326,7 @@
}
/* loop through all records we found */
- while (TRUE)
+ while (true)
{
/* get next record; if none found, we're done */
if ((p_rec = SDP_FindServiceInDb(p_scb->p_disc_db, uuid, p_rec)) == NULL)
@@ -349,7 +349,7 @@
{
if (SDP_FindProtocolListElemInRec(p_rec, UUID_PROTOCOL_RFCOMM, &pe))
{
- p_scb->peer_scn = (UINT8) pe.params[0];
+ p_scb->peer_scn = (uint8_t) pe.params[0];
}
else
{
@@ -386,7 +386,7 @@
}
/* found what we needed */
- result = TRUE;
+ result = true;
break;
}
return result;
@@ -405,10 +405,10 @@
void bta_ag_do_disc(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK service)
{
tSDP_UUID uuid_list[2];
- UINT16 num_uuid = 1;
- UINT16 attr_list[4];
- UINT8 num_attr;
- BOOLEAN db_inited = FALSE;
+ uint16_t num_uuid = 1;
+ uint16_t attr_list[4];
+ uint8_t num_attr;
+ bool db_inited = false;
/* HFP initiator; get proto list and features */
if (service & BTA_HFP_SERVICE_MASK && p_scb->role == BTA_AG_INT)
diff --git a/bta/ar/bta_ar.c b/bta/ar/bta_ar.c
index 21d89c7..2464620 100644
--- a/bta/ar/bta_ar.c
+++ b/bta/ar/bta_ar.c
@@ -41,9 +41,9 @@
** Returns void
**
*******************************************************************************/
-static UINT8 bta_ar_id(tBTA_SYS_ID sys_id)
+static uint8_t bta_ar_id(tBTA_SYS_ID sys_id)
{
- UINT8 mask = 0;
+ uint8_t mask = 0;
if (sys_id == BTA_ID_AV)
{
mask = BTA_AR_AV_MASK;
@@ -80,7 +80,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_ar_avdt_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data)
+static void bta_ar_avdt_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data)
{
/* route the AVDT registration callback to av or avk */
if (bta_ar_cb.p_av_conn_cback)
@@ -100,7 +100,7 @@
*******************************************************************************/
void bta_ar_reg_avdt(tAVDT_REG *p_reg, tAVDT_CTRL_CBACK *p_cback, tBTA_SYS_ID sys_id)
{
- UINT8 mask = 0;
+ uint8_t mask = 0;
if (sys_id == BTA_ID_AV)
{
@@ -140,7 +140,7 @@
*******************************************************************************/
void bta_ar_dereg_avdt(tBTA_SYS_ID sys_id)
{
- UINT8 mask = 0;
+ uint8_t mask = 0;
if (sys_id == BTA_ID_AV)
{
@@ -172,7 +172,7 @@
*******************************************************************************/
void bta_ar_avdt_conn(tBTA_SYS_ID sys_id, BD_ADDR bd_addr)
{
- UINT8 event = BTA_AR_AVDT_CONN_EVT;
+ uint8_t event = BTA_AR_AVDT_CONN_EVT;
tAVDT_CTRL data;
if (sys_id == BTA_ID_AV)
@@ -200,9 +200,9 @@
** Returns void
**
*******************************************************************************/
-void bta_ar_reg_avct(UINT16 mtu, UINT16 mtu_br, UINT8 sec_mask, tBTA_SYS_ID sys_id)
+void bta_ar_reg_avct(uint16_t mtu, uint16_t mtu_br, uint8_t sec_mask, tBTA_SYS_ID sys_id)
{
- UINT8 mask = bta_ar_id (sys_id);
+ uint8_t mask = bta_ar_id (sys_id);
if (mask)
{
@@ -225,7 +225,7 @@
*******************************************************************************/
void bta_ar_dereg_avct(tBTA_SYS_ID sys_id)
{
- UINT8 mask = bta_ar_id (sys_id);
+ uint8_t mask = bta_ar_id (sys_id);
bta_ar_cb.avct_registered &= ~mask;
@@ -242,12 +242,12 @@
** Returns void
**
******************************************************************************/
-void bta_ar_reg_avrc(UINT16 service_uuid, char *service_name, char *provider_name,
- UINT16 categories, tBTA_SYS_ID sys_id, BOOLEAN browse_supported,
- UINT16 profile_version)
+void bta_ar_reg_avrc(uint16_t service_uuid, char *service_name, char *provider_name,
+ uint16_t categories, tBTA_SYS_ID sys_id, bool browse_supported,
+ uint16_t profile_version)
{
- UINT8 mask = bta_ar_id (sys_id);
- UINT8 temp[8], *p;
+ uint8_t mask = bta_ar_id (sys_id);
+ uint8_t temp[8], *p;
if (!mask || !categories)
return;
@@ -284,7 +284,7 @@
p = temp;
UINT16_TO_BE_STREAM(p, categories);
SDP_AddAttribute(bta_ar_cb.sdp_ct_handle, ATTR_ID_SUPPORTED_FEATURES, UINT_DESC_TYPE,
- (UINT32)2, (UINT8*)temp);
+ (uint32_t)2, (uint8_t*)temp);
}
}
}
@@ -298,11 +298,11 @@
** Returns void
**
******************************************************************************/
-void bta_ar_dereg_avrc(UINT16 service_uuid, tBTA_SYS_ID sys_id)
+void bta_ar_dereg_avrc(uint16_t service_uuid, tBTA_SYS_ID sys_id)
{
- UINT8 mask = bta_ar_id (sys_id);
- UINT16 categories = 0;
- UINT8 temp[8], *p;
+ uint8_t mask = bta_ar_id (sys_id);
+ uint16_t categories = 0;
+ uint8_t temp[8], *p;
if (!mask)
return;
@@ -336,7 +336,7 @@
p = temp;
UINT16_TO_BE_STREAM(p, categories);
SDP_AddAttribute(bta_ar_cb.sdp_ct_handle, ATTR_ID_SUPPORTED_FEATURES, UINT_DESC_TYPE,
- (UINT32)2, (UINT8*)temp);
+ (uint32_t)2, (uint8_t*)temp);
}
}
}
diff --git a/bta/ar/bta_ar_int.h b/bta/ar/bta_ar_int.h
index d230448..2c142fc 100644
--- a/bta/ar/bta_ar_int.h
+++ b/bta/ar/bta_ar_int.h
@@ -29,7 +29,7 @@
#ifndef BTA_AR_DEBUG
-#define BTA_AR_DEBUG FALSE
+#define BTA_AR_DEBUG TRUE
#endif
#define BTA_AR_AV_MASK 0x01
@@ -40,12 +40,12 @@
{
tAVDT_CTRL_CBACK *p_av_conn_cback; /* av connection callback function */
tAVDT_CTRL_CBACK *p_avk_conn_cback; /* avk connection callback function */
- UINT8 avdt_registered;
- UINT8 avct_registered;
- UINT32 sdp_tg_handle;
- UINT32 sdp_ct_handle;
- UINT16 ct_categories[2];
- UINT8 tg_registered;
+ uint8_t avdt_registered;
+ uint8_t avct_registered;
+ uint32_t sdp_tg_handle;
+ uint32_t sdp_ct_handle;
+ uint16_t ct_categories[2];
+ uint8_t tg_registered;
tBTA_AV_HNDL hndl; /* Handle associated with the stream that rejected the connection. */
} tBTA_AR_CB;
diff --git a/bta/av/bta_av_aact.c b/bta/av/bta_av_aact.c
index 6c5d874..f2b67c8 100644
--- a/bta/av/bta_av_aact.c
+++ b/bta/av/bta_av_aact.c
@@ -25,7 +25,7 @@
******************************************************************************/
#include "bt_target.h"
-#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE)
+#if (BTA_AV_INCLUDED == TRUE)
#include <assert.h>
#include <string.h>
@@ -39,7 +39,7 @@
#include "utl.h"
#include "vendor.h"
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
#include "bta_ar_api.h"
#endif
@@ -154,7 +154,7 @@
};
/* these tables translate AVDT events to SSM events */
-static const UINT16 bta_av_stream_evt_ok[] = {
+static const uint16_t bta_av_stream_evt_ok[] = {
BTA_AV_STR_DISC_OK_EVT, /* AVDT_DISCOVER_CFM_EVT */
BTA_AV_STR_GETCAP_OK_EVT, /* AVDT_GETCAP_CFM_EVT */
BTA_AV_STR_OPEN_OK_EVT, /* AVDT_OPEN_CFM_EVT */
@@ -181,7 +181,7 @@
0 /* AVDT_DELAY_REPORT_CFM_EVT */
};
-static const UINT16 bta_av_stream_evt_fail[] = {
+static const uint16_t bta_av_stream_evt_fail[] = {
BTA_AV_STR_DISC_FAIL_EVT, /* AVDT_DISCOVER_CFM_EVT */
BTA_AV_STR_GETCAP_FAIL_EVT, /* AVDT_GETCAP_CFM_EVT */
BTA_AV_STR_OPEN_FAIL_EVT, /* AVDT_OPEN_CFM_EVT */
@@ -208,20 +208,20 @@
0 /* AVDT_DELAY_REPORT_CFM_EVT */
};
-void bta_av_stream_data_cback(UINT8 handle, BT_HDR *p_pkt, UINT32 time_stamp, UINT8 m_pt);
-static void bta_av_stream0_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data);
-static void bta_av_stream1_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data);
+void bta_av_stream_data_cback(uint8_t handle, BT_HDR *p_pkt, uint32_t time_stamp, uint8_t m_pt);
+static void bta_av_stream0_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data);
+static void bta_av_stream1_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data);
#if BTA_AV_NUM_STRS > 2
-static void bta_av_stream2_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data);
+static void bta_av_stream2_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data);
#endif
#if BTA_AV_NUM_STRS > 3
-static void bta_av_stream3_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data);
+static void bta_av_stream3_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data);
#endif
#if BTA_AV_NUM_STRS > 4
-static void bta_av_stream4_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data);
+static void bta_av_stream4_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data);
#endif
#if BTA_AV_NUM_STRS > 5
-static void bta_av_stream5_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data);
+static void bta_av_stream5_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data);
#endif
/* the array of callback functions to receive events from AVDT control channel */
tAVDT_CTRL_CBACK * const bta_av_dt_cback[] =
@@ -250,7 +250,7 @@
**
** Returns void
***********************************************/
-static UINT8 bta_av_get_scb_handle(tBTA_AV_SCB *p_scb, UINT8 local_sep)
+static uint8_t bta_av_get_scb_handle(tBTA_AV_SCB *p_scb, uint8_t local_sep)
{
for (int i = 0; i < BTA_AV_MAX_SEPS; i++) {
if ((p_scb->seps[i].tsep == local_sep) &&
@@ -270,7 +270,7 @@
**
** Returns void
***********************************************/
-static UINT8 bta_av_get_scb_sep_type(tBTA_AV_SCB *p_scb, UINT8 tavdt_handle)
+static uint8_t bta_av_get_scb_sep_type(tBTA_AV_SCB *p_scb, uint8_t tavdt_handle)
{
for (int i = 0; i < BTA_AV_MAX_SEPS; i++) {
if (p_scb->seps[i].av_handle == tavdt_handle)
@@ -298,8 +298,8 @@
{
APPL_TRACE_ERROR("reset flags");
/* a new addr, reset the supported flags */
- p_scb->recfg_sup = TRUE;
- p_scb->suspend_sup = TRUE;
+ p_scb->recfg_sup = true;
+ p_scb->suspend_sup = true;
}
/* do this copy anyway, just in case the first addr matches
@@ -324,7 +324,7 @@
p_scb->role &= ~BTA_AV_ROLE_START_INT;
start.chnl = p_scb->chnl;
start.status = BTA_AV_FAIL;
- start.initiator = TRUE;
+ start.initiator = true;
start.hndl = p_scb->hndl;
(*bta_av_cb.p_cback)(BTA_AV_START_EVT, (tBTA_AV *) &start);
}
@@ -344,12 +344,12 @@
{
UNUSED(p_data);
- APPL_TRACE_DEBUG("bta_av_st_rc_timer rc_handle:%d, use_rc: %d",
+ APPL_TRACE_DEBUG("%s rc_handle:%d, use_rc: %d", __func__,
p_scb->rc_handle, p_scb->use_rc);
/* for outgoing RC connection as INT/CT */
if ((p_scb->rc_handle == BTA_AV_RC_HANDLE_NONE) &&
/* (bta_av_cb.features & BTA_AV_FEAT_RCCT) && */
- (p_scb->use_rc == TRUE || (p_scb->role & BTA_AV_ROLE_AD_ACP)))
+ (p_scb->use_rc == true || (p_scb->role & BTA_AV_ROLE_AD_ACP)))
{
if ((p_scb->wait & BTA_AV_WAIT_ROLE_SW_BITS) == 0) {
bta_sys_start_timer(p_scb->avrc_ct_timer, BTA_AV_RC_DISC_TIME_VAL,
@@ -368,16 +368,16 @@
** Description The function gets the capabilities of the next available
** stream found in the discovery results.
**
-** Returns TRUE if we sent request to AVDT, FALSE otherwise.
+** Returns true if we sent request to AVDT, false otherwise.
**
*******************************************************************************/
-static BOOLEAN bta_av_next_getcap(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
+static bool bta_av_next_getcap(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
int i;
tAVDT_GETCAP_REQ *p_req;
- BOOLEAN sent_cmd = FALSE;
- UINT16 uuid_int = p_scb->uuid_int;
- UINT8 sep_requested = 0;
+ bool sent_cmd = false;
+ uint16_t uuid_int = p_scb->uuid_int;
+ uint8_t sep_requested = 0;
if(uuid_int == UUID_SERVCLASS_AUDIO_SOURCE)
sep_requested = AVDT_TSEP_SNK;
@@ -387,7 +387,7 @@
for (i = p_scb->sep_info_idx; i < p_scb->num_seps; i++)
{
/* steam not in use, is a sink, and is the right media type (audio/video) */
- if ((p_scb->sep_info[i].in_use == FALSE) &&
+ if ((p_scb->sep_info[i].in_use == false) &&
(p_scb->sep_info[i].tsep == sep_requested) &&
(p_scb->sep_info[i].media_type == p_scb->media_type))
{
@@ -407,7 +407,7 @@
(*p_req)(p_scb->peer_addr,
p_scb->sep_info[i].seid,
p_scb->p_cap, bta_av_dt_cback[p_scb->hdi]);
- sent_cmd = TRUE;
+ sent_cmd = true;
break;
}
}
@@ -431,9 +431,9 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_proc_stream_evt(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data, int index)
+static void bta_av_proc_stream_evt(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data, int index)
{
- UINT16 sec_len = 0;
+ uint16_t sec_len = 0;
tBTA_AV_SCB *p_scb = bta_av_cb.p_scb[index];
if (p_data)
@@ -510,12 +510,12 @@
break;
case AVDT_SECURITY_IND_EVT:
- p_msg->msg.security_ind.p_data = (UINT8 *) (p_msg + 1);
+ p_msg->msg.security_ind.p_data = (uint8_t *) (p_msg + 1);
memcpy(p_msg->msg.security_ind.p_data, p_data->security_ind.p_data, sec_len);
break;
case AVDT_SECURITY_CFM_EVT:
- p_msg->msg.security_cfm.p_data = (UINT8 *) (p_msg + 1);
+ p_msg->msg.security_cfm.p_data = (uint8_t *) (p_msg + 1);
if (p_data->hdr.err_code == 0)
{
memcpy(p_msg->msg.security_cfm.p_data, p_data->security_cfm.p_data, sec_len);
@@ -542,9 +542,9 @@
p_msg->hdr.event = bta_av_stream_evt_fail[event];
}
- p_msg->initiator = FALSE;
+ p_msg->initiator = false;
if (event == AVDT_SUSPEND_CFM_EVT)
- p_msg->initiator = TRUE;
+ p_msg->initiator = true;
APPL_TRACE_VERBOSE("hndl:x%x", p_scb->hndl);
p_msg->hdr.layer_specific = p_scb->hndl;
@@ -575,12 +575,12 @@
** Returns void
**
*******************************************************************************/
-void bta_av_stream_data_cback(UINT8 handle, BT_HDR *p_pkt, UINT32 time_stamp, UINT8 m_pt)
+void bta_av_stream_data_cback(uint8_t handle, BT_HDR *p_pkt, uint32_t time_stamp, uint8_t m_pt)
{
int index = 0;
tBTA_AV_SCB *p_scb ;
APPL_TRACE_DEBUG("bta_av_stream_data_cback avdt_handle: %d pkt_len=0x%x ofst = 0x%x", handle,p_pkt->len,p_pkt->offset);
- APPL_TRACE_DEBUG(" Number of frames 0x%x",*((UINT8*)(p_pkt + 1) + p_pkt->offset));
+ APPL_TRACE_DEBUG(" Number of frames 0x%x",*((uint8_t*)(p_pkt + 1) + p_pkt->offset));
APPL_TRACE_DEBUG("Sequence Number 0x%x",p_pkt->layer_specific);
/* Get SCB and correct sep type*/
for(index = 0; index < BTA_AV_NUM_STRS;index ++ )
@@ -608,7 +608,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_stream0_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data)
+static void bta_av_stream0_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data)
{
APPL_TRACE_VERBOSE("bta_av_stream0_cback avdt_handle: %d event=0x%x", handle, event);
bta_av_proc_stream_evt(handle, bd_addr, event, p_data, 0);
@@ -623,7 +623,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_stream1_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data)
+static void bta_av_stream1_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data)
{
APPL_TRACE_EVENT("bta_av_stream1_cback avdt_handle: %d event=0x%x", handle, event);
bta_av_proc_stream_evt(handle, bd_addr, event, p_data, 1);
@@ -639,7 +639,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_stream2_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data)
+static void bta_av_stream2_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data)
{
APPL_TRACE_EVENT("bta_av_stream2_cback avdt_handle: %d event=0x%x", handle, event);
bta_av_proc_stream_evt(handle, bd_addr, event, p_data, 2);
@@ -656,7 +656,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_stream3_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data)
+static void bta_av_stream3_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data)
{
APPL_TRACE_EVENT("bta_av_stream3_cback avdt_handle: %d event=0x%x", handle, event);
bta_av_proc_stream_evt(handle, bd_addr, event, p_data, 3);
@@ -673,7 +673,7 @@
**
*******************************************************************************/
#if BTA_AV_NUM_STRS > 4
-static void bta_av_stream4_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data)
+static void bta_av_stream4_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data)
{
APPL_TRACE_EVENT("bta_av_stream4_cback avdt_handle: %d event=0x%x", handle, event);
bta_av_proc_stream_evt(handle, bd_addr, event, p_data, 4);
@@ -690,7 +690,7 @@
**
*******************************************************************************/
#if BTA_AV_NUM_STRS > 5
-static void bta_av_stream5_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data)
+static void bta_av_stream5_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data)
{
APPL_TRACE_EVENT("bta_av_stream5_cback avdt_handle: %d event=0x%x", handle, event);
bta_av_proc_stream_evt(handle, bd_addr, event, p_data, 5);
@@ -706,7 +706,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_a2d_sdp_cback(BOOLEAN found, tA2D_Service *p_service)
+static void bta_av_a2d_sdp_cback(bool found, tA2D_Service *p_service)
{
tBTA_AV_SCB *p_scb = bta_av_hndl_to_scb(bta_av_cb.handle);
@@ -738,7 +738,7 @@
** Returns
**
*******************************************************************************/
-static void bta_av_adjust_seps_idx(tBTA_AV_SCB *p_scb, UINT8 avdt_handle)
+static void bta_av_adjust_seps_idx(tBTA_AV_SCB *p_scb, uint8_t avdt_handle)
{
APPL_TRACE_DEBUG("bta_av_adjust_seps_idx codec_type: %d", p_scb->codec_type);
for (int i = 0; i < BTA_AV_MAX_SEPS; i++) {
@@ -821,13 +821,14 @@
*******************************************************************************/
void bta_av_role_res (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- BOOLEAN initiator = FALSE;
- tBTA_AV_START start;
- tBTA_AV_OPEN av_open;
+ bool initiator = false;
+ tBTA_AV_START start;
+ tBTA_AV_OPEN av_open;
- APPL_TRACE_DEBUG("bta_av_role_res q_tag:%d, wait:x%x, role:x%x", p_scb->q_tag, p_scb->wait, p_scb->role);
+ APPL_TRACE_DEBUG("%s q_tag:%d, wait:x%x, role:x%x", __func__,
+ p_scb->q_tag, p_scb->wait, p_scb->role);
if (p_scb->role & BTA_AV_ROLE_START_INT)
- initiator = TRUE;
+ initiator = true;
if (p_scb->q_tag == BTA_AV_Q_TAG_START)
{
@@ -915,12 +916,12 @@
*******************************************************************************/
void bta_av_do_disc_a2d (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- BOOLEAN ok_continue = FALSE;
+ bool ok_continue = false;
tA2D_SDP_DB_PARAMS db_params;
- UINT16 attr_list[] = {ATTR_ID_SERVICE_CLASS_ID_LIST,
+ uint16_t attr_list[] = {ATTR_ID_SERVICE_CLASS_ID_LIST,
ATTR_ID_PROTOCOL_DESC_LIST,
ATTR_ID_BT_PROFILE_DESC_LIST};
- UINT16 sdp_uuid = 0; /* UUID for which SDP has to be done */
+ uint16_t sdp_uuid = 0; /* UUID for which SDP has to be done */
APPL_TRACE_DEBUG("bta_av_do_disc_a2d use_rc: %d rs:%d, oc:%d",
p_data->api_open.use_rc, p_data->api_open.switch_res, bta_av_cb.audio_open_cnt);
@@ -939,7 +940,7 @@
}
else
{
- ok_continue = TRUE;
+ ok_continue = true;
}
break;
@@ -954,7 +955,7 @@
/* continue to open if link role is ok */
if (bta_av_link_role_ok(p_scb, A2D_SET_MULTL_BIT))
{
- ok_continue = TRUE;
+ ok_continue = true;
}
else
{
@@ -963,7 +964,7 @@
break;
case BTA_AV_RS_DONE:
- ok_continue = TRUE;
+ ok_continue = true;
break;
}
@@ -998,16 +999,16 @@
bta_sys_app_open(BTA_ID_AV, p_scb->app_id, p_scb->peer_addr);
- if (p_scb->skip_sdp == TRUE)
+ if (p_scb->skip_sdp == true)
{
tA2D_Service a2d_ser;
a2d_ser.avdt_version = AVDT_VERSION;
- p_scb->skip_sdp = FALSE;
+ p_scb->skip_sdp = false;
p_scb->uuid_int = p_data->api_open.uuid;
/* only one A2D find service is active at a time */
bta_av_cb.handle = p_scb->hndl;
APPL_TRACE_WARNING("%s: Skip Sdp for incoming A2dp connection", __func__);
- bta_av_a2d_sdp_cback(TRUE, &a2d_ser);
+ bta_av_a2d_sdp_cback(true, &a2d_ser);
return;
}
@@ -1019,7 +1020,7 @@
db_params.num_attr = 3;
db_params.p_attrs = attr_list;
p_scb->uuid_int = p_data->api_open.uuid;
- p_scb->sdp_discovery_started = TRUE;
+ p_scb->sdp_discovery_started = true;
if (p_scb->uuid_int == UUID_SERVCLASS_AUDIO_SINK)
sdp_uuid = UUID_SERVCLASS_AUDIO_SOURCE;
else if (p_scb->uuid_int == UUID_SERVCLASS_AUDIO_SOURCE)
@@ -1033,7 +1034,7 @@
/* when the code reaches here, either the DB is NULL
* or A2D_FindService is not successful */
- bta_av_a2d_sdp_cback(FALSE, NULL);
+ bta_av_a2d_sdp_cback(false, NULL);
}
/*******************************************************************************
@@ -1048,14 +1049,14 @@
void bta_av_cleanup(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
tBTA_AV_CONN_CHG msg;
- UINT8 role = BTA_AV_ROLE_AD_INT;
+ uint8_t role = BTA_AV_ROLE_AD_INT;
UNUSED(p_data);
APPL_TRACE_DEBUG("bta_av_cleanup");
/* free any buffers */
osi_free_and_reset((void **)&p_scb->p_cap);
- p_scb->sdp_discovery_started = FALSE;
+ p_scb->sdp_discovery_started = false;
p_scb->avdt_version = 0;
/* initialize some control block variables */
@@ -1063,8 +1064,8 @@
/* if de-registering shut everything down */
msg.hdr.layer_specific = p_scb->hndl;
- p_scb->started = FALSE;
- p_scb->cong = FALSE;
+ p_scb->started = false;
+ p_scb->cong = false;
p_scb->role = role;
p_scb->cur_psc_mask = 0;
p_scb->wait = 0;
@@ -1077,9 +1078,9 @@
tBTA_AV_STATUS status = BTA_AV_FAIL_STREAM;
(*bta_av_cb.p_cback)(BTA_AV_OFFLOAD_START_RSP_EVT, (tBTA_AV *)&status);
}
- p_scb->offload_start_pending = FALSE;
+ p_scb->offload_start_pending = false;
- p_scb->skip_sdp = FALSE;
+ p_scb->skip_sdp = false;
if (p_scb->deregistring)
{
/* remove stream */
@@ -1094,7 +1095,7 @@
else
{
/* report stream closed to main SM */
- msg.is_up = FALSE;
+ msg.is_up = false;
bdcpy(msg.peer_addr, p_scb->peer_addr);
bta_av_conn_chg((tBTA_AV_DATA *) &msg);
}
@@ -1112,7 +1113,7 @@
void bta_av_free_sdb(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
UNUSED(p_data);
- p_scb->sdp_discovery_started = FALSE;
+ p_scb->sdp_discovery_started = false;
}
/*******************************************************************************
@@ -1129,8 +1130,8 @@
tBTA_AV_CI_SETCONFIG setconfig;
tAVDT_SEP_INFO *p_info;
tAVDT_CFG *p_evt_cfg = &p_data->str_msg.cfg;
- UINT8 psc_mask = (p_evt_cfg->psc_mask | p_scb->cfg.psc_mask);
- UINT8 local_sep; /* sep type of local handle on which connection was received */
+ uint8_t psc_mask = (p_evt_cfg->psc_mask | p_scb->cfg.psc_mask);
+ uint8_t local_sep; /* sep type of local handle on which connection was received */
tBTA_AV_STR_MSG *p_msg = (tBTA_AV_STR_MSG *)p_data;
UNUSED(p_data);
@@ -1170,9 +1171,9 @@
p_scb->role |= BTA_AV_ROLE_AD_ACP;
p_scb->cur_psc_mask = p_evt_cfg->psc_mask;
if (bta_av_cb.features & BTA_AV_FEAT_RCTG)
- p_scb->use_rc = TRUE;
+ p_scb->use_rc = true;
else
- p_scb->use_rc = FALSE;
+ p_scb->use_rc = false;
p_scb->num_seps = 1;
p_scb->sep_info_idx = 0;
@@ -1223,7 +1224,7 @@
alarm_cancel(p_scb->avrc_ct_timer);
if (bta_av_cb.conn_lcb) {
- p_rcb = bta_av_get_rcb_by_shdl((UINT8)(p_scb->hdi + 1));
+ p_rcb = bta_av_get_rcb_by_shdl((uint8_t)(p_scb->hdi + 1));
if (p_rcb)
bta_av_del_rc(p_rcb);
AVDT_DisconnectReq(p_scb->peer_addr, bta_av_dt_cback[p_scb->hdi]);
@@ -1284,16 +1285,17 @@
*******************************************************************************/
void bta_av_setconfig_rsp (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- UINT8 num = p_data->ci_setconfig.num_seid + 1;
- UINT8 avdt_handle = p_data->ci_setconfig.avdt_handle;
- UINT8 *p_seid = p_data->ci_setconfig.p_seid;
+ uint8_t num = p_data->ci_setconfig.num_seid + 1;
+ uint8_t avdt_handle = p_data->ci_setconfig.avdt_handle;
+ uint8_t *p_seid = p_data->ci_setconfig.p_seid;
int i;
- UINT8 local_sep;
+ uint8_t local_sep;
/* we like this codec_type. find the sep_idx */
local_sep = bta_av_get_scb_sep_type(p_scb,avdt_handle);
bta_av_adjust_seps_idx(p_scb, avdt_handle);
- APPL_TRACE_DEBUG("bta_av_setconfig_rsp: sep_idx: %d cur_psc_mask:0x%x", p_scb->sep_idx, p_scb->cur_psc_mask);
+ APPL_TRACE_DEBUG("%s: sep_idx: %d cur_psc_mask:0x%x", __func__,
+ p_scb->sep_idx, p_scb->cur_psc_mask);
if ((AVDT_TSEP_SNK == local_sep) && (p_data->ci_setconfig.err_code == AVDT_SUCCESS) &&
(p_scb->seps[p_scb->sep_idx].p_app_data_cback != NULL)) {
@@ -1315,7 +1317,7 @@
p_scb->wait = BTA_AV_WAIT_ACP_CAPS_ON;
if(p_data->ci_setconfig.recfg_needed)
p_scb->role |= BTA_AV_ROLE_SUSPEND_OPT;
- APPL_TRACE_DEBUG("bta_av_setconfig_rsp recfg_needed:%d role:x%x num:%d",
+ APPL_TRACE_DEBUG("%s recfg_needed:%d role:x%x num:%d", __func__,
p_data->ci_setconfig.recfg_needed, p_scb->role, num);
/* callout module tells BTA the number of "good" SEPs and their SEIDs.
* getcap on these SEID */
@@ -1346,7 +1348,7 @@
{
APPL_TRACE_DEBUG("sep_info[%d] SEID: %d", i, p_seid[i-1]);
/* initialize the sep_info[] to get capabilities */
- p_scb->sep_info[i].in_use = FALSE;
+ p_scb->sep_info[i].in_use = false;
p_scb->sep_info[i].tsep = AVDT_TSEP_SNK;
p_scb->sep_info[i].media_type = p_scb->media_type;
p_scb->sep_info[i].seid = p_seid[i-1];
@@ -1376,17 +1378,17 @@
{
tBTA_AV_CONN_CHG msg;
tBTA_AV_OPEN open;
- UINT8 *p;
- UINT16 mtu;
+ uint8_t *p;
+ uint16_t mtu;
msg.hdr.layer_specific = p_scb->hndl;
- msg.is_up = TRUE;
+ msg.is_up = true;
bdcpy(msg.peer_addr, p_scb->peer_addr);
p_scb->l2c_cid = AVDT_GetL2CapChannel(p_scb->avdt_handle);
bta_av_conn_chg((tBTA_AV_DATA *) &msg);
/* set the congestion flag, so AV would not send media packets by accident */
- p_scb->cong = TRUE;
- p_scb->offload_start_pending = FALSE;
+ p_scb->cong = true;
+ p_scb->offload_start_pending = false;
p_scb->stream_mtu = p_data->str_msg.msg.open_ind.peer_mtu - AVDT_MEDIA_HDR_SIZE;
@@ -1398,7 +1400,7 @@
/* Set the media channel as medium priority */
L2CA_SetTxPriority(p_scb->l2c_cid, L2CAP_CHNL_PRIORITY_MEDIUM);
- L2CA_SetChnlFlushability (p_scb->l2c_cid, TRUE);
+ L2CA_SetChnlFlushability (p_scb->l2c_cid, true);
bta_sys_conn_open(BTA_ID_AV, p_scb->app_id, p_scb->peer_addr);
memset(&p_scb->q_info, 0, sizeof(tBTA_AV_Q_INFO));
@@ -1430,7 +1432,7 @@
if(HCI_EDR_ACL_3MPS_SUPPORTED(p))
open.edr |= BTA_AV_EDR_3MBPS;
}
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
bta_ar_avdt_conn(BTA_ID_AV, open.bd_addr);
#endif
if (p_scb->seps[p_scb->sep_idx].tsep == AVDT_TSEP_SRC )
@@ -1535,7 +1537,7 @@
alarm_cancel(bta_av_cb.link_signalling_timer);
/* close stream */
- p_scb->started = FALSE;
+ p_scb->started = false;
/* drop the buffers queued in L2CAP */
L2CA_FlushChannel (p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
@@ -1562,7 +1564,7 @@
{
UNUSED(p_data);
- p_scb->sdp_discovery_started = FALSE;
+ p_scb->sdp_discovery_started = false;
if (p_scb->coll_mask & BTA_AV_COLL_INC_TMR)
{
/* SNK initiated L2C connection while SRC was doing SDP. */
@@ -1588,7 +1590,7 @@
if (!p_scb->open_status)
p_scb->open_status = BTA_AV_FAIL_SDP;
- p_scb->sdp_discovery_started = FALSE;
+ p_scb->sdp_discovery_started = false;
bta_av_str_closed(p_scb, p_data);
}
@@ -1605,9 +1607,9 @@
*******************************************************************************/
void bta_av_disc_results (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- UINT8 num_snks = 0, num_srcs =0, i;
+ uint8_t num_snks = 0, num_srcs =0, i;
/* our uuid in case we initiate connection */
- UINT16 uuid_int = p_scb->uuid_int;
+ uint16_t uuid_int = p_scb->uuid_int;
APPL_TRACE_DEBUG(" initiator UUID 0x%x", uuid_int);
/* store number of stream endpoints returned */
@@ -1616,7 +1618,7 @@
for (i = 0; i < p_scb->num_seps; i++)
{
/* steam not in use, is a sink, and is audio */
- if ((p_scb->sep_info[i].in_use == FALSE) &&
+ if ((p_scb->sep_info[i].in_use == false) &&
(p_scb->sep_info[i].media_type == p_scb->media_type))
{
if((p_scb->sep_info[i].tsep == AVDT_TSEP_SNK) &&
@@ -1664,7 +1666,7 @@
*******************************************************************************/
void bta_av_disc_res_as_acp (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- UINT8 num_snks = 0, i;
+ uint8_t num_snks = 0, i;
/* store number of stream endpoints returned */
p_scb->num_seps = p_data->str_msg.msg.discover_cfm.num_seps;
@@ -1677,7 +1679,7 @@
if ((p_scb->sep_info[i].tsep == AVDT_TSEP_SNK) &&
(p_scb->sep_info[i].media_type == p_scb->media_type))
{
- p_scb->sep_info[i].in_use = FALSE;
+ p_scb->sep_info[i].in_use = false;
num_snks++;
}
}
@@ -1713,12 +1715,12 @@
*******************************************************************************/
void bta_av_save_caps(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- tAVDT_CFG cfg;
- tAVDT_SEP_INFO *p_info = &p_scb->sep_info[p_scb->sep_info_idx];
- UINT8 old_wait = p_scb->wait;
- BOOLEAN getcap_done = FALSE;
+ tAVDT_CFG cfg;
+ tAVDT_SEP_INFO *p_info = &p_scb->sep_info[p_scb->sep_info_idx];
+ uint8_t old_wait = p_scb->wait;
+ bool getcap_done = false;
- APPL_TRACE_DEBUG("bta_av_save_caps num_seps:%d sep_info_idx:%d wait:x%x",
+ APPL_TRACE_DEBUG("%s num_seps:%d sep_info_idx:%d wait:x%x", __func__,
p_scb->num_seps, p_scb->sep_info_idx, p_scb->wait);
memcpy(&cfg, p_scb->p_cap, sizeof(tAVDT_CFG));
/* let application know the capability of the SNK */
@@ -1734,10 +1736,10 @@
/* In this case, we are done with getcap without sending another */
/* request to AVDT. */
if (!bta_av_next_getcap(p_scb, p_data))
- getcap_done = TRUE;
+ getcap_done = true;
}
else
- getcap_done = TRUE;
+ getcap_done = true;
if (getcap_done)
{
@@ -1764,7 +1766,7 @@
{
UNUSED(p_data);
- p_scb->use_rc = TRUE;
+ p_scb->use_rc = true;
}
/*******************************************************************************
@@ -1778,7 +1780,7 @@
*******************************************************************************/
void bta_av_cco_close (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- UINT16 mtu;
+ uint16_t mtu;
UNUSED(p_data);
mtu = bta_av_chk_mtu(p_scb, BTA_AV_MAX_A2DP_MTU);
@@ -1798,9 +1800,9 @@
void bta_av_open_failed (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- BOOLEAN is_av_opened = FALSE;
+ bool is_av_opened = false;
tBTA_AV_SCB * p_opened_scb = NULL;
- UINT8 idx;
+ uint8_t idx;
tBTA_AV_OPEN open;
APPL_TRACE_DEBUG("bta_av_open_failed");
@@ -1808,17 +1810,17 @@
bta_av_cco_close(p_scb, p_data);
/* check whether there is already an opened audio or video connection with the same device */
- for (idx = 0; (idx < BTA_AV_NUM_STRS) && (is_av_opened == FALSE); idx++ )
+ for (idx = 0; (idx < BTA_AV_NUM_STRS) && (is_av_opened == false); idx++ )
{
p_opened_scb = bta_av_cb.p_scb[idx];
if (p_opened_scb && (p_opened_scb->state == BTA_AV_OPEN_SST) && (!bdcmp(p_opened_scb->peer_addr,p_scb->peer_addr )) )
- is_av_opened = TRUE;
+ is_av_opened = true;
}
/* if there is already an active AV connnection with the same bd_addr,
don't send disconnect req, just report the open event with BTA_AV_FAIL_GET_CAP status */
- if (is_av_opened == TRUE)
+ if (is_av_opened == true)
{
bdcpy(open.bd_addr, p_scb->peer_addr);
open.chnl = p_scb->chnl;
@@ -1858,9 +1860,9 @@
void bta_av_getcap_results (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
tAVDT_CFG cfg;
- UINT8 media_type;
+ uint8_t media_type;
tAVDT_SEP_INFO *p_info = &p_scb->sep_info[p_scb->sep_info_idx];
- UINT16 uuid_int; /* UUID for which connection was initiatied */
+ uint16_t uuid_int; /* UUID for which connection was initiatied */
memcpy(&cfg, &p_scb->cfg, sizeof(tAVDT_CFG));
cfg.num_codec = 1;
@@ -1952,10 +1954,10 @@
void bta_av_setconfig_rej (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
tBTA_AV_REJECT reject;
- UINT8 avdt_handle = p_data->ci_setconfig.avdt_handle;
+ uint8_t avdt_handle = p_data->ci_setconfig.avdt_handle;
bta_av_adjust_seps_idx(p_scb, avdt_handle);
- APPL_TRACE_DEBUG("bta_av_setconfig_rej: sep_idx: %d",p_scb->sep_idx);
+ APPL_TRACE_DEBUG("%s: sep_idx: %d", __func__, p_scb->sep_idx);
AVDT_ConfigRsp(p_scb->avdt_handle, p_scb->avdt_label, AVDT_ERR_UNSUP_CFG, 0);
bdcpy(reject.bd_addr, p_data->str_msg.bd_addr);
@@ -2007,10 +2009,11 @@
*******************************************************************************/
void bta_av_do_start (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- UINT8 policy = HCI_ENABLE_SNIFF_MODE;
- UINT8 cur_role;
+ uint8_t policy = HCI_ENABLE_SNIFF_MODE;
+ uint8_t cur_role;
- APPL_TRACE_DEBUG("bta_av_do_start sco_occupied:%d, role:x%x, started:%d", bta_av_cb.sco_occupied, p_scb->role, p_scb->started);
+ APPL_TRACE_DEBUG("%s sco_occupied:%d, role:x%x, started:%d", __func__,
+ bta_av_cb.sco_occupied, p_scb->role, p_scb->started);
if (bta_av_cb.sco_occupied)
{
bta_av_start_failed(p_scb, p_data);
@@ -2028,7 +2031,7 @@
bta_sys_clear_policy(BTA_ID_AV, policy, p_scb->peer_addr);
- if ((p_scb->started == FALSE) && ((p_scb->role & BTA_AV_ROLE_START_INT) == 0))
+ if ((p_scb->started == false) && ((p_scb->role & BTA_AV_ROLE_START_INT) == 0))
{
p_scb->role |= BTA_AV_ROLE_START_INT;
bta_sys_busy(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
@@ -2061,12 +2064,12 @@
void bta_av_str_stopped (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
tBTA_AV_SUSPEND suspend_rsp;
- UINT8 start = p_scb->started;
- BOOLEAN sus_evt = TRUE;
- BT_HDR *p_buf;
- UINT8 policy = HCI_ENABLE_SNIFF_MODE;
+ uint8_t start = p_scb->started;
+ bool sus_evt = true;
+ BT_HDR *p_buf;
+ uint8_t policy = HCI_ENABLE_SNIFF_MODE;
- APPL_TRACE_ERROR("bta_av_str_stopped:audio_open_cnt=%d, p_data %x",
+ APPL_TRACE_ERROR("%s:audio_open_cnt=%d, p_data %x", __func__,
bta_av_cb.audio_open_cnt, p_data);
bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
@@ -2083,10 +2086,10 @@
tBTA_AV_STATUS status = BTA_AV_FAIL_STREAM;
(*bta_av_cb.p_cback)(BTA_AV_OFFLOAD_START_RSP_EVT, (tBTA_AV *)&status);
}
- p_scb->offload_start_pending = FALSE;
+ p_scb->offload_start_pending = false;
- bta_av_stream_chg(p_scb, FALSE);
- p_scb->co_started = FALSE;
+ bta_av_stream_chg(p_scb, false);
+ p_scb->co_started = false;
p_scb->p_cos->stop(p_scb->hndl, p_scb->codec_type);
L2CA_SetFlushTimeout(p_scb->peer_addr, L2CAP_DEFAULT_FLUSH_TO);
@@ -2114,23 +2117,23 @@
APPL_TRACE_DEBUG("suspending: %d, sup:%d", start, p_scb->suspend_sup);
if ((start) && (p_scb->suspend_sup))
{
- sus_evt = FALSE;
+ sus_evt = false;
p_scb->l2c_bufs = 0;
AVDT_SuspendReq(&p_scb->avdt_handle, 1);
}
- /* send SUSPEND_EVT event only if not in reconfiguring state and sus_evt is TRUE*/
+ /* send SUSPEND_EVT event only if not in reconfiguring state and sus_evt is true*/
if ((sus_evt)&&(p_scb->state != BTA_AV_RCFG_SST))
{
suspend_rsp.status = BTA_AV_SUCCESS;
- suspend_rsp.initiator = TRUE;
+ suspend_rsp.initiator = true;
(*bta_av_cb.p_cback)(BTA_AV_SUSPEND_EVT, (tBTA_AV *) &suspend_rsp);
}
}
else
{
suspend_rsp.status = BTA_AV_SUCCESS;
- suspend_rsp.initiator = TRUE;
+ suspend_rsp.initiator = true;
APPL_TRACE_EVENT("bta_av_str_stopped status %d", suspend_rsp.status);
/* send STOP_EVT event only if not in reconfiguring state */
@@ -2183,8 +2186,8 @@
{
if(p_scb->started)
{
- stop.flush = FALSE;
- stop.suspend = TRUE;
+ stop.flush = false;
+ stop.suspend = true;
bta_av_str_stopped(p_scb, (tBTA_AV_DATA *)&stop);
}
else
@@ -2201,7 +2204,7 @@
if(p_scb->started)
{
bta_av_str_stopped(p_scb, NULL);
- p_scb->started = FALSE;
+ p_scb->started = false;
/* drop the buffers queued in L2CAP */
L2CA_FlushChannel (p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
@@ -2223,10 +2226,10 @@
void bta_av_data_path (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
BT_HDR *p_buf = NULL;
- UINT32 data_len;
- UINT32 timestamp;
- BOOLEAN new_buf = FALSE;
- UINT8 m_pt = 0x60 | p_scb->codec_type;
+ uint32_t data_len;
+ uint32_t timestamp;
+ bool new_buf = false;
+ uint8_t m_pt = 0x60 | p_scb->codec_type;
tAVDT_DATA_OPT_MASK opt;
UNUSED(p_data);
@@ -2239,17 +2242,17 @@
APPL_TRACE_ERROR("q: %d", p_scb->l2c_bufs);
*/
//Always get the current number of bufs que'd up
- p_scb->l2c_bufs = (UINT8)L2CA_FlushChannel (p_scb->l2c_cid, L2CAP_FLUSH_CHANS_GET);
+ p_scb->l2c_bufs = (uint8_t)L2CA_FlushChannel (p_scb->l2c_cid, L2CAP_FLUSH_CHANS_GET);
if (!list_is_empty(p_scb->a2d_list)) {
p_buf = (BT_HDR *)list_front(p_scb->a2d_list);
list_remove(p_scb->a2d_list, p_buf);
/* use q_info.a2d data, read the timestamp */
- timestamp = *(UINT32 *)(p_buf + 1);
+ timestamp = *(uint32_t *)(p_buf + 1);
}
else
{
- new_buf = TRUE;
+ new_buf = true;
/* a2d_list empty, call co_data, dup data to other channels */
p_buf = (BT_HDR *)p_scb->p_cos->data(p_scb->codec_type, &data_len,
×tamp);
@@ -2257,7 +2260,7 @@
if (p_buf)
{
/* use the offset area for the time stamp */
- *(UINT32 *)(p_buf + 1) = timestamp;
+ *(uint32_t *)(p_buf + 1) = timestamp;
/* dup the data to other channels */
bta_av_dup_audio_buf(p_scb, p_buf);
@@ -2283,7 +2286,7 @@
}
AVDT_WriteReqOpt(p_scb->avdt_handle, p_buf, timestamp, m_pt, opt);
- p_scb->cong = TRUE;
+ p_scb->cong = true;
}
else
{
@@ -2323,26 +2326,26 @@
*******************************************************************************/
void bta_av_start_ok (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- tBTA_AV_START start;
+ tBTA_AV_START start;
tBTA_AV_API_STOP stop;
- BOOLEAN initiator = FALSE;
- BOOLEAN suspend = FALSE;
- UINT16 flush_to;
- UINT8 new_role = p_scb->role;
- BT_HDR hdr;
- UINT8 policy = HCI_ENABLE_SNIFF_MODE;
- UINT8 cur_role;
+ bool initiator = false;
+ bool suspend = false;
+ uint16_t flush_to;
+ uint8_t new_role = p_scb->role;
+ BT_HDR hdr;
+ uint8_t policy = HCI_ENABLE_SNIFF_MODE;
+ uint8_t cur_role;
- APPL_TRACE_DEBUG("bta_av_start_ok wait:x%x, role:x%x", p_scb->wait, p_scb->role);
+ APPL_TRACE_DEBUG("%s wait:x%x, role:x%x", __func__, p_scb->wait, p_scb->role);
- p_scb->started = TRUE;
+ p_scb->started = true;
if (p_scb->sco_suspend)
{
- p_scb->sco_suspend = FALSE;
+ p_scb->sco_suspend = false;
}
if (new_role & BTA_AV_ROLE_START_INT)
- initiator = TRUE;
+ initiator = true;
/* for A2DP SINK we do not send get_caps */
if ((p_scb->avdt_handle == p_scb->seps[p_scb->sep_idx].av_handle)
@@ -2424,7 +2427,7 @@
L2CA_SetFlushTimeout(p_scb->peer_addr, flush_to );
/* clear the congestion flag */
- p_scb->cong = FALSE;
+ p_scb->cong = false;
if (new_role & BTA_AV_ROLE_START_INT)
{
@@ -2432,13 +2435,13 @@
}
else if ((new_role & BTA_AV_ROLE_AD_ACP) && (new_role & BTA_AV_ROLE_SUSPEND_OPT))
{
- suspend = TRUE;
+ suspend = true;
}
if (!suspend)
{
p_scb->q_tag = BTA_AV_Q_TAG_STREAM;
- bta_av_stream_chg(p_scb, TRUE);
+ bta_av_stream_chg(p_scb, true);
}
{
@@ -2461,9 +2464,9 @@
p_scb->role &= ~BTA_AV_ROLE_AD_ACP;
p_scb->role &= ~BTA_AV_ROLE_SUSPEND_OPT;
- p_scb->no_rtp_hdr = FALSE;
+ p_scb->no_rtp_hdr = false;
p_scb->p_cos->start(p_scb->hndl, p_scb->codec_type, p_scb->cfg.codec_info, &p_scb->no_rtp_hdr);
- p_scb->co_started = TRUE;
+ p_scb->co_started = true;
APPL_TRACE_DEBUG("bta_av_start_ok suspending: %d, role:x%x, init %d",
suspend, p_scb->role, initiator);
@@ -2478,12 +2481,12 @@
if(suspend)
{
p_scb->role |= BTA_AV_ROLE_SUSPEND;
- p_scb->cong = TRUE; /* do not allow the media data to go through */
+ p_scb->cong = true; /* do not allow the media data to go through */
/* do not duplicate the media packets to this channel */
p_scb->p_cos->stop(p_scb->hndl, p_scb->codec_type);
- p_scb->co_started = FALSE;
- stop.flush = FALSE;
- stop.suspend = TRUE;
+ p_scb->co_started = false;
+ stop.flush = false;
+ stop.suspend = true;
bta_av_ssm_execute(p_scb, BTA_AV_AP_STOP_EVT, (tBTA_AV_DATA *)&stop);
}
}
@@ -2502,14 +2505,14 @@
{
UNUSED(p_data);
- if(p_scb->started == FALSE && p_scb->co_started == FALSE)
+ if(p_scb->started == false && p_scb->co_started == false)
{
bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
notify_start_failed(p_scb);
}
bta_sys_set_policy(BTA_ID_AV, (HCI_ENABLE_SNIFF_MODE|HCI_ENABLE_MASTER_SLAVE_SWITCH), p_scb->peer_addr);
- p_scb->sco_suspend = FALSE;
+ p_scb->sco_suspend = false;
}
/*******************************************************************************
@@ -2525,8 +2528,8 @@
{
tBTA_AV data;
tBTA_AV_EVT event;
- UINT16 mtu;
- UINT8 policy = HCI_ENABLE_SNIFF_MODE;
+ uint16_t mtu;
+ uint8_t policy = HCI_ENABLE_SNIFF_MODE;
if ((bta_av_cb.features & BTA_AV_FEAT_MASTER) == 0 || bta_av_cb.audio_open_cnt == 1)
policy |= HCI_ENABLE_MASTER_SLAVE_SWITCH;
@@ -2595,7 +2598,7 @@
UNUSED(p_data);
if(p_scb->co_started)
- p_scb->cong = FALSE;
+ p_scb->cong = false;
}
/*******************************************************************************
@@ -2610,18 +2613,18 @@
void bta_av_suspend_cfm (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
tBTA_AV_SUSPEND suspend_rsp;
- UINT8 err_code = p_data->str_msg.msg.hdr.err_code;
- UINT8 policy = HCI_ENABLE_SNIFF_MODE;
+ uint8_t err_code = p_data->str_msg.msg.hdr.err_code;
+ uint8_t policy = HCI_ENABLE_SNIFF_MODE;
- APPL_TRACE_DEBUG ("bta_av_suspend_cfm:audio_open_cnt = %d, err_code = %d",
+ APPL_TRACE_DEBUG ("%s:audio_open_cnt = %d, err_code = %d", __func__,
bta_av_cb.audio_open_cnt, err_code);
- if (p_scb->started == FALSE)
+ if (p_scb->started == false)
{
/* handle the condition where there is a collision of SUSPEND req from either side
** Second SUSPEND req could be rejected. Do not treat this as a failure
*/
- APPL_TRACE_WARNING("bta_av_suspend_cfm: already suspended, ignore, err_code %d",
+ APPL_TRACE_WARNING("%s: already suspended, ignore, err_code %d", __func__,
err_code);
return;
}
@@ -2632,25 +2635,25 @@
/* Disable suspend feature only with explicit rejection(not with timeout) */
if (err_code != AVDT_ERR_TIMEOUT)
{
- p_scb->suspend_sup = FALSE;
+ p_scb->suspend_sup = false;
}
suspend_rsp.status = BTA_AV_FAIL;
- APPL_TRACE_ERROR ("bta_av_suspend_cfm: suspend failed, closing connection");
+ APPL_TRACE_ERROR ("%s: suspend failed, closing connection", __func__);
/* SUSPEND failed. Close connection. */
bta_av_ssm_execute(p_scb, BTA_AV_API_CLOSE_EVT, NULL);
}
else
{
- /* only set started to FALSE when suspend is successful */
- p_scb->started = FALSE;
+ /* only set started to false when suspend is successful */
+ p_scb->started = false;
}
if (p_scb->role & BTA_AV_ROLE_SUSPEND)
{
p_scb->role &= ~BTA_AV_ROLE_SUSPEND;
- p_scb->cong = FALSE;
+ p_scb->cong = false;
}
bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
@@ -2668,12 +2671,12 @@
tBTA_AV_STATUS status = BTA_AV_FAIL_STREAM;
(*bta_av_cb.p_cback)(BTA_AV_OFFLOAD_START_RSP_EVT, (tBTA_AV *)&status);
}
- p_scb->offload_start_pending = FALSE;
+ p_scb->offload_start_pending = false;
- bta_av_stream_chg(p_scb, FALSE);
+ bta_av_stream_chg(p_scb, false);
{
- p_scb->co_started = FALSE;
+ p_scb->co_started = false;
p_scb->p_cos->stop(p_scb->hndl, p_scb->codec_type);
}
L2CA_SetFlushTimeout(p_scb->peer_addr, L2CAP_DEFAULT_FLUSH_TO);
@@ -2702,7 +2705,7 @@
UNUSED(p_data);
p_scb->l2c_cid = AVDT_GetL2CapChannel(p_scb->avdt_handle);
- APPL_TRACE_DEBUG("bta_av_rcfg_str_ok: l2c_cid: %d", p_scb->l2c_cid);
+ APPL_TRACE_DEBUG("%s: l2c_cid: %d", __func__, p_scb->l2c_cid);
/* rc listen */
bta_av_st_rc_timer(p_scb, NULL);
@@ -2776,7 +2779,7 @@
{
UNUSED(p_data);
- p_scb->cong = FALSE;
+ p_scb->cong = false;
p_scb->num_recfg++;
APPL_TRACE_DEBUG("bta_av_rcfg_connect num_recfg: %d", p_scb->num_recfg);
if(p_scb->num_recfg > BTA_AV_RECONFIG_RETRY)
@@ -2830,11 +2833,11 @@
*******************************************************************************/
void bta_av_suspend_cont (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- UINT8 err_code = p_data->str_msg.msg.hdr.err_code;
+ uint8_t err_code = p_data->str_msg.msg.hdr.err_code;
tBTA_AV_RECONFIG evt;
- p_scb->started = FALSE;
- p_scb->cong = FALSE;
+ p_scb->started = false;
+ p_scb->cong = false;
if (err_code)
{
if (AVDT_ERR_CONNECT == err_code)
@@ -2850,7 +2853,7 @@
/* Disable suspend feature only with explicit rejection(not with timeout) */
if (err_code != AVDT_ERR_TIMEOUT)
{
- p_scb->suspend_sup = FALSE;
+ p_scb->suspend_sup = false;
}
/* drop the buffers queued in L2CAP */
L2CA_FlushChannel (p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
@@ -2880,7 +2883,7 @@
*******************************************************************************/
void bta_av_rcfg_cfm (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
- UINT8 err_code = p_data->str_msg.msg.hdr.err_code;
+ uint8_t err_code = p_data->str_msg.msg.hdr.err_code;
/*
APPL_TRACE_DEBUG("bta_av_rcfg_cfm");
@@ -2891,9 +2894,9 @@
/* Disable reconfiguration feature only with explicit rejection(not with timeout) */
if (err_code != AVDT_ERR_TIMEOUT)
{
- p_scb->recfg_sup = FALSE;
+ p_scb->recfg_sup = false;
}
- /* started flag is FALSE when reconfigure command is sent */
+ /* started flag is false when reconfigure command is sent */
/* drop the buffers queued in L2CAP */
L2CA_FlushChannel (p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);
AVDT_CloseReq(p_scb->avdt_handle);
@@ -2977,7 +2980,7 @@
{
tBTA_AV_SCB *p_scbi;
int i;
- BOOLEAN new_started = FALSE;
+ bool new_started = false;
UNUSED(p_data);
if ((p_scb->chnl == BTA_AV_CHNL_AUDIO) && (bta_av_cb.audio_open_cnt >= 2))
@@ -2995,7 +2998,7 @@
if (!new_started)
{
/* start the new stream */
- new_started = TRUE;
+ new_started = true;
bta_av_ssm_execute(p_scb, BTA_AV_AP_START_EVT, NULL);
}
/* may need to update the flush timeout of this already started stream */
@@ -3033,7 +3036,7 @@
alarm_cancel(p_scb->avrc_ct_timer);
start.chnl = p_scb->chnl;
start.status = BTA_AV_FAIL_ROLE;
- start.initiator = TRUE;
+ start.initiator = true;
start.hndl = p_scb->hndl;
p_scb->wait &= ~BTA_AV_WAIT_ROLE_SW_BITS;
bta_av_cb.rs_idx = 0;
@@ -3049,7 +3052,7 @@
return;
}
- if(p_scb->use_rc == TRUE || (p_scb->role & BTA_AV_ROLE_AD_ACP) )
+ if(p_scb->use_rc == true || (p_scb->role & BTA_AV_ROLE_AD_ACP) )
{
if(bta_av_cb.disc)
{
@@ -3069,7 +3072,7 @@
else
{
/* use main SM for AVRC SDP activities */
- bta_av_rc_disc((UINT8)(p_scb->hdi + 1));
+ bta_av_rc_disc((uint8_t)(p_scb->hdi + 1));
}
}
else
@@ -3114,7 +3117,7 @@
tBTA_AV_API_OPEN *p_buf =
(tBTA_AV_API_OPEN *)osi_malloc(sizeof(tBTA_AV_API_OPEN));
memcpy(p_buf, &(p_scb->open_api), sizeof(tBTA_AV_API_OPEN));
- p_scb->skip_sdp = TRUE;
+ p_scb->skip_sdp = true;
bta_sys_sendmsg(p_buf);
}
}
@@ -3132,14 +3135,14 @@
void bta_av_offload_req(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
tBTA_AV_STATUS status = BTA_AV_FAIL_RESOURCES;
- UINT16 mtu = bta_av_chk_mtu(p_scb, p_scb->stream_mtu);
+ uint16_t mtu = bta_av_chk_mtu(p_scb, p_scb->stream_mtu);
APPL_TRACE_DEBUG("%s stream %s, audio channels open %d", __func__,
p_scb->started ? "STARTED" : "STOPPED", bta_av_cb.audio_open_cnt);
/* Check if stream has already been started. */
/* Support offload if only one audio source stream is open. */
- if (p_scb->started != TRUE) {
+ if (p_scb->started != true) {
status = BTA_AV_FAIL_STREAM;
} else if (bta_av_cb.audio_open_cnt == 1 &&
@@ -3159,8 +3162,8 @@
a2dp_offload_start.xmit_quota = BTA_AV_A2DP_OFFLOAD_XMIT_QUOTA;
a2dp_offload_start.stream_mtu = (mtu < p_scb->stream_mtu) ? mtu : p_scb->stream_mtu;
a2dp_offload_start.local_cid = p_scb->l2c_cid;
- a2dp_offload_start.is_flushable = TRUE;
- a2dp_offload_start.stream_source = ((UINT32)(p_scb->cfg.codec_info[1] | p_scb->cfg.codec_info[2]));
+ a2dp_offload_start.is_flushable = true;
+ a2dp_offload_start.stream_source = ((uint32_t)(p_scb->cfg.codec_info[1] | p_scb->cfg.codec_info[2]));
memcpy(a2dp_offload_start.codec_info, p_scb->cfg.codec_info,
sizeof(a2dp_offload_start.codec_info));
@@ -3169,7 +3172,7 @@
(vendor_opcode_t)BT_VND_OP_A2DP_OFFLOAD_START,
&a2dp_offload_start)) {
status = BTA_AV_SUCCESS;
- p_scb->offload_start_pending = TRUE;
+ p_scb->offload_start_pending = true;
}
}
}
@@ -3197,11 +3200,11 @@
status ? "FAIL" : "SUCCESS");
/* Check if stream has already been started. */
- if (status == BTA_AV_SUCCESS && p_scb->started != TRUE) {
+ if (status == BTA_AV_SUCCESS && p_scb->started != true) {
status = BTA_AV_FAIL_STREAM;
}
- p_scb->offload_start_pending = FALSE;
+ p_scb->offload_start_pending = false;
(*bta_av_cb.p_cback)(BTA_AV_OFFLOAD_START_RSP_EVT, (tBTA_AV *)&status);
}
diff --git a/bta/av/bta_av_act.c b/bta/av/bta_av_act.c
index a6cd05f..8f7c9f2 100644
--- a/bta/av/bta_av_act.c
+++ b/bta/av/bta_av_act.c
@@ -27,7 +27,7 @@
#include "bt_target.h"
-#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE)
+#if (BTA_AV_INCLUDED == TRUE)
#include <string.h>
@@ -41,7 +41,7 @@
#include "osi/include/properties.h"
#include "utl.h"
-#if ( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
#include "bta_ar_api.h"
#endif
@@ -72,7 +72,7 @@
** Returns tBTA_AV_RCB
**
*******************************************************************************/
-tBTA_AV_RCB * bta_av_get_rcb_by_shdl(UINT8 shdl)
+tBTA_AV_RCB * bta_av_get_rcb_by_shdl(uint8_t shdl)
{
tBTA_AV_RCB *p_rcb = NULL;
int i;
@@ -101,7 +101,7 @@
void bta_av_del_rc(tBTA_AV_RCB *p_rcb)
{
tBTA_AV_SCB *p_scb;
- UINT8 rc_handle; /* connected AVRCP handle */
+ uint8_t rc_handle; /* connected AVRCP handle */
p_scb = NULL;
if (p_rcb->handle != BTA_AV_RC_HANDLE_NONE)
@@ -160,7 +160,7 @@
for(i=0; i<BTA_AV_NUM_RCB; i++)
{
- if ((p_cb->disabling == TRUE) || (bta_av_cb.rcb[i].shdl != 0))
+ if ((p_cb->disabling == true) || (bta_av_cb.rcb[i].shdl != 0))
bta_av_del_rc(&bta_av_cb.rcb[i]);
}
}
@@ -174,7 +174,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_del_sdp_rec(UINT32 *p_sdp_handle)
+static void bta_av_del_sdp_rec(uint32_t *p_sdp_handle)
{
if (*p_sdp_handle != 0)
{
@@ -192,7 +192,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_avrc_sdp_cback(UINT16 status)
+static void bta_av_avrc_sdp_cback(uint16_t status)
{
BT_HDR *p_msg = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -212,16 +212,12 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_rc_ctrl_cback(UINT8 handle, UINT8 event, UINT16 result, BD_ADDR peer_addr)
+static void bta_av_rc_ctrl_cback(uint8_t handle, uint8_t event, uint16_t result, BD_ADDR peer_addr)
{
- UINT16 msg_event = 0;
+ uint16_t msg_event = 0;
UNUSED(result);
-#if (defined(BTA_AV_MIN_DEBUG_TRACES) && BTA_AV_MIN_DEBUG_TRACES == TRUE)
- APPL_TRACE_EVENT("rc_ctrl handle: %d event=0x%x", handle, event);
-#else
- APPL_TRACE_EVENT("bta_av_rc_ctrl_cback handle: %d event=0x%x", handle, event);
-#endif
+ APPL_TRACE_EVENT("%s handle: %d event=0x%x", __func__, handle, event);
if (event == AVRC_OPEN_IND_EVT)
{
/* save handle of opened connection
@@ -254,20 +250,20 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_rc_msg_cback(UINT8 handle, UINT8 label, UINT8 opcode, tAVRC_MSG *p_msg)
+static void bta_av_rc_msg_cback(uint8_t handle, uint8_t label, uint8_t opcode, tAVRC_MSG *p_msg)
{
- UINT8 *p_data_src = NULL;
- UINT16 data_len = 0;
+ uint8_t *p_data_src = NULL;
+ uint16_t data_len = 0;
APPL_TRACE_DEBUG("%s handle: %u opcode=0x%x", __func__, handle, opcode);
/* Determine the size of the buffer we need */
if (opcode == AVRC_OP_VENDOR && p_msg->vendor.p_vendor_data != NULL) {
p_data_src = p_msg->vendor.p_vendor_data;
- data_len = (UINT16) p_msg->vendor.vendor_len;
+ data_len = (uint16_t) p_msg->vendor.vendor_len;
} else if (opcode == AVRC_OP_PASS_THRU && p_msg->pass.p_pass_data != NULL) {
p_data_src = p_msg->pass.p_pass_data;
- data_len = (UINT16) p_msg->pass.pass_len;
+ data_len = (uint16_t) p_msg->pass.pass_len;
}
/* Create a copy of the message */
@@ -280,7 +276,7 @@
memcpy(&p_buf->msg, p_msg, sizeof(tAVRC_MSG));
/* Copy the data payload, and set the pointer to it */
if (p_data_src != NULL) {
- UINT8 *p_data_dst = (UINT8 *)(p_buf + 1);
+ uint8_t *p_data_dst = (uint8_t *)(p_buf + 1);
memcpy(p_data_dst, p_data_src, data_len);
if (opcode == AVRC_OP_VENDOR)
p_buf->msg.vendor.p_vendor_data = p_data_dst;
@@ -300,14 +296,14 @@
** Returns the created rc handle
**
*******************************************************************************/
-UINT8 bta_av_rc_create(tBTA_AV_CB *p_cb, UINT8 role, UINT8 shdl, UINT8 lidx)
+uint8_t bta_av_rc_create(tBTA_AV_CB *p_cb, uint8_t role, uint8_t shdl, uint8_t lidx)
{
tAVRC_CONN_CB ccb;
BD_ADDR_PTR bda = (BD_ADDR_PTR)bd_addr_any;
- UINT8 status = BTA_AV_RC_ROLE_ACP;
+ uint8_t status = BTA_AV_RC_ROLE_ACP;
tBTA_AV_SCB *p_scb = p_cb->p_scb[shdl - 1];
int i;
- UINT8 rc_handle;
+ uint8_t rc_handle;
tBTA_AV_RCB *p_rcb;
if (role == AVCT_INT)
@@ -369,12 +365,12 @@
** Returns BTA_AV_RSP_ACCEPT or BTA_AV_RSP_NOT_IMPL.
**
*******************************************************************************/
-static tBTA_AV_CODE bta_av_group_navi_supported(UINT8 len, UINT8 *p_data, BOOLEAN is_inquiry)
+static tBTA_AV_CODE bta_av_group_navi_supported(uint8_t len, uint8_t *p_data, bool is_inquiry)
{
tBTA_AV_CODE ret=BTA_AV_RSP_NOT_IMPL;
- UINT8 *p_ptr = p_data;
- UINT16 u16;
- UINT32 u32;
+ uint8_t *p_ptr = p_data;
+ uint16_t u16;
+ uint32_t u32;
if (p_bta_av_cfg->avrc_group && len == BTA_GROUP_NAVI_MSG_OP_DATA_LEN)
{
@@ -410,7 +406,7 @@
** Returns BTA_AV_RSP_ACCEPT of supported, BTA_AV_RSP_NOT_IMPL if not.
**
*******************************************************************************/
-static tBTA_AV_CODE bta_av_op_supported(tBTA_AV_RC rc_id, BOOLEAN is_inquiry)
+static tBTA_AV_CODE bta_av_op_supported(tBTA_AV_RC rc_id, bool is_inquiry)
{
tBTA_AV_CODE ret_code = BTA_AV_RSP_NOT_IMPL;
@@ -451,11 +447,11 @@
** Returns NULL, if not found.
**
*******************************************************************************/
-tBTA_AV_LCB * bta_av_find_lcb(BD_ADDR addr, UINT8 op)
+tBTA_AV_LCB * bta_av_find_lcb(BD_ADDR addr, uint8_t op)
{
tBTA_AV_CB *p_cb = &bta_av_cb;
int xx;
- UINT8 mask;
+ uint8_t mask;
tBTA_AV_LCB *p_lcb = NULL;
for(xx=0; xx<BTA_AV_NUM_LINKS; xx++)
@@ -489,11 +485,11 @@
tBTA_AV_RC_OPEN rc_open;
tBTA_AV_SCB *p_scb;
int i;
- UINT8 shdl = 0;
+ uint8_t shdl = 0;
tBTA_AV_LCB *p_lcb;
tBTA_AV_RCB *p_rcb;
- UINT8 tmp;
- UINT8 disc = 0;
+ uint8_t tmp;
+ uint8_t disc = 0;
/* find the SCB & stop the timer */
for(i=0; i<BTA_AV_NUM_STRS; i++)
@@ -664,7 +660,7 @@
void bta_av_rc_meta_rsp(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
{
tBTA_AV_RCB *p_rcb;
- BOOLEAN do_free = TRUE;
+ bool do_free = true;
if ((p_cb->features & BTA_AV_FEAT_METADATA) && (p_data->hdr.layer_specific < BTA_AV_NUM_RCB))
{
@@ -676,7 +672,7 @@
AVRC_MsgReq(p_rcb->handle, p_data->api_meta_rsp.label,
p_data->api_meta_rsp.rsp_code,
p_data->api_meta_rsp.p_pkt);
- do_free = FALSE;
+ do_free = false;
}
}
}
@@ -727,9 +723,9 @@
static tAVRC_STS bta_av_chk_notif_evt_id(tAVRC_MSG_VENDOR *p_vendor)
{
tAVRC_STS status = BTA_AV_STS_NO_RSP;
- UINT8 xx;
- UINT16 u16;
- UINT8 *p = p_vendor->p_vendor_data + 2;
+ uint8_t xx;
+ uint16_t u16;
+ uint8_t *p = p_vendor->p_vendor_data + 2;
BE_STREAM_TO_UINT16 (u16, p);
/* double check the fixed length */
@@ -762,14 +758,14 @@
**
** Description Process an AVRCP metadata command from the peer.
**
-** Returns TRUE to respond immediately
+** Returns true to respond immediately
**
*******************************************************************************/
-tBTA_AV_EVT bta_av_proc_meta_cmd(tAVRC_RESPONSE *p_rc_rsp, tBTA_AV_RC_MSG *p_msg, UINT8 *p_ctype)
+tBTA_AV_EVT bta_av_proc_meta_cmd(tAVRC_RESPONSE *p_rc_rsp, tBTA_AV_RC_MSG *p_msg, uint8_t *p_ctype)
{
tBTA_AV_EVT evt = BTA_AV_META_MSG_EVT;
- UINT8 u8, pdu, *p;
- UINT16 u16;
+ uint8_t u8, pdu, *p;
+ uint16_t u16;
tAVRC_MSG_VENDOR *p_vendor = &p_msg->msg.vendor;
#if (AVRC_METADATA_INCLUDED == TRUE)
@@ -868,11 +864,11 @@
tBTA_AV av;
BT_HDR *p_pkt = NULL;
tAVRC_MSG_VENDOR *p_vendor = &p_data->rc_msg.msg.vendor;
- BOOLEAN is_inquiry =
+ bool is_inquiry =
((p_data->rc_msg.msg.hdr.ctype == AVRC_CMD_SPEC_INQ) ||
p_data->rc_msg.msg.hdr.ctype == AVRC_CMD_GEN_INQ);
#if (AVRC_METADATA_INCLUDED == TRUE)
- UINT8 ctype = 0;
+ uint8_t ctype = 0;
tAVRC_RESPONSE rc_rsp;
rc_rsp.rsp.status = BTA_AV_STS_NO_RSP;
@@ -899,7 +895,7 @@
p_data->rc_msg.msg.pass.p_pass_data, is_inquiry);
#endif
}
-#if (AVRC_CTRL_INCLUDED == TRUE)
+#if (AVRC_CTLR_INCLUDED == TRUE)
else if (((p_data->rc_msg.msg.pass.op_id == AVRC_ID_VOL_UP)||
(p_data->rc_msg.msg.pass.op_id == AVRC_ID_VOL_DOWN)) &&
!strcmp(avrcp_ct_support, "true"))
@@ -947,7 +943,7 @@
(p_data->rc_msg.msg.pass.pass_len > 0))
{
av.remote_rsp.p_data =
- (UINT8 *)osi_malloc(p_data->rc_msg.msg.pass.pass_len);
+ (uint8_t *)osi_malloc(p_data->rc_msg.msg.pass.pass_len);
APPL_TRACE_DEBUG("Vendor Unique data len = %d",
p_data->rc_msg.msg.pass.pass_len);
memcpy(av.remote_rsp.p_data,p_data->rc_msg.msg.pass.p_pass_data,
@@ -1049,7 +1045,7 @@
*******************************************************************************/
void bta_av_rc_close (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
{
- UINT16 handle = p_data->hdr.layer_specific;
+ uint16_t handle = p_data->hdr.layer_specific;
tBTA_AV_SCB *p_scb;
tBTA_AV_RCB *p_rcb;
@@ -1057,7 +1053,8 @@
{
p_rcb = &p_cb->rcb[handle];
- APPL_TRACE_DEBUG("bta_av_rc_close handle: %d, status=0x%x", p_rcb->handle, p_rcb->status);
+ APPL_TRACE_DEBUG("%s handle: %d, status=0x%x", __func__,
+ p_rcb->handle, p_rcb->status);
if (p_rcb->handle != BTA_AV_RC_HANDLE_NONE)
{
if (p_rcb->shdl)
@@ -1084,10 +1081,10 @@
** Returns The index to p_scb[]
**
*******************************************************************************/
-static UINT8 bta_av_get_shdl(tBTA_AV_SCB *p_scb)
+static uint8_t bta_av_get_shdl(tBTA_AV_SCB *p_scb)
{
int i;
- UINT8 shdl = 0;
+ uint8_t shdl = 0;
/* find the SCB & stop the timer */
for(i=0; i<BTA_AV_NUM_STRS; i++)
{
@@ -1109,12 +1106,12 @@
** Returns void
**
*******************************************************************************/
-void bta_av_stream_chg(tBTA_AV_SCB *p_scb, BOOLEAN started)
+void bta_av_stream_chg(tBTA_AV_SCB *p_scb, bool started)
{
- UINT8 started_msk;
+ uint8_t started_msk;
int i;
- UINT8 *p_streams;
- BOOLEAN no_streams = FALSE;
+ uint8_t *p_streams;
+ bool no_streams = false;
tBTA_AV_SCB *p_scbi;
started_msk = BTA_AV_HNDL_TO_MSK(p_scb->hdi);
@@ -1142,11 +1139,11 @@
if (BTA_AV_CHNL_AUDIO == p_scb->chnl)
{
if (bta_av_cb.video_streams == 0)
- no_streams = TRUE;
+ no_streams = true;
}
else
{
- no_streams = TRUE;
+ no_streams = true;
if ( bta_av_cb.audio_streams )
{
for (; i<BTA_AV_NUM_STRS; i++)
@@ -1156,7 +1153,7 @@
if ( p_scbi && (bta_av_cb.audio_streams & BTA_AV_HNDL_TO_MSK(i))
&& bdcmp(p_scbi->peer_addr, p_scb->peer_addr) == 0)
{
- no_streams = FALSE;
+ no_streams = false;
break;
}
}
@@ -1189,15 +1186,15 @@
tBTA_AV_CB *p_cb = &bta_av_cb;
tBTA_AV_SCB *p_scb = NULL;
tBTA_AV_SCB *p_scbi;
- UINT8 mask;
- UINT8 conn_msk;
- UINT8 old_msk;
+ uint8_t mask;
+ uint8_t conn_msk;
+ uint8_t old_msk;
int i;
int index = (p_data->hdr.layer_specific & BTA_AV_HNDL_MSK) - 1;
tBTA_AV_LCB *p_lcb;
tBTA_AV_LCB *p_lcb_rc;
tBTA_AV_RCB *p_rcb, *p_rcb2;
- BOOLEAN chk_restore = FALSE;
+ bool chk_restore = false;
/* Validate array index*/
if (index < BTA_AV_NUM_STRS)
@@ -1320,7 +1317,7 @@
alarm_cancel(p_scb->avrc_ct_timer);
}
/* one audio channel goes down. check if we need to restore high priority */
- chk_restore = TRUE;
+ chk_restore = true;
}
}
@@ -1394,10 +1391,10 @@
void bta_av_disable(tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
{
BT_HDR hdr;
- UINT16 xx;
+ uint16_t xx;
UNUSED(p_data);
- p_cb->disabling = TRUE;
+ p_cb->disabling = true;
bta_av_close_all_rc(p_cb);
@@ -1443,10 +1440,10 @@
*******************************************************************************/
void bta_av_sig_chg(tBTA_AV_DATA *p_data)
{
- UINT16 event = p_data->str_msg.hdr.layer_specific;
+ uint16_t event = p_data->str_msg.hdr.layer_specific;
tBTA_AV_CB *p_cb = &bta_av_cb;
- UINT32 xx;
- UINT8 mask;
+ uint32_t xx;
+ uint8_t mask;
tBTA_AV_LCB *p_lcb = NULL;
APPL_TRACE_DEBUG("bta_av_sig_chg event: %d", event);
@@ -1463,7 +1460,7 @@
tBTA_AV_SCB *p_scb = p_cb->p_scb[xx];
if (p_scb != NULL)
{
- UINT8 avdt_tsep_type = p_scb->sep_info[p_scb->sep_info_idx].tsep;
+ uint8_t avdt_tsep_type = p_scb->sep_info[p_scb->sep_info_idx].tsep;
/* If the device is a A2DP source, disconnect the AVDT connection */
if ((avdt_tsep_type == AVDT_TSEP_SRC) && (p_data->hdr.offset == AVDT_ACP))
{
@@ -1491,7 +1488,7 @@
{
APPL_TRACE_DEBUG("Incoming L2CAP acquired, set state as incoming", NULL);
bdcpy(p_cb->p_scb[xx]->peer_addr, p_data->str_msg.bd_addr);
- p_cb->p_scb[xx]->use_rc = TRUE; /* allowing RC for incoming connection */
+ p_cb->p_scb[xx]->use_rc = true; /* allowing RC for incoming connection */
bta_av_ssm_execute(p_cb->p_scb[xx], BTA_AV_ACP_CONNECT_EVT, p_data);
/* The Pending Event should be sent as soon as the L2CAP signalling channel
@@ -1524,7 +1521,7 @@
}
}
}
-#if ( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
else if (event == BTA_AR_AVDT_CONN_EVT)
{
alarm_cancel(bta_av_cb.link_signalling_timer);
@@ -1571,7 +1568,7 @@
{
tBTA_AV_CB *p_cb = &bta_av_cb;
int xx;
- UINT8 mask;
+ uint8_t mask;
tBTA_AV_LCB *p_lcb = NULL;
tBTA_AV_PEND pend;
UNUSED(p_data);
@@ -1607,7 +1604,7 @@
*******************************************************************************/
static void bta_av_accept_signalling_timer_cback(void *data)
{
- UINT32 inx = PTR_TO_UINT(data);
+ uint32_t inx = PTR_TO_UINT(data);
tBTA_AV_CB *p_cb = &bta_av_cb;
tBTA_AV_SCB *p_scb = NULL;
if (inx < BTA_AV_NUM_STRS)
@@ -1671,18 +1668,18 @@
** Returns tBTA_AV_FEAT peer device feature mask
**
*******************************************************************************/
-tBTA_AV_FEAT bta_av_check_peer_features (UINT16 service_uuid)
+tBTA_AV_FEAT bta_av_check_peer_features (uint16_t service_uuid)
{
tBTA_AV_FEAT peer_features = 0;
tBTA_AV_CB *p_cb = &bta_av_cb;
tSDP_DISC_REC *p_rec = NULL;
tSDP_DISC_ATTR *p_attr;
- UINT16 peer_rc_version=0;
- UINT16 categories = 0;
+ uint16_t peer_rc_version=0;
+ uint16_t categories = 0;
APPL_TRACE_DEBUG("bta_av_check_peer_features service_uuid:x%x", service_uuid);
/* loop through all records we found */
- while (TRUE)
+ while (true)
{
/* get next record; if none found, we're done */
if ((p_rec = SDP_FindServiceInDb(p_cb->p_disc_db, service_uuid, p_rec)) == NULL)
@@ -1741,18 +1738,18 @@
** Returns tBTA_AV_FEAT peer device feature mask
**
*******************************************************************************/
-tBTA_AV_FEAT bta_avk_check_peer_features (UINT16 service_uuid)
+tBTA_AV_FEAT bta_avk_check_peer_features (uint16_t service_uuid)
{
tBTA_AV_FEAT peer_features = 0;
tBTA_AV_CB *p_cb = &bta_av_cb;
- APPL_TRACE_DEBUG("%s service_uuid:x%x", __FUNCTION__, service_uuid);
+ APPL_TRACE_DEBUG("%s service_uuid:x%x", __func__, service_uuid);
/* loop through all records we found */
tSDP_DISC_REC *p_rec = SDP_FindServiceInDb(p_cb->p_disc_db, service_uuid, NULL);
while (p_rec)
{
- APPL_TRACE_DEBUG("%s found Service record for x%x", __FUNCTION__, service_uuid);
+ APPL_TRACE_DEBUG("%s found Service record for x%x", __func__, service_uuid);
if (( SDP_FindAttributeInRec(p_rec, ATTR_ID_SERVICE_CLASS_ID_LIST)) != NULL)
{
@@ -1770,11 +1767,11 @@
if (( SDP_FindAttributeInRec(p_rec, ATTR_ID_BT_PROFILE_DESC_LIST)) != NULL)
{
/* get profile version (if failure, version parameter is not updated) */
- UINT16 peer_rc_version = 0;
- BOOLEAN val = SDP_FindProfileVersionInRec(
+ uint16_t peer_rc_version = 0;
+ bool val = SDP_FindProfileVersionInRec(
p_rec, UUID_SERVCLASS_AV_REMOTE_CONTROL, &peer_rc_version);
APPL_TRACE_DEBUG("%s peer_rc_version for TG 0x%x, profile_found %d",
- __FUNCTION__, peer_rc_version, val);
+ __func__, peer_rc_version, val);
if (peer_rc_version >= AVRC_REV_1_3)
peer_features |= (BTA_AV_FEAT_VENDOR | BTA_AV_FEAT_METADATA);
@@ -1790,7 +1787,7 @@
tSDP_DISC_ATTR *p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SUPPORTED_FEATURES);
if (p_attr != NULL)
{
- UINT16 categories = p_attr->attr_value.v.u16;
+ uint16_t categories = p_attr->attr_value.v.u16;
if (categories & AVRC_SUPF_CT_CAT2)
peer_features |= (BTA_AV_FEAT_ADV_CTRL);
if (categories & AVRC_SUPF_CT_APP_SETTINGS)
@@ -1801,7 +1798,7 @@
/* get next record; if none found, we're done */
p_rec = SDP_FindServiceInDb(p_cb->p_disc_db, service_uuid, p_rec);
}
- APPL_TRACE_DEBUG("%s peer_features:x%x", __FUNCTION__, peer_features);
+ APPL_TRACE_DEBUG("%s peer_features:x%x", __func__, peer_features);
return peer_features;
}
@@ -1822,11 +1819,11 @@
tBTA_AV_LCB *p_lcb;
tBTA_AV_RC_OPEN rc_open;
tBTA_AV_RC_FEAT rc_feat;
- UINT8 rc_handle;
+ uint8_t rc_handle;
tBTA_AV_FEAT peer_features = 0; /* peer features mask */
UNUSED(p_data);
- APPL_TRACE_DEBUG("%s bta_av_rc_disc_done disc:x%x", __FUNCTION__, p_cb->disc);
+ APPL_TRACE_DEBUG("%s bta_av_rc_disc_done disc:x%x", __func__, p_cb->disc);
if (!p_cb->disc)
{
return;
@@ -1855,7 +1852,7 @@
}
}
- APPL_TRACE_DEBUG("%s rc_handle %d", __FUNCTION__, rc_handle);
+ APPL_TRACE_DEBUG("%s rc_handle %d", __func__, rc_handle);
#if (BTA_AV_SINK_INCLUDED == TRUE)
if (p_cb->sdp_a2d_snk_handle)
{
@@ -1889,14 +1886,14 @@
{
if (p_scb)
{
- /* if peer remote control service matches ours and USE_RC is TRUE */
+ /* if peer remote control service matches ours and USE_RC is true */
if ((((p_cb->features & BTA_AV_FEAT_RCCT) && (peer_features & BTA_AV_FEAT_RCTG)) ||
((p_cb->features & BTA_AV_FEAT_RCTG) && (peer_features & BTA_AV_FEAT_RCCT))) )
{
p_lcb = bta_av_find_lcb(p_scb->peer_addr, BTA_AV_LCB_FIND);
if (p_lcb)
{
- rc_handle = bta_av_rc_create(p_cb, AVCT_INT, (UINT8)(p_scb->hdi + 1), p_lcb->lidx);
+ rc_handle = bta_av_rc_create(p_cb, AVCT_INT, (uint8_t)(p_scb->hdi + 1), p_lcb->lidx);
p_cb->rcb[rc_handle].peer_features = peer_features;
}
#if (BT_USE_TRACES == TRUE || BT_TRACE_APPL == TRUE)
@@ -1909,7 +1906,7 @@
else if (p_scb->use_rc)
{
/* can not find AVRC on peer device. report failure */
- p_scb->use_rc = FALSE;
+ p_scb->use_rc = false;
bdcpy(rc_open.peer_addr, p_scb->peer_addr);
rc_open.peer_features = 0;
rc_open.status = BTA_AV_FAIL_SDP;
@@ -1954,7 +1951,7 @@
tBTA_AV_RCB *p_rcb;
tBTA_AV_SCB *p_scb;
int i;
- BOOLEAN conn = FALSE;
+ bool conn = false;
tBTA_AV_LCB *p_lcb;
rc_close.rc_handle = BTA_AV_RC_HANDLE_NONE;
@@ -2018,7 +2015,7 @@
else if ((p_rcb->handle != BTA_AV_RC_HANDLE_NONE) && (p_rcb->status & BTA_AV_RC_CONN_MASK))
{
/* at least one channel is still connected */
- conn = TRUE;
+ conn = true;
}
}
@@ -2045,17 +2042,17 @@
** Returns void
**
*******************************************************************************/
-void bta_av_rc_disc(UINT8 disc)
+void bta_av_rc_disc(uint8_t disc)
{
tBTA_AV_CB *p_cb = &bta_av_cb;
tAVRC_SDP_DB_PARAMS db_params;
- UINT16 attr_list[] = {ATTR_ID_SERVICE_CLASS_ID_LIST,
+ uint16_t attr_list[] = {ATTR_ID_SERVICE_CLASS_ID_LIST,
ATTR_ID_BT_PROFILE_DESC_LIST,
ATTR_ID_SUPPORTED_FEATURES};
- UINT8 hdi;
+ uint8_t hdi;
tBTA_AV_SCB *p_scb;
- UINT8 *p_addr = NULL;
- UINT8 rc_handle;
+ uint8_t *p_addr = NULL;
+ uint8_t rc_handle;
APPL_TRACE_DEBUG("bta_av_rc_disc 0x%x, %d", disc, bta_av_cb.disc);
if ((bta_av_cb.disc != 0) || (disc == 0))
@@ -2117,7 +2114,7 @@
tBTA_AV_CB *p_cb = &bta_av_cb;
tBTA_AV_SCB *p_scb;
tBTA_UTL_COD cod;
- UINT8 mask;
+ uint8_t mask;
BT_HDR *p_buf;
/* find the stream control block */
@@ -2149,7 +2146,7 @@
/* remove the A2DP SDP record, if no more audio stream is left */
if (!p_cb->reg_audio)
{
-#if ( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
bta_ar_dereg_avrc (UUID_SERVCLASS_AV_REMOTE_CONTROL, BTA_ID_AV);
#endif
if (p_cb->sdp_a2d_handle)
@@ -2189,7 +2186,7 @@
/* if no stream control block is active */
if ((p_cb->reg_audio + p_cb->reg_video) == 0)
{
-#if ( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
/* deregister from AVDT */
bta_ar_dereg_avdt(BTA_ID_AV);
@@ -2200,7 +2197,7 @@
if (p_cb->disabling)
{
- p_cb->disabling = FALSE;
+ p_cb->disabling = false;
bta_av_cb.features = 0;
}
diff --git a/bta/av/bta_av_api.c b/bta/av/bta_av_api.c
index 5a033c9..2c13447 100644
--- a/bta/av/bta_av_api.c
+++ b/bta/av/bta_av_api.c
@@ -27,7 +27,7 @@
#include <assert.h>
#include "bt_target.h"
-#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE)
+#if (BTA_AV_INCLUDED == TRUE)
#include "bta_api.h"
#include "bta_sys.h"
@@ -109,8 +109,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvRegister(tBTA_AV_CHNL chnl, const char *p_service_name, UINT8 app_id,
- tBTA_AV_DATA_CBACK *p_data_cback, UINT16 service_uuid)
+void BTA_AvRegister(tBTA_AV_CHNL chnl, const char *p_service_name, uint8_t app_id,
+ tBTA_AV_DATA_CBACK *p_data_cback, uint16_t service_uuid)
{
tBTA_AV_API_REG *p_buf =
(tBTA_AV_API_REG *)osi_malloc(sizeof(tBTA_AV_API_REG));
@@ -158,8 +158,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvOpen(BD_ADDR bd_addr, tBTA_AV_HNDL handle, BOOLEAN use_rc, tBTA_SEC sec_mask,
- UINT16 uuid)
+void BTA_AvOpen(BD_ADDR bd_addr, tBTA_AV_HNDL handle, bool use_rc, tBTA_SEC sec_mask,
+ uint16_t uuid)
{
tBTA_AV_API_OPEN *p_buf =
(tBTA_AV_API_OPEN *)osi_malloc(sizeof(tBTA_AV_API_OPEN));
@@ -299,19 +299,19 @@
** Function BTA_AvStop
**
** Description Stop audio/video stream data transfer.
-** If suspend is TRUE, this function sends AVDT suspend signal
+** If suspend is true, this function sends AVDT suspend signal
** to the connected peer(s).
**
** Returns void
**
*******************************************************************************/
-void BTA_AvStop(BOOLEAN suspend)
+void BTA_AvStop(bool suspend)
{
tBTA_AV_API_STOP *p_buf =
(tBTA_AV_API_STOP *)osi_malloc(sizeof(tBTA_AV_API_STOP));
p_buf->hdr.event = BTA_AV_API_STOP_EVT;
- p_buf->flush = TRUE;
+ p_buf->flush = true;
p_buf->suspend = suspend;
bta_sys_sendmsg(p_buf);
@@ -322,16 +322,16 @@
** Function BTA_AvReconfig
**
** Description Reconfigure the audio/video stream.
-** If suspend is TRUE, this function tries the suspend/reconfigure
+** If suspend is true, this function tries the suspend/reconfigure
** procedure first.
-** If suspend is FALSE or when suspend/reconfigure fails,
+** If suspend is false or when suspend/reconfigure fails,
** this function closes and re-opens the AVDT connection.
**
** Returns void
**
*******************************************************************************/
-void BTA_AvReconfig(tBTA_AV_HNDL hndl, BOOLEAN suspend, UINT8 sep_info_idx,
- UINT8 *p_codec_info, UINT8 num_protect, UINT8 *p_protect_info)
+void BTA_AvReconfig(tBTA_AV_HNDL hndl, bool suspend, uint8_t sep_info_idx,
+ uint8_t *p_codec_info, uint8_t num_protect, uint8_t *p_protect_info)
{
tBTA_AV_API_RCFG *p_buf =
(tBTA_AV_API_RCFG *)osi_malloc(sizeof(tBTA_AV_API_RCFG) + num_protect);
@@ -341,7 +341,7 @@
p_buf->num_protect = num_protect;
p_buf->suspend = suspend;
p_buf->sep_info_idx = sep_info_idx;
- p_buf->p_protect_info = (UINT8 *)(p_buf + 1);
+ p_buf->p_protect_info = (uint8_t *)(p_buf + 1);
memcpy(p_buf->codec_info, p_codec_info, AVDT_CODEC_SIZE);
memcpy(p_buf->p_protect_info, p_protect_info, num_protect);
@@ -358,7 +358,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvProtectReq(tBTA_AV_HNDL hndl, UINT8 *p_data, UINT16 len)
+void BTA_AvProtectReq(tBTA_AV_HNDL hndl, uint8_t *p_data, uint16_t len)
{
tBTA_AV_API_PROTECT_REQ *p_buf =
(tBTA_AV_API_PROTECT_REQ *)osi_malloc(sizeof(tBTA_AV_API_PROTECT_REQ) + len);
@@ -369,7 +369,7 @@
if (p_data == NULL) {
p_buf->p_data = NULL;
} else {
- p_buf->p_data = (UINT8 *) (p_buf + 1);
+ p_buf->p_data = (uint8_t *) (p_buf + 1);
memcpy(p_buf->p_data, p_data, len);
}
@@ -388,7 +388,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvProtectRsp(tBTA_AV_HNDL hndl, UINT8 error_code, UINT8 *p_data, UINT16 len)
+void BTA_AvProtectRsp(tBTA_AV_HNDL hndl, uint8_t error_code, uint8_t *p_data, uint16_t len)
{
tBTA_AV_API_PROTECT_RSP *p_buf =
(tBTA_AV_API_PROTECT_RSP *)osi_malloc(sizeof(tBTA_AV_API_PROTECT_RSP) + len);
@@ -400,7 +400,7 @@
if (p_data == NULL) {
p_buf->p_data = NULL;
} else {
- p_buf->p_data = (UINT8 *) (p_buf + 1);
+ p_buf->p_data = (uint8_t *) (p_buf + 1);
memcpy(p_buf->p_data, p_data, len);
}
@@ -417,7 +417,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvRemoteCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_RC rc_id, tBTA_AV_STATE key_state)
+void BTA_AvRemoteCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_RC rc_id, tBTA_AV_STATE key_state)
{
tBTA_AV_API_REMOTE_CMD *p_buf =
(tBTA_AV_API_REMOTE_CMD *)osi_malloc(sizeof(tBTA_AV_API_REMOTE_CMD));
@@ -444,9 +444,9 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvRemoteVendorUniqueCmd(UINT8 rc_handle, UINT8 label,
- tBTA_AV_STATE key_state, UINT8* p_msg,
- UINT8 buf_len)
+void BTA_AvRemoteVendorUniqueCmd(uint8_t rc_handle, uint8_t label,
+ tBTA_AV_STATE key_state, uint8_t* p_msg,
+ uint8_t buf_len)
{
tBTA_AV_API_REMOTE_CMD *p_buf =
(tBTA_AV_API_REMOTE_CMD *)osi_malloc(sizeof(tBTA_AV_API_REMOTE_CMD) +
@@ -461,7 +461,7 @@
if (p_msg == NULL) {
p_buf->msg.p_pass_data = NULL;
} else {
- p_buf->msg.p_pass_data = (UINT8 *)(p_buf + 1);
+ p_buf->msg.p_pass_data = (uint8_t *)(p_buf + 1);
memcpy(p_buf->msg.p_pass_data, p_msg, buf_len);
}
bta_sys_sendmsg(p_buf);
@@ -478,7 +478,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvVendorCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE cmd_code, UINT8 *p_data, UINT16 len)
+void BTA_AvVendorCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE cmd_code, uint8_t *p_data, uint16_t len)
{
tBTA_AV_API_VENDOR *p_buf =
(tBTA_AV_API_VENDOR *)osi_malloc(sizeof(tBTA_AV_API_VENDOR) + len);
@@ -494,7 +494,7 @@
if (p_data == NULL) {
p_buf->msg.p_vendor_data = NULL;
} else {
- p_buf->msg.p_vendor_data = (UINT8 *) (p_buf + 1);
+ p_buf->msg.p_vendor_data = (uint8_t *) (p_buf + 1);
memcpy(p_buf->msg.p_vendor_data, p_data, len);
}
@@ -513,7 +513,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvVendorRsp(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE rsp_code, UINT8 *p_data, UINT16 len, UINT32 company_id)
+void BTA_AvVendorRsp(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code, uint8_t *p_data, uint16_t len, uint32_t company_id)
{
tBTA_AV_API_VENDOR *p_buf =
(tBTA_AV_API_VENDOR *)osi_malloc(sizeof(tBTA_AV_API_VENDOR) + len);
@@ -532,7 +532,7 @@
if (p_data == NULL) {
p_buf->msg.p_vendor_data = NULL;
} else {
- p_buf->msg.p_vendor_data = (UINT8 *) (p_buf + 1);
+ p_buf->msg.p_vendor_data = (uint8_t *) (p_buf + 1);
memcpy(p_buf->msg.p_vendor_data, p_data, len);
}
@@ -569,7 +569,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvCloseRc(UINT8 rc_handle)
+void BTA_AvCloseRc(uint8_t rc_handle)
{
tBTA_AV_API_CLOSE_RC *p_buf =
(tBTA_AV_API_CLOSE_RC *)osi_malloc(sizeof(tBTA_AV_API_CLOSE_RC));
@@ -592,7 +592,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvMetaRsp(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE rsp_code,
+void BTA_AvMetaRsp(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code,
BT_HDR *p_pkt)
{
tBTA_AV_API_META_RSP *p_buf =
@@ -602,7 +602,7 @@
p_buf->hdr.layer_specific = rc_handle;
p_buf->rsp_code = rsp_code;
p_buf->p_pkt = p_pkt;
- p_buf->is_rsp = TRUE;
+ p_buf->is_rsp = true;
p_buf->label = label;
bta_sys_sendmsg(p_buf);
@@ -622,7 +622,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvMetaCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CMD cmd_code, BT_HDR *p_pkt)
+void BTA_AvMetaCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_CMD cmd_code, BT_HDR *p_pkt)
{
tBTA_AV_API_META_RSP *p_buf =
(tBTA_AV_API_META_RSP *)osi_malloc(sizeof(tBTA_AV_API_META_RSP));
@@ -631,7 +631,7 @@
p_buf->hdr.layer_specific = rc_handle;
p_buf->p_pkt = p_pkt;
p_buf->rsp_code = cmd_code;
- p_buf->is_rsp = FALSE;
+ p_buf->is_rsp = false;
p_buf->label = label;
bta_sys_sendmsg(p_buf);
diff --git a/bta/av/bta_av_cfg.c b/bta/av/bta_av_cfg.c
index 7e13316..0b6f4be 100644
--- a/bta/av/bta_av_cfg.c
+++ b/bta/av/bta_av_cfg.c
@@ -34,7 +34,7 @@
#define BTA_AV_RC_PASS_RSP_CODE BTA_AV_RSP_NOT_IMPL
#endif
-const UINT32 bta_av_meta_caps_co_ids[] = {
+const uint32_t bta_av_meta_caps_co_ids[] = {
AVRC_CO_METADATA,
AVRC_CO_BROADCOM
};
@@ -54,7 +54,7 @@
*/
/* Flushing partial avdtp packets can cause some headsets to disconnect the link
if receiving partial a2dp frames */
-const UINT16 bta_av_audio_flush_to[] = {
+const uint16_t bta_av_audio_flush_to[] = {
0, /* 1 stream */
0, /* 2 streams */
0, /* 3 streams */
@@ -63,8 +63,8 @@
}; /* AVDTP audio transport channel flush timeout */
/* Note: Android doesnt support AVRC_SUPF_TG_GROUP_NAVI */
-/* Note: if AVRC_SUPF_TG_GROUP_NAVI is set, bta_av_cfg.avrc_group should be TRUE */
-#if AVRC_METADATA_INCLUDED == TRUE
+/* Note: if AVRC_SUPF_TG_GROUP_NAVI is set, bta_av_cfg.avrc_group should be true */
+#if (AVRC_METADATA_INCLUDED == TRUE)
#define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1) /* TODO: | AVRC_SUPF_TG_APP_SETTINGS) */
#else
#define BTA_AV_RC_SUPF_TG (AVRC_SUPF_TG_CAT1)
@@ -73,7 +73,7 @@
/*
* If the number of event IDs is changed in this array, BTA_AV_ NUM_RC_EVT_IDS also needs to be changed.
*/
-const UINT8 bta_av_meta_caps_evt_ids[] = {
+const uint8_t bta_av_meta_caps_evt_ids[] = {
AVRC_EVT_PLAY_STATUS_CHANGE,
AVRC_EVT_TRACK_CHANGE,
AVRC_EVT_PLAY_POS_CHANGED,
@@ -85,8 +85,8 @@
#define BTA_AV_NUM_RC_EVT_IDS (sizeof(bta_av_meta_caps_evt_ids) / sizeof(bta_av_meta_caps_evt_ids[0]))
#endif /* BTA_AV_NUM_RC_EVT_IDS */
-const UINT8 bta_avk_meta_caps_evt_ids[] = {
-#if AVRC_ADV_CTRL_INCLUDED == TRUE
+const uint8_t bta_avk_meta_caps_evt_ids[] = {
+#if (AVRC_ADV_CTRL_INCLUDED == TRUE)
AVRC_EVT_VOLUME_CHANGE,
#endif
};
@@ -104,7 +104,7 @@
const tBTA_AV_CFG bta_av_cfg =
{
AVRC_CO_BROADCOM, /* AVRCP Company ID */
-#if AVRC_METADATA_INCLUDED == TRUE
+#if (AVRC_METADATA_INCLUDED == TRUE)
512, /* AVRCP MTU at L2CAP for control channel */
#else
48, /* AVRCP MTU at L2CAP for control channel */
@@ -118,7 +118,7 @@
6, /* AVDTP audio channel max data queue size */
BTA_AV_MAX_VDP_MTU, /* AVDTP video transport channel MTU at L2CAP */
600, /* AVDTP video transport channel flush timeout */
- FALSE, /* TRUE, to accept AVRC 1.3 group nevigation command */
+ false, /* true, to accept AVRC 1.3 group nevigation command */
2, /* company id count in p_meta_co_ids */
BTA_AV_NUM_RC_EVT_IDS, /* event id count in p_meta_evt_ids */
BTA_AV_RC_PASS_RSP_CODE,/* the default response code for pass through commands */
@@ -134,7 +134,7 @@
const tBTA_AV_CFG bta_avk_cfg =
{
AVRC_CO_METADATA, /* AVRCP Company ID */
-#if AVRC_METADATA_INCLUDED == TRUE
+#if (AVRC_METADATA_INCLUDED == TRUE)
512, /* AVRCP MTU at L2CAP for control channel */
#else
48, /* AVRCP MTU at L2CAP for control channel */
@@ -148,7 +148,7 @@
6, /* AVDTP audio channel max data queue size */
BTA_AV_MAX_VDP_MTU, /* AVDTP video transport channel MTU at L2CAP */
600, /* AVDTP video transport channel flush timeout */
- FALSE, /* TRUE, to accept AVRC 1.3 group nevigation command */
+ false, /* true, to accept AVRC 1.3 group nevigation command */
2, /* company id count in p_meta_co_ids */
BTA_AVK_NUM_RC_EVT_IDS, /* event id count in p_meta_evt_ids */
BTA_AV_RC_PASS_RSP_CODE,/* the default response code for pass through commands */
@@ -162,7 +162,7 @@
tBTA_AV_CFG *p_bta_av_cfg = NULL;
-const UINT16 bta_av_rc_id[] =
+const uint16_t bta_av_rc_id[] =
{
0x0000, /* bit mask: 0=SELECT, 1=UP, 2=DOWN, 3=LEFT,
4=RIGHT, 5=RIGHT_UP, 6=RIGHT_DOWN, 7=LEFT_UP,
@@ -188,19 +188,19 @@
4=PLAY, 5=STOP, 6=PAUSE, 7=RECORD,
8=REWIND, 9=FAST_FOR, 10=EJECT, 11=FORWARD,
12=BACKWARD */
-#else
-#if (defined BTA_AVRCP_FF_RW_SUPPORT) && (BTA_AVRCP_FF_RW_SUPPORT == TRUE)
+#else /* BTA_AV_RC_PASS_RSP_CODE != BTA_AV_RSP_INTERIM */
+#if (BTA_AVRCP_FF_RW_SUPPORT == TRUE)
0x1b70, /* bit mask: 0=POWER, 1=VOL_UP, 2=VOL_DOWN, 3=MUTE,
4=PLAY, 5=STOP, 6=PAUSE, 7=RECORD,
8=REWIND, 9=FAST_FOR, 10=EJECT, 11=FORWARD,
12=BACKWARD */
-#else
+#else /* BTA_AVRCP_FF_RW_SUPPORT == FALSE */
0x1870, /* bit mask: 0=POWER, 1=VOL_UP, 2=VOL_DOWN, 3=MUTE,
4=PLAY, 5=STOP, 6=PAUSE, 7=RECORD,
8=REWIND, 9=FAST_FOR, 10=EJECT, 11=FORWARD,
12=BACKWARD */
-#endif
-#endif
+#endif /* BTA_AVRCP_FF_RW_SUPPORT */
+#endif /* BTA_AV_RC_PASS_RSP_CODE */
0x0000, /* bit mask: 0=ANGLE, 1=SUBPICT */
@@ -211,7 +211,7 @@
};
#if (BTA_AV_RC_PASS_RSP_CODE == BTA_AV_RSP_INTERIM)
-const UINT16 bta_av_rc_id_ac[] =
+const uint16_t bta_av_rc_id_ac[] =
{
0x0000, /* bit mask: 0=SELECT, 1=UP, 2=DOWN, 3=LEFT,
4=RIGHT, 5=RIGHT_UP, 6=RIGHT_DOWN, 7=LEFT_UP,
@@ -244,9 +244,9 @@
0x0000 /* bit mask: 0=not used, 1=F1, 2=F2, 3=F3,
4=F4, 5=F5 */
};
-UINT16 *p_bta_av_rc_id_ac = (UINT16 *) bta_av_rc_id_ac;
+uint16_t *p_bta_av_rc_id_ac = (uint16_t *) bta_av_rc_id_ac;
#else
-UINT16 *p_bta_av_rc_id_ac = NULL;
+uint16_t *p_bta_av_rc_id_ac = NULL;
#endif
-UINT16 *p_bta_av_rc_id = (UINT16 *) bta_av_rc_id;
+uint16_t *p_bta_av_rc_id = (uint16_t *) bta_av_rc_id;
diff --git a/bta/av/bta_av_ci.c b/bta/av/bta_av_ci.c
index 36169c6..4ea30d0 100644
--- a/bta/av/bta_av_ci.c
+++ b/bta/av/bta_av_ci.c
@@ -65,8 +65,8 @@
** Returns void
**
*******************************************************************************/
-void bta_av_ci_setconfig(tBTA_AV_HNDL hndl, UINT8 err_code, UINT8 category,
- UINT8 num_seid, UINT8 *p_seid, BOOLEAN recfg_needed, UINT8 avdt_handle)
+void bta_av_ci_setconfig(tBTA_AV_HNDL hndl, uint8_t err_code, uint8_t category,
+ uint8_t num_seid, uint8_t *p_seid, bool recfg_needed, uint8_t avdt_handle)
{
tBTA_AV_CI_SETCONFIG *p_buf =
(tBTA_AV_CI_SETCONFIG *)osi_malloc(sizeof(tBTA_AV_CI_SETCONFIG));
@@ -80,7 +80,7 @@
p_buf->num_seid = num_seid;
p_buf->avdt_handle= avdt_handle;
if (p_seid && num_seid) {
- p_buf->p_seid = (UINT8 *)(p_buf + 1);
+ p_buf->p_seid = (uint8_t *)(p_buf + 1);
memcpy(p_buf->p_seid, p_seid, num_seid);
} else {
p_buf->p_seid = NULL;
diff --git a/bta/av/bta_av_int.h b/bta/av/bta_av_int.h
index 5b81479..de7a59c 100644
--- a/bta/av/bta_av_int.h
+++ b/bta/av/bta_av_int.h
@@ -147,8 +147,8 @@
/* the number of ACL links with AVDT */
#define BTA_AV_NUM_LINKS AVDT_NUM_LINKS
-#define BTA_AV_CO_ID_TO_BE_STREAM(p, u32) {*(p)++ = (UINT8)((u32) >> 16); *(p)++ = (UINT8)((u32) >> 8); *(p)++ = (UINT8)(u32); }
-#define BTA_AV_BE_STREAM_TO_CO_ID(u32, p) {(u32) = (((UINT32)(*((p) + 2))) + (((UINT32)(*((p) + 1))) << 8) + (((UINT32)(*(p))) << 16)); (p) += 3;}
+#define BTA_AV_CO_ID_TO_BE_STREAM(p, u32) {*(p)++ = (uint8_t)((u32) >> 16); *(p)++ = (uint8_t)((u32) >> 8); *(p)++ = (uint8_t)(u32); }
+#define BTA_AV_BE_STREAM_TO_CO_ID(u32, p) {(u32) = (((uint32_t)(*((p) + 2))) + (((uint32_t)(*((p) + 1))) << 8) + (((uint32_t)(*(p))) << 16)); (p) += 3;}
/* these bits are defined for bta_av_cb.multi_av */
#define BTA_AV_MULTI_AV_SUPPORTED 0x01
@@ -160,26 +160,26 @@
*****************************************************************************/
/* function types for call-out functions */
-typedef BOOLEAN (*tBTA_AV_CO_INIT) (UINT8 *p_codec_type, UINT8 *p_codec_info,
- UINT8 *p_num_protect, UINT8 *p_protect_info, UINT8 index);
-typedef void (*tBTA_AV_CO_DISC_RES) (tBTA_AV_HNDL hndl, UINT8 num_seps,
- UINT8 num_snk, UINT8 num_src, BD_ADDR addr, UINT16 uuid_local);
-typedef UINT8 (*tBTA_AV_CO_GETCFG) (tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT8 *p_codec_info, UINT8 *p_sep_info_idx, UINT8 seid,
- UINT8 *p_num_protect, UINT8 *p_protect_info);
+typedef bool (*tBTA_AV_CO_INIT) (uint8_t *p_codec_type, uint8_t *p_codec_info,
+ uint8_t *p_num_protect, uint8_t *p_protect_info, uint8_t index);
+typedef void (*tBTA_AV_CO_DISC_RES) (tBTA_AV_HNDL hndl, uint8_t num_seps,
+ uint8_t num_snk, uint8_t num_src, BD_ADDR addr, uint16_t uuid_local);
+typedef uint8_t (*tBTA_AV_CO_GETCFG) (tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
+ uint8_t *p_codec_info, uint8_t *p_sep_info_idx, uint8_t seid,
+ uint8_t *p_num_protect, uint8_t *p_protect_info);
typedef void (*tBTA_AV_CO_SETCFG) (tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT8 *p_codec_info, UINT8 seid, BD_ADDR addr,
- UINT8 num_protect, UINT8 *p_protect_info,
- UINT8 t_local_sep, UINT8 avdt_handle);
+ uint8_t *p_codec_info, uint8_t seid, BD_ADDR addr,
+ uint8_t num_protect, uint8_t *p_protect_info,
+ uint8_t t_local_sep, uint8_t avdt_handle);
typedef void (*tBTA_AV_CO_OPEN) (tBTA_AV_HNDL hndl,
- tBTA_AV_CODEC codec_type, UINT8 *p_codec_info,
- UINT16 mtu);
-typedef void (*tBTA_AV_CO_CLOSE) (tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type, UINT16 mtu);
-typedef void (*tBTA_AV_CO_START) (tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,UINT8 *p_codec_info, BOOLEAN *p_no_rtp_hdr);
+ tBTA_AV_CODEC codec_type, uint8_t *p_codec_info,
+ uint16_t mtu);
+typedef void (*tBTA_AV_CO_CLOSE) (tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type, uint16_t mtu);
+typedef void (*tBTA_AV_CO_START) (tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,uint8_t *p_codec_info, bool *p_no_rtp_hdr);
typedef void (*tBTA_AV_CO_STOP) (tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type);
typedef void * (*tBTA_AV_CO_DATAPATH) (tBTA_AV_CODEC codec_type,
- UINT32 *p_len, UINT32 *p_timestamp);
-typedef void (*tBTA_AV_CO_DELAY) (tBTA_AV_HNDL hndl, UINT16 delay);
+ uint32_t *p_len, uint32_t *p_timestamp);
+typedef void (*tBTA_AV_CO_DELAY) (tBTA_AV_HNDL hndl, uint16_t delay);
/* the call-out functions for one stream */
typedef struct
@@ -210,9 +210,9 @@
{
BT_HDR hdr;
char p_service_name[BTA_SERVICE_NAME_LEN+1];
- UINT8 app_id;
- tBTA_AV_DATA_CBACK *p_app_data_cback;
- UINT16 service_uuid;
+ uint8_t app_id;
+ tBTA_AV_DATA_CBACK *p_app_data_cback;
+ uint16_t service_uuid;
} tBTA_AV_API_REG;
@@ -223,24 +223,24 @@
BTA_AV_RS_FAIL, /* the role switch result - failed */
BTA_AV_RS_DONE /* the role switch is done - continue */
};
-typedef UINT8 tBTA_AV_RS_RES;
+typedef uint8_t tBTA_AV_RS_RES;
/* data type for BTA_AV_API_OPEN_EVT */
typedef struct
{
BT_HDR hdr;
BD_ADDR bd_addr;
- BOOLEAN use_rc;
+ bool use_rc;
tBTA_SEC sec_mask;
tBTA_AV_RS_RES switch_res;
- UINT16 uuid; /* uuid of initiator */
+ uint16_t uuid; /* uuid of initiator */
} tBTA_AV_API_OPEN;
/* data type for BTA_AV_API_STOP_EVT */
typedef struct
{
- BT_HDR hdr;
- BOOLEAN suspend;
- BOOLEAN flush;
+ BT_HDR hdr;
+ bool suspend;
+ bool flush;
} tBTA_AV_API_STOP;
/* data type for BTA_AV_API_DISCONNECT_EVT */
@@ -254,17 +254,17 @@
typedef struct
{
BT_HDR hdr;
- UINT8 *p_data;
- UINT16 len;
+ uint8_t *p_data;
+ uint16_t len;
} tBTA_AV_API_PROTECT_REQ;
/* data type for BTA_AV_API_PROTECT_RSP_EVT */
typedef struct
{
BT_HDR hdr;
- UINT8 *p_data;
- UINT16 len;
- UINT8 error_code;
+ uint8_t *p_data;
+ uint16_t len;
+ uint8_t error_code;
} tBTA_AV_API_PROTECT_RSP;
/* data type for BTA_AV_API_REMOTE_CMD_EVT */
@@ -272,7 +272,7 @@
{
BT_HDR hdr;
tAVRC_MSG_PASS msg;
- UINT8 label;
+ uint8_t label;
} tBTA_AV_API_REMOTE_CMD;
/* data type for BTA_AV_API_VENDOR_CMD_EVT and RSP */
@@ -280,7 +280,7 @@
{
BT_HDR hdr;
tAVRC_MSG_VENDOR msg;
- UINT8 label;
+ uint8_t label;
} tBTA_AV_API_VENDOR;
/* data type for BTA_AV_API_RC_OPEN_EVT */
@@ -299,8 +299,8 @@
typedef struct
{
BT_HDR hdr;
- BOOLEAN is_rsp;
- UINT8 label;
+ bool is_rsp;
+ uint8_t label;
tBTA_AV_CODE rsp_code;
BT_HDR *p_pkt;
} tBTA_AV_API_META_RSP;
@@ -310,11 +310,11 @@
typedef struct
{
BT_HDR hdr;
- UINT8 codec_info[AVDT_CODEC_SIZE]; /* codec configuration */
- UINT8 *p_protect_info;
- UINT8 num_protect;
- BOOLEAN suspend;
- UINT8 sep_info_idx;
+ uint8_t codec_info[AVDT_CODEC_SIZE]; /* codec configuration */
+ uint8_t *p_protect_info;
+ uint8_t num_protect;
+ bool suspend;
+ uint8_t sep_info_idx;
} tBTA_AV_API_RCFG;
/* data type for BTA_AV_CI_SETCONFIG_OK_EVT and BTA_AV_CI_SETCONFIG_FAIL_EVT */
@@ -322,12 +322,12 @@
{
BT_HDR hdr;
tBTA_AV_HNDL hndl;
- UINT8 err_code;
- UINT8 category;
- UINT8 num_seid;
- UINT8 *p_seid;
- BOOLEAN recfg_needed;
- UINT8 avdt_handle; /* local sep type for which this stream will be set up */
+ uint8_t err_code;
+ uint8_t category;
+ uint8_t num_seid;
+ uint8_t *p_seid;
+ bool recfg_needed;
+ uint8_t avdt_handle; /* local sep type for which this stream will be set up */
} tBTA_AV_CI_SETCONFIG;
/* data type for all stream events from AVDTP */
@@ -336,9 +336,9 @@
tAVDT_CFG cfg; /* configuration/capabilities parameters */
tAVDT_CTRL msg; /* AVDTP callback message parameters */
BD_ADDR bd_addr; /* bd address */
- UINT8 handle;
- UINT8 avdt_event;
- BOOLEAN initiator; /* TRUE, if local device initiates the SUSPEND */
+ uint8_t handle;
+ uint8_t avdt_event;
+ bool initiator; /* true, if local device initiates the SUSPEND */
} tBTA_AV_STR_MSG;
/* data type for BTA_AV_AVRC_MSG_EVT */
@@ -346,9 +346,9 @@
{
BT_HDR hdr;
tAVRC_MSG msg;
- UINT8 handle;
- UINT8 label;
- UINT8 opcode;
+ uint8_t handle;
+ uint8_t label;
+ uint8_t opcode;
} tBTA_AV_RC_MSG;
/* data type for BTA_AV_AVRC_OPEN_EVT, BTA_AV_AVRC_CLOSE_EVT */
@@ -356,7 +356,7 @@
{
BT_HDR hdr;
BD_ADDR peer_addr;
- UINT8 handle;
+ uint8_t handle;
} tBTA_AV_RC_CONN_CHG;
/* data type for BTA_AV_CONN_CHG_EVT */
@@ -364,22 +364,22 @@
{
BT_HDR hdr;
BD_ADDR peer_addr;
- BOOLEAN is_up;
+ bool is_up;
} tBTA_AV_CONN_CHG;
/* data type for BTA_AV_ROLE_CHANGE_EVT */
typedef struct
{
BT_HDR hdr;
- UINT8 new_role;
- UINT8 hci_status;
+ uint8_t new_role;
+ uint8_t hci_status;
} tBTA_AV_ROLE_RES;
/* data type for BTA_AV_SDP_DISC_OK_EVT */
typedef struct
{
BT_HDR hdr;
- UINT16 avdt_version; /* AVDTP protocol version */
+ uint16_t avdt_version; /* AVDTP protocol version */
} tBTA_AV_SDP_RES;
/* data type for BTA_AV_API_OFFLOAD_RSP_EVT */
@@ -393,9 +393,9 @@
/* type for SEP control block */
typedef struct
{
- UINT8 av_handle; /* AVDTP handle */
+ uint8_t av_handle; /* AVDTP handle */
tBTA_AV_CODEC codec_type; /* codec type */
- UINT8 tsep; /* SEP type of local SEP */
+ uint8_t tsep; /* SEP type of local SEP */
tBTA_AV_DATA_CBACK *p_app_data_cback; /* Application callback for media packets */
} tBTA_AV_SEP;
@@ -441,11 +441,11 @@
typedef struct
{
tBTA_AV_VDP_DATA_ACT *p_act;
- UINT8 *p_frame;
- UINT16 buf_size;
- UINT32 len;
- UINT32 offset;
- UINT32 timestamp;
+ uint8_t *p_frame;
+ uint16_t buf_size;
+ uint32_t len;
+ uint32_t offset;
+ uint32_t timestamp;
} tBTA_AV_VF_INFO;
typedef union
@@ -479,7 +479,7 @@
{
const tBTA_AV_ACT *p_act_tbl; /* the action table for stream state machine */
const tBTA_AV_CO_FUNCTS *p_cos; /* the associated callout functions */
- BOOLEAN sdp_discovery_started; /* variable to determine whether SDP is started */
+ bool sdp_discovery_started; /* variable to determine whether SDP is started */
tBTA_AV_SEP seps[BTA_AV_MAX_SEPS];
tAVDT_CFG *p_cap; /* buffer used for get capabilities */
list_t *a2d_list; /* used for audio channels only */
@@ -488,47 +488,47 @@
tAVDT_CFG cfg; /* local SEP configuration */
alarm_t *avrc_ct_timer; /* delay timer for AVRC CT */
BD_ADDR peer_addr; /* peer BD address */
- UINT16 l2c_cid; /* L2CAP channel ID */
- UINT16 stream_mtu; /* MTU of stream */
- UINT16 avdt_version; /* the avdt version of peer device */
+ uint16_t l2c_cid; /* L2CAP channel ID */
+ uint16_t stream_mtu; /* MTU of stream */
+ uint16_t avdt_version; /* the avdt version of peer device */
tBTA_SEC sec_mask; /* security mask */
tBTA_AV_CODEC codec_type; /* codec type */
- UINT8 media_type; /* Media type */
- BOOLEAN cong; /* TRUE if AVDTP congested */
+ uint8_t media_type; /* Media type */
+ bool cong; /* true if AVDTP congested */
tBTA_AV_STATUS open_status; /* open failure status */
tBTA_AV_CHNL chnl; /* the channel: audio/video */
tBTA_AV_HNDL hndl; /* the handle: ((hdi + 1)|chnl) */
- UINT16 cur_psc_mask; /* Protocol service capabilities mask for current connection */
- UINT8 avdt_handle; /* AVDTP handle */
- UINT8 hdi; /* the index to SCB[] */
- UINT8 num_seps; /* number of seps returned by stream discovery */
- UINT8 num_disc_snks; /* number of discovered snks */
- UINT8 num_disc_srcs; /* number of discovered srcs */
- UINT8 sep_info_idx; /* current index into sep_info */
- UINT8 sep_idx; /* current index into local seps[] */
- UINT8 rcfg_idx; /* reconfig requested index into sep_info */
- UINT8 state; /* state machine state */
- UINT8 avdt_label; /* AVDTP label */
- UINT8 app_id; /* application id */
- UINT8 num_recfg; /* number of reconfigure sent */
- UINT8 role;
- UINT8 l2c_bufs; /* the number of buffers queued to L2CAP */
- UINT8 rc_handle; /* connected AVRCP handle */
- BOOLEAN use_rc; /* TRUE if AVRCP is allowed */
- BOOLEAN started; /* TRUE if stream started */
- UINT8 co_started; /* non-zero, if stream started from call-out perspective */
- BOOLEAN recfg_sup; /* TRUE if the first attempt to reconfigure the stream was successfull, else False if command fails */
- BOOLEAN suspend_sup; /* TRUE if Suspend stream is supported, else FALSE if suspend command fails */
- BOOLEAN deregistring; /* TRUE if deregistering */
- BOOLEAN sco_suspend; /* TRUE if SUSPEND is issued automatically for SCO */
- UINT8 coll_mask; /* Mask to check incoming and outgoing collision */
+ uint16_t cur_psc_mask; /* Protocol service capabilities mask for current connection */
+ uint8_t avdt_handle; /* AVDTP handle */
+ uint8_t hdi; /* the index to SCB[] */
+ uint8_t num_seps; /* number of seps returned by stream discovery */
+ uint8_t num_disc_snks; /* number of discovered snks */
+ uint8_t num_disc_srcs; /* number of discovered srcs */
+ uint8_t sep_info_idx; /* current index into sep_info */
+ uint8_t sep_idx; /* current index into local seps[] */
+ uint8_t rcfg_idx; /* reconfig requested index into sep_info */
+ uint8_t state; /* state machine state */
+ uint8_t avdt_label; /* AVDTP label */
+ uint8_t app_id; /* application id */
+ uint8_t num_recfg; /* number of reconfigure sent */
+ uint8_t role;
+ uint8_t l2c_bufs; /* the number of buffers queued to L2CAP */
+ uint8_t rc_handle; /* connected AVRCP handle */
+ bool use_rc; /* true if AVRCP is allowed */
+ bool started; /* true if stream started */
+ uint8_t co_started; /* non-zero, if stream started from call-out perspective */
+ bool recfg_sup; /* true if the first attempt to reconfigure the stream was successfull, else False if command fails */
+ bool suspend_sup; /* true if Suspend stream is supported, else false if suspend command fails */
+ bool deregistring; /* true if deregistering */
+ bool sco_suspend; /* true if SUSPEND is issued automatically for SCO */
+ uint8_t coll_mask; /* Mask to check incoming and outgoing collision */
tBTA_AV_API_OPEN open_api; /* Saved OPEN api message */
- UINT8 wait; /* set 0x1, when getting Caps as ACP, set 0x2, when started */
- UINT8 q_tag; /* identify the associated q_info union member */
- BOOLEAN no_rtp_hdr; /* TRUE if add no RTP header*/
- UINT16 uuid_int; /*intended UUID of Initiator to connect to */
- BOOLEAN offload_start_pending;
- BOOLEAN skip_sdp; /* Decides if sdp to be done prior to profile connection */
+ uint8_t wait; /* set 0x1, when getting Caps as ACP, set 0x2, when started */
+ uint8_t q_tag; /* identify the associated q_info union member */
+ bool no_rtp_hdr; /* true if add no RTP header*/
+ uint16_t uuid_int; /*intended UUID of Initiator to connect to */
+ bool offload_start_pending;
+ bool skip_sdp; /* Decides if sdp to be done prior to profile connection */
} tBTA_AV_SCB;
#define BTA_AV_RC_ROLE_MASK 0x10
@@ -541,10 +541,10 @@
/* index to this control block is the rc handle */
typedef struct
{
- UINT8 status;
- UINT8 handle;
- UINT8 shdl; /* stream handle (hdi + 1) */
- UINT8 lidx; /* (index+1) to LCB */
+ uint8_t status;
+ uint8_t handle;
+ uint8_t shdl; /* stream handle (hdi + 1) */
+ uint8_t lidx; /* (index+1) to LCB */
tBTA_AV_FEAT peer_features; /* peer features mask */
} tBTA_AV_RCB;
#define BTA_AV_NUM_RCB (BTA_AV_NUM_STRS + 2)
@@ -559,8 +559,8 @@
typedef struct
{
BD_ADDR addr; /* peer BD address */
- UINT8 conn_msk; /* handle mask of connected stream handle */
- UINT8 lidx; /* index + 1 */
+ uint8_t conn_msk; /* handle mask of connected stream handle */
+ uint8_t lidx; /* index + 1 */
} tBTA_AV_LCB;
/* type for stream state machine action functions */
@@ -577,30 +577,30 @@
tBTA_AV_LCB lcb[BTA_AV_NUM_LINKS+1]; /* link control block */
alarm_t *link_signalling_timer;
alarm_t *accept_signalling_timer; /* timer to monitor signalling when accepting */
- UINT32 sdp_a2d_handle; /* SDP record handle for audio src */
+ uint32_t sdp_a2d_handle; /* SDP record handle for audio src */
#if (BTA_AV_SINK_INCLUDED == TRUE)
- UINT32 sdp_a2d_snk_handle; /* SDP record handle for audio snk */
+ uint32_t sdp_a2d_snk_handle; /* SDP record handle for audio snk */
#endif
- UINT32 sdp_vdp_handle; /* SDP record handle for video src */
+ uint32_t sdp_vdp_handle; /* SDP record handle for video src */
tBTA_AV_FEAT features; /* features mask */
tBTA_SEC sec_mask; /* security mask */
tBTA_AV_HNDL handle; /* the handle for SDP activity */
- BOOLEAN disabling; /* TRUE if api disabled called */
- UINT8 disc; /* (hdi+1) or (rc_handle|BTA_AV_CHNL_MSK) if p_disc_db is in use */
- UINT8 state; /* state machine state */
- UINT8 conn_rc; /* handle mask of connected RCP channels */
- UINT8 conn_audio; /* handle mask of connected audio channels */
- UINT8 conn_video; /* handle mask of connected video channels */
- UINT8 conn_lcb; /* index mask of used LCBs */
- UINT8 audio_open_cnt; /* number of connected audio channels */
- UINT8 reg_audio; /* handle mask of registered audio channels */
- UINT8 reg_video; /* handle mask of registered video channels */
- UINT8 rc_acp_handle;
- UINT8 rc_acp_idx; /* (index + 1) to RCB */
- UINT8 rs_idx; /* (index + 1) to SCB for the one waiting for RS on open */
- BOOLEAN sco_occupied; /* TRUE if SCO is being used or call is in progress */
- UINT8 audio_streams; /* handle mask of streaming audio channels */
- UINT8 video_streams; /* handle mask of streaming video channels */
+ bool disabling; /* true if api disabled called */
+ uint8_t disc; /* (hdi+1) or (rc_handle|BTA_AV_CHNL_MSK) if p_disc_db is in use */
+ uint8_t state; /* state machine state */
+ uint8_t conn_rc; /* handle mask of connected RCP channels */
+ uint8_t conn_audio; /* handle mask of connected audio channels */
+ uint8_t conn_video; /* handle mask of connected video channels */
+ uint8_t conn_lcb; /* index mask of used LCBs */
+ uint8_t audio_open_cnt; /* number of connected audio channels */
+ uint8_t reg_audio; /* handle mask of registered audio channels */
+ uint8_t reg_video; /* handle mask of registered video channels */
+ uint8_t rc_acp_handle;
+ uint8_t rc_acp_idx; /* (index + 1) to RCB */
+ uint8_t rs_idx; /* (index + 1) to SCB for the one waiting for RS on open */
+ bool sco_occupied; /* true if SCO is being used or call is in progress */
+ uint8_t audio_streams; /* handle mask of streaming audio channels */
+ uint8_t video_streams; /* handle mask of streaming video channels */
} tBTA_AV_CB;
@@ -610,7 +610,7 @@
*****************************************************************************/
/* control block declaration */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_AV_CB bta_av_cb;
#else
extern tBTA_AV_CB *bta_av_cb_ptr;
@@ -623,46 +623,46 @@
extern const tBTA_AV_CFG bta_av_cfg;
/* rc id config struct */
-extern UINT16 *p_bta_av_rc_id;
-extern UINT16 *p_bta_av_rc_id_ac;
+extern uint16_t *p_bta_av_rc_id;
+extern uint16_t *p_bta_av_rc_id_ac;
extern const tBTA_AV_SACT bta_av_a2d_action[];
extern const tBTA_AV_CO_FUNCTS bta_av_a2d_cos;
extern const tBTA_AV_SACT bta_av_vdp_action[];
extern tAVDT_CTRL_CBACK * const bta_av_dt_cback[];
-extern void bta_av_stream_data_cback(UINT8 handle, BT_HDR *p_pkt, UINT32 time_stamp, UINT8 m_pt);
+extern void bta_av_stream_data_cback(uint8_t handle, BT_HDR *p_pkt, uint32_t time_stamp, uint8_t m_pt);
/*****************************************************************************
** Function prototypes
*****************************************************************************/
/* utility functions */
-extern tBTA_AV_SCB *bta_av_hndl_to_scb(UINT16 handle);
-extern BOOLEAN bta_av_chk_start(tBTA_AV_SCB *p_scb);
+extern tBTA_AV_SCB *bta_av_hndl_to_scb(uint16_t handle);
+extern bool bta_av_chk_start(tBTA_AV_SCB *p_scb);
extern void bta_av_restore_switch (void);
-extern UINT16 bta_av_chk_mtu(tBTA_AV_SCB *p_scb, UINT16 mtu);
-extern void bta_av_conn_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data);
-extern UINT8 bta_av_rc_create(tBTA_AV_CB *p_cb, UINT8 role, UINT8 shdl, UINT8 lidx);
-extern void bta_av_stream_chg(tBTA_AV_SCB *p_scb, BOOLEAN started);
-extern BOOLEAN bta_av_is_scb_opening (tBTA_AV_SCB *p_scb);
-extern BOOLEAN bta_av_is_scb_incoming (tBTA_AV_SCB *p_scb);
+extern uint16_t bta_av_chk_mtu(tBTA_AV_SCB *p_scb, uint16_t mtu);
+extern void bta_av_conn_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data);
+extern uint8_t bta_av_rc_create(tBTA_AV_CB *p_cb, uint8_t role, uint8_t shdl, uint8_t lidx);
+extern void bta_av_stream_chg(tBTA_AV_SCB *p_scb, bool started);
+extern bool bta_av_is_scb_opening (tBTA_AV_SCB *p_scb);
+extern bool bta_av_is_scb_incoming (tBTA_AV_SCB *p_scb);
extern void bta_av_set_scb_sst_init (tBTA_AV_SCB *p_scb);
-extern BOOLEAN bta_av_is_scb_init (tBTA_AV_SCB *p_scb);
+extern bool bta_av_is_scb_init (tBTA_AV_SCB *p_scb);
extern void bta_av_set_scb_sst_incoming (tBTA_AV_SCB *p_scb);
-extern tBTA_AV_LCB * bta_av_find_lcb(BD_ADDR addr, UINT8 op);
+extern tBTA_AV_LCB * bta_av_find_lcb(BD_ADDR addr, uint8_t op);
/* main functions */
extern void bta_av_api_deregister(tBTA_AV_DATA *p_data);
extern void bta_av_dup_audio_buf(tBTA_AV_SCB *p_scb, BT_HDR *p_buf);
-extern void bta_av_sm_execute(tBTA_AV_CB *p_cb, UINT16 event, tBTA_AV_DATA *p_data);
-extern void bta_av_ssm_execute(tBTA_AV_SCB *p_scb, UINT16 event, tBTA_AV_DATA *p_data);
-extern BOOLEAN bta_av_hdl_event(BT_HDR *p_msg);
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
-extern char *bta_av_evt_code(UINT16 evt_code);
+extern void bta_av_sm_execute(tBTA_AV_CB *p_cb, uint16_t event, tBTA_AV_DATA *p_data);
+extern void bta_av_ssm_execute(tBTA_AV_SCB *p_scb, uint16_t event, tBTA_AV_DATA *p_data);
+extern bool bta_av_hdl_event(BT_HDR *p_msg);
+#if (BTA_AV_DEBUG == TRUE)
+extern char *bta_av_evt_code(uint16_t evt_code);
#endif
-extern BOOLEAN bta_av_switch_if_needed(tBTA_AV_SCB *p_scb);
-extern BOOLEAN bta_av_link_role_ok(tBTA_AV_SCB *p_scb, UINT8 bits);
-extern BOOLEAN bta_av_is_rcfg_sst(tBTA_AV_SCB *p_scb);
+extern bool bta_av_switch_if_needed(tBTA_AV_SCB *p_scb);
+extern bool bta_av_link_role_ok(tBTA_AV_SCB *p_scb, uint8_t bits);
+extern bool bta_av_is_rcfg_sst(tBTA_AV_SCB *p_scb);
/* nsm action functions */
extern void bta_av_api_disconnect(tBTA_AV_DATA *p_data);
@@ -670,7 +670,7 @@
extern void bta_av_signalling_timer(tBTA_AV_DATA *p_data);
extern void bta_av_rc_disc_done(tBTA_AV_DATA *p_data);
extern void bta_av_rc_closed(tBTA_AV_DATA *p_data);
-extern void bta_av_rc_disc(UINT8 disc);
+extern void bta_av_rc_disc(uint8_t disc);
extern void bta_av_conn_chg(tBTA_AV_DATA *p_data);
extern void bta_av_dereg_comp(tBTA_AV_DATA *p_data);
@@ -686,7 +686,7 @@
extern void bta_av_rc_free_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data);
extern void bta_av_rc_free_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data);
-extern tBTA_AV_RCB * bta_av_get_rcb_by_shdl(UINT8 shdl);
+extern tBTA_AV_RCB * bta_av_get_rcb_by_shdl(uint8_t shdl);
extern void bta_av_del_rc(tBTA_AV_RCB *p_rcb);
/* ssm action functions */
diff --git a/bta/av/bta_av_main.c b/bta/av/bta_av_main.c
index 735ee2c..556d97c 100644
--- a/bta/av/bta_av_main.c
+++ b/bta/av/bta_av_main.c
@@ -30,14 +30,14 @@
#include "bt_target.h"
#include "osi/include/log.h"
-#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE)
+#if (BTA_AV_INCLUDED == TRUE)
#include "bta_av_co.h"
#include "bta_av_int.h"
#include "l2c_api.h"
#include "l2cdefs.h"
#include "utl.h"
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
#include "bta_ar_api.h"
#endif
@@ -115,7 +115,7 @@
#define BTA_AV_NUM_COLS 2 /* number of columns in state tables */
/* state table for init state */
-static const UINT8 bta_av_st_init[][BTA_AV_NUM_COLS] =
+static const uint8_t bta_av_st_init[][BTA_AV_NUM_COLS] =
{
/* Event Action 1 Next state */
/* API_DISABLE_EVT */ {BTA_AV_DISABLE, BTA_AV_INIT_ST },
@@ -130,7 +130,7 @@
};
/* state table for open state */
-static const UINT8 bta_av_st_open[][BTA_AV_NUM_COLS] =
+static const uint8_t bta_av_st_open[][BTA_AV_NUM_COLS] =
{
/* Event Action 1 Next state */
/* API_DISABLE_EVT */ {BTA_AV_DISABLE, BTA_AV_INIT_ST },
@@ -145,7 +145,7 @@
};
/* type for state table */
-typedef const UINT8 (*tBTA_AV_ST_TBL)[BTA_AV_NUM_COLS];
+typedef const uint8_t (*tBTA_AV_ST_TBL)[BTA_AV_NUM_COLS];
/* state table */
static const tBTA_AV_ST_TBL bta_av_st_tbl[] =
@@ -166,9 +166,9 @@
#endif
static void bta_av_api_to_ssm(tBTA_AV_DATA *p_data);
-static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8
+static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t
app_id, BD_ADDR peer_addr);
-static void bta_av_sys_rs_cback (tBTA_SYS_CONN_STATUS status,UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
+static void bta_av_sys_rs_cback (tBTA_SYS_CONN_STATUS status,uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
/* action functions */
const tBTA_AV_NSM_ACT bta_av_nsm_act[] =
@@ -199,12 +199,12 @@
*****************************************************************************/
/* AV control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_AV_CB bta_av_cb;
#endif
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
-static char *bta_av_st_code(UINT8 state);
+#if (BTA_AV_DEBUG == TRUE)
+static char *bta_av_st_code(uint8_t state);
#endif
/*******************************************************************************
@@ -290,11 +290,11 @@
** Returns void
**
*******************************************************************************/
-tBTA_AV_SCB * bta_av_hndl_to_scb(UINT16 handle)
+tBTA_AV_SCB * bta_av_hndl_to_scb(uint16_t handle)
{
tBTA_AV_HNDL hndl = (tBTA_AV_HNDL)handle;
tBTA_AV_SCB * p_scb = NULL;
- UINT8 idx = (hndl & BTA_AV_HNDL_MSK);
+ uint8_t idx = (hndl & BTA_AV_HNDL_MSK);
if(idx && (idx <= BTA_AV_NUM_STRS) )
{
@@ -367,13 +367,13 @@
/*******************************************************************************
*******************************************************************************/
-void bta_av_conn_cback(UINT8 handle, BD_ADDR bd_addr, UINT8 event, tAVDT_CTRL *p_data)
+void bta_av_conn_cback(uint8_t handle, BD_ADDR bd_addr, uint8_t event, tAVDT_CTRL *p_data)
{
- UINT16 evt = 0;
+ uint16_t evt = 0;
tBTA_AV_SCB *p_scb = NULL;
UNUSED(handle);
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
if (event == BTA_AR_AVDT_CONN_EVT ||
event == AVDT_CONNECT_IND_EVT || event == AVDT_DISCONNECT_IND_EVT)
#else
@@ -383,7 +383,7 @@
evt = BTA_AV_SIG_CHG_EVT;
if(AVDT_DISCONNECT_IND_EVT == event)
p_scb = bta_av_addr_to_scb(bd_addr);
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
+#if (BTA_AV_DEBUG == TRUE)
else if (AVDT_CONNECT_IND_EVT == event)
{
APPL_TRACE_DEBUG("CONN_IND is ACP:%d", p_data->hdr.err_param);
@@ -396,7 +396,7 @@
p_msg->hdr.layer_specific = event;
p_msg->hdr.offset = p_data->hdr.err_param;
bdcpy(p_msg->bd_addr, bd_addr);
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
+#if (BTA_AV_DEBUG == TRUE)
if(p_scb) {
APPL_TRACE_DEBUG("scb hndl x%x, role x%x", p_scb->hndl, p_scb->role);
}
@@ -409,7 +409,7 @@
}
}
-#if AVDT_REPORTING == TRUE
+#if (AVDT_REPORTING == TRUE)
/*******************************************************************************
**
** Function bta_av_a2dp_report_cback
@@ -419,7 +419,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_a2dp_report_cback(UINT8 handle, AVDT_REPORT_TYPE type,
+static void bta_av_a2dp_report_cback(uint8_t handle, AVDT_REPORT_TYPE type,
tAVDT_REPORT_DATA *p_data)
{
UNUSED(handle);
@@ -443,7 +443,7 @@
static void bta_av_api_sink_enable(tBTA_AV_DATA *p_data)
{
- UINT16 activate_sink = 0;
+ uint16_t activate_sink = 0;
activate_sink = p_data->hdr.layer_specific;
APPL_TRACE_DEBUG("bta_av_api_sink_enable %d ", activate_sink)
char p_service_name[BTA_SERVICE_NAME_LEN+1];
@@ -492,7 +492,7 @@
char *p_service_name;
tBTA_AV_CODEC codec_type;
tBTA_UTL_COD cod;
- UINT8 index = 0;
+ uint8_t index = 0;
memset(&cs,0,sizeof(tAVDT_CS));
@@ -500,7 +500,7 @@
registr.app_id = p_data->api_reg.app_id;
registr.chnl = (tBTA_AV_CHNL)p_data->hdr.layer_specific;
- UINT16 profile_initialized = p_data->api_reg.service_uuid;
+ uint16_t profile_initialized = p_data->api_reg.service_uuid;
if (profile_initialized == UUID_SERVCLASS_AUDIO_SINK)
{
p_bta_av_cfg = (tBTA_AV_CFG *) &bta_avk_cfg;
@@ -533,7 +533,7 @@
reg.sig_tout = BTA_AV_SIG_TOUT;
reg.idle_tout = BTA_AV_IDLE_TOUT;
reg.sec_mask = bta_av_cb.sec_mask;
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
bta_ar_reg_avdt(®, bta_av_conn_cback, BTA_ID_AV);
#endif
bta_sys_role_chg_register(&bta_av_sys_rs_cback);
@@ -542,13 +542,13 @@
if (bta_av_cb.features & (BTA_AV_FEAT_RCTG))
{
/* register with no authorization; let AVDTP use authorization instead */
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
#if (BTA_AV_WITH_AVCTP_AUTHORIZATION == TRUE)
bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu,
bta_av_cb.sec_mask, BTA_ID_AV);
#else
bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu,
- (UINT8)(bta_av_cb.sec_mask & (~BTA_SEC_AUTHORIZE)), BTA_ID_AV);
+ (uint8_t)(bta_av_cb.sec_mask & (~BTA_SEC_AUTHORIZE)), BTA_ID_AV);
#endif
if (profile_initialized == UUID_SERVCLASS_AUDIO_SOURCE)
{
@@ -597,9 +597,9 @@
p_service_name = p_data->api_reg.p_service_name;
}
- p_scb->suspend_sup = TRUE;
- p_scb->recfg_sup = TRUE;
- p_scb->skip_sdp = FALSE;
+ p_scb->suspend_sup = true;
+ p_scb->recfg_sup = true;
+ p_scb->skip_sdp = false;
cs.p_ctrl_cback = bta_av_dt_cback[p_scb->hdi];
if(registr.chnl == BTA_AV_CHNL_AUDIO)
@@ -612,12 +612,12 @@
cs.media_type = AVDT_MEDIA_AUDIO;
cs.mtu = p_bta_av_cfg->audio_mtu;
cs.flush_to = L2CAP_DEFAULT_FLUSH_TO;
-#if AVDT_REPORTING == TRUE
+#if (AVDT_REPORTING == TRUE)
if(bta_av_cb.features & BTA_AV_FEAT_REPORT)
{
cs.cfg.psc_mask |= AVDT_PSC_REPORT;
cs.p_report_cback = bta_av_a2dp_report_cback;
-#if AVDT_MULTIPLEXING == TRUE
+#if (AVDT_MULTIPLEXING == TRUE)
cs.cfg.mux_tsid_report = 2;
#endif
}
@@ -646,7 +646,7 @@
/* keep the configuration in the stream control block */
memcpy(&p_scb->cfg, &cs.cfg, sizeof(tAVDT_CFG));
if ((*bta_av_a2d_cos.init)(&codec_type, cs.cfg.codec_info,
- &cs.cfg.num_protect, cs.cfg.protect_info, index) == TRUE)
+ &cs.cfg.num_protect, cs.cfg.protect_info, index) == true)
{
if(AVDT_CreateStream(&p_scb->seps[index].av_handle, &cs) == AVDT_SUCCESS)
{
@@ -693,18 +693,18 @@
/* if TG is not supported, we need to register to AVCT now */
if ((bta_av_cb.features & (BTA_AV_FEAT_RCTG)) == 0)
{
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
#if (BTA_AV_WITH_AVCTP_AUTHORIZATION == TRUE)
bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu,
bta_av_cb.sec_mask, BTA_ID_AV);
#else
bta_ar_reg_avct(p_bta_av_cfg->avrc_mtu, p_bta_av_cfg->avrc_br_mtu,
- (UINT8)(bta_av_cb.sec_mask & (~BTA_SEC_AUTHORIZE)), BTA_ID_AV);
+ (uint8_t)(bta_av_cb.sec_mask & (~BTA_SEC_AUTHORIZE)), BTA_ID_AV);
#endif
#endif
bta_av_rc_create(&bta_av_cb, AVCT_ACP, 0, BTA_AV_NUM_LINKS + 1);
}
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if (BTA_AR_INCLUDED == TRUE)
/* create an SDP record as AVRC CT. We create 1.3 for SOURCE
* because we rely on feature bits being scanned by external
* devices more than the profile version itself.
@@ -752,7 +752,7 @@
if(p_scb)
{
- p_scb->deregistring = TRUE;
+ p_scb->deregistring = true;
bta_av_ssm_execute(p_scb, BTA_AV_API_CLOSE_EVT, p_data);
}
else
@@ -775,7 +775,7 @@
{
tBTA_AV_SCB *p_scb;
int i;
- UINT8 chnl = (UINT8)p_data->hdr.layer_specific;
+ uint8_t chnl = (uint8_t)p_data->hdr.layer_specific;
for( i=0; i < BTA_AV_NUM_STRS; i++ )
{
@@ -817,7 +817,7 @@
static void bta_av_api_to_ssm(tBTA_AV_DATA *p_data)
{
int xx;
- UINT16 event = p_data->hdr.event - BTA_AV_FIRST_A2S_API_EVT + BTA_AV_FIRST_A2S_SSM_EVT;
+ uint16_t event = p_data->hdr.event - BTA_AV_FIRST_A2S_API_EVT + BTA_AV_FIRST_A2S_SSM_EVT;
for(xx=0; xx<BTA_AV_NUM_STRS; xx++)
{
@@ -832,12 +832,12 @@
** Description if this is audio channel, check if more than one audio
** channel is connected & already started.
**
-** Returns TRUE, if need api_start
+** Returns true, if need api_start
**
*******************************************************************************/
-BOOLEAN bta_av_chk_start(tBTA_AV_SCB *p_scb)
+bool bta_av_chk_start(tBTA_AV_SCB *p_scb)
{
- BOOLEAN start = FALSE;
+ bool start = false;
tBTA_AV_SCB *p_scbi;
int i;
@@ -854,7 +854,7 @@
p_scbi = bta_av_cb.p_scb[i];
if(p_scbi && p_scbi->chnl == BTA_AV_CHNL_AUDIO && p_scbi->co_started)
{
- start = TRUE;
+ start = true;
/* may need to update the flush timeout of this already started stream */
if(p_scbi->co_started != bta_av_cb.audio_open_cnt)
{
@@ -882,7 +882,7 @@
{
tBTA_AV_CB *p_cb = &bta_av_cb;
int i;
- UINT8 mask;
+ uint8_t mask;
APPL_TRACE_DEBUG("reg_audio: 0x%x",bta_av_cb.reg_audio);
for(i=0; i<BTA_AV_NUM_STRS; i++)
@@ -908,12 +908,12 @@
** Returns (BTA_SYS_ROLE_CHANGE, new_role, hci_status, p_bda)
**
*******************************************************************************/
-static void bta_av_sys_rs_cback (tBTA_SYS_CONN_STATUS status,UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+static void bta_av_sys_rs_cback (tBTA_SYS_CONN_STATUS status,uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
int i;
tBTA_AV_SCB *p_scb = NULL;
- UINT8 cur_role;
- UINT8 peer_idx = 0;
+ uint8_t cur_role;
+ uint8_t peer_idx = 0;
UNUSED(status);
APPL_TRACE_DEBUG("bta_av_sys_rs_cback: %d", bta_av_cb.rs_idx);
@@ -987,7 +987,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8
+static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t
app_id, BD_ADDR peer_addr)
{
tBTA_AV_SCB *p_scb;
@@ -999,27 +999,27 @@
APPL_TRACE_DEBUG("bta_av_sco_chg_cback:%d status:%d", id, status);
if(id)
{
- bta_av_cb.sco_occupied = TRUE;
+ bta_av_cb.sco_occupied = true;
/* either BTA_SYS_SCO_OPEN or BTA_SYS_SCO_CLOSE with remaining active SCO */
for(i=0; i<BTA_AV_NUM_STRS; i++)
{
p_scb = bta_av_cb.p_scb[i];
- if( p_scb && p_scb->co_started && (p_scb->sco_suspend == FALSE))
+ if( p_scb && p_scb->co_started && (p_scb->sco_suspend == false))
{
APPL_TRACE_DEBUG("suspending scb:%d", i);
/* scb is used and started, not suspended automatically */
- p_scb->sco_suspend = TRUE;
- stop.flush = FALSE;
- stop.suspend = TRUE;
+ p_scb->sco_suspend = true;
+ stop.flush = false;
+ stop.suspend = true;
bta_av_ssm_execute(p_scb, BTA_AV_AP_STOP_EVT, (tBTA_AV_DATA *)&stop);
}
}
}
else
{
- bta_av_cb.sco_occupied = FALSE;
+ bta_av_cb.sco_occupied = false;
for(i=0; i<BTA_AV_NUM_STRS; i++)
{
@@ -1042,16 +1042,16 @@
** channel that is local as slave role.
** If so, role switch and remove it from link policy.
**
-** Returns TRUE, if role switch is done
+** Returns true, if role switch is done
**
*******************************************************************************/
-BOOLEAN bta_av_switch_if_needed(tBTA_AV_SCB *p_scb)
+bool bta_av_switch_if_needed(tBTA_AV_SCB *p_scb)
{
- UINT8 role;
- BOOLEAN needed = FALSE;
+ uint8_t role;
+ bool needed = false;
tBTA_AV_SCB *p_scbi;
int i;
- UINT8 mask;
+ uint8_t mask;
for(i=0; i<BTA_AV_NUM_STRS; i++)
{
@@ -1075,7 +1075,7 @@
BTA_AV_RS_TIME_VAL,
BTA_AV_AVRC_TIMER_EVT, p_scb->hndl);
}
- needed = TRUE;
+ needed = true;
/* mark the original channel as waiting for RS result */
bta_av_cb.rs_idx = p_scb->hdi + 1;
break;
@@ -1092,13 +1092,13 @@
** Description This function checks if the SCB has existing ACL connection
** If so, check if the link role fits the requirements.
**
-** Returns TRUE, if role is ok
+** Returns true, if role is ok
**
*******************************************************************************/
-BOOLEAN bta_av_link_role_ok(tBTA_AV_SCB *p_scb, UINT8 bits)
+bool bta_av_link_role_ok(tBTA_AV_SCB *p_scb, uint8_t bits)
{
- UINT8 role;
- BOOLEAN is_ok = TRUE;
+ uint8_t role;
+ bool is_ok = true;
if (BTM_GetRole(p_scb->peer_addr, &role) == BTM_SUCCESS)
{
@@ -1114,7 +1114,7 @@
{
/* can not switch role on SCB - start the timer on SCB */
}
- is_ok = FALSE;
+ is_ok = false;
p_scb->wait |= BTA_AV_WAIT_ROLE_SW_RES_START;
}
@@ -1133,12 +1133,12 @@
** Returns The smallest mtu of the connected audio channels
**
*******************************************************************************/
-UINT16 bta_av_chk_mtu(tBTA_AV_SCB *p_scb, UINT16 mtu)
+uint16_t bta_av_chk_mtu(tBTA_AV_SCB *p_scb, uint16_t mtu)
{
- UINT16 ret_mtu = BTA_AV_MAX_A2DP_MTU;
+ uint16_t ret_mtu = BTA_AV_MAX_A2DP_MTU;
tBTA_AV_SCB *p_scbi;
int i;
- UINT8 mask;
+ uint8_t mask;
UNUSED(mtu);
/* TODO_MV mess with the mtu according to the number of EDR/non-EDR headsets */
@@ -1184,7 +1184,7 @@
if ((p_buf == NULL) || (bta_av_cb.audio_open_cnt < 2))
return;
- UINT16 copy_size = BT_HDR_SIZE + p_buf->len + p_buf->offset;
+ uint16_t copy_size = BT_HDR_SIZE + p_buf->len + p_buf->offset;
for (int i = 0; i < BTA_AV_NUM_STRS; i++) {
tBTA_AV_SCB *p_scbi = bta_av_cb.p_scb[i];
@@ -1220,12 +1220,12 @@
** Returns void
**
*******************************************************************************/
-void bta_av_sm_execute(tBTA_AV_CB *p_cb, UINT16 event, tBTA_AV_DATA *p_data)
+void bta_av_sm_execute(tBTA_AV_CB *p_cb, uint16_t event, tBTA_AV_DATA *p_data)
{
tBTA_AV_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
+#if (BTA_AV_DEBUG == TRUE)
APPL_TRACE_EVENT("AV event=0x%x(%s) state=%d(%s)",
event, bta_av_evt_code(event), p_cb->state, bta_av_st_code(p_cb->state));
#else
@@ -1255,22 +1255,22 @@
** Description Advanced audio/video main event handling function.
**
**
-** Returns BOOLEAN
+** Returns bool
**
*******************************************************************************/
-BOOLEAN bta_av_hdl_event(BT_HDR *p_msg)
+bool bta_av_hdl_event(BT_HDR *p_msg)
{
- UINT16 event = p_msg->event;
- UINT16 first_event = BTA_AV_FIRST_NSM_EVT;
+ uint16_t event = p_msg->event;
+ uint16_t first_event = BTA_AV_FIRST_NSM_EVT;
if (event > BTA_AV_LAST_EVT)
{
- return TRUE; /* to free p_msg */
+ return true; /* to free p_msg */
}
if(event >= first_event)
{
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
+#if (BTA_AV_DEBUG == TRUE)
APPL_TRACE_VERBOSE("AV nsm event=0x%x(%s)", event, bta_av_evt_code(event));
#else
APPL_TRACE_VERBOSE("AV nsm event=0x%x", event);
@@ -1280,7 +1280,7 @@
}
else if (event >= BTA_AV_FIRST_SM_EVT && event <= BTA_AV_LAST_SM_EVT)
{
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
+#if (BTA_AV_DEBUG == TRUE)
APPL_TRACE_VERBOSE("AV sm event=0x%x(%s)", event, bta_av_evt_code(event));
#else
APPL_TRACE_VERBOSE("AV sm event=0x%x", event);
@@ -1295,13 +1295,13 @@
bta_av_ssm_execute( bta_av_hndl_to_scb(p_msg->layer_specific),
p_msg->event, (tBTA_AV_DATA *) p_msg);
}
- return TRUE;
+ return true;
}
/*****************************************************************************
** Debug Functions
*****************************************************************************/
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
+#if (BTA_AV_DEBUG == TRUE)
/*******************************************************************************
**
** Function bta_av_st_code
@@ -1311,7 +1311,7 @@
** Returns char *
**
*******************************************************************************/
-static char *bta_av_st_code(UINT8 state)
+static char *bta_av_st_code(uint8_t state)
{
switch(state)
{
@@ -1329,7 +1329,7 @@
** Returns char *
**
*******************************************************************************/
-char *bta_av_evt_code(UINT16 evt_code)
+char *bta_av_evt_code(uint16_t evt_code)
{
switch(evt_code)
{
diff --git a/bta/av/bta_av_sbc.c b/bta/av/bta_av_sbc.c
index dec24df..ff0f1ef 100644
--- a/bta/av/bta_av_sbc.c
+++ b/bta/av/bta_av_sbc.c
@@ -29,20 +29,20 @@
#include "utl.h"
typedef int (tBTA_AV_SBC_ACT)(void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret);
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret);
typedef struct
{
- INT32 cur_pos; /* current position */
- UINT32 src_sps; /* samples per second (source audio data) */
- UINT32 dst_sps; /* samples per second (converted audio data) */
+ int32_t cur_pos; /* current position */
+ uint32_t src_sps; /* samples per second (source audio data) */
+ uint32_t dst_sps; /* samples per second (converted audio data) */
tBTA_AV_SBC_ACT *p_act; /* the action function to do the conversion */
- UINT16 bits; /* number of bits per pcm sample */
- UINT16 n_channels; /* number of channels (i.e. mono(1), stereo(2)...) */
- INT16 worker1;
- INT16 worker2;
- UINT8 div;
+ uint16_t bits; /* number of bits per pcm sample */
+ uint16_t n_channels; /* number of channels (i.e. mono(1), stereo(2)...) */
+ int16_t worker1;
+ int16_t worker2;
+ uint8_t div;
} tBTA_AV_SBC_UPS_CB;
tBTA_AV_SBC_UPS_CB bta_av_sbc_ups_cb;
@@ -61,7 +61,7 @@
** Returns none
**
*******************************************************************************/
-void bta_av_sbc_init_up_sample (UINT32 src_sps, UINT32 dst_sps, UINT16 bits, UINT16 n_channels)
+void bta_av_sbc_init_up_sample (uint32_t src_sps, uint32_t dst_sps, uint16_t bits, uint16_t n_channels)
{
bta_av_sbc_ups_cb.cur_pos = -1;
bta_av_sbc_ups_cb.src_sps = src_sps;
@@ -125,11 +125,11 @@
**
*******************************************************************************/
int bta_av_sbc_up_sample (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret)
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret)
{
- UINT32 src;
- UINT32 dst;
+ uint32_t src;
+ uint32_t dst;
if(bta_av_sbc_ups_cb.p_act)
{
@@ -162,15 +162,15 @@
**
*******************************************************************************/
int bta_av_sbc_up_sample_16s (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret)
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret)
{
- INT16 *p_src_tmp = (INT16 *)p_src;
- INT16 *p_dst_tmp = (INT16 *)p_dst;
- INT16 *p_worker1 = &bta_av_sbc_ups_cb.worker1;
- INT16 *p_worker2 = &bta_av_sbc_ups_cb.worker2;
- UINT32 src_sps = bta_av_sbc_ups_cb.src_sps;
- UINT32 dst_sps = bta_av_sbc_ups_cb.dst_sps;
+ int16_t *p_src_tmp = (int16_t *)p_src;
+ int16_t *p_dst_tmp = (int16_t *)p_dst;
+ int16_t *p_worker1 = &bta_av_sbc_ups_cb.worker1;
+ int16_t *p_worker2 = &bta_av_sbc_ups_cb.worker2;
+ uint32_t src_sps = bta_av_sbc_ups_cb.src_sps;
+ uint32_t dst_sps = bta_av_sbc_ups_cb.dst_sps;
while (bta_av_sbc_ups_cb.cur_pos > 0 && dst_samples)
{
@@ -200,7 +200,7 @@
bta_av_sbc_ups_cb.cur_pos += dst_sps;
}
- if (bta_av_sbc_ups_cb.cur_pos == (INT32)dst_sps)
+ if (bta_av_sbc_ups_cb.cur_pos == (int32_t)dst_sps)
bta_av_sbc_ups_cb.cur_pos = 0;
*p_ret = ((char *)p_src_tmp - (char *)p_src);
@@ -225,14 +225,14 @@
**
*******************************************************************************/
int bta_av_sbc_up_sample_16m (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret)
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret)
{
- INT16 *p_src_tmp = (INT16 *)p_src;
- INT16 *p_dst_tmp = (INT16 *)p_dst;
- INT16 *p_worker = &bta_av_sbc_ups_cb.worker1;
- UINT32 src_sps = bta_av_sbc_ups_cb.src_sps;
- UINT32 dst_sps = bta_av_sbc_ups_cb.dst_sps;
+ int16_t *p_src_tmp = (int16_t *)p_src;
+ int16_t *p_dst_tmp = (int16_t *)p_dst;
+ int16_t *p_worker = &bta_av_sbc_ups_cb.worker1;
+ uint32_t src_sps = bta_av_sbc_ups_cb.src_sps;
+ uint32_t dst_sps = bta_av_sbc_ups_cb.dst_sps;
while (bta_av_sbc_ups_cb.cur_pos > 0 && dst_samples)
{
@@ -265,7 +265,7 @@
bta_av_sbc_ups_cb.cur_pos += dst_sps;
}
- if (bta_av_sbc_ups_cb.cur_pos == (INT32)dst_sps)
+ if (bta_av_sbc_ups_cb.cur_pos == (int32_t)dst_sps)
bta_av_sbc_ups_cb.cur_pos = 0;
*p_ret = ((char *)p_src_tmp - (char *)p_src);
@@ -290,15 +290,15 @@
**
*******************************************************************************/
int bta_av_sbc_up_sample_8s (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret)
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret)
{
- UINT8 *p_src_tmp = (UINT8 *)p_src;
- INT16 *p_dst_tmp = (INT16 *)p_dst;
- INT16 *p_worker1 = &bta_av_sbc_ups_cb.worker1;
- INT16 *p_worker2 = &bta_av_sbc_ups_cb.worker2;
- UINT32 src_sps = bta_av_sbc_ups_cb.src_sps;
- UINT32 dst_sps = bta_av_sbc_ups_cb.dst_sps;
+ uint8_t *p_src_tmp = (uint8_t *)p_src;
+ int16_t *p_dst_tmp = (int16_t *)p_dst;
+ int16_t *p_worker1 = &bta_av_sbc_ups_cb.worker1;
+ int16_t *p_worker2 = &bta_av_sbc_ups_cb.worker2;
+ uint32_t src_sps = bta_av_sbc_ups_cb.src_sps;
+ uint32_t dst_sps = bta_av_sbc_ups_cb.dst_sps;
while (bta_av_sbc_ups_cb.cur_pos > 0 && dst_samples)
{
@@ -314,10 +314,10 @@
while (src_samples -- && dst_samples)
{
- *p_worker1 = *(UINT8 *)p_src_tmp++;
+ *p_worker1 = *(uint8_t *)p_src_tmp++;
*p_worker1 -= 0x80;
*p_worker1 <<= 8;
- *p_worker2 = *(UINT8 *)p_src_tmp++;
+ *p_worker2 = *(uint8_t *)p_src_tmp++;
*p_worker2 -= 0x80;
*p_worker2 <<= 8;
@@ -334,7 +334,7 @@
bta_av_sbc_ups_cb.cur_pos += dst_sps;
}
- if (bta_av_sbc_ups_cb.cur_pos == (INT32)dst_sps)
+ if (bta_av_sbc_ups_cb.cur_pos == (int32_t)dst_sps)
bta_av_sbc_ups_cb.cur_pos = 0;
*p_ret = ((char *)p_src_tmp - (char *)p_src);
@@ -359,14 +359,14 @@
**
*******************************************************************************/
int bta_av_sbc_up_sample_8m (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret)
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret)
{
- UINT8 *p_src_tmp = (UINT8 *)p_src;
- INT16 *p_dst_tmp = (INT16 *)p_dst;
- INT16 *p_worker = &bta_av_sbc_ups_cb.worker1;
- UINT32 src_sps = bta_av_sbc_ups_cb.src_sps;
- UINT32 dst_sps = bta_av_sbc_ups_cb.dst_sps;
+ uint8_t *p_src_tmp = (uint8_t *)p_src;
+ int16_t *p_dst_tmp = (int16_t *)p_dst;
+ int16_t *p_worker = &bta_av_sbc_ups_cb.worker1;
+ uint32_t src_sps = bta_av_sbc_ups_cb.src_sps;
+ uint32_t dst_sps = bta_av_sbc_ups_cb.dst_sps;
while (bta_av_sbc_ups_cb.cur_pos > 0 && dst_samples)
{
@@ -382,7 +382,7 @@
while (src_samples-- && dst_samples)
{
- *p_worker = *(UINT8 *)p_src_tmp++;
+ *p_worker = *(uint8_t *)p_src_tmp++;
*p_worker -= 0x80;
*p_worker <<= 8;
@@ -399,7 +399,7 @@
bta_av_sbc_ups_cb.cur_pos += dst_sps;
}
- if (bta_av_sbc_ups_cb.cur_pos == (INT32)dst_sps)
+ if (bta_av_sbc_ups_cb.cur_pos == (int32_t)dst_sps)
bta_av_sbc_ups_cb.cur_pos = 0;
*p_ret = ((char *)p_src_tmp - (char *)p_src);
@@ -422,14 +422,14 @@
** Codec configuration in p_cap.
**
*******************************************************************************/
-UINT8 bta_av_sbc_cfg_for_cap(UINT8 *p_peer, tA2D_SBC_CIE *p_cap, tA2D_SBC_CIE *p_pref)
+uint8_t bta_av_sbc_cfg_for_cap(uint8_t *p_peer, tA2D_SBC_CIE *p_cap, tA2D_SBC_CIE *p_pref)
{
- UINT8 status = A2D_SUCCESS;
+ uint8_t status = A2D_SUCCESS;
tA2D_SBC_CIE peer_cie;
UNUSED(p_cap);
/* parse peer capabilities */
- if ((status = A2D_ParsSbcInfo(&peer_cie, p_peer, TRUE)) != 0)
+ if ((status = A2D_ParsSbcInfo(&peer_cie, p_peer, true)) != 0)
{
return status;
}
@@ -519,13 +519,13 @@
** Returns 0 if ok, nonzero if error.
**
*******************************************************************************/
-UINT8 bta_av_sbc_cfg_matches_cap(UINT8 *p_cfg, tA2D_SBC_CIE *p_cap)
+uint8_t bta_av_sbc_cfg_matches_cap(uint8_t *p_cfg, tA2D_SBC_CIE *p_cap)
{
- UINT8 status = 0;
+ uint8_t status = 0;
tA2D_SBC_CIE cfg_cie;
/* parse configuration */
- if ((status = A2D_ParsSbcInfo(&cfg_cie, p_cfg, TRUE)) != 0)
+ if ((status = A2D_ParsSbcInfo(&cfg_cie, p_cfg, true)) != 0)
{
APPL_TRACE_ERROR(" bta_av_sbc_cfg_matches_cap Parsing Failed %d", status);
return status;
@@ -591,13 +591,13 @@
** Returns 0 if ok, nonzero if error.
**
*******************************************************************************/
-UINT8 bta_av_sbc_cfg_in_cap(UINT8 *p_cfg, tA2D_SBC_CIE *p_cap)
+uint8_t bta_av_sbc_cfg_in_cap(uint8_t *p_cfg, tA2D_SBC_CIE *p_cap)
{
- UINT8 status = 0;
+ uint8_t status = 0;
tA2D_SBC_CIE cfg_cie;
/* parse configuration */
- if ((status = A2D_ParsSbcInfo(&cfg_cie, p_cfg, FALSE)) != 0)
+ if ((status = A2D_ParsSbcInfo(&cfg_cie, p_cfg, false)) != 0)
{
return status;
}
@@ -653,13 +653,13 @@
** Returns void
**
*******************************************************************************/
-void bta_av_sbc_bld_hdr(BT_HDR *p_buf, UINT16 fr_per_pkt)
+void bta_av_sbc_bld_hdr(BT_HDR *p_buf, uint16_t fr_per_pkt)
{
- UINT8 *p;
+ uint8_t *p;
p_buf->offset -= BTA_AV_SBC_HDR_SIZE;
- p = (UINT8 *) (p_buf + 1) + p_buf->offset;
+ p = (uint8_t *) (p_buf + 1) + p_buf->offset;
p_buf->len += BTA_AV_SBC_HDR_SIZE;
- A2D_BldSbcMplHdr(p, FALSE, FALSE, FALSE, (UINT8) fr_per_pkt);
+ A2D_BldSbcMplHdr(p, false, false, false, (uint8_t) fr_per_pkt);
}
diff --git a/bta/av/bta_av_ssm.c b/bta/av/bta_av_ssm.c
index 1eb4096..812004d 100644
--- a/bta/av/bta_av_ssm.c
+++ b/bta/av/bta_av_ssm.c
@@ -23,7 +23,7 @@
******************************************************************************/
#include "bt_target.h"
-#if defined(BTA_AV_INCLUDED) && (BTA_AV_INCLUDED == TRUE)
+#if (BTA_AV_INCLUDED == TRUE)
#include <string.h>
#include "bta_av_co.h"
@@ -111,7 +111,7 @@
#define BTA_AV_NUM_COLS 3 /* number of columns in state tables */
/* state table for init state */
-static const UINT8 bta_av_sst_init[][BTA_AV_NUM_COLS] =
+static const uint8_t bta_av_sst_init[][BTA_AV_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* AP_OPEN_EVT */ {BTA_AV_DO_DISC, BTA_AV_SIGNORE, BTA_AV_OPENING_SST },
@@ -153,7 +153,7 @@
};
/* state table for incoming state */
-static const UINT8 bta_av_sst_incoming[][BTA_AV_NUM_COLS] =
+static const uint8_t bta_av_sst_incoming[][BTA_AV_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* AP_OPEN_EVT */ {BTA_AV_OPEN_AT_INC, BTA_AV_SIGNORE, BTA_AV_INCOMING_SST },
@@ -195,7 +195,7 @@
};
/* state table for opening state */
-static const UINT8 bta_av_sst_opening[][BTA_AV_NUM_COLS] =
+static const uint8_t bta_av_sst_opening[][BTA_AV_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* AP_OPEN_EVT */ {BTA_AV_SIGNORE, BTA_AV_SIGNORE, BTA_AV_OPENING_SST },
@@ -237,7 +237,7 @@
};
/* state table for open state */
-static const UINT8 bta_av_sst_open[][BTA_AV_NUM_COLS] =
+static const uint8_t bta_av_sst_open[][BTA_AV_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* AP_OPEN_EVT */ {BTA_AV_SIGNORE, BTA_AV_SIGNORE, BTA_AV_OPEN_SST },
@@ -279,7 +279,7 @@
};
/* state table for reconfig state */
-static const UINT8 bta_av_sst_rcfg[][BTA_AV_NUM_COLS] =
+static const uint8_t bta_av_sst_rcfg[][BTA_AV_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* AP_OPEN_EVT */ {BTA_AV_SIGNORE, BTA_AV_SIGNORE, BTA_AV_RCFG_SST },
@@ -321,7 +321,7 @@
};
/* state table for closing state */
-static const UINT8 bta_av_sst_closing[][BTA_AV_NUM_COLS] =
+static const uint8_t bta_av_sst_closing[][BTA_AV_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* AP_OPEN_EVT */ {BTA_AV_SIGNORE, BTA_AV_SIGNORE, BTA_AV_CLOSING_SST },
@@ -363,7 +363,7 @@
};
/* type for state table */
-typedef const UINT8 (*tBTA_AV_SST_TBL)[BTA_AV_NUM_COLS];
+typedef const uint8_t (*tBTA_AV_SST_TBL)[BTA_AV_NUM_COLS];
/* state table */
static const tBTA_AV_SST_TBL bta_av_sst_tbl[] =
@@ -378,8 +378,8 @@
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
-static char *bta_av_sst_code(UINT8 state);
+#if (BTA_AV_DEBUG == TRUE)
+static char *bta_av_sst_code(uint8_t state);
#endif
/*******************************************************************************
@@ -389,17 +389,17 @@
** Description Check if stream state machine is in reconfig state.
**
**
-** Returns TRUE if stream state machine is in reconfig state.
+** Returns true if stream state machine is in reconfig state.
**
*******************************************************************************/
-BOOLEAN bta_av_is_rcfg_sst (tBTA_AV_SCB *p_scb)
+bool bta_av_is_rcfg_sst (tBTA_AV_SCB *p_scb)
{
- BOOLEAN is_rcfg_sst = FALSE;
+ bool is_rcfg_sst = false;
if (p_scb != NULL)
{
if (p_scb->state == BTA_AV_RCFG_SST)
- is_rcfg_sst = TRUE;
+ is_rcfg_sst = true;
}
return is_rcfg_sst;
@@ -415,10 +415,10 @@
** Returns void
**
*******************************************************************************/
-void bta_av_ssm_execute(tBTA_AV_SCB *p_scb, UINT16 event, tBTA_AV_DATA *p_data)
+void bta_av_ssm_execute(tBTA_AV_SCB *p_scb, uint16_t event, tBTA_AV_DATA *p_data)
{
tBTA_AV_SST_TBL state_table;
- UINT8 action;
+ uint8_t action;
int i, xx;
if(p_scb == NULL)
@@ -449,7 +449,7 @@
}
}
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
+#if (BTA_AV_DEBUG == TRUE)
APPL_TRACE_VERBOSE("AV Sevent(0x%x)=0x%x(%s) state=%d(%s)",
p_scb->hndl, event, bta_av_evt_code(event), p_scb->state, bta_av_sst_code(p_scb->state));
#else
@@ -481,20 +481,20 @@
**
** Function bta_av_is_scb_opening
**
-** Description Returns TRUE is scb is in opening state.
+** Description Returns true is scb is in opening state.
**
**
-** Returns TRUE if scb is in opening state.
+** Returns true if scb is in opening state.
**
*******************************************************************************/
-BOOLEAN bta_av_is_scb_opening (tBTA_AV_SCB *p_scb)
+bool bta_av_is_scb_opening (tBTA_AV_SCB *p_scb)
{
- BOOLEAN is_opening = FALSE;
+ bool is_opening = false;
if (p_scb)
{
if (p_scb->state == BTA_AV_OPENING_SST)
- is_opening = TRUE;
+ is_opening = true;
}
return is_opening;
@@ -504,20 +504,20 @@
**
** Function bta_av_is_scb_incoming
**
-** Description Returns TRUE is scb is in incoming state.
+** Description Returns true is scb is in incoming state.
**
**
-** Returns TRUE if scb is in incoming state.
+** Returns true if scb is in incoming state.
**
*******************************************************************************/
-BOOLEAN bta_av_is_scb_incoming (tBTA_AV_SCB *p_scb)
+bool bta_av_is_scb_incoming (tBTA_AV_SCB *p_scb)
{
- BOOLEAN is_incoming = FALSE;
+ bool is_incoming = false;
if (p_scb)
{
if (p_scb->state == BTA_AV_INCOMING_SST)
- is_incoming = TRUE;
+ is_incoming = true;
}
return is_incoming;
@@ -545,20 +545,20 @@
**
** Function bta_av_is_scb_init
**
-** Description Returns TRUE is scb is in init state.
+** Description Returns true is scb is in init state.
**
**
-** Returns TRUE if scb is in incoming state.
+** Returns true if scb is in incoming state.
**
*******************************************************************************/
-BOOLEAN bta_av_is_scb_init (tBTA_AV_SCB *p_scb)
+bool bta_av_is_scb_init (tBTA_AV_SCB *p_scb)
{
- BOOLEAN is_init = FALSE;
+ bool is_init = false;
if (p_scb)
{
if (p_scb->state == BTA_AV_INIT_SST)
- is_init = TRUE;
+ is_init = true;
}
return is_init;
@@ -585,7 +585,7 @@
/*****************************************************************************
** Debug Functions
*****************************************************************************/
-#if (defined(BTA_AV_DEBUG) && BTA_AV_DEBUG == TRUE)
+#if (BTA_AV_DEBUG == TRUE)
/*******************************************************************************
**
** Function bta_av_sst_code
@@ -595,7 +595,7 @@
** Returns char *
**
*******************************************************************************/
-static char *bta_av_sst_code(UINT8 state)
+static char *bta_av_sst_code(uint8_t state)
{
switch(state)
{
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
diff --git a/bta/gatt/bta_gattc_act.cc b/bta/gatt/bta_gattc_act.cc
index 388d9a4..8c8861f 100644
--- a/bta/gatt/bta_gattc_act.cc
+++ b/bta/gatt/bta_gattc_act.cc
@@ -37,28 +37,28 @@
#include "stack/l2cap/l2c_int.h"
#include "utl.h"
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
#include "bta_hh_int.h"
#endif
-#if BTA_GATT_INCLUDED && BLE_INCLUDED == TRUE
+#if (BTA_GATT_INCLUDED == TRUE && BLE_INCLUDED == TRUE)
/*****************************************************************************
** Constants
*****************************************************************************/
-static void bta_gattc_conn_cback(tGATT_IF gattc_if, BD_ADDR bda, UINT16 conn_id,
- BOOLEAN connected, tGATT_DISCONN_REASON reason,
+static void bta_gattc_conn_cback(tGATT_IF gattc_if, BD_ADDR bda, uint16_t conn_id,
+ bool connected, tGATT_DISCONN_REASON reason,
tBT_TRANSPORT transport);
-static void bta_gattc_cmpl_cback(UINT16 conn_id, tGATTC_OPTYPE op, tGATT_STATUS status,
+static void bta_gattc_cmpl_cback(uint16_t conn_id, tGATTC_OPTYPE op, tGATT_STATUS status,
tGATT_CL_COMPLETE *p_data);
-static void bta_gattc_cmpl_sendmsg(UINT16 conn_id, tGATTC_OPTYPE op,
+static void bta_gattc_cmpl_sendmsg(uint16_t conn_id, tGATTC_OPTYPE op,
tBTA_GATT_STATUS status,
tGATT_CL_COMPLETE *p_data);
static void bta_gattc_deregister_cmpl(tBTA_GATTC_RCB *p_clreg);
static void bta_gattc_enc_cmpl_cback(tGATT_IF gattc_if, BD_ADDR bda);
-static void bta_gattc_cong_cback (UINT16 conn_id, BOOLEAN congested);
+static void bta_gattc_cong_cback (uint16_t conn_id, bool congested);
static tGATT_CBACK bta_gattc_cl_cback =
{
@@ -72,7 +72,7 @@
};
/* opcode(tGATTC_OPTYPE) order has to be comply with internal event order */
-static UINT16 bta_gattc_opcode_to_int_evt[] =
+static uint16_t bta_gattc_opcode_to_int_evt[] =
{
BTA_GATTC_API_READ_EVT,
BTA_GATTC_API_WRITE_EVT,
@@ -92,7 +92,7 @@
"Notification",
"Indication"
};
-#endif
+#endif // BT_TRACE_VERBOSE
/*****************************************************************************
** Action Functions
*****************************************************************************/
@@ -138,7 +138,7 @@
*******************************************************************************/
void bta_gattc_disable(tBTA_GATTC_CB *p_cb)
{
- UINT8 i;
+ uint8_t i;
APPL_TRACE_DEBUG("bta_gattc_disable");
@@ -155,11 +155,11 @@
p_cb->state = BTA_GATTC_STATE_DISABLING;
/* don't deregister HH GATT IF */
/* HH GATT IF will be deregistered by bta_hh_le_deregister when disable HH */
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
if (!bta_hh_le_is_hh_gatt_if(p_cb->cl_rcb[i].client_if)) {
#endif
bta_gattc_deregister(p_cb, &p_cb->cl_rcb[i]);
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
}
#endif
}
@@ -185,7 +185,7 @@
void bta_gattc_register(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_data)
{
tBTA_GATTC cb_data;
- UINT8 i;
+ uint8_t i;
tBT_UUID *p_app_uuid = &p_data->api_reg.app_uuid;
tBTA_GATT_STATUS status = BTA_GATT_NO_RESOURCES;
@@ -210,7 +210,7 @@
}
else
{
- p_cb->cl_rcb[i].in_use = TRUE;
+ p_cb->cl_rcb[i].in_use = true;
p_cb->cl_rcb[i].p_cback = p_data->api_reg.p_cback;
memcpy(&p_cb->cl_rcb[i].app_uuid, p_app_uuid, sizeof(tBT_UUID));
@@ -272,7 +272,7 @@
*******************************************************************************/
void bta_gattc_deregister(tBTA_GATTC_CB *p_cb, tBTA_GATTC_RCB *p_clreg)
{
- UINT8 i;
+ uint8_t i;
BT_HDR buf;
if (p_clreg != NULL)
@@ -284,12 +284,12 @@
{
if (p_cb->bg_track[i].cif_mask & (1 <<(p_clreg->client_if - 1)))
{
- bta_gattc_mark_bg_conn(p_clreg->client_if, p_cb->bg_track[i].remote_bda, FALSE, FALSE);
- GATT_CancelConnect(p_clreg->client_if, p_cb->bg_track[i].remote_bda, FALSE);
+ bta_gattc_mark_bg_conn(p_clreg->client_if, p_cb->bg_track[i].remote_bda, false, false);
+ GATT_CancelConnect(p_clreg->client_if, p_cb->bg_track[i].remote_bda, false);
}
if (p_cb->bg_track[i].cif_adv_mask & (1 <<(p_clreg->client_if - 1)))
{
- bta_gattc_mark_bg_conn(p_clreg->client_if, p_cb->bg_track[i].remote_bda, FALSE, TRUE);
+ bta_gattc_mark_bg_conn(p_clreg->client_if, p_cb->bg_track[i].remote_bda, false, true);
}
}
}
@@ -301,7 +301,7 @@
{
if (p_cb->clcb[i].in_use && (p_cb->clcb[i].p_rcb == p_clreg))
{
- p_clreg->dereg_pending = TRUE;
+ p_clreg->dereg_pending = true;
buf.event = BTA_GATTC_API_CLOSE_EVT;
buf.layer_specific = p_cb->clcb[i].bta_conn_id;
@@ -328,7 +328,7 @@
*******************************************************************************/
void bta_gattc_process_api_open (tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA * p_msg)
{
- UINT16 event = ((BT_HDR *)p_msg)->event;
+ uint16_t event = ((BT_HDR *)p_msg)->event;
tBTA_GATTC_CLCB *p_clcb = NULL;
tBTA_GATTC_RCB *p_clreg = bta_gattc_cl_get_regcb(p_msg->api_conn.client_if);
UNUSED(p_cb);
@@ -376,7 +376,7 @@
*******************************************************************************/
void bta_gattc_process_api_open_cancel (tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA * p_msg)
{
- UINT16 event = ((BT_HDR *)p_msg)->event;
+ uint16_t event = ((BT_HDR *)p_msg)->event;
tBTA_GATTC_CLCB *p_clcb = NULL;
tBTA_GATTC_RCB *p_clreg;
tBTA_GATTC cb_data;
@@ -518,7 +518,7 @@
/* open/hold a connection */
if (!GATT_Connect(p_clcb->p_rcb->client_if, p_data->api_conn.remote_bda,
- TRUE, p_data->api_conn.transport))
+ true, p_data->api_conn.transport))
{
APPL_TRACE_ERROR("Connection open failure");
@@ -551,14 +551,14 @@
void bta_gattc_init_bk_conn(tBTA_GATTC_API_OPEN *p_data, tBTA_GATTC_RCB *p_clreg)
{
tBTA_GATT_STATUS status = BTA_GATT_NO_RESOURCES;
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATTC_CLCB *p_clcb;
tBTA_GATTC_DATA gattc_data;
- if (bta_gattc_mark_bg_conn(p_data->client_if, p_data->remote_bda, TRUE, FALSE))
+ if (bta_gattc_mark_bg_conn(p_data->client_if, p_data->remote_bda, true, false))
{
/* always call open to hold a connection */
- if (!GATT_Connect(p_data->client_if, p_data->remote_bda, FALSE, p_data->transport))
+ if (!GATT_Connect(p_data->client_if, p_data->remote_bda, false, p_data->transport))
{
uint8_t *bda = (uint8_t *)p_data->remote_bda;
status = BTA_GATT_ERROR;
@@ -612,9 +612,9 @@
cb_data.status = BTA_GATT_ERROR;
/* remove the device from the bg connection mask */
- if (bta_gattc_mark_bg_conn(p_data->client_if, p_data->remote_bda, FALSE, FALSE))
+ if (bta_gattc_mark_bg_conn(p_data->client_if, p_data->remote_bda, false, false))
{
- if (GATT_CancelConnect(p_data->client_if, p_data->remote_bda, FALSE))
+ if (GATT_CancelConnect(p_data->client_if, p_data->remote_bda, false))
{
cb_data.status = BTA_GATT_OK;
}
@@ -666,7 +666,7 @@
{
tBTA_GATTC cb_data;
- if (GATT_CancelConnect(p_clcb->p_rcb->client_if, p_data->api_cancel_conn.remote_bda, TRUE))
+ if (GATT_CancelConnect(p_clcb->p_rcb->client_if, p_data->api_cancel_conn.remote_bda, true))
{
bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_CANCEL_OPEN_OK_EVT, p_data);
}
@@ -702,7 +702,7 @@
&gatt_if, p_clcb->bda, &p_clcb->transport);
}
- p_clcb->p_srcb->connected = TRUE;
+ p_clcb->p_srcb->connected = true;
if (p_clcb->p_srcb->mtu == 0)
p_clcb->p_srcb->mtu = GATT_DEF_BLE_MTU_SIZE;
@@ -731,7 +731,7 @@
/* a pending service handle change indication */
if (p_clcb->p_srcb->srvc_hdl_chg)
{
- p_clcb->p_srcb->srvc_hdl_chg = FALSE;
+ p_clcb->p_srcb->srvc_hdl_chg = false;
/* start discovery */
bta_gattc_sm_execute(p_clcb, BTA_GATTC_INT_DISCOVER_EVT, NULL);
}
@@ -834,7 +834,7 @@
void bta_gattc_reset_discover_st(tBTA_GATTC_SERV *p_srcb, tBTA_GATT_STATUS status)
{
tBTA_GATTC_CB *p_cb = &bta_gattc_cb;
- UINT8 i;
+ uint8_t i;
for (i = 0; i < BTA_GATTC_CLCB_MAX; i ++)
{
@@ -887,10 +887,10 @@
void bta_gattc_set_discover_st(tBTA_GATTC_SERV *p_srcb)
{
tBTA_GATTC_CB *p_cb = &bta_gattc_cb;
- UINT8 i;
+ uint8_t i;
-#if BLE_INCLUDED == TRUE
- L2CA_EnableUpdateBleConnParams(p_srcb->server_bda, FALSE);
+#if (BLE_INCLUDED == TRUE)
+ L2CA_EnableUpdateBleConnParams(p_srcb->server_bda, false);
#endif
for (i = 0; i < BTA_GATTC_CLCB_MAX; i ++)
{
@@ -974,12 +974,12 @@
if (p_clcb->p_srcb != NULL)
{
/* clear the service change mask */
- p_clcb->p_srcb->srvc_hdl_chg = FALSE;
+ p_clcb->p_srcb->srvc_hdl_chg = false;
p_clcb->p_srcb->update_count = 0;
p_clcb->p_srcb->state = BTA_GATTC_SERV_DISC_ACT;
if (p_clcb->transport == BTA_TRANSPORT_LE)
- L2CA_EnableUpdateBleConnParams(p_clcb->p_srcb->server_bda, FALSE);
+ L2CA_EnableUpdateBleConnParams(p_clcb->p_srcb->server_bda, false);
/* set all srcb related clcb into discovery ST */
bta_gattc_set_discover_st(p_clcb->p_srcb);
@@ -995,7 +995,7 @@
bta_gattc_reset_discover_st(p_clcb->p_srcb, p_clcb->status);
}
else
- p_clcb->disc_active = TRUE;
+ p_clcb->disc_active = true;
}
else
{
@@ -1028,12 +1028,12 @@
APPL_TRACE_DEBUG("bta_gattc_disc_cmpl conn_id=%d",p_clcb->bta_conn_id);
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
if(p_clcb->transport == BTA_TRANSPORT_LE)
- L2CA_EnableUpdateBleConnParams(p_clcb->p_srcb->server_bda, TRUE);
+ L2CA_EnableUpdateBleConnParams(p_clcb->p_srcb->server_bda, true);
#endif
p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE;
- p_clcb->disc_active = FALSE;
+ p_clcb->disc_active = false;
if (p_clcb->status != GATT_SUCCESS)
{
@@ -1125,7 +1125,7 @@
read_param.read_multiple.num_handles = p_data->api_read_multi.num_attr;
read_param.read_multiple.auth_req = p_data->api_read_multi.auth_req;
memcpy(&read_param.read_multiple.handles, p_data->api_read_multi.handles,
- sizeof(UINT16) * p_data->api_read_multi.num_attr);
+ sizeof(uint16_t) * p_data->api_read_multi.num_attr);
status = GATTC_Read(p_clcb->bta_conn_id, GATT_READ_MULTIPLE, &read_param);
}
@@ -1216,7 +1216,7 @@
*******************************************************************************/
void bta_gattc_confirm(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
- UINT16 handle = p_data->api_confirm.handle;
+ uint16_t handle = p_data->api_confirm.handle;
if (GATTC_SendHandleValueConfirm(p_data->api_confirm.hdr.layer_specific, handle)
!= GATT_SUCCESS) {
@@ -1240,7 +1240,7 @@
*******************************************************************************/
void bta_gattc_read_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_OP_CMPL *p_data)
{
- UINT8 event;
+ uint8_t event;
tBTA_GATTC cb_data;
tBTA_GATT_UNFMT read_value;
@@ -1280,7 +1280,7 @@
void bta_gattc_write_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_OP_CMPL *p_data)
{
tBTA_GATTC cb_data = {0};
- UINT8 event;
+ uint8_t event;
memset(&cb_data, 0, sizeof(tBTA_GATTC));
@@ -1363,8 +1363,8 @@
*******************************************************************************/
void bta_gattc_op_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
- UINT8 op = (UINT8)p_data->op_cmpl.op_code;
- UINT8 mapped_op = 0;
+ uint8_t op = (uint8_t)p_data->op_cmpl.op_code;
+ uint8_t mapped_op = 0;
APPL_TRACE_DEBUG("bta_gattc_op_cmpl op = %d", op);
@@ -1542,8 +1542,8 @@
** Returns void
**
*******************************************************************************/
-static void bta_gattc_conn_cback(tGATT_IF gattc_if, BD_ADDR bda, UINT16 conn_id,
- BOOLEAN connected, tGATT_DISCONN_REASON reason,
+static void bta_gattc_conn_cback(tGATT_IF gattc_if, BD_ADDR bda, uint16_t conn_id,
+ bool connected, tGATT_DISCONN_REASON reason,
tBT_TRANSPORT transport)
{
if (reason != 0) {
@@ -1589,7 +1589,7 @@
if (p_clcb == NULL)
return;
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
/* filter this event just for BTA HH LE GATT client,
In the future, if we want to enable encryption complete event
for all GATT clients, we can remove this code */
@@ -1625,8 +1625,8 @@
{
tBTA_GATTC_SERV *p_srvc_cb = bta_gattc_find_srvr_cache(p_msg->api_conn.remote_bda);
tBTA_GATTC_CLCB *p_clcb = &bta_gattc_cb.clcb[0];
- BOOLEAN found = FALSE;
- UINT8 i;
+ bool found = false;
+ uint8_t i;
UNUSED(p_cb);
if (p_srvc_cb != NULL)
@@ -1638,7 +1638,7 @@
{
if (p_clcb->in_use && p_clcb->p_srcb == p_srvc_cb)
{
- found = TRUE;
+ found = true;
break;
}
}
@@ -1667,7 +1667,7 @@
** Returns None.
**
*******************************************************************************/
-BOOLEAN bta_gattc_process_srvc_chg_ind(UINT16 conn_id,
+bool bta_gattc_process_srvc_chg_ind(uint16_t conn_id,
tBTA_GATTC_RCB *p_clrcb,
tBTA_GATTC_SERV *p_srcb,
tBTA_GATTC_CLCB *p_clcb,
@@ -1675,8 +1675,8 @@
tGATT_VALUE *att_value)
{
tBT_UUID gattp_uuid, srvc_chg_uuid;
- BOOLEAN processed = FALSE;
- UINT8 i;
+ bool processed = false;
+ uint8_t i;
gattp_uuid.len = 2;
gattp_uuid.uu.uuid16 = UUID_SERVCLASS_GATT_SERVER;
@@ -1685,24 +1685,24 @@
srvc_chg_uuid.uu.uuid16 = GATT_UUID_GATT_SRV_CHGD;
const tBTA_GATTC_CHARACTERISTIC *p_char = bta_gattc_get_characteristic_srcb(p_srcb, p_notify->handle);
- if (p_char && bta_gattc_uuid_compare(&p_char->service->uuid, &gattp_uuid, TRUE) &&
- bta_gattc_uuid_compare(&p_char->uuid, &srvc_chg_uuid, TRUE))
+ if (p_char && bta_gattc_uuid_compare(&p_char->service->uuid, &gattp_uuid, true) &&
+ bta_gattc_uuid_compare(&p_char->uuid, &srvc_chg_uuid, true))
{
if (att_value->len != BTA_GATTC_SERVICE_CHANGED_LEN) {
APPL_TRACE_ERROR("%s: received malformed service changed indication, skipping", __func__);
- return FALSE;
+ return false;
}
- UINT8 *p = att_value->value;
- UINT16 s_handle = ((UINT16)(*(p )) + (((UINT16)(*(p + 1))) << 8));
- UINT16 e_handle = ((UINT16)(*(p + 2)) + (((UINT16)(*(p + 3))) << 8));
+ uint8_t *p = att_value->value;
+ uint16_t s_handle = ((uint16_t)(*(p )) + (((uint16_t)(*(p + 1))) << 8));
+ uint16_t e_handle = ((uint16_t)(*(p + 2)) + (((uint16_t)(*(p + 3))) << 8));
APPL_TRACE_ERROR("%s: service changed s_handle:0x%04x e_handle:0x%04x",
__func__, s_handle, e_handle);
- processed = TRUE;
+ processed = true;
/* mark service handle change pending */
- p_srcb->srvc_hdl_chg = TRUE;
+ p_srcb->srvc_hdl_chg = true;
/* clear up all notification/indication registration */
bta_gattc_clear_notif_registration(p_srcb, conn_id, s_handle, e_handle);
/* service change indication all received, do discovery update */
@@ -1750,7 +1750,7 @@
** Returns None.
**
*******************************************************************************/
-void bta_gattc_proc_other_indication(tBTA_GATTC_CLCB *p_clcb, UINT8 op,
+void bta_gattc_proc_other_indication(tBTA_GATTC_CLCB *p_clcb, uint8_t op,
tGATT_CL_COMPLETE *p_data,
tBTA_GATTC_NOTIFY *p_notify)
{
@@ -1759,7 +1759,7 @@
p_data->att_value.handle, p_data->handle);
APPL_TRACE_DEBUG("is_notify", p_notify->is_notify);
- p_notify->is_notify = (op == GATTC_OPTYPE_INDICATION) ? FALSE : TRUE;
+ p_notify->is_notify = (op == GATTC_OPTYPE_INDICATION) ? false : true;
p_notify->len = p_data->att_value.len;
bdcpy(p_notify->bda, p_clcb->bda);
memcpy(p_notify->value, p_data->att_value.value, p_data->att_value.len);
@@ -1778,9 +1778,9 @@
** Returns None.
**
*******************************************************************************/
-void bta_gattc_process_indicate(UINT16 conn_id, tGATTC_OPTYPE op, tGATT_CL_COMPLETE *p_data)
+void bta_gattc_process_indicate(uint16_t conn_id, tGATTC_OPTYPE op, tGATT_CL_COMPLETE *p_data)
{
- UINT16 handle = p_data->att_value.handle;
+ uint16_t handle = p_data->att_value.handle;
tBTA_GATTC_CLCB *p_clcb ;
tBTA_GATTC_RCB *p_clrcb = NULL;
tBTA_GATTC_SERV *p_srcb = NULL;
@@ -1858,7 +1858,7 @@
** Returns None.
**
*******************************************************************************/
-static void bta_gattc_cmpl_cback(UINT16 conn_id, tGATTC_OPTYPE op, tGATT_STATUS status,
+static void bta_gattc_cmpl_cback(uint16_t conn_id, tGATTC_OPTYPE op, tGATT_STATUS status,
tGATT_CL_COMPLETE *p_data)
{
tBTA_GATTC_CLCB *p_clcb;
@@ -1897,7 +1897,7 @@
** Returns None.
**
*******************************************************************************/
-static void bta_gattc_cmpl_sendmsg(UINT16 conn_id, tGATTC_OPTYPE op,
+static void bta_gattc_cmpl_sendmsg(uint16_t conn_id, tGATTC_OPTYPE op,
tBTA_GATT_STATUS status,
tGATT_CL_COMPLETE *p_data)
{
@@ -1926,7 +1926,7 @@
** Returns void
**
********************************************************************************/
-static void bta_gattc_cong_cback (UINT16 conn_id, BOOLEAN congested)
+static void bta_gattc_cong_cback (uint16_t conn_id, bool congested)
{
tBTA_GATTC_CLCB *p_clcb;
tBTA_GATTC cb_data;
@@ -1943,7 +1943,7 @@
}
}
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_gattc_init_clcb_conn
@@ -1953,14 +1953,14 @@
** Returns void
**
********************************************************************************/
-void bta_gattc_init_clcb_conn(UINT8 cif, BD_ADDR remote_bda)
+void bta_gattc_init_clcb_conn(uint8_t cif, BD_ADDR remote_bda)
{
tBTA_GATTC_CLCB *p_clcb = NULL;
tBTA_GATTC_DATA gattc_data;
- UINT16 conn_id;
+ uint16_t conn_id;
/* should always get the connection ID */
- if (GATT_GetConnIdIfConnected(cif, remote_bda, &conn_id, BTA_GATT_TRANSPORT_LE) == FALSE)
+ if (GATT_GetConnIdIfConnected(cif, remote_bda, &conn_id, BTA_GATT_TRANSPORT_LE) == false)
{
APPL_TRACE_ERROR("bta_gattc_init_clcb_conn ERROR: not a connected device");
return;
@@ -1973,7 +1973,7 @@
gattc_data.api_conn.client_if = cif;
memcpy(gattc_data.api_conn.remote_bda, remote_bda, BD_ADDR_LEN);
- gattc_data.api_conn.is_direct = TRUE;
+ gattc_data.api_conn.is_direct = true;
bta_gattc_sm_execute(p_clcb, BTA_GATTC_API_OPEN_EVT, &gattc_data);
}
@@ -1992,9 +1992,9 @@
** Returns void
**
********************************************************************************/
-void bta_gattc_process_listen_all(UINT8 cif)
+void bta_gattc_process_listen_all(uint8_t cif)
{
- UINT8 i_conn = 0;
+ uint8_t i_conn = 0;
tBTA_GATTC_CONN *p_conn = &bta_gattc_cb.conn_track[0];
for (i_conn = 0; i_conn < BTA_GATTC_CONN_MAX; i_conn++, p_conn ++)
@@ -2037,7 +2037,7 @@
if (bta_gattc_mark_bg_conn(p_msg->api_listen.client_if,
(BD_ADDR_PTR) p_msg->api_listen.remote_bda,
p_msg->api_listen.start,
- TRUE))
+ true))
{
if (!GATT_Listen(p_msg->api_listen.client_if,
p_msg->api_listen.start,
@@ -2103,5 +2103,5 @@
if (p_clreg && p_clreg->p_cback)
(*p_clreg->p_cback)(BTA_GATTC_LISTEN_EVT, &cb_data);
}
-#endif
-#endif
+#endif // BLE_INCLUDED
+#endif // BTA_GATT_INCLUDED == TRUE && BLE_INCLUDED == TRUE
diff --git a/bta/gatt/bta_gattc_api.cc b/bta/gatt/bta_gattc_api.cc
index e53c39c..4b88781 100644
--- a/bta/gatt/bta_gattc_api.cc
+++ b/bta/gatt/bta_gattc_api.cc
@@ -24,7 +24,7 @@
#include "bt_target.h"
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#include <string.h>
#include "bt_common.h"
@@ -56,7 +56,7 @@
*******************************************************************************/
void BTA_GATTC_Disable(void)
{
- if (bta_sys_is_register(BTA_ID_GATTC) == FALSE)
+ if (bta_sys_is_register(BTA_ID_GATTC) == false)
{
APPL_TRACE_WARNING("GATTC Module not enabled/already disabled");
return;
@@ -87,7 +87,7 @@
tBTA_GATTC_API_REG *p_buf =
(tBTA_GATTC_API_REG *)osi_malloc(sizeof(tBTA_GATTC_API_REG));
- if (bta_sys_is_register(BTA_ID_GATTC) == FALSE)
+ if (bta_sys_is_register(BTA_ID_GATTC) == false)
bta_sys_register(BTA_ID_GATTC, &bta_gattc_reg);
p_buf->hdr.event = BTA_GATTC_API_REG_EVT;
@@ -137,7 +137,7 @@
**
*******************************************************************************/
void BTA_GATTC_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda,
- BOOLEAN is_direct, tBTA_GATT_TRANSPORT transport)
+ bool is_direct, tBTA_GATT_TRANSPORT transport)
{
tBTA_GATTC_API_OPEN *p_buf =
(tBTA_GATTC_API_OPEN *) osi_malloc(sizeof(tBTA_GATTC_API_OPEN));
@@ -165,7 +165,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTC_CancelOpen(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, BOOLEAN is_direct)
+void BTA_GATTC_CancelOpen(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, bool is_direct)
{
tBTA_GATTC_API_CANCEL_OPEN *p_buf =
(tBTA_GATTC_API_CANCEL_OPEN *)osi_malloc(sizeof(tBTA_GATTC_API_CANCEL_OPEN));
@@ -189,7 +189,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTC_Close(UINT16 conn_id)
+void BTA_GATTC_Close(uint16_t conn_id)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -212,7 +212,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTC_ConfigureMTU (UINT16 conn_id, UINT16 mtu)
+void BTA_GATTC_ConfigureMTU (uint16_t conn_id, uint16_t mtu)
{
tBTA_GATTC_API_CFG_MTU *p_buf =
(tBTA_GATTC_API_CFG_MTU *)osi_malloc(sizeof(tBTA_GATTC_API_CFG_MTU));
@@ -240,7 +240,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_ServiceSearchRequest (UINT16 conn_id, tBT_UUID *p_srvc_uuid)
+void BTA_GATTC_ServiceSearchRequest (uint16_t conn_id, tBT_UUID *p_srvc_uuid)
{
const size_t len = sizeof(tBTA_GATTC_API_SEARCH) + sizeof(tBT_UUID);
tBTA_GATTC_API_SEARCH *p_buf = (tBTA_GATTC_API_SEARCH *)osi_calloc(len);
@@ -268,7 +268,7 @@
** Returns returns list_t of tBTA_GATTC_SERVICE or NULL.
**
*******************************************************************************/
-const list_t* BTA_GATTC_GetServices(UINT16 conn_id) {
+const list_t* BTA_GATTC_GetServices(uint16_t conn_id) {
return bta_gattc_get_services(conn_id);
}
@@ -284,7 +284,7 @@
** Returns returns pointer to tBTA_GATTC_CHARACTERISTIC or NULL.
**
*******************************************************************************/
-const tBTA_GATTC_CHARACTERISTIC* BTA_GATTC_GetCharacteristic(UINT16 conn_id, UINT16 handle) {
+const tBTA_GATTC_CHARACTERISTIC* BTA_GATTC_GetCharacteristic(uint16_t conn_id, uint16_t handle) {
return bta_gattc_get_characteristic(conn_id, handle);
}
@@ -300,7 +300,7 @@
** Returns returns pointer to tBTA_GATTC_DESCRIPTOR or NULL.
**
*******************************************************************************/
-const tBTA_GATTC_DESCRIPTOR* BTA_GATTC_GetDescriptor(UINT16 conn_id, UINT16 handle) {
+const tBTA_GATTC_DESCRIPTOR* BTA_GATTC_GetDescriptor(uint16_t conn_id, uint16_t handle) {
return bta_gattc_get_descriptor(conn_id, handle);
}
@@ -316,7 +316,7 @@
** count: number of elements in database.
**
*******************************************************************************/
-void BTA_GATTC_GetGattDb(UINT16 conn_id, UINT16 start_handle, UINT16 end_handle,
+void BTA_GATTC_GetGattDb(uint16_t conn_id, uint16_t start_handle, uint16_t end_handle,
btgatt_db_element_t **db, int *count)
{
bta_gattc_get_gatt_db(conn_id, start_handle, end_handle, db, count);
@@ -334,7 +334,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_ReadCharacteristic(UINT16 conn_id, UINT16 handle, tBTA_GATT_AUTH_REQ auth_req)
+void BTA_GATTC_ReadCharacteristic(uint16_t conn_id, uint16_t handle, tBTA_GATT_AUTH_REQ auth_req)
{
tBTA_GATTC_API_READ *p_buf =
(tBTA_GATTC_API_READ *)osi_calloc(sizeof(tBTA_GATTC_API_READ));
@@ -360,7 +360,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_ReadCharDescr (UINT16 conn_id, UINT16 handle, tBTA_GATT_AUTH_REQ auth_req)
+void BTA_GATTC_ReadCharDescr (uint16_t conn_id, uint16_t handle, tBTA_GATT_AUTH_REQ auth_req)
{
tBTA_GATTC_API_READ *p_buf =
(tBTA_GATTC_API_READ *)osi_calloc(sizeof(tBTA_GATTC_API_READ));
@@ -387,7 +387,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_ReadMultiple(UINT16 conn_id, tBTA_GATTC_MULTI *p_read_multi,
+void BTA_GATTC_ReadMultiple(uint16_t conn_id, tBTA_GATTC_MULTI *p_read_multi,
tBTA_GATT_AUTH_REQ auth_req)
{
tBTA_GATTC_API_READ_MULTI *p_buf =
@@ -399,7 +399,7 @@
p_buf->num_attr = p_read_multi->num_attr;
if (p_buf->num_attr > 0)
- memcpy(p_buf->handles, p_read_multi->handles, sizeof(UINT16) * p_read_multi->num_attr);
+ memcpy(p_buf->handles, p_read_multi->handles, sizeof(uint16_t) * p_read_multi->num_attr);
bta_sys_sendmsg(p_buf);
}
@@ -418,8 +418,8 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_WriteCharValue ( UINT16 conn_id,
- UINT16 handle,
+void BTA_GATTC_WriteCharValue ( uint16_t conn_id,
+ uint16_t handle,
tBTA_GATTC_WRITE_TYPE write_type,
std::vector<uint8_t> value,
tBTA_GATT_AUTH_REQ auth_req)
@@ -436,7 +436,7 @@
p_buf->len = value.size();
if (value.size() > 0) {
- p_buf->p_value = (UINT8 *)(p_buf + 1);
+ p_buf->p_value = (uint8_t *)(p_buf + 1);
memcpy(p_buf->p_value, value.data(), value.size());
}
@@ -457,8 +457,8 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_WriteCharDescr (UINT16 conn_id,
- UINT16 handle,
+void BTA_GATTC_WriteCharDescr (uint16_t conn_id,
+ uint16_t handle,
tBTA_GATTC_WRITE_TYPE write_type,
std::vector<uint8_t> value,
tBTA_GATT_AUTH_REQ auth_req)
@@ -474,7 +474,7 @@
p_buf->write_type = write_type;
if (value.size() != 0) {
- p_buf->p_value = (UINT8 *)(p_buf + 1);
+ p_buf->p_value = (uint8_t *)(p_buf + 1);
p_buf->len = value.size();
memcpy(p_buf->p_value, value.data(), value.size());
}
@@ -496,8 +496,8 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_PrepareWrite (UINT16 conn_id, UINT16 handle, UINT16 offset,
- std::vector<uint8_t> value,
+void BTA_GATTC_PrepareWrite (uint16_t conn_id, uint16_t handle,
+ uint16_t offset, std::vector<uint8_t> value,
tBTA_GATT_AUTH_REQ auth_req)
{
tBTA_GATTC_API_WRITE *p_buf =
@@ -513,7 +513,7 @@
p_buf->len = value.size();
if (value.size() > 0) {
- p_buf->p_value = (UINT8 *)(p_buf + 1);
+ p_buf->p_value = (uint8_t *)(p_buf + 1);
memcpy(p_buf->p_value, value.data(), value.size());
}
@@ -532,7 +532,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_ExecuteWrite (UINT16 conn_id, BOOLEAN is_execute)
+void BTA_GATTC_ExecuteWrite (uint16_t conn_id, bool is_execute)
{
tBTA_GATTC_API_EXEC *p_buf =
(tBTA_GATTC_API_EXEC *)osi_calloc(sizeof(tBTA_GATTC_API_EXEC));
@@ -556,7 +556,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_SendIndConfirm (UINT16 conn_id, UINT16 handle)
+void BTA_GATTC_SendIndConfirm (uint16_t conn_id, uint16_t handle)
{
tBTA_GATTC_API_CONFIRM *p_buf =
(tBTA_GATTC_API_CONFIRM *)osi_calloc(sizeof(tBTA_GATTC_API_CONFIRM));
@@ -584,11 +584,11 @@
**
*******************************************************************************/
tBTA_GATT_STATUS BTA_GATTC_RegisterForNotifications (tBTA_GATTC_IF client_if,
- const BD_ADDR bda, UINT16 handle)
+ const BD_ADDR bda, uint16_t handle)
{
tBTA_GATTC_RCB *p_clreg;
tBTA_GATT_STATUS status = BTA_GATT_ILLEGAL_PARAMETER;
- UINT8 i;
+ uint8_t i;
if (!handle)
{
@@ -617,7 +617,7 @@
{
memset((void *)&p_clreg->notif_reg[i], 0, sizeof(tBTA_GATTC_NOTIF_REG));
- p_clreg->notif_reg[i].in_use = TRUE;
+ p_clreg->notif_reg[i].in_use = true;
memcpy(p_clreg->notif_reg[i].remote_bda, bda, BD_ADDR_LEN);
p_clreg->notif_reg[i].handle = handle;
@@ -654,7 +654,7 @@
**
*******************************************************************************/
tBTA_GATT_STATUS BTA_GATTC_DeregisterForNotifications (tBTA_GATTC_IF client_if,
- const BD_ADDR bda, UINT16 handle)
+ const BD_ADDR bda, uint16_t handle)
{
if (!handle) {
APPL_TRACE_ERROR("%s: deregistration failed, handle is 0", __func__);
@@ -721,7 +721,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTC_Listen(tBTA_GATTC_IF client_if, BOOLEAN start, BD_ADDR_PTR target_bda)
+void BTA_GATTC_Listen(tBTA_GATTC_IF client_if, bool start, BD_ADDR_PTR target_bda)
{
tBTA_GATTC_API_LISTEN *p_buf =
(tBTA_GATTC_API_LISTEN *)osi_malloc(sizeof(tBTA_GATTC_API_LISTEN) + BD_ADDR_LEN);
@@ -730,7 +730,7 @@
p_buf->client_if = client_if;
p_buf->start = start;
if (target_bda) {
- p_buf->remote_bda = (UINT8*)(p_buf + 1);
+ p_buf->remote_bda = (uint8_t*)(p_buf + 1);
memcpy(p_buf->remote_bda, target_bda, BD_ADDR_LEN);
} else {
p_buf->remote_bda = NULL;
@@ -751,7 +751,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTC_Broadcast(tBTA_GATTC_IF client_if, BOOLEAN start)
+void BTA_GATTC_Broadcast(tBTA_GATTC_IF client_if, bool start)
{
tBTA_GATTC_API_LISTEN *p_buf =
(tBTA_GATTC_API_LISTEN *)osi_malloc(sizeof(tBTA_GATTC_API_LISTEN) + BD_ADDR_LEN);
diff --git a/bta/gatt/bta_gattc_cache.cc b/bta/gatt/bta_gattc_cache.cc
index 485fedf..36d4a8f 100644
--- a/bta/gatt/bta_gattc_cache.cc
+++ b/bta/gatt/bta_gattc_cache.cc
@@ -27,7 +27,7 @@
#include "bt_target.h"
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#include <errno.h>
#include <stdio.h>
@@ -45,13 +45,13 @@
#include "sdpdefs.h"
#include "utl.h"
-static void bta_gattc_cache_write(BD_ADDR server_bda, UINT16 num_attr, tBTA_GATTC_NV_ATTR *attr);
-static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb);
-static tBTA_GATT_STATUS bta_gattc_sdp_service_disc(UINT16 conn_id, tBTA_GATTC_SERV *p_server_cb);
+static void bta_gattc_cache_write(BD_ADDR server_bda, uint16_t num_attr, tBTA_GATTC_NV_ATTR *attr);
+static void bta_gattc_char_dscpt_disc_cmpl(uint16_t conn_id, tBTA_GATTC_SERV *p_srvc_cb);
+static tBTA_GATT_STATUS bta_gattc_sdp_service_disc(uint16_t conn_id, tBTA_GATTC_SERV *p_server_cb);
extern void bta_to_btif_uuid(bt_uuid_t *p_dest, tBT_UUID *p_src);
-tBTA_GATTC_SERVICE* bta_gattc_find_matching_service(const list_t *services, UINT16 handle);
-tBTA_GATTC_DESCRIPTOR* bta_gattc_get_descriptor_srcb(tBTA_GATTC_SERV *p_srcb, UINT16 handle);
-tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic_srcb(tBTA_GATTC_SERV *p_srcb, UINT16 handle);
+tBTA_GATTC_SERVICE* bta_gattc_find_matching_service(const list_t *services, uint16_t handle);
+tBTA_GATTC_DESCRIPTOR* bta_gattc_get_descriptor_srcb(tBTA_GATTC_SERV *p_srcb, uint16_t handle);
+tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic_srcb(tBTA_GATTC_SERV *p_srcb, uint16_t handle);
#define BTA_GATT_SDP_DB_SIZE 4096
@@ -71,10 +71,10 @@
typedef struct
{
tSDP_DISCOVERY_DB *p_sdp_db;
- UINT16 sdp_conn_id;
+ uint16_t sdp_conn_id;
} tBTA_GATTC_CB_DATA;
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
static char *bta_gattc_attr_type[] =
{
"I", /* Included Service */
@@ -132,9 +132,9 @@
** Returns none.
**
*******************************************************************************/
-static void bta_gattc_display_explore_record(tBTA_GATTC_ATTR_REC *p_rec, UINT8 num_rec)
+static void bta_gattc_display_explore_record(tBTA_GATTC_ATTR_REC *p_rec, uint8_t num_rec)
{
- UINT8 i;
+ uint8_t i;
tBTA_GATTC_ATTR_REC *pp = p_rec;
APPL_TRACE_ERROR("<================Start Explore Queue =============>");
@@ -147,7 +147,7 @@
APPL_TRACE_ERROR(" ");
}
-#endif /* BTA_GATT_DEBUG == TRUE */
+#endif /* BTA_GATT_DEBUG == true */
/*******************************************************************************
**
@@ -199,11 +199,11 @@
**
*******************************************************************************/
static tBTA_GATT_STATUS bta_gattc_add_srvc_to_cache(tBTA_GATTC_SERV *p_srvc_cb,
- UINT16 s_handle, UINT16 e_handle,
+ uint16_t s_handle, uint16_t e_handle,
tBT_UUID *p_uuid,
- BOOLEAN is_primary)
+ bool is_primary)
{
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_DEBUG("Add a service into Service");
#endif
@@ -227,12 +227,12 @@
}
static tBTA_GATT_STATUS bta_gattc_add_char_to_cache(tBTA_GATTC_SERV *p_srvc_cb,
- UINT16 attr_handle,
- UINT16 value_handle,
+ uint16_t attr_handle,
+ uint16_t value_handle,
tBT_UUID *p_uuid,
- UINT8 property)
+ uint8_t property)
{
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_DEBUG("%s: Add a characteristic into Service", __func__);
APPL_TRACE_DEBUG("handle=%d uuid16=0x%x property=0x%x",
value_handle, p_uuid->uu.uuid16, property);
@@ -274,13 +274,13 @@
**
*******************************************************************************/
static tBTA_GATT_STATUS bta_gattc_add_attr_to_cache(tBTA_GATTC_SERV *p_srvc_cb,
- UINT16 handle,
+ uint16_t handle,
tBT_UUID *p_uuid,
- UINT8 property,
- UINT16 incl_srvc_s_handle,
+ uint8_t property,
+ uint16_t incl_srvc_s_handle,
tBTA_GATTC_ATTR_TYPE type)
{
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_DEBUG("%s: Add a [%s] into Service", __func__, bta_gattc_attr_type[type]);
APPL_TRACE_DEBUG("handle=%d uuid16=0x%x property=0x%x type=%d",
handle, p_uuid->uu.uuid16, property, type);
@@ -341,7 +341,7 @@
** Returns None.
**
*******************************************************************************/
-void bta_gattc_get_disc_range(tBTA_GATTC_SERV *p_srvc_cb, UINT16 *p_s_hdl, UINT16 *p_e_hdl, BOOLEAN is_srvc)
+void bta_gattc_get_disc_range(tBTA_GATTC_SERV *p_srvc_cb, uint16_t *p_s_hdl, uint16_t *p_e_hdl, bool is_srvc)
{
tBTA_GATTC_ATTR_REC *p_rec = NULL;
@@ -357,7 +357,7 @@
}
*p_e_hdl = p_rec->e_handle;
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_DEBUG("discover range [%d ~ %d]",p_rec->s_handle, p_rec->e_handle);
#endif
return;
@@ -371,8 +371,8 @@
** Returns status of the operation.
**
*******************************************************************************/
-tBTA_GATT_STATUS bta_gattc_discover_pri_service(UINT16 conn_id, tBTA_GATTC_SERV *p_server_cb,
- UINT8 disc_type)
+tBTA_GATT_STATUS bta_gattc_discover_pri_service(uint16_t conn_id, tBTA_GATTC_SERV *p_server_cb,
+ uint8_t disc_type)
{
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
tBTA_GATT_STATUS status = BTA_GATT_ERROR;
@@ -396,11 +396,11 @@
** Returns status of the operation.
**
*******************************************************************************/
-tBTA_GATT_STATUS bta_gattc_discover_procedure(UINT16 conn_id, tBTA_GATTC_SERV *p_server_cb,
- UINT8 disc_type)
+tBTA_GATT_STATUS bta_gattc_discover_procedure(uint16_t conn_id, tBTA_GATTC_SERV *p_server_cb,
+ uint8_t disc_type)
{
tGATT_DISC_PARAM param;
- BOOLEAN is_service = TRUE;
+ bool is_service = true;
memset(¶m, 0, sizeof(tGATT_DISC_PARAM));
@@ -412,7 +412,7 @@
else
{
if (disc_type == GATT_DISC_CHAR_DSCPT)
- is_service = FALSE;
+ is_service = false;
bta_gattc_get_disc_range(p_server_cb, ¶m.s_handle, ¶m.e_handle, is_service);
@@ -433,7 +433,7 @@
** Returns status of the operation.
**
*******************************************************************************/
-tBTA_GATT_STATUS bta_gattc_start_disc_include_srvc(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb)
+tBTA_GATT_STATUS bta_gattc_start_disc_include_srvc(uint16_t conn_id, tBTA_GATTC_SERV *p_srvc_cb)
{
return bta_gattc_discover_procedure(conn_id, p_srvc_cb, GATT_DISC_INC_SRVC);
}
@@ -446,7 +446,7 @@
** Returns status of the operation.
**
*******************************************************************************/
-tBTA_GATT_STATUS bta_gattc_start_disc_char(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb)
+tBTA_GATT_STATUS bta_gattc_start_disc_char(uint16_t conn_id, tBTA_GATTC_SERV *p_srvc_cb)
{
p_srvc_cb->total_char = 0;
@@ -461,7 +461,7 @@
** Returns none.
**
*******************************************************************************/
-void bta_gattc_start_disc_char_dscp(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb)
+void bta_gattc_start_disc_char_dscp(uint16_t conn_id, tBTA_GATTC_SERV *p_srvc_cb)
{
APPL_TRACE_DEBUG("starting discover characteristics descriptor");
@@ -478,7 +478,7 @@
** Returns status
**
*******************************************************************************/
-static void bta_gattc_explore_srvc(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb)
+static void bta_gattc_explore_srvc(uint16_t conn_id, tBTA_GATTC_SERV *p_srvc_cb)
{
tBTA_GATTC_ATTR_REC *p_rec = p_srvc_cb->p_srvc_list + p_srvc_cb->cur_srvc_idx;
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
@@ -510,7 +510,7 @@
/* no service found at all, the end of server discovery*/
LOG_WARN(LOG_TAG, "%s no more services found", __func__);
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
bta_gattc_display_cache_server(p_srvc_cb->p_srvc_cache);
#endif
/* save cache to NV */
@@ -531,7 +531,7 @@
** Returns status
**
*******************************************************************************/
-static void bta_gattc_incl_srvc_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb)
+static void bta_gattc_incl_srvc_disc_cmpl(uint16_t conn_id, tBTA_GATTC_SERV *p_srvc_cb)
{
p_srvc_cb->cur_char_idx = p_srvc_cb->total_srvc;
@@ -547,7 +547,7 @@
** Returns status
**
*******************************************************************************/
-static void bta_gattc_char_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb)
+static void bta_gattc_char_disc_cmpl(uint16_t conn_id, tBTA_GATTC_SERV *p_srvc_cb)
{
tBTA_GATTC_ATTR_REC *p_rec = p_srvc_cb->p_srvc_list + p_srvc_cb->cur_char_idx;
@@ -580,7 +580,7 @@
** Returns status
**
*******************************************************************************/
-static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb)
+static void bta_gattc_char_dscpt_disc_cmpl(uint16_t conn_id, tBTA_GATTC_SERV *p_srvc_cb)
{
tBTA_GATTC_ATTR_REC *p_rec = NULL;
@@ -600,7 +600,7 @@
else
/* all characteristic has been explored, start with next service if any */
{
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_ERROR("all char has been explored");
#endif
p_srvc_cb->cur_srvc_idx ++;
@@ -608,18 +608,18 @@
}
}
-static BOOLEAN bta_gattc_srvc_in_list(tBTA_GATTC_SERV *p_srvc_cb, UINT16 s_handle,
- UINT16 e_handle, tBT_UUID uuid)
+static bool bta_gattc_srvc_in_list(tBTA_GATTC_SERV *p_srvc_cb, uint16_t s_handle,
+ uint16_t e_handle, tBT_UUID uuid)
{
tBTA_GATTC_ATTR_REC *p_rec = NULL;
- UINT8 i;
- BOOLEAN exist_srvc = FALSE;
+ uint8_t i;
+ bool exist_srvc = false;
UNUSED(uuid);
if (!GATT_HANDLE_IS_VALID(s_handle) || !GATT_HANDLE_IS_VALID(e_handle))
{
APPL_TRACE_ERROR("invalid included service handle: [0x%04x ~ 0x%04x]", s_handle, e_handle);
- exist_srvc = TRUE;
+ exist_srvc = true;
}
else
{
@@ -630,7 +630,7 @@
/* a new service should not have any overlap with other service handle range */
if (p_rec->s_handle == s_handle || p_rec->e_handle == e_handle)
{
- exist_srvc = TRUE;
+ exist_srvc = true;
break;
}
}
@@ -647,8 +647,8 @@
**
*******************************************************************************/
static tBTA_GATT_STATUS bta_gattc_add_srvc_to_list(tBTA_GATTC_SERV *p_srvc_cb,
- UINT16 s_handle, UINT16 e_handle,
- tBT_UUID uuid, BOOLEAN is_primary)
+ uint16_t s_handle, uint16_t e_handle,
+ tBT_UUID uuid, bool is_primary)
{
tBTA_GATTC_ATTR_REC *p_rec = NULL;
tBTA_GATT_STATUS status = BTA_GATT_OK;
@@ -686,8 +686,8 @@
**
*******************************************************************************/
static tBTA_GATT_STATUS bta_gattc_add_char_to_list(tBTA_GATTC_SERV *p_srvc_cb,
- UINT16 decl_handle, UINT16 value_handle,
- tBT_UUID uuid, UINT8 property)
+ uint16_t decl_handle, uint16_t value_handle,
+ tBT_UUID uuid, uint8_t property)
{
tBTA_GATTC_ATTR_REC *p_rec = NULL;
tBTA_GATT_STATUS status = BTA_GATT_OK;
@@ -737,12 +737,12 @@
** Returns void
**
*******************************************************************************/
-void bta_gattc_sdp_callback(UINT16 sdp_status, void* user_data)
+void bta_gattc_sdp_callback(uint16_t sdp_status, void* user_data)
{
tSDP_DISC_REC *p_sdp_rec = NULL;
tBT_UUID service_uuid;
tSDP_PROTOCOL_ELEM pe;
- UINT16 start_handle = 0, end_handle = 0;
+ uint16_t start_handle = 0, end_handle = 0;
tBTA_GATTC_CB_DATA *cb_data = (tBTA_GATTC_CB_DATA *)user_data;
tBTA_GATTC_SERV *p_srvc_cb = bta_gattc_find_scb_by_cid(cb_data->sdp_conn_id);
@@ -759,10 +759,10 @@
if (SDP_FindProtocolListElemInRec(p_sdp_rec, UUID_PROTOCOL_ATT, &pe))
{
- start_handle = (UINT16) pe.params[0];
- end_handle = (UINT16) pe.params[1];
+ start_handle = (uint16_t) pe.params[0];
+ end_handle = (uint16_t) pe.params[1];
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_EVENT("Found ATT service [0x%04x] handle[0x%04x ~ 0x%04x]",
service_uuid.uu.uuid16, start_handle, end_handle);
#endif
@@ -775,7 +775,7 @@
start_handle,
end_handle,
service_uuid,
- TRUE);
+ true);
}
else
{
@@ -813,11 +813,11 @@
** Returns void
**
*******************************************************************************/
-static tBTA_GATT_STATUS bta_gattc_sdp_service_disc(UINT16 conn_id, tBTA_GATTC_SERV *p_server_cb)
+static tBTA_GATT_STATUS bta_gattc_sdp_service_disc(uint16_t conn_id, tBTA_GATTC_SERV *p_server_cb)
{
tSDP_UUID uuid;
- UINT16 num_attrs = 2;
- UINT16 attr_list[2];
+ uint16_t num_attrs = 2;
+ uint16_t attr_list[2];
memset (&uuid, 0, sizeof(tSDP_UUID));
@@ -859,10 +859,10 @@
** Returns void
**
*******************************************************************************/
-void bta_gattc_disc_res_cback (UINT16 conn_id, tGATT_DISC_TYPE disc_type, tGATT_DISC_RES *p_data)
+void bta_gattc_disc_res_cback (uint16_t conn_id, tGATT_DISC_TYPE disc_type, tGATT_DISC_RES *p_data)
{
tBTA_GATTC_SERV * p_srvc_cb = NULL;
- BOOLEAN pri_srvc;
+ bool pri_srvc;
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
p_srvc_cb = bta_gattc_find_scb_by_cid(conn_id);
@@ -877,7 +877,7 @@
p_data->handle,
p_data->value.group_value.e_handle,
p_data->value.group_value.service_type,
- TRUE);
+ true);
break;
case GATT_DISC_SRVC_BY_UUID:
@@ -885,7 +885,7 @@
p_data->handle,
p_data->value.group_value.e_handle,
p_data->value.group_value.service_type,
- TRUE);
+ true);
break;
case GATT_DISC_INC_SRVC:
@@ -901,7 +901,7 @@
p_data->value.incl_service.s_handle,
p_data->value.incl_service.e_handle,
p_data->value.incl_service.service_type,
- FALSE);
+ false);
/* add into database */
bta_gattc_add_attr_to_cache(p_srvc_cb,
p_data->handle,
@@ -928,7 +928,7 @@
}
}
}
-void bta_gattc_disc_cmpl_cback (UINT16 conn_id, tGATT_DISC_TYPE disc_type, tGATT_STATUS status)
+void bta_gattc_disc_cmpl_cback (uint16_t conn_id, tGATT_DISC_TYPE disc_type, tGATT_STATUS status)
{
tBTA_GATTC_SERV * p_srvc_cb;
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
@@ -948,7 +948,7 @@
{
case GATT_DISC_SRVC_ALL:
case GATT_DISC_SRVC_BY_UUID:
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
bta_gattc_display_explore_record(p_srvc_cb->p_srvc_list, p_srvc_cb->next_avail_idx);
#endif
bta_gattc_explore_srvc(conn_id, p_srvc_cb);
@@ -960,7 +960,7 @@
break;
case GATT_DISC_CHAR:
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
bta_gattc_display_explore_record(p_srvc_cb->p_srvc_list, p_srvc_cb->next_avail_idx);
#endif
bta_gattc_char_disc_cmpl(conn_id, p_srvc_cb);
@@ -979,7 +979,7 @@
**
** Description search local cache for matching service record.
**
-** Returns FALSE if map can not be found.
+** Returns false if map can not be found.
**
*******************************************************************************/
void bta_gattc_search_service(tBTA_GATTC_CLCB *p_clcb, tBT_UUID *p_uuid)
@@ -993,10 +993,10 @@
sn != list_end(p_clcb->p_srcb->p_srvc_cache); sn = list_next(sn)) {
tBTA_GATTC_SERVICE *p_cache = (tBTA_GATTC_SERVICE*) list_node(sn);
- if (!bta_gattc_uuid_compare(p_uuid, &p_cache->uuid, FALSE))
+ if (!bta_gattc_uuid_compare(p_uuid, &p_cache->uuid, false))
continue;
-#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_DEBUG("found service [0x%04x], inst[%d] handle [%d]",
p_cache->uuid.uu.uuid16,
p_cache->handle,
@@ -1022,7 +1022,7 @@
return p_srcb->p_srvc_cache;
}
-const list_t* bta_gattc_get_services(UINT16 conn_id) {
+const list_t* bta_gattc_get_services(uint16_t conn_id) {
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
if (p_clcb == NULL )
@@ -1033,7 +1033,7 @@
return bta_gattc_get_services_srcb(p_srcb);
}
-tBTA_GATTC_SERVICE* bta_gattc_find_matching_service(const list_t *services, UINT16 handle) {
+tBTA_GATTC_SERVICE* bta_gattc_find_matching_service(const list_t *services, uint16_t handle) {
if (!services || list_is_empty(services))
return NULL;
@@ -1048,19 +1048,19 @@
return NULL;
}
-const tBTA_GATTC_SERVICE* bta_gattc_get_service_for_handle_srcb(tBTA_GATTC_SERV *p_srcb, UINT16 handle) {
+const tBTA_GATTC_SERVICE* bta_gattc_get_service_for_handle_srcb(tBTA_GATTC_SERV *p_srcb, uint16_t handle) {
const list_t *services = bta_gattc_get_services_srcb(p_srcb);
return bta_gattc_find_matching_service(services, handle);
}
-const tBTA_GATTC_SERVICE* bta_gattc_get_service_for_handle(UINT16 conn_id, UINT16 handle) {
+const tBTA_GATTC_SERVICE* bta_gattc_get_service_for_handle(uint16_t conn_id, uint16_t handle) {
const list_t *services = bta_gattc_get_services(conn_id);
return bta_gattc_find_matching_service(services, handle);
}
-tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic_srcb(tBTA_GATTC_SERV *p_srcb, UINT16 handle) {
+tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic_srcb(tBTA_GATTC_SERV *p_srcb, uint16_t handle) {
const tBTA_GATTC_SERVICE* service = bta_gattc_get_service_for_handle_srcb(p_srcb, handle);
if (!service)
@@ -1076,7 +1076,7 @@
return NULL;
}
-tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic(UINT16 conn_id, UINT16 handle) {
+tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic(uint16_t conn_id, uint16_t handle) {
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
if (p_clcb == NULL )
@@ -1086,7 +1086,7 @@
return bta_gattc_get_characteristic_srcb(p_srcb, handle);
}
-tBTA_GATTC_DESCRIPTOR* bta_gattc_get_descriptor_srcb(tBTA_GATTC_SERV *p_srcb, UINT16 handle) {
+tBTA_GATTC_DESCRIPTOR* bta_gattc_get_descriptor_srcb(tBTA_GATTC_SERV *p_srcb, uint16_t handle) {
const tBTA_GATTC_SERVICE* service = bta_gattc_get_service_for_handle_srcb(p_srcb, handle);
if (!service) {
@@ -1107,7 +1107,7 @@
return NULL;
}
-tBTA_GATTC_DESCRIPTOR* bta_gattc_get_descriptor(UINT16 conn_id, UINT16 handle) {
+tBTA_GATTC_DESCRIPTOR* bta_gattc_get_descriptor(uint16_t conn_id, uint16_t handle) {
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
if (p_clcb == NULL )
@@ -1128,9 +1128,9 @@
*******************************************************************************/
void bta_gattc_fill_gatt_db_el(btgatt_db_element_t *p_attr,
bt_gatt_db_attribute_type_t type,
- UINT16 att_handle,
- UINT16 s_handle, UINT16 e_handle,
- UINT16 id, tBT_UUID uuid, UINT8 prop)
+ uint16_t att_handle,
+ uint16_t s_handle, uint16_t e_handle,
+ uint16_t id, tBT_UUID uuid, uint8_t prop)
{
p_attr->type = type;
p_attr->attribute_handle = att_handle;
@@ -1145,7 +1145,7 @@
** Returns number of elements inside db from start_handle to end_handle
*******************************************************************************/
static size_t bta_gattc_get_db_size(list_t *services,
- UINT16 start_handle, UINT16 end_handle) {
+ uint16_t start_handle, uint16_t end_handle) {
if (!services || list_is_empty(services))
return 0;
@@ -1198,7 +1198,7 @@
**
*******************************************************************************/
static void bta_gattc_get_gatt_db_impl(tBTA_GATTC_SERV *p_srvc_cb,
- UINT16 start_handle, UINT16 end_handle,
+ uint16_t start_handle, uint16_t end_handle,
btgatt_db_element_t **db,
int *count)
{
@@ -1311,7 +1311,7 @@
** Returns None.
**
*******************************************************************************/
-void bta_gattc_get_gatt_db(UINT16 conn_id, UINT16 start_handle, UINT16 end_handle, btgatt_db_element_t **db, int *count)
+void bta_gattc_get_gatt_db(uint16_t conn_id, uint16_t start_handle, uint16_t end_handle, btgatt_db_element_t **db, int *count)
{
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
@@ -1346,7 +1346,7 @@
** Returns None.
**
*******************************************************************************/
-void bta_gattc_rebuild_cache(tBTA_GATTC_SERV *p_srvc_cb, UINT16 num_attr,
+void bta_gattc_rebuild_cache(tBTA_GATTC_SERV *p_srvc_cb, uint16_t num_attr,
tBTA_GATTC_NV_ATTR *p_attr)
{
/* first attribute loading, initialize buffer */
@@ -1400,9 +1400,9 @@
** Returns None.
**
*******************************************************************************/
-void bta_gattc_fill_nv_attr(tBTA_GATTC_NV_ATTR *p_attr, UINT8 type, UINT16 s_handle,
- UINT16 e_handle, tBT_UUID uuid, UINT8 prop, UINT16 incl_srvc_handle,
- BOOLEAN is_primary)
+void bta_gattc_fill_nv_attr(tBTA_GATTC_NV_ATTR *p_attr, uint8_t type, uint16_t s_handle,
+ uint16_t e_handle, tBT_UUID uuid, uint8_t prop, uint16_t incl_srvc_handle,
+ bool is_primary)
{
p_attr->s_handle = s_handle;
p_attr->e_handle = e_handle;
@@ -1424,7 +1424,7 @@
** Returns None.
**
*******************************************************************************/
-void bta_gattc_cache_save(tBTA_GATTC_SERV *p_srvc_cb, UINT16 conn_id)
+void bta_gattc_cache_save(tBTA_GATTC_SERV *p_srvc_cb, uint16_t conn_id)
{
if (!p_srvc_cb->p_srvc_cache || list_is_empty(p_srvc_cb->p_srvc_cache))
return;
@@ -1465,7 +1465,7 @@
p_char->uuid,
p_char->properties,
0 /* incl_srvc_handle */,
- FALSE);
+ false);
if (!p_char->descriptors || list_is_empty(p_char->descriptors))
continue;
@@ -1481,7 +1481,7 @@
p_desc->uuid,
0 /* properties */,
0 /* incl_srvc_handle */,
- FALSE);
+ false);
}
}
@@ -1499,7 +1499,7 @@
p_isvc->uuid,
0 /* properties */,
p_isvc->included_service->s_handle,
- FALSE);
+ false);
}
}
@@ -1530,12 +1530,12 @@
return false;
}
- UINT16 cache_ver = 0;
+ uint16_t cache_ver = 0;
tBTA_GATTC_NV_ATTR *attr = NULL;
bool success = false;
- UINT16 num_attr = 0;
+ uint16_t num_attr = 0;
- if (fread(&cache_ver, sizeof(UINT16), 1, fd) != 1) {
+ if (fread(&cache_ver, sizeof(uint16_t), 1, fd) != 1) {
APPL_TRACE_ERROR("%s: can't read GATT cache version from: %s", __func__, fname);
goto done;
}
@@ -1546,7 +1546,7 @@
}
- if (fread(&num_attr, sizeof(UINT16), 1, fd) != 1) {
+ if (fread(&num_attr, sizeof(uint16_t), 1, fd) != 1) {
APPL_TRACE_ERROR("%s: can't read number of GATT attributes: %s", __func__, fname);
goto done;
}
@@ -1581,7 +1581,7 @@
** Returns
**
*******************************************************************************/
-static void bta_gattc_cache_write(BD_ADDR server_bda, UINT16 num_attr,
+static void bta_gattc_cache_write(BD_ADDR server_bda, uint16_t num_attr,
tBTA_GATTC_NV_ATTR *attr)
{
char fname[255] = {0};
@@ -1593,14 +1593,14 @@
return;
}
- UINT16 cache_ver = GATT_CACHE_VERSION;
- if (fwrite(&cache_ver, sizeof(UINT16), 1, fd) != 1) {
+ uint16_t cache_ver = GATT_CACHE_VERSION;
+ if (fwrite(&cache_ver, sizeof(uint16_t), 1, fd) != 1) {
APPL_TRACE_ERROR("%s: can't write GATT cache version: %s", __func__, fname);
fclose(fd);
return;
}
- if (fwrite(&num_attr, sizeof(UINT16), 1, fd) != 1) {
+ if (fwrite(&num_attr, sizeof(uint16_t), 1, fd) != 1) {
APPL_TRACE_ERROR("%s: can't write GATT cache attribute count: %s", __func__, fname);
fclose(fd);
return;
diff --git a/bta/gatt/bta_gattc_int.h b/bta/gatt/bta_gattc_int.h
index f8ff50c..5b2ecdd 100644
--- a/bta/gatt/bta_gattc_int.h
+++ b/bta/gatt/bta_gattc_int.h
@@ -72,7 +72,7 @@
BTA_GATTC_API_DISABLE_EVT,
BTA_GATTC_ENC_CMPL_EVT
};
-typedef UINT16 tBTA_GATTC_INT_EVT;
+typedef uint16_t tBTA_GATTC_INT_EVT;
#define BTA_GATTC_SERVICE_CHANGED_LEN 4
@@ -117,7 +117,7 @@
BT_HDR hdr;
BD_ADDR remote_bda;
tBTA_GATTC_IF client_if;
- BOOLEAN is_direct;
+ bool is_direct;
tBTA_TRANSPORT transport;
} tBTA_GATTC_API_OPEN;
@@ -127,7 +127,7 @@
{
BT_HDR hdr;
tBTA_GATT_AUTH_REQ auth_req;
- UINT16 handle;
+ uint16_t handle;
tBTA_GATTC_EVT cmpl_evt;
} tBTA_GATTC_API_READ;
@@ -135,24 +135,24 @@
{
BT_HDR hdr;
tBTA_GATT_AUTH_REQ auth_req;
- UINT16 handle;
+ uint16_t handle;
tBTA_GATTC_EVT cmpl_evt;
tBTA_GATTC_WRITE_TYPE write_type;
- UINT16 offset;
- UINT16 len;
- UINT8 *p_value;
+ uint16_t offset;
+ uint16_t len;
+ uint8_t *p_value;
}tBTA_GATTC_API_WRITE;
typedef struct
{
BT_HDR hdr;
- BOOLEAN is_execute;
+ bool is_execute;
}tBTA_GATTC_API_EXEC;
typedef struct
{
BT_HDR hdr;
- UINT16 handle;
+ uint16_t handle;
} tBTA_GATTC_API_CONFIRM;
typedef tGATT_CL_COMPLETE tBTA_GATTC_CMPL;
@@ -160,7 +160,7 @@
typedef struct
{
BT_HDR hdr;
- UINT8 op_code;
+ uint8_t op_code;
tGATT_STATUS status;
tBTA_GATTC_CMPL *p_cmpl;
}tBTA_GATTC_OP_CMPL;
@@ -175,8 +175,8 @@
{
BT_HDR hdr;
tBTA_GATT_AUTH_REQ auth_req;
- UINT8 num_attr;
- UINT16 handles[GATT_MAX_READ_MULTI_HANDLES];
+ uint8_t num_attr;
+ uint16_t handles[GATT_MAX_READ_MULTI_HANDLES];
}tBTA_GATTC_API_READ_MULTI;
typedef struct
@@ -184,14 +184,14 @@
BT_HDR hdr;
BD_ADDR_PTR remote_bda;
tBTA_GATTC_IF client_if;
- BOOLEAN start;
+ bool start;
} tBTA_GATTC_API_LISTEN;
typedef struct
{
BT_HDR hdr;
- UINT16 mtu;
+ uint16_t mtu;
}tBTA_GATTC_API_CFG_MTU;
typedef struct
@@ -199,7 +199,7 @@
BT_HDR hdr;
BD_ADDR remote_bda;
tBTA_GATTC_IF client_if;
- UINT8 role;
+ uint8_t role;
tBT_TRANSPORT transport;
tGATT_DISCONN_REASON reason;
}tBTA_GATTC_INT_CONN;
@@ -242,11 +242,11 @@
typedef struct
{
tBT_UUID uuid;
- UINT16 s_handle;
- UINT16 e_handle;
+ uint16_t s_handle;
+ uint16_t e_handle;
// this field is set only for characteristic
- UINT16 char_decl_handle;
- BOOLEAN is_primary;
+ uint16_t char_decl_handle;
+ bool is_primary;
tBTA_GATT_CHAR_PROP property;
}tBTA_GATTC_ATTR_REC;
@@ -265,13 +265,13 @@
BTA_GATTC_CONN_ST, /* connected state */
BTA_GATTC_DISCOVER_ST /* discover is in progress */
};
-typedef UINT8 tBTA_GATTC_STATE;
+typedef uint8_t tBTA_GATTC_STATE;
typedef struct
{
- BOOLEAN in_use;
+ bool in_use;
BD_ADDR server_bda;
- BOOLEAN connected;
+ bool connected;
#define BTA_GATTC_SERV_IDLE 0
#define BTA_GATTC_SERV_LOAD 1
@@ -279,24 +279,24 @@
#define BTA_GATTC_SERV_DISC 3
#define BTA_GATTC_SERV_DISC_ACT 4
- UINT8 state;
+ uint8_t state;
list_t *p_srvc_cache; /* list of tBTA_GATTC_SERVICE */
- UINT8 update_count; /* indication received */
- UINT8 num_clcb; /* number of associated CLCB */
+ uint8_t update_count; /* indication received */
+ uint8_t num_clcb; /* number of associated CLCB */
tBTA_GATTC_ATTR_REC *p_srvc_list;
- UINT8 cur_srvc_idx;
- UINT8 cur_char_idx;
- UINT8 next_avail_idx;
- UINT8 total_srvc;
- UINT8 total_char;
+ uint8_t cur_srvc_idx;
+ uint8_t cur_char_idx;
+ uint8_t next_avail_idx;
+ uint8_t total_srvc;
+ uint8_t total_char;
- UINT8 srvc_hdl_chg; /* service handle change indication pending */
- UINT16 attr_index; /* cahce NV saving/loading attribute index */
+ uint8_t srvc_hdl_chg; /* service handle change indication pending */
+ uint16_t attr_index; /* cahce NV saving/loading attribute index */
- UINT16 mtu;
+ uint16_t mtu;
} tBTA_GATTC_SERV;
#ifndef BTA_GATTC_NOTIF_REG_MAX
@@ -305,18 +305,18 @@
typedef struct
{
- BOOLEAN in_use;
+ bool in_use;
BD_ADDR remote_bda;
- UINT16 handle;
+ uint16_t handle;
}tBTA_GATTC_NOTIF_REG;
typedef struct
{
tBTA_GATTC_CBACK *p_cback;
- BOOLEAN in_use;
+ bool in_use;
tBTA_GATTC_IF client_if; /* client interface with BTE stack for this application */
- UINT8 num_clcb; /* number of associated CLCB */
- BOOLEAN dereg_pending;
+ uint8_t num_clcb; /* number of associated CLCB */
+ bool dereg_pending;
tBT_UUID app_uuid;
tBTA_GATTC_NOTIF_REG notif_reg[BTA_GATTC_NOTIF_REG_MAX];
}tBTA_GATTC_RCB;
@@ -324,7 +324,7 @@
/* client channel is a mapping between a BTA client(cl_id) and a remote BD address */
typedef struct
{
- UINT16 bta_conn_id; /* client channel ID, unique for clcb */
+ uint16_t bta_conn_id; /* client channel ID, unique for clcb */
BD_ADDR bda;
tBTA_TRANSPORT transport; /* channel transport */
tBTA_GATTC_RCB *p_rcb; /* pointer to the registration CB */
@@ -335,26 +335,26 @@
#define BTA_GATTC_DISC_WAITING 0x01
#define BTA_GATTC_REQ_WAITING 0x10
- UINT8 auto_update; /* auto update is waiting */
- BOOLEAN disc_active;
- BOOLEAN in_use;
+ uint8_t auto_update; /* auto update is waiting */
+ bool disc_active;
+ bool in_use;
tBTA_GATTC_STATE state;
tBTA_GATT_STATUS status;
- UINT16 reason;
+ uint16_t reason;
} tBTA_GATTC_CLCB;
/* back ground connection tracking information */
#if GATT_MAX_APPS <= 8
-typedef UINT8 tBTA_GATTC_CIF_MASK ;
+typedef uint8_t tBTA_GATTC_CIF_MASK ;
#elif GATT_MAX_APPS <= 16
-typedef UINT16 tBTA_GATTC_CIF_MASK;
+typedef uint16_t tBTA_GATTC_CIF_MASK;
#elif GATT_MAX_APPS <= 32
-typedef UINT32 tBTA_GATTC_CIF_MASK;
+typedef uint32_t tBTA_GATTC_CIF_MASK;
#endif
typedef struct
{
- BOOLEAN in_use;
+ bool in_use;
BD_ADDR remote_bda;
tBTA_GATTC_CIF_MASK cif_mask;
tBTA_GATTC_CIF_MASK cif_adv_mask;
@@ -363,7 +363,7 @@
typedef struct
{
- BOOLEAN in_use;
+ bool in_use;
BD_ADDR remote_bda;
}tBTA_GATTC_CONN;
@@ -377,7 +377,7 @@
typedef struct
{
- UINT8 state;
+ uint8_t state;
tBTA_GATTC_CONN conn_track[BTA_GATTC_CONN_MAX];
tBTA_GATTC_BG_TCK bg_track[BTA_GATTC_KNOWN_SR_MAX];
@@ -392,7 +392,7 @@
*****************************************************************************/
/* GATTC control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_GATTC_CB bta_gattc_cb;
#else
extern tBTA_GATTC_CB *bta_gattc_cb_ptr;
@@ -402,8 +402,8 @@
/*****************************************************************************
** Function prototypes
*****************************************************************************/
-extern BOOLEAN bta_gattc_hdl_event(BT_HDR *p_msg);
-extern BOOLEAN bta_gattc_sm_execute(tBTA_GATTC_CLCB *p_clcb, UINT16 event, tBTA_GATTC_DATA *p_data);
+extern bool bta_gattc_hdl_event(BT_HDR *p_msg);
+extern bool bta_gattc_sm_execute(tBTA_GATTC_CLCB *p_clcb, uint16_t event, tBTA_GATTC_DATA *p_data);
/* function processed outside SM */
extern void bta_gattc_disable(tBTA_GATTC_CB *p_cb);
@@ -447,57 +447,57 @@
extern void bta_gattc_init_bk_conn(tBTA_GATTC_API_OPEN *p_data, tBTA_GATTC_RCB *p_clreg);
extern void bta_gattc_cancel_bk_conn(tBTA_GATTC_API_CANCEL_OPEN *p_data);
extern void bta_gattc_send_open_cback( tBTA_GATTC_RCB *p_clreg, tBTA_GATT_STATUS status,
- BD_ADDR remote_bda, UINT16 conn_id, tBTA_TRANSPORT transport, UINT16 mtu);
+ BD_ADDR remote_bda, uint16_t conn_id, tBTA_TRANSPORT transport, uint16_t mtu);
extern void bta_gattc_process_api_refresh(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA * p_msg);
extern void bta_gattc_cfg_mtu(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
extern void bta_gattc_listen(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA * p_msg);
extern void bta_gattc_broadcast(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA * p_msg);
#endif
/* utility functions */
-extern tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_cif (UINT8 client_if, BD_ADDR remote_bda, tBTA_TRANSPORT transport);
-extern tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_conn_id (UINT16 conn_id);
+extern tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_cif (uint8_t client_if, BD_ADDR remote_bda, tBTA_TRANSPORT transport);
+extern tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_conn_id (uint16_t conn_id);
extern tBTA_GATTC_CLCB * bta_gattc_clcb_alloc(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, tBTA_TRANSPORT transport);
extern void bta_gattc_clcb_dealloc(tBTA_GATTC_CLCB *p_clcb);
extern tBTA_GATTC_CLCB * bta_gattc_find_alloc_clcb(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, tBTA_TRANSPORT transport);
-extern tBTA_GATTC_RCB * bta_gattc_cl_get_regcb(UINT8 client_if);
+extern tBTA_GATTC_RCB * bta_gattc_cl_get_regcb(uint8_t client_if);
extern tBTA_GATTC_SERV * bta_gattc_find_srcb(BD_ADDR bda);
extern tBTA_GATTC_SERV * bta_gattc_srcb_alloc(BD_ADDR bda);
-extern tBTA_GATTC_SERV * bta_gattc_find_scb_by_cid (UINT16 conn_id);
+extern tBTA_GATTC_SERV * bta_gattc_find_scb_by_cid (uint16_t conn_id);
extern tBTA_GATTC_CLCB * bta_gattc_find_int_conn_clcb(tBTA_GATTC_DATA *p_msg);
extern tBTA_GATTC_CLCB * bta_gattc_find_int_disconn_clcb(tBTA_GATTC_DATA *p_msg);
-extern BOOLEAN bta_gattc_enqueue(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
+extern bool bta_gattc_enqueue(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
-extern BOOLEAN bta_gattc_uuid_compare (const tBT_UUID *p_src, const tBT_UUID *p_tar, BOOLEAN is_precise);
-extern BOOLEAN bta_gattc_check_notif_registry(tBTA_GATTC_RCB *p_clreg, tBTA_GATTC_SERV *p_srcb, tBTA_GATTC_NOTIFY *p_notify);
-extern BOOLEAN bta_gattc_mark_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR_PTR remote_bda, BOOLEAN add, BOOLEAN is_listen);
-extern BOOLEAN bta_gattc_check_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR remote_bda, UINT8 role);
-extern UINT8 bta_gattc_num_reg_app(void);
-extern void bta_gattc_clear_notif_registration(tBTA_GATTC_SERV *p_srcb, UINT16 conn_id, UINT16 start_handle, UINT16 end_handle);
+extern bool bta_gattc_uuid_compare (const tBT_UUID *p_src, const tBT_UUID *p_tar, bool is_precise);
+extern bool bta_gattc_check_notif_registry(tBTA_GATTC_RCB *p_clreg, tBTA_GATTC_SERV *p_srcb, tBTA_GATTC_NOTIFY *p_notify);
+extern bool bta_gattc_mark_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR_PTR remote_bda, bool add, bool is_listen);
+extern bool bta_gattc_check_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR remote_bda, uint8_t role);
+extern uint8_t bta_gattc_num_reg_app(void);
+extern void bta_gattc_clear_notif_registration(tBTA_GATTC_SERV *p_srcb, uint16_t conn_id, uint16_t start_handle, uint16_t end_handle);
extern tBTA_GATTC_SERV * bta_gattc_find_srvr_cache(BD_ADDR bda);
/* discovery functions */
-extern void bta_gattc_disc_res_cback (UINT16 conn_id, tGATT_DISC_TYPE disc_type, tGATT_DISC_RES *p_data);
-extern void bta_gattc_disc_cmpl_cback (UINT16 conn_id, tGATT_DISC_TYPE disc_type, tGATT_STATUS status);
-extern tBTA_GATT_STATUS bta_gattc_discover_procedure(UINT16 conn_id, tBTA_GATTC_SERV *p_server_cb, UINT8 disc_type);
-extern tBTA_GATT_STATUS bta_gattc_discover_pri_service(UINT16 conn_id, tBTA_GATTC_SERV *p_server_cb, UINT8 disc_type);
+extern void bta_gattc_disc_res_cback (uint16_t conn_id, tGATT_DISC_TYPE disc_type, tGATT_DISC_RES *p_data);
+extern void bta_gattc_disc_cmpl_cback (uint16_t conn_id, tGATT_DISC_TYPE disc_type, tGATT_STATUS status);
+extern tBTA_GATT_STATUS bta_gattc_discover_procedure(uint16_t conn_id, tBTA_GATTC_SERV *p_server_cb, uint8_t disc_type);
+extern tBTA_GATT_STATUS bta_gattc_discover_pri_service(uint16_t conn_id, tBTA_GATTC_SERV *p_server_cb, uint8_t disc_type);
extern void bta_gattc_search_service(tBTA_GATTC_CLCB *p_clcb, tBT_UUID *p_uuid);
-extern const list_t* bta_gattc_get_services(UINT16 conn_id);
-extern const tBTA_GATTC_SERVICE* bta_gattc_get_service_for_handle(UINT16 conn_id, UINT16 handle);
-tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic_srcb(tBTA_GATTC_SERV *p_srcb, UINT16 handle);
-extern tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic(UINT16 conn_id, UINT16 handle);
-extern tBTA_GATTC_DESCRIPTOR* bta_gattc_get_descriptor(UINT16 conn_id, UINT16 handle);
-extern void bta_gattc_get_gatt_db(UINT16 conn_id, UINT16 start_handle, UINT16 end_handle, btgatt_db_element_t **db, int *count);
+extern const list_t* bta_gattc_get_services(uint16_t conn_id);
+extern const tBTA_GATTC_SERVICE* bta_gattc_get_service_for_handle(uint16_t conn_id, uint16_t handle);
+tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic_srcb(tBTA_GATTC_SERV *p_srcb, uint16_t handle);
+extern tBTA_GATTC_CHARACTERISTIC* bta_gattc_get_characteristic(uint16_t conn_id, uint16_t handle);
+extern tBTA_GATTC_DESCRIPTOR* bta_gattc_get_descriptor(uint16_t conn_id, uint16_t handle);
+extern void bta_gattc_get_gatt_db(uint16_t conn_id, uint16_t start_handle, uint16_t end_handle, btgatt_db_element_t **db, int *count);
extern tBTA_GATT_STATUS bta_gattc_init_cache(tBTA_GATTC_SERV *p_srvc_cb);
-extern void bta_gattc_rebuild_cache(tBTA_GATTC_SERV *p_srcv, UINT16 num_attr, tBTA_GATTC_NV_ATTR *attr);
-extern void bta_gattc_cache_save(tBTA_GATTC_SERV *p_srvc_cb, UINT16 conn_id);
+extern void bta_gattc_rebuild_cache(tBTA_GATTC_SERV *p_srcv, uint16_t num_attr, tBTA_GATTC_NV_ATTR *attr);
+extern void bta_gattc_cache_save(tBTA_GATTC_SERV *p_srvc_cb, uint16_t conn_id);
extern void bta_gattc_reset_discover_st(tBTA_GATTC_SERV *p_srcb, tBTA_GATT_STATUS status);
extern tBTA_GATTC_CONN * bta_gattc_conn_alloc(BD_ADDR remote_bda);
extern tBTA_GATTC_CONN * bta_gattc_conn_find(BD_ADDR remote_bda);
extern tBTA_GATTC_CONN * bta_gattc_conn_find_alloc(BD_ADDR remote_bda);
-extern BOOLEAN bta_gattc_conn_dealloc(BD_ADDR remote_bda);
+extern bool bta_gattc_conn_dealloc(BD_ADDR remote_bda);
extern bool bta_gattc_cache_load(tBTA_GATTC_CLCB *p_clcb);
extern void bta_gattc_cache_reset(BD_ADDR server_bda);
diff --git a/bta/gatt/bta_gattc_main.cc b/bta/gatt/bta_gattc_main.cc
index 86d8536..cc1bd02 100644
--- a/bta/gatt/bta_gattc_main.cc
+++ b/bta/gatt/bta_gattc_main.cc
@@ -24,7 +24,7 @@
#include "bt_target.h"
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#include <string.h>
@@ -110,7 +110,7 @@
#define BTA_GATTC_NUM_COLS 2 /* number of columns in state tables */
/* state table for idle state */
-static const UINT8 bta_gattc_st_idle[][BTA_GATTC_NUM_COLS] =
+static const uint8_t bta_gattc_st_idle[][BTA_GATTC_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_GATTC_API_OPEN_EVT */ {BTA_GATTC_OPEN, BTA_GATTC_W4_CONN_ST},
@@ -139,7 +139,7 @@
};
/* state table for wait for open state */
-static const UINT8 bta_gattc_st_w4_conn[][BTA_GATTC_NUM_COLS] =
+static const uint8_t bta_gattc_st_w4_conn[][BTA_GATTC_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_GATTC_API_OPEN_EVT */ {BTA_GATTC_OPEN, BTA_GATTC_W4_CONN_ST},
@@ -168,7 +168,7 @@
};
/* state table for open state */
-static const UINT8 bta_gattc_st_connected[][BTA_GATTC_NUM_COLS] =
+static const uint8_t bta_gattc_st_connected[][BTA_GATTC_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_GATTC_API_OPEN_EVT */ {BTA_GATTC_OPEN, BTA_GATTC_CONN_ST},
@@ -198,7 +198,7 @@
};
/* state table for discover state */
-static const UINT8 bta_gattc_st_discover[][BTA_GATTC_NUM_COLS] =
+static const uint8_t bta_gattc_st_discover[][BTA_GATTC_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_GATTC_API_OPEN_EVT */ {BTA_GATTC_OPEN, BTA_GATTC_DISCOVER_ST},
@@ -227,7 +227,7 @@
};
/* type for state table */
-typedef const UINT8 (*tBTA_GATTC_ST_TBL)[BTA_GATTC_NUM_COLS];
+typedef const uint8_t (*tBTA_GATTC_ST_TBL)[BTA_GATTC_NUM_COLS];
/* state table */
const tBTA_GATTC_ST_TBL bta_gattc_st_tbl[] =
@@ -243,11 +243,11 @@
*****************************************************************************/
/* GATTC control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_GATTC_CB bta_gattc_cb;
#endif
-#if BTA_GATT_DEBUG == TRUE
+#if (BTA_GATT_DEBUG == TRUE)
static char *gattc_evt_code(tBTA_GATTC_INT_EVT evt_code);
static char *gattc_state_code(tBTA_GATTC_STATE state_code);
#endif
@@ -259,19 +259,19 @@
** Description State machine event handling function for GATTC
**
**
-** Returns BOOLEAN : TRUE if queued client request buffer can be immediately released
-** else FALSE
+** Returns bool : true if queued client request buffer can be immediately released
+** else false
**
*******************************************************************************/
-BOOLEAN bta_gattc_sm_execute(tBTA_GATTC_CLCB *p_clcb, UINT16 event, tBTA_GATTC_DATA *p_data)
+bool bta_gattc_sm_execute(tBTA_GATTC_CLCB *p_clcb, uint16_t event, tBTA_GATTC_DATA *p_data)
{
tBTA_GATTC_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
int i;
- BOOLEAN rt = TRUE;
-#if BTA_GATT_DEBUG == TRUE
+ bool rt = true;
+#if (BTA_GATT_DEBUG == TRUE)
tBTA_GATTC_STATE in_state = p_clcb->state;
- UINT16 in_event = event;
+ uint16_t in_event = event;
APPL_TRACE_DEBUG("bta_gattc_sm_execute: State 0x%02x [%s], Event 0x%x[%s]", in_state,
gattc_state_code(in_state),
in_event,
@@ -297,7 +297,7 @@
/* buffer is queued, don't free in the bta dispatcher.
* we free it ourselves when a completion event is received.
*/
- rt = FALSE;
+ rt = false;
}
}
else
@@ -306,7 +306,7 @@
}
}
-#if BTA_GATT_DEBUG == TRUE
+#if (BTA_GATT_DEBUG == TRUE)
if (in_state != p_clcb->state)
{
APPL_TRACE_DEBUG("GATTC State Change: [%s] -> [%s] after Event [%s]",
@@ -325,16 +325,16 @@
** Description GATT client main event handling function.
**
**
-** Returns BOOLEAN
+** Returns bool
**
*******************************************************************************/
-BOOLEAN bta_gattc_hdl_event(BT_HDR *p_msg)
+bool bta_gattc_hdl_event(BT_HDR *p_msg)
{
tBTA_GATTC_CB *p_cb = &bta_gattc_cb;
tBTA_GATTC_CLCB *p_clcb = NULL;
tBTA_GATTC_RCB *p_clreg;
- BOOLEAN rt = TRUE;
-#if BTA_GATT_DEBUG == TRUE
+ bool rt = true;
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_gattc_hdl_event: Event [%s]", gattc_evt_code(p_msg->event));
#endif
switch (p_msg->event)
@@ -368,7 +368,7 @@
bta_gattc_process_api_refresh(p_cb, (tBTA_GATTC_DATA *) p_msg);
break;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
case BTA_GATTC_API_LISTEN_EVT:
bta_gattc_listen(p_cb, (tBTA_GATTC_DATA *) p_msg);
break;
@@ -409,7 +409,7 @@
/*****************************************************************************
** Debug Functions
*****************************************************************************/
-#if BTA_GATT_DEBUG == TRUE
+#if (BTA_GATT_DEBUG == TRUE)
/*******************************************************************************
**
diff --git a/bta/gatt/bta_gattc_utils.cc b/bta/gatt/bta_gattc_utils.cc
index 1600d5c..9e3f16b 100644
--- a/bta/gatt/bta_gattc_utils.cc
+++ b/bta/gatt/bta_gattc_utils.cc
@@ -26,7 +26,7 @@
#include "bt_target.h"
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#include <string.h>
@@ -41,7 +41,7 @@
** Constants
*****************************************************************************/
-static const UINT8 base_uuid[LEN_UUID_128] = {0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
+static const uint8_t base_uuid[LEN_UUID_128] = {0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const BD_ADDR dummy_bda = {0,0,0,0,0,0};
@@ -52,12 +52,12 @@
**
** Description Convert a 16 bits UUID to be an standard 128 bits one.
**
-** Returns TRUE if two uuid match; FALSE otherwise.
+** Returns true if two uuid match; false otherwise.
**
*******************************************************************************/
-void bta_gatt_convert_uuid16_to_uuid128(UINT8 uuid_128[LEN_UUID_128], UINT16 uuid_16)
+void bta_gatt_convert_uuid16_to_uuid128(uint8_t uuid_128[LEN_UUID_128], uint16_t uuid_16)
{
- UINT8 *p = &uuid_128[LEN_UUID_128 - 4];
+ uint8_t *p = &uuid_128[LEN_UUID_128 - 4];
memcpy (uuid_128, base_uuid, LEN_UUID_128);
@@ -69,21 +69,21 @@
**
** Description Compare two UUID to see if they are the same.
**
-** Returns TRUE if two uuid match; FALSE otherwise.
+** Returns true if two uuid match; false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_gattc_uuid_compare (const tBT_UUID *p_src, const tBT_UUID *p_tar, BOOLEAN is_precise)
+bool bta_gattc_uuid_compare (const tBT_UUID *p_src, const tBT_UUID *p_tar, bool is_precise)
{
- UINT8 su[LEN_UUID_128], tu[LEN_UUID_128];
- const UINT8 *ps, *pt;
+ uint8_t su[LEN_UUID_128], tu[LEN_UUID_128];
+ const uint8_t *ps, *pt;
/* any of the UUID is unspecified */
if (p_src == 0 || p_tar == 0)
{
if (is_precise)
- return FALSE;
+ return false;
else
- return TRUE;
+ return true;
}
/* If both are 16-bit, we can do a simple compare */
@@ -123,9 +123,9 @@
** Returns pointer to the regcb
**
*******************************************************************************/
-tBTA_GATTC_RCB * bta_gattc_cl_get_regcb(UINT8 client_if)
+tBTA_GATTC_RCB * bta_gattc_cl_get_regcb(uint8_t client_if)
{
- UINT8 i = 0;
+ uint8_t i = 0;
tBTA_GATTC_RCB *p_clrcb = &bta_gattc_cb.cl_rcb[0];
for (i = 0; i < BTA_GATTC_CL_MAX; i ++, p_clrcb ++)
@@ -145,9 +145,9 @@
** Returns pointer to the regcb
**
*******************************************************************************/
-UINT8 bta_gattc_num_reg_app(void)
+uint8_t bta_gattc_num_reg_app(void)
{
- UINT8 i = 0, j = 0;
+ uint8_t i = 0, j = 0;
for (i = 0; i < BTA_GATTC_CL_MAX; i ++)
{
@@ -165,11 +165,11 @@
** Returns pointer to the clcb
**
*******************************************************************************/
-tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_cif (UINT8 client_if, BD_ADDR remote_bda,
+tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_cif (uint8_t client_if, BD_ADDR remote_bda,
tBTA_TRANSPORT transport)
{
tBTA_GATTC_CLCB *p_clcb = &bta_gattc_cb.clcb[0];
- UINT8 i;
+ uint8_t i;
for (i = 0; i < BTA_GATTC_CLCB_MAX; i ++, p_clcb ++)
{
@@ -190,10 +190,10 @@
** Returns pointer to the clcb
**
*******************************************************************************/
-tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_conn_id (UINT16 conn_id)
+tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_conn_id (uint16_t conn_id)
{
tBTA_GATTC_CLCB *p_clcb = &bta_gattc_cb.clcb[0];
- UINT8 i;
+ uint8_t i;
for (i = 0; i < BTA_GATTC_CLCB_MAX; i ++, p_clcb ++)
{
@@ -216,18 +216,18 @@
tBTA_GATTC_CLCB * bta_gattc_clcb_alloc(tBTA_GATTC_IF client_if, BD_ADDR remote_bda,
tBTA_TRANSPORT transport)
{
- UINT8 i_clcb = 0;
+ uint8_t i_clcb = 0;
tBTA_GATTC_CLCB *p_clcb = NULL;
for (i_clcb = 0; i_clcb < BTA_GATTC_CLCB_MAX; i_clcb++)
{
if (!bta_gattc_cb.clcb[i_clcb].in_use)
{
-#if BTA_GATT_DEBUG == TRUE
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_gattc_clcb_alloc: found clcb[%d] available",i_clcb);
#endif
p_clcb = &bta_gattc_cb.clcb[i_clcb];
- p_clcb->in_use = TRUE;
+ p_clcb->in_use = true;
p_clcb->status = BTA_GATT_OK;
p_clcb->transport = transport;
bdcpy(p_clcb->bda, remote_bda);
@@ -245,7 +245,7 @@
else
{
/* release this clcb if clcb or srcb allocation failed */
- p_clcb->in_use = FALSE;
+ p_clcb->in_use = false;
p_clcb = NULL;
}
break;
@@ -299,7 +299,7 @@
/* if the srcb is no longer needed, reset the state */
if ( p_srcb->num_clcb == 0)
{
- p_srcb->connected = FALSE;
+ p_srcb->connected = false;
p_srcb->state = BTA_GATTC_SERV_IDLE;
p_srcb->mtu = 0;
}
@@ -323,7 +323,7 @@
tBTA_GATTC_SERV * bta_gattc_find_srcb(BD_ADDR bda)
{
tBTA_GATTC_SERV *p_srcb = &bta_gattc_cb.known_server[0];
- UINT8 i;
+ uint8_t i;
for (i = 0; i < BTA_GATTC_KNOWN_SR_MAX; i ++, p_srcb ++)
{
@@ -345,7 +345,7 @@
tBTA_GATTC_SERV * bta_gattc_find_srvr_cache(BD_ADDR bda)
{
tBTA_GATTC_SERV *p_srcb = &bta_gattc_cb.known_server[0];
- UINT8 i;
+ uint8_t i;
for (i = 0; i < BTA_GATTC_KNOWN_SR_MAX; i ++, p_srcb ++)
{
@@ -363,7 +363,7 @@
** Returns pointer to the server cache.
**
*******************************************************************************/
-tBTA_GATTC_SERV * bta_gattc_find_scb_by_cid (UINT16 conn_id)
+tBTA_GATTC_SERV * bta_gattc_find_scb_by_cid (uint16_t conn_id)
{
tBTA_GATTC_CLCB *p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
@@ -385,14 +385,14 @@
{
tBTA_GATTC_SERV *p_tcb = &bta_gattc_cb.known_server[0],
*p_recycle = NULL;
- BOOLEAN found = FALSE;
- UINT8 i;
+ bool found = false;
+ uint8_t i;
for (i = 0; i < BTA_GATTC_KNOWN_SR_MAX; i ++, p_tcb ++)
{
if (!p_tcb->in_use)
{
- found = TRUE;
+ found = true;
break;
}
else if (!p_tcb->connected)
@@ -415,7 +415,7 @@
osi_free_and_reset((void **)&p_tcb->p_srvc_list);
memset(p_tcb, 0 , sizeof(tBTA_GATTC_SERV));
- p_tcb->in_use = TRUE;
+ p_tcb->in_use = true;
bdcpy(p_tcb->server_bda, bda);
}
return p_tcb;
@@ -429,18 +429,18 @@
** Returns success or failure.
**
*******************************************************************************/
-BOOLEAN bta_gattc_enqueue(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
+bool bta_gattc_enqueue(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
if (p_clcb->p_q_cmd == NULL)
{
p_clcb->p_q_cmd = p_data;
- return TRUE;
+ return true;
}
APPL_TRACE_ERROR ("%s: already has a pending command!!", __func__);
/* skip the callback now. ----- need to send callback ? */
- return FALSE;
+ return false;
}
/*******************************************************************************
@@ -452,10 +452,10 @@
** Returns
**
*******************************************************************************/
-BOOLEAN bta_gattc_check_notif_registry(tBTA_GATTC_RCB *p_clreg, tBTA_GATTC_SERV *p_srcb,
+bool bta_gattc_check_notif_registry(tBTA_GATTC_RCB *p_clreg, tBTA_GATTC_SERV *p_srcb,
tBTA_GATTC_NOTIFY *p_notify)
{
- UINT8 i;
+ uint8_t i;
for (i = 0 ; i < BTA_GATTC_NOTIF_REG_MAX; i ++)
{
@@ -464,10 +464,10 @@
p_clreg->notif_reg[i].handle == p_notify->handle)
{
APPL_TRACE_DEBUG("Notification registered!");
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
/*******************************************************************************
@@ -482,15 +482,15 @@
** Returns None.
**
*******************************************************************************/
-void bta_gattc_clear_notif_registration(tBTA_GATTC_SERV *p_srcb, UINT16 conn_id,
- UINT16 start_handle, UINT16 end_handle)
+void bta_gattc_clear_notif_registration(tBTA_GATTC_SERV *p_srcb, uint16_t conn_id,
+ uint16_t start_handle, uint16_t end_handle)
{
BD_ADDR remote_bda;
tBTA_GATTC_IF gatt_if;
tBTA_GATTC_RCB *p_clrcb ;
- UINT8 i;
+ uint8_t i;
tGATT_TRANSPORT transport;
- UINT16 handle;
+ uint16_t handle;
if (GATT_GetConnectionInfor(conn_id, &gatt_if, remote_bda, &transport)) {
if ((p_clrcb = bta_gattc_cl_get_regcb(gatt_if)) != NULL) {
@@ -520,14 +520,14 @@
** Description mark background connection status when a bg connection is initiated
** or terminated.
**
-** Returns TRUE if success; FALSE otherwise.
+** Returns true if success; false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_gattc_mark_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR_PTR remote_bda_ptr,
- BOOLEAN add, BOOLEAN is_listen)
+bool bta_gattc_mark_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR_PTR remote_bda_ptr,
+ bool add, bool is_listen)
{
tBTA_GATTC_BG_TCK *p_bg_tck = &bta_gattc_cb.bg_track[0];
- UINT8 i = 0;
+ uint8_t i = 0;
tBTA_GATTC_CIF_MASK *p_cif_mask;
for (i = 0; i < BTA_GATTC_KNOWN_SR_MAX; i ++, p_bg_tck ++)
@@ -553,7 +553,7 @@
{
memset(p_bg_tck, 0, sizeof(tBTA_GATTC_BG_TCK));
}
- return TRUE;
+ return true;
}
}
if (!add)
@@ -564,7 +564,7 @@
APPL_TRACE_ERROR("%s unable to find the bg connection mask for: %s", __func__,
bdaddr_to_string((bt_bdaddr_t *)remote_bda_ptr, bdstr, sizeof(bdstr)));
}
- return FALSE;
+ return false;
}
else /* adding a new device mask */
{
@@ -573,7 +573,7 @@
{
if (!p_bg_tck->in_use)
{
- p_bg_tck->in_use = TRUE;
+ p_bg_tck->in_use = true;
if (remote_bda_ptr)
bdcpy(p_bg_tck->remote_bda, remote_bda_ptr);
else
@@ -582,11 +582,11 @@
p_cif_mask = is_listen ? &p_bg_tck->cif_adv_mask : &p_bg_tck->cif_mask;
*p_cif_mask = (1 <<(client_if - 1));
- return TRUE;
+ return true;
}
}
APPL_TRACE_ERROR("no available space to mark the bg connection status");
- return FALSE;
+ return false;
}
}
/*******************************************************************************
@@ -595,14 +595,14 @@
**
** Description check if this is a background connection background connection.
**
-** Returns TRUE if success; FALSE otherwise.
+** Returns true if success; false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_gattc_check_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR remote_bda, UINT8 role)
+bool bta_gattc_check_bg_conn (tBTA_GATTC_IF client_if, BD_ADDR remote_bda, uint8_t role)
{
tBTA_GATTC_BG_TCK *p_bg_tck = &bta_gattc_cb.bg_track[0];
- UINT8 i = 0;
- BOOLEAN is_bg_conn = FALSE;
+ uint8_t i = 0;
+ bool is_bg_conn = false;
for (i = 0; i < BTA_GATTC_KNOWN_SR_MAX && !is_bg_conn; i ++, p_bg_tck ++)
{
@@ -612,11 +612,11 @@
{
if (((p_bg_tck->cif_mask &(1 <<(client_if - 1))) != 0) &&
role == HCI_ROLE_MASTER)
- is_bg_conn = TRUE;
+ is_bg_conn = true;
if (((p_bg_tck->cif_adv_mask &(1 <<(client_if - 1))) != 0) &&
role == HCI_ROLE_SLAVE)
- is_bg_conn = TRUE;
+ is_bg_conn = true;
}
}
return is_bg_conn;
@@ -631,8 +631,8 @@
**
*******************************************************************************/
void bta_gattc_send_open_cback( tBTA_GATTC_RCB *p_clreg, tBTA_GATT_STATUS status,
- BD_ADDR remote_bda, UINT16 conn_id,
- tBTA_TRANSPORT transport, UINT16 mtu)
+ BD_ADDR remote_bda, uint16_t conn_id,
+ tBTA_TRANSPORT transport, uint16_t mtu)
{
tBTA_GATTC cb_data;
@@ -661,17 +661,17 @@
*******************************************************************************/
tBTA_GATTC_CONN * bta_gattc_conn_alloc(BD_ADDR remote_bda)
{
- UINT8 i_conn = 0;
+ uint8_t i_conn = 0;
tBTA_GATTC_CONN *p_conn = &bta_gattc_cb.conn_track[0];
for (i_conn = 0; i_conn < BTA_GATTC_CONN_MAX; i_conn++, p_conn ++)
{
if (!p_conn->in_use)
{
-#if BTA_GATT_DEBUG == TRUE
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_gattc_conn_alloc: found conn_track[%d] available",i_conn);
#endif
- p_conn->in_use = TRUE;
+ p_conn->in_use = true;
bdcpy(p_conn->remote_bda, remote_bda);
return p_conn;
}
@@ -690,14 +690,14 @@
*******************************************************************************/
tBTA_GATTC_CONN * bta_gattc_conn_find(BD_ADDR remote_bda)
{
- UINT8 i_conn = 0;
+ uint8_t i_conn = 0;
tBTA_GATTC_CONN *p_conn = &bta_gattc_cb.conn_track[0];
for (i_conn = 0; i_conn < BTA_GATTC_CONN_MAX; i_conn++, p_conn ++)
{
if (p_conn->in_use && bdcmp(remote_bda, p_conn->remote_bda) == 0)
{
-#if BTA_GATT_DEBUG == TRUE
+#if (BTA_GATT_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_gattc_conn_find: found conn_track[%d] matched",i_conn);
#endif
return p_conn;
@@ -735,17 +735,17 @@
** Returns pointer to the clcb
**
*******************************************************************************/
-BOOLEAN bta_gattc_conn_dealloc(BD_ADDR remote_bda)
+bool bta_gattc_conn_dealloc(BD_ADDR remote_bda)
{
tBTA_GATTC_CONN *p_conn = bta_gattc_conn_find (remote_bda);
if (p_conn != NULL)
{
- p_conn->in_use = FALSE;
+ p_conn->in_use = false;
memset(p_conn->remote_bda, 0, BD_ADDR_LEN);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*******************************************************************************
diff --git a/bta/gatt/bta_gatts_act.cc b/bta/gatt/bta_gatts_act.cc
index 4c35b0c..8ad94df 100644
--- a/bta/gatt/bta_gatts_act.cc
+++ b/bta/gatt/bta_gatts_act.cc
@@ -26,7 +26,7 @@
#include "bt_target.h"
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#include "utl.h"
#include "bt_common.h"
@@ -37,17 +37,17 @@
#include "btif/include/btif_debug_conn.h"
#include <string.h>
-static void bta_gatts_nv_save_cback(BOOLEAN is_saved, tGATTS_HNDL_RANGE *p_hndl_range);
-static BOOLEAN bta_gatts_nv_srv_chg_cback(tGATTS_SRV_CHG_CMD cmd, tGATTS_SRV_CHG_REQ *p_req,
+static void bta_gatts_nv_save_cback(bool is_saved, tGATTS_HNDL_RANGE *p_hndl_range);
+static bool bta_gatts_nv_srv_chg_cback(tGATTS_SRV_CHG_CMD cmd, tGATTS_SRV_CHG_REQ *p_req,
tGATTS_SRV_CHG_RSP *p_rsp);
-static void bta_gatts_conn_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
- BOOLEAN connected, tGATT_DISCONN_REASON reason,
+static void bta_gatts_conn_cback (tGATT_IF gatt_if, BD_ADDR bda, uint16_t conn_id,
+ bool connected, tGATT_DISCONN_REASON reason,
tGATT_TRANSPORT transport);
-static void bta_gatts_send_request_cback (UINT16 conn_id,
- UINT32 trans_id,
+static void bta_gatts_send_request_cback (uint16_t conn_id,
+ uint32_t trans_id,
tGATTS_REQ_TYPE req_type, tGATTS_DATA *p_data);
-static void bta_gatts_cong_cback (UINT16 conn_id, BOOLEAN congested);
+static void bta_gatts_cong_cback (uint16_t conn_id, bool congested);
static tGATT_CBACK bta_gatts_cback =
{
@@ -76,7 +76,7 @@
** Returns none.
**
*******************************************************************************/
-static void bta_gatts_nv_save_cback(BOOLEAN is_add, tGATTS_HNDL_RANGE *p_hndl_range)
+static void bta_gatts_nv_save_cback(bool is_add, tGATTS_HNDL_RANGE *p_hndl_range)
{
bta_gatts_co_update_handle_range(is_add, (tBTA_GATTS_HNDL_RANGE *)p_hndl_range);
}
@@ -92,7 +92,7 @@
** Returns none.
**
*******************************************************************************/
-static BOOLEAN bta_gatts_nv_srv_chg_cback(tGATTS_SRV_CHG_CMD cmd,
+static bool bta_gatts_nv_srv_chg_cback(tGATTS_SRV_CHG_CMD cmd,
tGATTS_SRV_CHG_REQ *p_req, tGATTS_SRV_CHG_RSP *p_rsp)
{
return bta_gatts_co_srv_chg((tBTA_GATTS_SRV_CHG_CMD) cmd,
@@ -112,7 +112,7 @@
*******************************************************************************/
void bta_gatts_enable(tBTA_GATTS_CB *p_cb)
{
- UINT8 index=0;
+ uint8_t index=0;
tBTA_GATTS_HNDL_RANGE handle_range;
if (p_cb->enabled)
@@ -123,7 +123,7 @@
{
memset(p_cb, 0, sizeof(tBTA_GATTS_CB));
- p_cb->enabled = TRUE;
+ p_cb->enabled = true;
while ( bta_gatts_co_load_handle_range(index, &handle_range))
{
@@ -152,7 +152,7 @@
*******************************************************************************/
void bta_gatts_api_disable(tBTA_GATTS_CB *p_cb)
{
- UINT8 i;
+ uint8_t i;
if (p_cb->enabled)
{
@@ -184,9 +184,9 @@
{
tBTA_GATTS cb_data;
tBTA_GATT_STATUS status = BTA_GATT_OK;
- UINT8 i, first_unuse = 0xff;
+ uint8_t i, first_unuse = 0xff;
- if (p_cb->enabled == FALSE)
+ if (p_cb->enabled == false)
{
bta_gatts_enable(p_cb);
}
@@ -221,7 +221,7 @@
{
APPL_TRACE_ERROR("register application first_unuse rcb_idx = %d", first_unuse);
- p_cb->rcb[first_unuse].in_use = TRUE;
+ p_cb->rcb[first_unuse].in_use = true;
p_cb->rcb[first_unuse].p_cback = p_msg->api_reg.p_cback;
memcpy(&p_cb->rcb[first_unuse].app_uuid, &p_msg->api_reg.app_uuid, sizeof(tBT_UUID));
cb_data.reg_oper.server_if =
@@ -284,7 +284,7 @@
{
tBTA_GATT_STATUS status = BTA_GATT_ERROR;
tBTA_GATTS_CBACK *p_cback = NULL;
- UINT8 i;
+ uint8_t i;
tBTA_GATTS cb_data;
cb_data.reg_oper.server_if = p_msg->api_dereg.server_if;
@@ -327,10 +327,10 @@
*******************************************************************************/
void bta_gatts_create_srvc(tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA * p_msg)
{
- UINT8 rcb_idx;
+ uint8_t rcb_idx;
tBTA_GATTS cb_data;
- UINT8 srvc_idx;
- UINT16 service_id = 0;
+ uint8_t srvc_idx;
+ uint16_t service_id = 0;
cb_data.create.status = BTA_GATT_ERROR;
@@ -391,7 +391,7 @@
void bta_gatts_add_include_srvc(tBTA_GATTS_SRVC_CB *p_srvc_cb,tBTA_GATTS_DATA * p_msg)
{
tBTA_GATTS_RCB *p_rcb = &bta_gatts_cb.rcb[p_srvc_cb->rcb_idx];
- UINT16 attr_id = 0;
+ uint16_t attr_id = 0;
tBTA_GATTS cb_data;
attr_id = GATTS_AddIncludeService(p_msg->api_add_incl_srvc.hdr.layer_specific,
@@ -425,7 +425,7 @@
void bta_gatts_add_char(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA * p_msg)
{
tBTA_GATTS_RCB *p_rcb = &bta_gatts_cb.rcb[p_srvc_cb->rcb_idx];
- UINT16 attr_id = 0;
+ uint16_t attr_id = 0;
tBTA_GATTS cb_data;
attr_id = GATTS_AddCharacteristic(p_msg->api_add_char.hdr.layer_specific,
@@ -461,7 +461,7 @@
void bta_gatts_add_char_descr(tBTA_GATTS_SRVC_CB *p_srvc_cb, tBTA_GATTS_DATA * p_msg)
{
tBTA_GATTS_RCB *p_rcb = &bta_gatts_cb.rcb[p_srvc_cb->rcb_idx];
- UINT16 attr_id = 0;
+ uint16_t attr_id = 0;
tBTA_GATTS cb_data;
attr_id = GATTS_AddCharDescriptor(p_msg->api_add_char_descr.hdr.layer_specific,
@@ -682,7 +682,7 @@
{
tBTA_GATTS_RCB *p_rcb=NULL;
tBTA_GATT_STATUS status= BTA_GATT_ERROR;
- UINT16 conn_id;
+ uint16_t conn_id;
UNUSED(p_cb);
if ((p_rcb = bta_gatts_find_app_rcb_by_app_if(p_msg->api_open.server_if)) != NULL)
@@ -835,8 +835,8 @@
** Returns none.
**
*******************************************************************************/
-static void bta_gatts_send_request_cback (UINT16 conn_id,
- UINT32 trans_id,
+static void bta_gatts_send_request_cback (uint16_t conn_id,
+ uint32_t trans_id,
tGATTS_REQ_TYPE req_type, tGATTS_DATA *p_data)
{
tBTA_GATTS cb_data;
@@ -888,12 +888,12 @@
** Returns none.
**
*******************************************************************************/
-static void bta_gatts_conn_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
- BOOLEAN connected, tGATT_DISCONN_REASON reason,
+static void bta_gatts_conn_cback (tGATT_IF gatt_if, BD_ADDR bda, uint16_t conn_id,
+ bool connected, tGATT_DISCONN_REASON reason,
tGATT_TRANSPORT transport)
{
tBTA_GATTS cb_data;
- UINT8 evt = connected ? BTA_GATTS_CONNECT_EVT: BTA_GATTS_DISCONNECT_EVT;
+ uint8_t evt = connected ? BTA_GATTS_CONNECT_EVT: BTA_GATTS_DISCONNECT_EVT;
tBTA_GATTS_RCB *p_reg;
APPL_TRACE_DEBUG ("bta_gatts_conn_cback gatt_if=%d conn_id=%d connected=%d reason = 0x%04d",
@@ -943,7 +943,7 @@
** Returns none.
**
*******************************************************************************/
-static void bta_gatts_cong_cback (UINT16 conn_id, BOOLEAN congested)
+static void bta_gatts_cong_cback (uint16_t conn_id, bool congested)
{
tBTA_GATTS_RCB *p_rcb;
tGATT_IF gatt_if;
diff --git a/bta/gatt/bta_gatts_api.cc b/bta/gatt/bta_gatts_api.cc
index cc52527..a6c5a14 100644
--- a/bta/gatt/bta_gatts_api.cc
+++ b/bta/gatt/bta_gatts_api.cc
@@ -24,7 +24,7 @@
#include "bt_target.h"
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#include <string.h>
#include "bt_common.h"
@@ -55,7 +55,7 @@
*******************************************************************************/
void BTA_GATTS_Disable(void)
{
- if (bta_sys_is_register(BTA_ID_GATTS) == FALSE)
+ if (bta_sys_is_register(BTA_ID_GATTS) == false)
{
APPL_TRACE_WARNING("GATTS Module not enabled/already disabled");
return;
@@ -86,7 +86,7 @@
(tBTA_GATTS_API_REG *)osi_malloc(sizeof(tBTA_GATTS_API_REG));
/* register with BTA system manager */
- if (bta_sys_is_register(BTA_ID_GATTS) == FALSE)
+ if (bta_sys_is_register(BTA_ID_GATTS) == false)
bta_sys_register(BTA_ID_GATTS, &bta_gatts_reg);
p_buf->hdr.event = BTA_GATTS_API_REG_EVT;
@@ -140,8 +140,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTS_CreateService(tBTA_GATTS_IF server_if, tBT_UUID *p_service_uuid, UINT8 inst,
- UINT16 num_handle, BOOLEAN is_primary)
+void BTA_GATTS_CreateService(tBTA_GATTS_IF server_if, tBT_UUID *p_service_uuid, uint8_t inst,
+ uint16_t num_handle, bool is_primary)
{
tBTA_GATTS_API_CREATE_SRVC *p_buf =
(tBTA_GATTS_API_CREATE_SRVC *)osi_malloc(sizeof(tBTA_GATTS_API_CREATE_SRVC));
@@ -170,7 +170,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTS_AddIncludeService(UINT16 service_id, UINT16 included_service_id)
+void BTA_GATTS_AddIncludeService(uint16_t service_id, uint16_t included_service_id)
{
tBTA_GATTS_API_ADD_INCL_SRVC *p_buf =
(tBTA_GATTS_API_ADD_INCL_SRVC *)osi_malloc(sizeof(tBTA_GATTS_API_ADD_INCL_SRVC));
@@ -197,7 +197,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTS_AddCharacteristic (UINT16 service_id, tBT_UUID *p_char_uuid,
+void BTA_GATTS_AddCharacteristic (uint16_t service_id, tBT_UUID *p_char_uuid,
tBTA_GATT_PERM perm, tBTA_GATT_CHAR_PROP property)
{
tBTA_GATTS_API_ADD_CHAR *p_buf =
@@ -230,7 +230,7 @@
** Returns returns status.
**
*******************************************************************************/
-void BTA_GATTS_AddCharDescriptor (UINT16 service_id,
+void BTA_GATTS_AddCharDescriptor (uint16_t service_id,
tBTA_GATT_PERM perm,
tBT_UUID * p_descr_uuid)
{
@@ -258,7 +258,7 @@
** Returns returns none.
**
*******************************************************************************/
-void BTA_GATTS_DeleteService(UINT16 service_id)
+void BTA_GATTS_DeleteService(uint16_t service_id)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -280,7 +280,7 @@
** Returns None.
**
*******************************************************************************/
-void BTA_GATTS_StartService(UINT16 service_id, tBTA_GATT_TRANSPORT sup_transport)
+void BTA_GATTS_StartService(uint16_t service_id, tBTA_GATT_TRANSPORT sup_transport)
{
tBTA_GATTS_API_START *p_buf =
(tBTA_GATTS_API_START *)osi_malloc(sizeof(tBTA_GATTS_API_START));
@@ -303,7 +303,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTS_StopService(UINT16 service_id)
+void BTA_GATTS_StopService(uint16_t service_id)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -327,8 +327,8 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTS_HandleValueIndication (UINT16 conn_id, UINT16 attr_id,
- std::vector<uint8_t> value, BOOLEAN need_confirm)
+void BTA_GATTS_HandleValueIndication (uint16_t conn_id, uint16_t attr_id,
+ std::vector<uint8_t> value, bool need_confirm)
{
tBTA_GATTS_API_INDICATION *p_buf =
(tBTA_GATTS_API_INDICATION *)osi_calloc(sizeof(tBTA_GATTS_API_INDICATION));
@@ -359,7 +359,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTS_SendRsp (UINT16 conn_id, UINT32 trans_id,
+void BTA_GATTS_SendRsp (uint16_t conn_id, uint32_t trans_id,
tBTA_GATT_STATUS status, tBTA_GATTS_RSP *p_msg)
{
const size_t len = sizeof(tBTA_GATTS_API_RSP) + sizeof(tBTA_GATTS_RSP);
@@ -392,7 +392,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTS_Open(tBTA_GATTS_IF server_if, BD_ADDR remote_bda, BOOLEAN is_direct,
+void BTA_GATTS_Open(tBTA_GATTS_IF server_if, BD_ADDR remote_bda, bool is_direct,
tBTA_GATT_TRANSPORT transport)
{
tBTA_GATTS_API_OPEN *p_buf =
@@ -421,7 +421,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTS_CancelOpen(tBTA_GATTS_IF server_if, BD_ADDR remote_bda, BOOLEAN is_direct)
+void BTA_GATTS_CancelOpen(tBTA_GATTS_IF server_if, BD_ADDR remote_bda, bool is_direct)
{
tBTA_GATTS_API_CANCEL_OPEN *p_buf =
(tBTA_GATTS_API_CANCEL_OPEN *)osi_malloc(sizeof(tBTA_GATTS_API_CANCEL_OPEN));
@@ -445,7 +445,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTS_Close(UINT16 conn_id)
+void BTA_GATTS_Close(uint16_t conn_id)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -470,7 +470,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_GATTS_Listen(tBTA_GATTS_IF server_if, BOOLEAN start, BD_ADDR_PTR target_bda)
+void BTA_GATTS_Listen(tBTA_GATTS_IF server_if, bool start, BD_ADDR_PTR target_bda)
{
tBTA_GATTS_API_LISTEN *p_buf =
(tBTA_GATTS_API_LISTEN *)osi_malloc(sizeof(tBTA_GATTS_API_LISTEN) + BD_ADDR_LEN);
@@ -479,7 +479,7 @@
p_buf->server_if = server_if;
p_buf->start = start;
if (target_bda) {
- p_buf->remote_bda = (UINT8 *)(p_buf + 1);
+ p_buf->remote_bda = (uint8_t *)(p_buf + 1);
memcpy(p_buf->remote_bda, target_bda, BD_ADDR_LEN);
} else {
p_buf->remote_bda = NULL;
diff --git a/bta/gatt/bta_gatts_int.h b/bta/gatt/bta_gatts_int.h
index 115ba98..8784e2e 100644
--- a/bta/gatt/bta_gatts_int.h
+++ b/bta/gatt/bta_gatts_int.h
@@ -55,7 +55,7 @@
BTA_GATTS_API_LISTEN_EVT,
BTA_GATTS_API_DISABLE_EVT
};
-typedef UINT16 tBTA_GATTS_INT_EVT;
+typedef uint16_t tBTA_GATTS_INT_EVT;
/* max number of application allowed on device */
#define BTA_GATTS_MAX_APP_NUM GATT_MAX_SR_PROFILES
@@ -84,9 +84,9 @@
BT_HDR hdr;
tBTA_GATTS_IF server_if;
tBT_UUID service_uuid;
- UINT16 num_handle;
- UINT8 inst;
- BOOLEAN is_pri;
+ uint16_t num_handle;
+ uint8_t inst;
+ bool is_pri;
} tBTA_GATTS_API_CREATE_SRVC;
@@ -102,7 +102,7 @@
typedef struct
{
BT_HDR hdr;
- UINT16 included_service_id;
+ uint16_t included_service_id;
}tBTA_GATTS_API_ADD_INCL_SRVC;
@@ -116,16 +116,16 @@
typedef struct
{
BT_HDR hdr;
- UINT16 attr_id;
- UINT16 len;
- BOOLEAN need_confirm;
- UINT8 value[BTA_GATT_MAX_ATTR_LEN];
+ uint16_t attr_id;
+ uint16_t len;
+ bool need_confirm;
+ uint8_t value[BTA_GATT_MAX_ATTR_LEN];
}tBTA_GATTS_API_INDICATION;
typedef struct
{
BT_HDR hdr;
- UINT32 trans_id;
+ uint32_t trans_id;
tBTA_GATT_STATUS status;
tBTA_GATTS_RSP *p_rsp;
}tBTA_GATTS_API_RSP;
@@ -142,7 +142,7 @@
BT_HDR hdr;
BD_ADDR remote_bda;
tBTA_GATTS_IF server_if;
- BOOLEAN is_direct;
+ bool is_direct;
tBTA_GATT_TRANSPORT transport;
}tBTA_GATTS_API_OPEN;
@@ -154,7 +154,7 @@
BT_HDR hdr;
BD_ADDR_PTR remote_bda;
tBTA_GATTS_IF server_if;
- BOOLEAN start;
+ bool start;
} tBTA_GATTS_API_LISTEN;
typedef union
@@ -180,7 +180,7 @@
/* application registration control block */
typedef struct
{
- BOOLEAN in_use;
+ bool in_use;
tBT_UUID app_uuid;
tBTA_GATTS_CBACK *p_cback;
tBTA_GATTS_IF gatt_if;
@@ -190,11 +190,11 @@
typedef struct
{
tBT_UUID service_uuid; /* service UUID */
- UINT16 service_id; /* service handle */
- UINT8 inst_num; /* instance ID */
- UINT8 rcb_idx;
- UINT8 idx; /* self index of serviec CB */
- BOOLEAN in_use;
+ uint16_t service_id; /* service handle */
+ uint8_t inst_num; /* instance ID */
+ uint8_t rcb_idx;
+ uint8_t idx; /* self index of serviec CB */
+ bool in_use;
}tBTA_GATTS_SRVC_CB;
@@ -202,7 +202,7 @@
/* GATT server control block */
typedef struct
{
- BOOLEAN enabled;
+ bool enabled;
tBTA_GATTS_RCB rcb[BTA_GATTS_MAX_APP_NUM];
tBTA_GATTS_SRVC_CB srvc_cb[BTA_GATTS_MAX_SRVC_NUM];
}tBTA_GATTS_CB;
@@ -214,7 +214,7 @@
*****************************************************************************/
/* GATTC control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_GATTS_CB bta_gatts_cb;
#else
extern tBTA_GATTS_CB *bta_gatts_cb_ptr;
@@ -224,7 +224,7 @@
/*****************************************************************************
** Function prototypes
*****************************************************************************/
-extern BOOLEAN bta_gatts_hdl_event(BT_HDR *p_msg);
+extern bool bta_gatts_hdl_event(BT_HDR *p_msg);
extern void bta_gatts_api_disable(tBTA_GATTS_CB *p_cb);
extern void bta_gatts_api_enable(tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA *p_data);
@@ -248,12 +248,12 @@
extern void bta_gatts_close (tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA * p_msg);
extern void bta_gatts_listen(tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA * p_msg);
-extern BOOLEAN bta_gatts_uuid_compare(tBT_UUID tar, tBT_UUID src);
+extern bool bta_gatts_uuid_compare(tBT_UUID tar, tBT_UUID src);
extern tBTA_GATTS_RCB *bta_gatts_find_app_rcb_by_app_if(tBTA_GATTS_IF server_if);
-extern UINT8 bta_gatts_find_app_rcb_idx_by_app_if(tBTA_GATTS_CB *p_cb, tBTA_GATTS_IF server_if);
-extern UINT8 bta_gatts_alloc_srvc_cb(tBTA_GATTS_CB *p_cb, UINT8 rcb_idx);
-extern tBTA_GATTS_SRVC_CB * bta_gatts_find_srvc_cb_by_srvc_id(tBTA_GATTS_CB *p_cb, UINT16 service_id);
-extern tBTA_GATTS_SRVC_CB * bta_gatts_find_srvc_cb_by_attr_id(tBTA_GATTS_CB *p_cb, UINT16 attr_id);
+extern uint8_t bta_gatts_find_app_rcb_idx_by_app_if(tBTA_GATTS_CB *p_cb, tBTA_GATTS_IF server_if);
+extern uint8_t bta_gatts_alloc_srvc_cb(tBTA_GATTS_CB *p_cb, uint8_t rcb_idx);
+extern tBTA_GATTS_SRVC_CB * bta_gatts_find_srvc_cb_by_srvc_id(tBTA_GATTS_CB *p_cb, uint16_t service_id);
+extern tBTA_GATTS_SRVC_CB * bta_gatts_find_srvc_cb_by_attr_id(tBTA_GATTS_CB *p_cb, uint16_t attr_id);
#endif /* BTA_GATTS_INT_H */
diff --git a/bta/gatt/bta_gatts_main.cc b/bta/gatt/bta_gatts_main.cc
index 5008f5d..8a83907 100644
--- a/bta/gatt/bta_gatts_main.cc
+++ b/bta/gatt/bta_gatts_main.cc
@@ -24,7 +24,7 @@
#include "bt_target.h"
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#include <string.h>
@@ -46,7 +46,7 @@
};
/* GATTS control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_GATTS_CB bta_gatts_cb;
#endif
@@ -60,7 +60,7 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_gatts_hdl_event(BT_HDR *p_msg)
+bool bta_gatts_hdl_event(BT_HDR *p_msg)
{
tBTA_GATTS_CB *p_cb = &bta_gatts_cb;
tBTA_GATTS_SRVC_CB *p_srvc_cb = NULL;
@@ -137,7 +137,7 @@
}
- return (TRUE);
+ return (true);
}
#endif /* BTA_GATT_INCLUDED */
diff --git a/bta/gatt/bta_gatts_utils.cc b/bta/gatt/bta_gatts_utils.cc
index df8b140..01752b2 100644
--- a/bta/gatt/bta_gatts_utils.cc
+++ b/bta/gatt/bta_gatts_utils.cc
@@ -24,7 +24,7 @@
#include "bt_target.h"
-#if defined(BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#include <string.h>
#include "utl.h"
@@ -32,7 +32,7 @@
#include "bta_sys.h"
#include "bta_gatts_int.h"
-static const UINT8 base_uuid[LEN_UUID_128] = {0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
+static const uint8_t base_uuid[LEN_UUID_128] = {0xFB, 0x34, 0x9B, 0x5F, 0x80, 0x00, 0x00, 0x80,
0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/*******************************************************************************
@@ -41,12 +41,12 @@
**
** Description Convert a 16 bits UUID to be an standard 128 bits one.
**
-** Returns TRUE if two uuid match; FALSE otherwise.
+** Returns true if two uuid match; false otherwise.
**
*******************************************************************************/
-static void bta_gatt_convert_uuid16_to_uuid128(UINT8 uuid_128[LEN_UUID_128], UINT16 uuid_16)
+static void bta_gatt_convert_uuid16_to_uuid128(uint8_t uuid_128[LEN_UUID_128], uint16_t uuid_16)
{
- UINT8 *p = &uuid_128[LEN_UUID_128 - 4];
+ uint8_t *p = &uuid_128[LEN_UUID_128 - 4];
memcpy (uuid_128, base_uuid, LEN_UUID_128);
@@ -61,15 +61,15 @@
** Returns pointer to the control block, or otherwise NULL when failed.
**
*******************************************************************************/
-UINT8 bta_gatts_alloc_srvc_cb(tBTA_GATTS_CB *p_cb, UINT8 rcb_idx)
+uint8_t bta_gatts_alloc_srvc_cb(tBTA_GATTS_CB *p_cb, uint8_t rcb_idx)
{
- UINT8 i;
+ uint8_t i;
for (i = 0; i < BTA_GATTS_MAX_SRVC_NUM; i ++)
{
if (!p_cb->srvc_cb[i].in_use)
{
- p_cb->srvc_cb[i].in_use = TRUE;
+ p_cb->srvc_cb[i].in_use = true;
p_cb->srvc_cb[i].rcb_idx = rcb_idx;
return i;
}
@@ -88,7 +88,7 @@
*******************************************************************************/
tBTA_GATTS_RCB *bta_gatts_find_app_rcb_by_app_if(tBTA_GATTS_IF server_if)
{
- UINT8 i;
+ uint8_t i;
tBTA_GATTS_RCB *p_reg;
for (i = 0, p_reg = bta_gatts_cb.rcb; i < BTA_GATTS_MAX_APP_NUM; i ++, p_reg++)
@@ -109,9 +109,9 @@
**
*******************************************************************************/
-UINT8 bta_gatts_find_app_rcb_idx_by_app_if(tBTA_GATTS_CB *p_cb, tBTA_GATTS_IF server_if)
+uint8_t bta_gatts_find_app_rcb_idx_by_app_if(tBTA_GATTS_CB *p_cb, tBTA_GATTS_IF server_if)
{
- UINT8 i;
+ uint8_t i;
for (i = 0; i < BTA_GATTS_MAX_APP_NUM; i ++)
{
@@ -129,9 +129,9 @@
** Returns pointer to the rcb.
**
*******************************************************************************/
-tBTA_GATTS_SRVC_CB * bta_gatts_find_srvc_cb_by_srvc_id(tBTA_GATTS_CB *p_cb, UINT16 service_id)
+tBTA_GATTS_SRVC_CB * bta_gatts_find_srvc_cb_by_srvc_id(tBTA_GATTS_CB *p_cb, uint16_t service_id)
{
- UINT8 i;
+ uint8_t i;
APPL_TRACE_DEBUG("bta_gatts_find_srvc_cb_by_srvc_id service_id=%d", service_id);
for (i = 0; i < BTA_GATTS_MAX_SRVC_NUM; i ++)
{
@@ -153,9 +153,9 @@
** Returns pointer to the rcb.
**
*******************************************************************************/
-tBTA_GATTS_SRVC_CB * bta_gatts_find_srvc_cb_by_attr_id(tBTA_GATTS_CB *p_cb, UINT16 attr_id)
+tBTA_GATTS_SRVC_CB * bta_gatts_find_srvc_cb_by_attr_id(tBTA_GATTS_CB *p_cb, uint16_t attr_id)
{
- UINT8 i;
+ uint8_t i;
for (i = 0; i < (BTA_GATTS_MAX_SRVC_NUM); i ++)
{
@@ -186,18 +186,18 @@
**
** Description Compare two UUID to see if they are the same.
**
-** Returns TRUE if two uuid match; FALSE otherwise.
+** Returns true if two uuid match; false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_gatts_uuid_compare(tBT_UUID tar, tBT_UUID src)
+bool bta_gatts_uuid_compare(tBT_UUID tar, tBT_UUID src)
{
- UINT8 su[LEN_UUID_128], tu[LEN_UUID_128];
- UINT8 *ps, *pt;
+ uint8_t su[LEN_UUID_128], tu[LEN_UUID_128];
+ uint8_t *ps, *pt;
/* any of the UUID is unspecified */
if (src.len == 0 || tar.len == 0)
{
- return TRUE;
+ return true;
}
/* If both are 16-bit, we can do a simple compare */
diff --git a/bta/hf_client/bta_hf_client_act.c b/bta/hf_client/bta_hf_client_act.c
index b70940d..b70b525 100644
--- a/bta/hf_client/bta_hf_client_act.c
+++ b/bta/hf_client/bta_hf_client_act.c
@@ -98,7 +98,7 @@
*******************************************************************************/
void bta_hf_client_deregister(tBTA_HF_CLIENT_DATA *p_data)
{
- bta_hf_client_cb.scb.deregister = TRUE;
+ bta_hf_client_cb.scb.deregister = true;
/* remove sdp record */
bta_hf_client_del_record(p_data);
@@ -122,7 +122,7 @@
*******************************************************************************/
void bta_hf_client_start_dereg(tBTA_HF_CLIENT_DATA *p_data)
{
- bta_hf_client_cb.scb.deregister = TRUE;
+ bta_hf_client_cb.scb.deregister = true;
/* remove sdp record */
bta_hf_client_del_record(p_data);
@@ -147,7 +147,7 @@
/* if SCO is open close SCO and wait on RFCOMM close */
if (bta_hf_client_cb.scb.sco_state == BTA_HF_CLIENT_SCO_OPEN_ST)
{
- bta_hf_client_cb.scb.sco_close_rfc = TRUE;
+ bta_hf_client_cb.scb.sco_close_rfc = true;
}
else
{
@@ -249,7 +249,7 @@
bta_hf_client_cback_open(NULL, BTA_HF_CLIENT_SUCCESS);
/* start SLC procedure */
- bta_hf_client_slc_seq(FALSE);
+ bta_hf_client_slc_seq(false);
}
/*******************************************************************************
@@ -264,7 +264,7 @@
*******************************************************************************/
void bta_hf_client_rfc_acp_open(tBTA_HF_CLIENT_DATA *p_data)
{
- UINT16 lcid;
+ uint16_t lcid;
BD_ADDR dev_addr;
int status;
@@ -325,8 +325,8 @@
bta_hf_client_cb.scb.peer_features = 0;
bta_hf_client_cb.scb.chld_features = 0;
bta_hf_client_cb.scb.role = BTA_HF_CLIENT_ACP;
- bta_hf_client_cb.scb.svc_conn = FALSE;
- bta_hf_client_cb.scb.send_at_reply = FALSE;
+ bta_hf_client_cb.scb.svc_conn = false;
+ bta_hf_client_cb.scb.send_at_reply = false;
bta_hf_client_cb.scb.negotiated_codec = BTM_SCO_CODEC_CVSD;
bta_hf_client_at_reset();
@@ -395,8 +395,8 @@
bta_hf_client_cb.scb.peer_features = 0;
bta_hf_client_cb.scb.chld_features = 0;
bta_hf_client_cb.scb.role = BTA_HF_CLIENT_ACP;
- bta_hf_client_cb.scb.svc_conn = FALSE;
- bta_hf_client_cb.scb.send_at_reply = FALSE;
+ bta_hf_client_cb.scb.svc_conn = false;
+ bta_hf_client_cb.scb.send_at_reply = false;
bta_hf_client_cb.scb.negotiated_codec = BTM_SCO_CODEC_CVSD;
bta_hf_client_at_reset();
@@ -407,7 +407,7 @@
(*bta_hf_client_cb.p_cback)(BTA_HF_CLIENT_CLOSE_EVT, NULL);
/* if not deregistering reopen server */
- if (bta_hf_client_cb.scb.deregister == FALSE)
+ if (bta_hf_client_cb.scb.deregister == false)
{
/* Clear peer bd_addr so instance can be reused */
bdcpy(bta_hf_client_cb.scb.peer_addr, bd_addr_null);
@@ -442,7 +442,7 @@
*******************************************************************************/
void bta_hf_client_disc_int_res(tBTA_HF_CLIENT_DATA *p_data)
{
- UINT16 event = BTA_HF_CLIENT_DISC_FAIL_EVT;
+ uint16_t event = BTA_HF_CLIENT_DISC_FAIL_EVT;
APPL_TRACE_DEBUG ("bta_hf_client_disc_int_res: Status: %d", p_data->disc_result.status);
@@ -500,7 +500,7 @@
*******************************************************************************/
void bta_hf_client_rfc_data(tBTA_HF_CLIENT_DATA *p_data)
{
- UINT16 len;
+ uint16_t len;
char buf[BTA_HF_CLIENT_RFC_READ_MAX];
UNUSED(p_data);
@@ -545,7 +545,7 @@
if (!bta_hf_client_cb.scb.svc_conn)
{
/* set state variable */
- bta_hf_client_cb.scb.svc_conn = TRUE;
+ bta_hf_client_cb.scb.svc_conn = true;
/* call callback */
evt.conn.peer_feat = bta_hf_client_cb.scb.peer_features;
@@ -564,7 +564,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_ind(tBTA_HF_CLIENT_IND_TYPE type, UINT16 value)
+void bta_hf_client_ind(tBTA_HF_CLIENT_IND_TYPE type, uint16_t value)
{
tBTA_HF_CLIENT evt;
@@ -587,7 +587,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_evt_val(tBTA_HF_CLIENT_EVT type, UINT16 value)
+void bta_hf_client_evt_val(tBTA_HF_CLIENT_EVT type, uint16_t value)
{
tBTA_HF_CLIENT evt;
@@ -675,7 +675,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_at_result(tBTA_HF_CLIENT_AT_RESULT_TYPE type, UINT16 cme)
+void bta_hf_client_at_result(tBTA_HF_CLIENT_AT_RESULT_TYPE type, uint16_t cme)
{
tBTA_HF_CLIENT evt;
@@ -697,7 +697,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_clcc(UINT32 idx, BOOLEAN incoming, UINT8 status, BOOLEAN mpty, char *number)
+void bta_hf_client_clcc(uint32_t idx, bool incoming, uint8_t status, bool mpty, char *number)
{
tBTA_HF_CLIENT evt;
@@ -710,7 +710,7 @@
if (number)
{
- evt.clcc.number_present = TRUE;
+ evt.clcc.number_present = true;
strlcpy(evt.clcc.number, number, BTA_HF_CLIENT_NUMBER_LEN + 1);
evt.clcc.number[BTA_HF_CLIENT_NUMBER_LEN] = '\0';
}
@@ -728,7 +728,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_cnum(char *number, UINT16 service)
+void bta_hf_client_cnum(char *number, uint16_t service)
{
tBTA_HF_CLIENT evt;
diff --git a/bta/hf_client/bta_hf_client_api.c b/bta/hf_client/bta_hf_client_api.c
index 83d648c..5d7773c 100644
--- a/bta/hf_client/bta_hf_client_api.c
+++ b/bta/hf_client/bta_hf_client_api.c
@@ -133,7 +133,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientDeregister(UINT16 handle)
+void BTA_HfClientDeregister(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -156,7 +156,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientOpen(UINT16 handle, BD_ADDR bd_addr, tBTA_SEC sec_mask)
+void BTA_HfClientOpen(uint16_t handle, BD_ADDR bd_addr, tBTA_SEC sec_mask)
{
tBTA_HF_CLIENT_API_OPEN *p_buf =
(tBTA_HF_CLIENT_API_OPEN *)osi_malloc(sizeof(tBTA_HF_CLIENT_API_OPEN));
@@ -180,7 +180,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientClose(UINT16 handle)
+void BTA_HfClientClose(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -201,7 +201,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientAudioOpen(UINT16 handle)
+void BTA_HfClientAudioOpen(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -222,7 +222,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientAudioClose(UINT16 handle)
+void BTA_HfClientAudioClose(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -242,7 +242,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientSendAT(UINT16 handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, UINT32 val1, UINT32 val2, const char *str)
+void BTA_HfClientSendAT(uint16_t handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, uint32_t val1, uint32_t val2, const char *str)
{
tBTA_HF_CLIENT_DATA_VAL *p_buf =
(tBTA_HF_CLIENT_DATA_VAL *)osi_malloc(sizeof(tBTA_HF_CLIENT_DATA_VAL));
diff --git a/bta/hf_client/bta_hf_client_at.c b/bta/hf_client/bta_hf_client_at.c
index ee5a3ee..e67d4eb 100644
--- a/bta/hf_client/bta_hf_client_at.c
+++ b/bta/hf_client/bta_hf_client_at.c
@@ -71,9 +71,9 @@
typedef struct
{
char* name;
- UINT8 min;
- UINT8 max;
- UINT8 namelen;
+ uint8_t min;
+ uint8_t max;
+ uint8_t namelen;
} tBTA_HF_CLIENT_INDICATOR;
#define BTA_HF_CLIENT_AT_SUPPORTED_INDICATOR_COUNT 7
@@ -97,8 +97,8 @@
#define BTA_HF_CLIENT_VGM_MIN 0
#define BTA_HF_CLIENT_VGM_MAX 15
-UINT32 service_index = 0;
-BOOLEAN service_availability = TRUE;
+uint32_t service_index = 0;
+bool service_availability = true;
/* helper functions for handling AT commands queueing */
static void bta_hf_client_handle_ok();
@@ -117,7 +117,7 @@
bta_hf_client_cb.scb.at_cb.queued_cmd = NULL;
}
-static void bta_hf_client_queue_at(tBTA_HF_CLIENT_AT_CMD cmd, const char *buf, UINT16 buf_len)
+static void bta_hf_client_queue_at(tBTA_HF_CLIENT_AT_CMD cmd, const char *buf, uint16_t buf_len)
{
tBTA_HF_CLIENT_AT_QCMD *new_cmd =
(tBTA_HF_CLIENT_AT_QCMD *)osi_malloc(sizeof(tBTA_HF_CLIENT_AT_QCMD));
@@ -166,16 +166,16 @@
alarm_cancel(bta_hf_client_cb.scb.at_cb.resp_timer);
}
-static void bta_hf_client_send_at(tBTA_HF_CLIENT_AT_CMD cmd, char *buf, UINT16 buf_len)
+static void bta_hf_client_send_at(tBTA_HF_CLIENT_AT_CMD cmd, char *buf, uint16_t buf_len)
{
if ((bta_hf_client_cb.scb.at_cb.current_cmd == BTA_HF_CLIENT_AT_NONE ||
- bta_hf_client_cb.scb.svc_conn == FALSE) &&
+ bta_hf_client_cb.scb.svc_conn == false) &&
!alarm_is_scheduled(bta_hf_client_cb.scb.at_cb.hold_timer))
{
- UINT16 len;
+ uint16_t len;
#ifdef BTA_HF_CLIENT_AT_DUMP
- APPL_TRACE_DEBUG("%s %.*s", __FUNCTION__, buf_len - 1, buf);
+ APPL_TRACE_DEBUG("%s %.*s", __func__, buf_len - 1, buf);
#endif
bta_hf_client_cb.scb.at_cb.current_cmd = cmd;
@@ -183,7 +183,7 @@
if (!service_availability &&
(cmd == BTA_HF_CLIENT_AT_CNUM || cmd == BTA_HF_CLIENT_AT_COPS))
{
- APPL_TRACE_WARNING("%s: No service, skipping %d command", __FUNCTION__, cmd);
+ APPL_TRACE_WARNING("%s: No service, skipping %d command", __func__, cmd);
bta_hf_client_handle_ok();
return;
}
@@ -202,7 +202,7 @@
{
tBTA_HF_CLIENT_AT_QCMD *cur = bta_hf_client_cb.scb.at_cb.queued_cmd;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (cur != NULL)
{
@@ -216,19 +216,19 @@
static void bta_hf_client_at_hold_timer_cback(UNUSED_ATTR void *data)
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
bta_hf_client_send_queued_at();
}
static void bta_hf_client_stop_at_hold_timer(void)
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
alarm_cancel(bta_hf_client_cb.scb.at_cb.hold_timer);
}
static void bta_hf_client_start_at_hold_timer(void)
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
alarm_set_on_queue(bta_hf_client_cb.scb.at_cb.hold_timer,
BTA_HF_CLIENT_AT_HOLD_TIMEOUT,
bta_hf_client_at_hold_timer_cback,
@@ -238,7 +238,7 @@
/******************************************************************************
**
-** COMMON AT EVENT HANDLING FUNCTIONS
+** COMMON AT EVENT HANDLING funcS
**
** Receives data (strings, ints, etc.) from the parser and processes this data.
** No buffer parsing is being done here.
@@ -246,13 +246,13 @@
static void bta_hf_client_handle_ok()
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
bta_hf_client_stop_at_resp_timer();
if (!bta_hf_client_cb.scb.svc_conn)
{
- bta_hf_client_slc_seq(FALSE);
+ bta_hf_client_slc_seq(false);
return;
}
@@ -266,9 +266,9 @@
bta_hf_client_cb.scb.at_cb.current_cmd = BTA_HF_CLIENT_AT_NONE;
return;
case BTA_HF_CLIENT_AT_CLIP: //last cmd is post slc seq
- if (bta_hf_client_cb.scb.send_at_reply == FALSE)
+ if (bta_hf_client_cb.scb.send_at_reply == false)
{
- bta_hf_client_cb.scb.send_at_reply = TRUE;
+ bta_hf_client_cb.scb.send_at_reply = true;
}
break;
case BTA_HF_CLIENT_AT_NONE:
@@ -287,15 +287,15 @@
bta_hf_client_send_queued_at();
}
-static void bta_hf_client_handle_error(tBTA_HF_CLIENT_AT_RESULT_TYPE type, UINT16 cme)
+static void bta_hf_client_handle_error(tBTA_HF_CLIENT_AT_RESULT_TYPE type, uint16_t cme)
{
- APPL_TRACE_DEBUG("%s %u %u", __FUNCTION__, type, cme);
+ APPL_TRACE_DEBUG("%s %u %u", __func__, type, cme);
bta_hf_client_stop_at_resp_timer();
if (!bta_hf_client_cb.scb.svc_conn)
{
- bta_hf_client_slc_seq(TRUE);
+ bta_hf_client_slc_seq(true);
return;
}
@@ -308,9 +308,9 @@
bta_hf_client_cback_sco(BTA_HF_CLIENT_AUDIO_CLOSE_EVT);
break;
case BTA_HF_CLIENT_AT_CLIP: //last cmd is post slc seq
- if (bta_hf_client_cb.scb.send_at_reply == FALSE)
+ if (bta_hf_client_cb.scb.send_at_reply == false)
{
- bta_hf_client_cb.scb.send_at_reply = TRUE;
+ bta_hf_client_cb.scb.send_at_reply = true;
}
break;
default:
@@ -328,23 +328,23 @@
static void bta_hf_client_handle_ring()
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
bta_hf_client_evt_val(BTA_HF_CLIENT_RING_INDICATION,0);
}
-static void bta_hf_client_handle_brsf(UINT32 value)
+static void bta_hf_client_handle_brsf(uint32_t value)
{
- APPL_TRACE_DEBUG("%s 0x%x", __FUNCTION__, value);
+ APPL_TRACE_DEBUG("%s 0x%x", __func__, value);
bta_hf_client_cb.scb.peer_features = value;
}
/* handles a single indicator descriptor - registers it for value changing events */
-static void bta_hf_client_handle_cind_list_item(char *name, UINT32 min, UINT32 max, UINT32 index)
+static void bta_hf_client_handle_cind_list_item(char *name, uint32_t min, uint32_t max, uint32_t index)
{
- UINT8 i = 0;
+ uint8_t i = 0;
- APPL_TRACE_DEBUG("%s %lu.%s <%lu:%lu>", __FUNCTION__, index, name, min, max);
+ APPL_TRACE_DEBUG("%s %lu.%s <%lu:%lu>", __func__, index, name, min, max);
/* look for a matching indicator on list of supported ones */
for(i = 0; i < BTA_HF_CLIENT_AT_SUPPORTED_INDICATOR_COUNT; i++)
@@ -367,9 +367,9 @@
}
}
-static void bta_hf_client_handle_cind_value(UINT32 index, UINT32 value)
+static void bta_hf_client_handle_cind_value(uint32_t index, uint32_t value)
{
- APPL_TRACE_DEBUG("%s index: %u value: %u", __FUNCTION__, index, value);
+ APPL_TRACE_DEBUG("%s index: %u value: %u", __func__, index, value);
if (index >= BTA_HF_CLIENT_AT_INDICATOR_COUNT)
{
@@ -380,11 +380,11 @@
{
if (value == 0)
{
- service_availability = FALSE;
+ service_availability = false;
}
else
{
- service_availability = TRUE;
+ service_availability = true;
}
}
if (bta_hf_client_cb.scb.at_cb.indicator_lookup[index] == -1)
@@ -406,18 +406,18 @@
bta_hf_client_ind(index, value);
}
-static void bta_hf_client_handle_chld(UINT32 mask)
+static void bta_hf_client_handle_chld(uint32_t mask)
{
- APPL_TRACE_DEBUG("%s 0x%x", __FUNCTION__, mask);
+ APPL_TRACE_DEBUG("%s 0x%x", __func__, mask);
bta_hf_client_cb.scb.chld_features |= mask;
}
-static void bta_hf_client_handle_ciev(UINT32 index, UINT32 value)
+static void bta_hf_client_handle_ciev(uint32_t index, uint32_t value)
{
- INT8 realind = -1;
+ int8_t realind = -1;
- APPL_TRACE_DEBUG("%s index: %u value: %u", __FUNCTION__, index, value);
+ APPL_TRACE_DEBUG("%s index: %u value: %u", __func__, index, value);
if(index == 0 || index > BTA_HF_CLIENT_AT_INDICATOR_COUNT)
{
@@ -426,7 +426,7 @@
if (service_index == index - 1)
{
- service_availability = value == 0 ? FALSE : TRUE;
+ service_availability = value == 0 ? false : true;
}
realind = bta_hf_client_cb.scb.at_cb.indicator_lookup[index - 1];
@@ -445,11 +445,11 @@
{
if (value == 1)
{
- service_availability = TRUE;
+ service_availability = true;
}
else
{
- service_availability = FALSE;
+ service_availability = false;
}
}
@@ -458,12 +458,12 @@
}
}
-static void bta_hf_client_handle_bcs(UINT32 codec)
+static void bta_hf_client_handle_bcs(uint32_t codec)
{
- APPL_TRACE_DEBUG("%s %u", __FUNCTION__, codec);
+ APPL_TRACE_DEBUG("%s %u", __func__, codec);
if (codec == BTM_SCO_CODEC_CVSD ||
- (codec == BTM_SCO_CODEC_MSBC && bta_hf_client_cb.msbc_enabled == TRUE))
+ (codec == BTM_SCO_CODEC_MSBC && bta_hf_client_cb.msbc_enabled == true))
{
bta_hf_client_cb.scb.negotiated_codec = codec;
bta_hf_client_send_at_bcs(codec);
@@ -475,21 +475,21 @@
}
}
-static void bta_hf_client_handle_bsir(UINT32 provided)
+static void bta_hf_client_handle_bsir(uint32_t provided)
{
- APPL_TRACE_DEBUG("%s %u", __FUNCTION__, provided);
+ APPL_TRACE_DEBUG("%s %u", __func__, provided);
bta_hf_client_evt_val(BTA_HF_CLIENT_BSIR_EVT, provided);
}
-static void bta_hf_client_handle_cmeerror(UINT32 code)
+static void bta_hf_client_handle_cmeerror(uint32_t code)
{
bta_hf_client_handle_error(BTA_HF_CLIENT_AT_RESULT_CME, code);
}
-static void bta_hf_client_handle_vgm(UINT32 value)
+static void bta_hf_client_handle_vgm(uint32_t value)
{
- APPL_TRACE_DEBUG("%s %lu", __FUNCTION__, value);
+ APPL_TRACE_DEBUG("%s %lu", __func__, value);
if(value <= BTA_HF_CLIENT_VGM_MAX)
{
@@ -497,9 +497,9 @@
}
}
-static void bta_hf_client_handle_vgs(UINT32 value)
+static void bta_hf_client_handle_vgs(uint32_t value)
{
- APPL_TRACE_DEBUG("%s %lu", __FUNCTION__, value);
+ APPL_TRACE_DEBUG("%s %lu", __func__, value);
if(value <= BTA_HF_CLIENT_VGS_MAX)
{
@@ -507,9 +507,9 @@
}
}
-static void bta_hf_client_handle_bvra(UINT32 value)
+static void bta_hf_client_handle_bvra(uint32_t value)
{
- APPL_TRACE_DEBUG("%s %lu", __FUNCTION__, value);
+ APPL_TRACE_DEBUG("%s %lu", __func__, value);
if (value > 1)
{
@@ -519,58 +519,58 @@
bta_hf_client_evt_val(BTA_HF_CLIENT_VOICE_REC_EVT, value);
}
-static void bta_hf_client_handle_clip(char *numstr, UINT32 type)
+static void bta_hf_client_handle_clip(char *numstr, uint32_t type)
{
- APPL_TRACE_DEBUG("%s %u %s", __FUNCTION__, type, numstr);
+ APPL_TRACE_DEBUG("%s %u %s", __func__, type, numstr);
bta_hf_client_clip(numstr);
}
-static void bta_hf_client_handle_ccwa(char *numstr, UINT32 type)
+static void bta_hf_client_handle_ccwa(char *numstr, uint32_t type)
{
- APPL_TRACE_DEBUG("%s %u %s", __FUNCTION__, type, numstr);
+ APPL_TRACE_DEBUG("%s %u %s", __func__, type, numstr);
bta_hf_client_ccwa(numstr);
}
-static void bta_hf_client_handle_cops(char *opstr, UINT32 mode)
+static void bta_hf_client_handle_cops(char *opstr, uint32_t mode)
{
- APPL_TRACE_DEBUG("%s %u %s", __FUNCTION__, mode, opstr);
+ APPL_TRACE_DEBUG("%s %u %s", __func__, mode, opstr);
bta_hf_client_operator_name(opstr);
}
static void bta_hf_client_handle_binp(char *numstr)
{
- APPL_TRACE_DEBUG("%s %s", __FUNCTION__, numstr);
+ APPL_TRACE_DEBUG("%s %s", __func__, numstr);
bta_hf_client_binp(numstr);
}
-static void bta_hf_client_handle_clcc(UINT16 idx, UINT16 dir, UINT16 status, UINT16 mode, UINT16 mpty, char *numstr, UINT16 type)
+static void bta_hf_client_handle_clcc(uint16_t idx, uint16_t dir, uint16_t status, uint16_t mode, uint16_t mpty, char *numstr, uint16_t type)
{
APPL_TRACE_DEBUG("%s idx: %u dir: %u status: %u mode: %u mpty: %u",
- __FUNCTION__, idx, dir, status, mode, mpty);
+ __func__, idx, dir, status, mode, mpty);
if (numstr)
{
- APPL_TRACE_DEBUG("%s number: %s type: %u", __FUNCTION__, numstr, type);
+ APPL_TRACE_DEBUG("%s number: %s type: %u", __func__, numstr, type);
}
bta_hf_client_clcc(idx, dir, status, mpty, numstr);
}
-static void bta_hf_client_handle_cnum( char *numstr, UINT16 type, UINT16 service)
+static void bta_hf_client_handle_cnum( char *numstr, uint16_t type, uint16_t service)
{
- APPL_TRACE_DEBUG("%s number: %s type: %u service: %u", __FUNCTION__, numstr, type, service);
+ APPL_TRACE_DEBUG("%s number: %s type: %u service: %u", __func__, numstr, type, service);
/* TODO: should number be modified according to type? */
bta_hf_client_cnum(numstr, service);
}
-static void bta_hf_client_handle_btrh( UINT16 code)
+static void bta_hf_client_handle_btrh( uint16_t code)
{
- APPL_TRACE_DEBUG("%s %lu", __FUNCTION__, code);
+ APPL_TRACE_DEBUG("%s %lu", __func__, code);
bta_hf_client_evt_val(BTA_HF_CLIENT_BTRH_EVT, code);
}
@@ -590,7 +590,7 @@
/* check for <cr><lf> and forward buffer if match */
#define AT_CHECK_RN(buf) \
if (strncmp("\r\n", buf, sizeof("\r\n") - 1) != 0) { \
- APPL_TRACE_DEBUG("%s missing end <cr><lf>", __FUNCTION__); \
+ APPL_TRACE_DEBUG("%s missing end <cr><lf>", __func__); \
return NULL;} \
(buf) += sizeof("\r\n") - 1;
@@ -628,9 +628,9 @@
}
/* generic uint32 parser */
-static char *bta_hf_client_parse_uint32(char *buffer, void (*handler_callback)(UINT32))
+static char *bta_hf_client_parse_uint32(char *buffer, void (*handler_callback)(uint32_t))
{
- UINT32 value;
+ uint32_t value;
int res;
int offset;
@@ -658,8 +658,8 @@
static char *bta_hf_client_parse_cind_values(char *buffer)
{
/* value and its position */
- UINT16 index = 0;
- UINT32 value = 0;
+ uint16_t index = 0;
+ uint32_t value = 0;
int offset;
int res;
@@ -694,8 +694,8 @@
{
int offset = 0;
char name[129];
- UINT32 min, max;
- UINT32 index = 0;
+ uint32_t min, max;
+ uint32_t index = 0;
int res;
while ((res = sscanf(buffer, "(\"%128[^\"]\",(%u%*[-,]%u))%n", name, &min, &max, &offset)) > 2)
@@ -812,7 +812,7 @@
static char *bta_hf_client_parse_ciev(char *buffer)
{
- UINT32 index, value;
+ uint32_t index, value;
int res;
int offset = 0;
@@ -898,7 +898,7 @@
{
/* spec forces 32 chars, plus \0 here */
char number[33];
- UINT32 type = 0;
+ uint32_t type = 0;
int res;
int offset = 0;
@@ -932,7 +932,7 @@
{
/* ac to spec 32 chars max, plus \0 here */
char number[33];
- UINT32 type = 0;
+ uint32_t type = 0;
int res ;
int offset = 0;
@@ -963,7 +963,7 @@
static char *bta_hf_client_parse_cops(char *buffer)
{
- UINT8 mode;
+ uint8_t mode;
/* spec forces 16 chars max, plus \0 here */
char opstr[17];
int res;
@@ -1043,9 +1043,9 @@
static char *bta_hf_client_parse_clcc(char *buffer)
{
- UINT16 idx, dir, status, mode, mpty;
+ uint16_t idx, dir, status, mode, mpty;
char numstr[33]; /* spec forces 32 chars, plus one for \0*/
- UINT16 type;
+ uint16_t type;
int res;
int offset = 0;
@@ -1126,8 +1126,8 @@
static char *bta_hf_client_parse_cnum(char *buffer)
{
char numstr[33]; /* spec forces 32 chars, plus one for \0*/
- UINT16 type;
- UINT16 service = 0; /* 0 in case this optional parameter is not being sent */
+ uint16_t type;
+ uint16_t service = 0; /* 0 in case this optional parameter is not being sent */
int res;
int offset = 0;
@@ -1192,7 +1192,7 @@
static char *bta_hf_client_parse_btrh(char *buffer)
{
- UINT16 code = 0;
+ uint16_t code = 0;
int res;
int offset;
@@ -1284,7 +1284,7 @@
buffer = tmp + 2;
- APPL_TRACE_DEBUG("%s %.*s", __FUNCTION__, buffer - start - 2, start);
+ APPL_TRACE_DEBUG("%s %.*s", __func__, buffer - start - 2, start);
return buffer;
}
@@ -1334,7 +1334,7 @@
};
/* calculate supported event list length */
-static const UINT16 bta_hf_client_psraser_cb_count =
+static const uint16_t bta_hf_client_psraser_cb_count =
sizeof(bta_hf_client_parser_cb) / sizeof(bta_hf_client_parser_cb[0]);
#ifdef BTA_HF_CLIENT_AT_DUMP
@@ -1368,7 +1368,7 @@
*p2 = '\0';
- APPL_TRACE_DEBUG("%s %s", __FUNCTION__, dump);
+ APPL_TRACE_DEBUG("%s %s", __func__, dump);
}
#endif
@@ -1376,7 +1376,7 @@
{
char *buf = bta_hf_client_cb.scb.at_cb.buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
#ifdef BTA_HF_CLIENT_AT_DUMP
bta_hf_client_dump_at();
@@ -1419,20 +1419,20 @@
}
}
-static BOOLEAN bta_hf_client_check_at_complete(void)
+static bool bta_hf_client_check_at_complete(void)
{
- BOOLEAN ret = FALSE;
+ bool ret = false;
tBTA_HF_CLIENT_AT_CB *at_cb = &bta_hf_client_cb.scb.at_cb;
if (at_cb->offset >= BTA_HF_CLIENT_AT_EVENT_MIN_LEN)
{
if (at_cb->buf[at_cb->offset - 2] == '\r' && at_cb->buf[at_cb->offset - 1] == '\n')
{
- ret = TRUE;
+ ret = true;
}
}
- APPL_TRACE_DEBUG("%s %d", __FUNCTION__, ret);
+ APPL_TRACE_DEBUG("%s %d", __func__, ret);
return ret;
}
@@ -1451,7 +1451,7 @@
*******************************************************************************/
void bta_hf_client_at_parse(char *buf, unsigned int len)
{
- APPL_TRACE_DEBUG("%s offset: %u len: %u", __FUNCTION__, bta_hf_client_cb.scb.at_cb.offset, len);
+ APPL_TRACE_DEBUG("%s offset: %u len: %u", __func__, bta_hf_client_cb.scb.at_cb.offset, len);
if (len + bta_hf_client_cb.scb.at_cb.offset > BTA_HF_CLIENT_AT_PARSER_MAX_LEN)
{
@@ -1459,7 +1459,7 @@
unsigned int tmp = bta_hf_client_cb.scb.at_cb.offset;
unsigned int space_left = BTA_HF_CLIENT_AT_PARSER_MAX_LEN - bta_hf_client_cb.scb.at_cb.offset;
- APPL_TRACE_DEBUG("%s overrun, trying to recover", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s overrun, trying to recover", __func__);
/* fill up parser buffer */
memcpy(bta_hf_client_cb.scb.at_cb.buf + bta_hf_client_cb.scb.at_cb.offset, buf, space_left);
@@ -1468,7 +1468,7 @@
bta_hf_client_cb.scb.at_cb.offset += space_left;
/* find end of last complete command before proceeding */
- while(bta_hf_client_check_at_complete() == FALSE)
+ while(bta_hf_client_check_at_complete() == false)
{
if (bta_hf_client_cb.scb.at_cb.offset == 0) {
APPL_TRACE_ERROR("HFPClient: AT parser buffer overrun, disconnecting");
@@ -1499,7 +1499,7 @@
bta_hf_client_cb.scb.at_cb.offset += len;
/* If last event is complete, parsing can be started */
- if (bta_hf_client_check_at_complete() == TRUE)
+ if (bta_hf_client_check_at_complete() == true)
{
bta_hf_client_at_parse_start();
bta_hf_client_at_clear_buf();
@@ -1511,7 +1511,7 @@
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
int at_len;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
at_len = snprintf(buf, sizeof(buf), "AT+BRSF=%u\r", bta_hf_client_cb.scb.features);
if (at_len < 0)
@@ -1527,7 +1527,7 @@
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (bta_hf_client_cb.msbc_enabled)
{
@@ -1541,12 +1541,12 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_BAC, buf, strlen(buf));
}
-void bta_hf_client_send_at_bcs(UINT32 codec)
+void bta_hf_client_send_at_bcs(uint32_t codec)
{
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
int at_len;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
at_len = snprintf(buf, sizeof(buf), "AT+BCS=%u\r", codec);
if (at_len < 0)
@@ -1558,12 +1558,12 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_BCS, buf, at_len);
}
-void bta_hf_client_send_at_cind(BOOLEAN status)
+void bta_hf_client_send_at_cind(bool status)
{
char *buf;
tBTA_HF_CLIENT_AT_CMD cmd;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (status)
{
@@ -1579,11 +1579,11 @@
bta_hf_client_send_at(cmd, buf, strlen(buf));
}
-void bta_hf_client_send_at_cmer(BOOLEAN activate)
+void bta_hf_client_send_at_cmer(bool activate)
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (activate)
buf = "AT+CMER=3,0,0,1\r";
@@ -1593,12 +1593,12 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_CMER, buf, strlen(buf));
}
-void bta_hf_client_send_at_chld(char cmd, UINT32 idx)
+void bta_hf_client_send_at_chld(char cmd, uint32_t idx)
{
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
int at_len;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (idx > 0)
at_len = snprintf(buf, sizeof(buf), "AT+CHLD=%c%u\r", cmd, idx);
@@ -1614,11 +1614,11 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_CHLD, buf, at_len);
}
-void bta_hf_client_send_at_clip(BOOLEAN activate)
+void bta_hf_client_send_at_clip(bool activate)
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (activate)
buf = "AT+CLIP=1\r";
@@ -1628,11 +1628,11 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_CLIP, buf, strlen(buf));
}
-void bta_hf_client_send_at_ccwa(BOOLEAN activate)
+void bta_hf_client_send_at_ccwa(bool activate)
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (activate)
buf = "AT+CCWA=1\r";
@@ -1643,11 +1643,11 @@
}
-void bta_hf_client_send_at_cmee(BOOLEAN activate)
+void bta_hf_client_send_at_cmee(bool activate)
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (activate)
buf = "AT+CMEE=1\r";
@@ -1657,11 +1657,11 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_CMEE, buf, strlen(buf));
}
-void bta_hf_client_send_at_cops(BOOLEAN query)
+void bta_hf_client_send_at_cops(bool query)
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (query)
buf = "AT+COPS?\r";
@@ -1675,18 +1675,18 @@
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
buf = "AT+CLCC\r";
bta_hf_client_send_at(BTA_HF_CLIENT_AT_CLCC, buf, strlen(buf));
}
-void bta_hf_client_send_at_bvra(BOOLEAN enable)
+void bta_hf_client_send_at_bvra(bool enable)
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (enable)
buf = "AT+BVRA=1\r";
@@ -1696,12 +1696,12 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_BVRA, buf, strlen(buf));
}
-void bta_hf_client_send_at_vgs(UINT32 volume)
+void bta_hf_client_send_at_vgs(uint32_t volume)
{
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
int at_len;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
at_len = snprintf(buf, sizeof(buf), "AT+VGS=%u\r", volume);
if (at_len < 0)
@@ -1713,12 +1713,12 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_VGS, buf, at_len);
}
-void bta_hf_client_send_at_vgm(UINT32 volume)
+void bta_hf_client_send_at_vgm(uint32_t volume)
{
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
int at_len;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
at_len = snprintf(buf, sizeof(buf), "AT+VGM=%u\r", volume);
if (at_len < 0)
@@ -1730,12 +1730,12 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_VGM, buf, at_len);
}
-void bta_hf_client_send_at_atd(char *number, UINT32 memory)
+void bta_hf_client_send_at_atd(char *number, uint32_t memory)
{
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
int at_len;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (number[0] != '\0') {
at_len = snprintf(buf, sizeof(buf), "ATD%s;\r", number);
@@ -1762,7 +1762,7 @@
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
buf = "AT+BLDN\r";
@@ -1773,7 +1773,7 @@
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
buf = "ATA\r";
@@ -1784,21 +1784,21 @@
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
buf = "AT+CHUP\r";
bta_hf_client_send_at(BTA_HF_CLIENT_AT_CHUP, buf, strlen(buf));
}
-void bta_hf_client_send_at_btrh(BOOLEAN query, UINT32 val)
+void bta_hf_client_send_at_btrh(bool query, uint32_t val)
{
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
int at_len;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
- if (query == TRUE)
+ if (query == true)
{
at_len = snprintf(buf, sizeof(buf), "AT+BTRH?\r");
}
@@ -1821,7 +1821,7 @@
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
int at_len;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
at_len = snprintf(buf, sizeof(buf), "AT+VTS=%c\r", code);
@@ -1838,7 +1838,7 @@
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
buf = "AT+BCC\r";
@@ -1849,7 +1849,7 @@
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
buf = "AT+CNUM\r";
@@ -1860,11 +1860,11 @@
{
char *buf;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (!(bta_hf_client_cb.scb.peer_features & BTA_HF_CLIENT_PEER_FEAT_ECNR))
{
- APPL_TRACE_ERROR("%s: Remote does not support NREC.", __FUNCTION__);
+ APPL_TRACE_ERROR("%s: Remote does not support NREC.", __func__);
return;
}
@@ -1873,12 +1873,12 @@
bta_hf_client_send_at(BTA_HF_CLIENT_AT_NREC, buf, strlen(buf));
}
-void bta_hf_client_send_at_binp(UINT32 action)
+void bta_hf_client_send_at_binp(uint32_t action)
{
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
int at_len;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
at_len = snprintf(buf, sizeof(buf), "AT+BINP=%u\r", action);
@@ -1897,7 +1897,7 @@
int at_len;
int i;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (bta_hf_client_cb.scb.peer_version < HFP_VERSION_1_6)
{
APPL_TRACE_DEBUG("Remote does not Support AT+BIA");
diff --git a/bta/hf_client/bta_hf_client_at.h b/bta/hf_client/bta_hf_client_at.h
index 78b5d63..ad10135 100644
--- a/bta/hf_client/bta_hf_client_at.h
+++ b/bta/hf_client/bta_hf_client_at.h
@@ -28,18 +28,18 @@
typedef struct
{
const char *p_cmd; /* AT command string */
- UINT8 arg_type; /* allowable argument type syntax */
- UINT8 fmt; /* whether arg is int or string */
- UINT8 min; /* minimum value for int arg */
- INT16 max; /* maximum value for int arg */
+ uint8_t arg_type; /* allowable argument type syntax */
+ uint8_t fmt; /* whether arg is int or string */
+ uint8_t min; /* minimum value for int arg */
+ int16_t max; /* maximum value for int arg */
} tBTA_AG_AT_CMD;
/* callback function executed when command is parsed */
-typedef void (tBTA_AG_AT_CMD_CBACK)(void *p_user, UINT16 cmd, UINT8 arg_type,
- char *p_arg, INT16 int_arg);
+typedef void (tBTA_AG_AT_CMD_CBACK)(void *p_user, uint16_t cmd, uint8_t arg_type,
+ char *p_arg, int16_t int_arg);
/* callback function executed to send "ERROR" result code */
-typedef void (tBTA_AG_AT_ERR_CBACK)(void *p_user, BOOLEAN unknown, char *p_arg);
+typedef void (tBTA_AG_AT_ERR_CBACK)(void *p_user, bool unknown, char *p_arg);
enum
{
@@ -72,7 +72,7 @@
BTA_HF_CLIENT_AT_BINP,
};
-typedef UINT8 tBTA_HF_CLIENT_AT_CMD;
+typedef uint8_t tBTA_HF_CLIENT_AT_CMD;
/* Maximum combined buffer for received AT events string */
#define BTA_HF_CLIENT_AT_PARSER_MAX_LEN 4096
@@ -81,7 +81,7 @@
struct queued_at_cmd{
tBTA_HF_CLIENT_AT_CMD cmd;
char buf[BTA_HF_CLIENT_AT_MAX_LEN];
- UINT16 buf_len;
+ uint16_t buf_len;
struct queued_at_cmd *next;
};
typedef struct queued_at_cmd tBTA_HF_CLIENT_AT_QCMD;
diff --git a/bta/hf_client/bta_hf_client_cmd.c b/bta/hf_client/bta_hf_client_cmd.c
index 59d7b5f..f8e6b5b 100644
--- a/bta/hf_client/bta_hf_client_cmd.c
+++ b/bta/hf_client/bta_hf_client_cmd.c
@@ -31,7 +31,7 @@
bta_hf_client_send_at_vts((char)p_val->uint32_val1);
break;
case BTA_HF_CLIENT_AT_CMD_BTRH:
- bta_hf_client_send_at_btrh(FALSE, p_val->uint32_val1);
+ bta_hf_client_send_at_btrh(false, p_val->uint32_val1);
break;
case BTA_HF_CLIENT_AT_CMD_CHUP:
bta_hf_client_send_at_chup();
@@ -50,7 +50,7 @@
bta_hf_client_send_at_ata();
break;
case BTA_HF_CLIENT_AT_CMD_COPS:
- bta_hf_client_send_at_cops(TRUE);
+ bta_hf_client_send_at_cops(true);
break;
case BTA_HF_CLIENT_AT_CMD_ATD:
bta_hf_client_send_at_atd(p_val->str, p_val->uint32_val1);
@@ -62,7 +62,7 @@
bta_hf_client_send_at_vgs(p_val->uint32_val1);
break;
case BTA_HF_CLIENT_AT_CMD_BVRA:
- bta_hf_client_send_at_bvra(p_val->uint32_val1 == 0 ? FALSE : TRUE);
+ bta_hf_client_send_at_bvra(p_val->uint32_val1 == 0 ? false : true);
break;
case BTA_HF_CLIENT_AT_CMD_CLCC:
bta_hf_client_send_at_clcc();
diff --git a/bta/hf_client/bta_hf_client_int.h b/bta/hf_client/bta_hf_client_int.h
index a2dbde2..cc8c55d 100644
--- a/bta/hf_client/bta_hf_client_int.h
+++ b/bta/hf_client/bta_hf_client_int.h
@@ -101,24 +101,24 @@
typedef struct
{
BT_HDR hdr;
- UINT16 status;
+ uint16_t status;
} tBTA_HF_CLIENT_DISC_RESULT;
/* data type for RFCOMM events */
typedef struct
{
BT_HDR hdr;
- UINT16 port_handle;
+ uint16_t port_handle;
} tBTA_HF_CLIENT_RFC;
/* generic purpose data type for other events */
typedef struct
{
BT_HDR hdr;
- BOOLEAN bool_val;
- UINT8 uint8_val;
- UINT32 uint32_val1;
- UINT32 uint32_val2;
+ bool bool_val;
+ uint8_t uint8_val;
+ uint32_t uint32_val1;
+ uint32_t uint32_val2;
char str[BTA_HF_CLIENT_NUMBER_LEN + 1];
} tBTA_HF_CLIENT_DATA_VAL;
@@ -138,27 +138,27 @@
/* type for each service control block */
typedef struct
{
- UINT16 serv_handle; /* RFCOMM server handle */
+ uint16_t serv_handle; /* RFCOMM server handle */
BD_ADDR peer_addr; /* peer bd address */
tSDP_DISCOVERY_DB *p_disc_db; /* pointer to discovery database */
- UINT16 conn_handle; /* RFCOMM handle of connected service */
+ uint16_t conn_handle; /* RFCOMM handle of connected service */
tBTA_SEC serv_sec_mask; /* server security mask */
tBTA_SEC cli_sec_mask; /* client security mask */
tBTA_HF_CLIENT_FEAT features; /* features registered by application */
tBTA_HF_CLIENT_PEER_FEAT peer_features; /* peer device features */
tBTA_HF_CLIENT_CHLD_FEAT chld_features; /* call handling features */
- UINT16 peer_version; /* profile version of peer device */
- UINT8 peer_scn; /* peer scn */
- UINT8 role; /* initiator/acceptor role */
- UINT16 sco_idx; /* SCO handle */
- UINT8 sco_state; /* SCO state variable */
- BOOLEAN sco_close_rfc; /* TRUE if also close RFCOMM after SCO */
- BOOLEAN retry_with_sco_only;
- BOOLEAN deregister; /* TRUE if service shutting down */
- BOOLEAN svc_conn; /* set to TRUE when service level connection is up */
- BOOLEAN send_at_reply; /* set to TRUE to notify framework about AT results */
+ uint16_t peer_version; /* profile version of peer device */
+ uint8_t peer_scn; /* peer scn */
+ uint8_t role; /* initiator/acceptor role */
+ uint16_t sco_idx; /* SCO handle */
+ uint8_t sco_state; /* SCO state variable */
+ bool sco_close_rfc; /* true if also close RFCOMM after SCO */
+ bool retry_with_sco_only;
+ bool deregister; /* true if service shutting down */
+ bool svc_conn; /* set to true when service level connection is up */
+ bool send_at_reply; /* set to true to notify framework about AT results */
tBTA_HF_CLIENT_AT_CB at_cb; /* AT Parser control block */
- UINT8 state; /* state machine state */
+ uint8_t state; /* state machine state */
tBTM_SCO_CODEC_TYPE negotiated_codec; /* negotiated codec */
alarm_t *collision_timer; /* Collision timer */
} tBTA_HF_CLIENT_SCB;
@@ -180,10 +180,10 @@
typedef struct
{
tBTA_HF_CLIENT_SCB scb; /* service control block */
- UINT32 sdp_handle;
- UINT8 scn;
+ uint32_t sdp_handle;
+ uint8_t scn;
tBTA_HF_CLIENT_CBACK *p_cback; /* application callback */
- BOOLEAN msbc_enabled;
+ bool msbc_enabled;
} tBTA_HF_CLIENT_CB;
/*****************************************************************************
@@ -200,26 +200,26 @@
/* main functions */
extern void bta_hf_client_scb_init(void);
extern void bta_hf_client_scb_disable(void);
-extern BOOLEAN bta_hf_client_hdl_event(BT_HDR *p_msg);
-extern void bta_hf_client_sm_execute(UINT16 event,
+extern bool bta_hf_client_hdl_event(BT_HDR *p_msg);
+extern void bta_hf_client_sm_execute(uint16_t event,
tBTA_HF_CLIENT_DATA *p_data);
-extern void bta_hf_client_slc_seq(BOOLEAN error);
-extern void bta_hf_client_collision_cback (tBTA_SYS_CONN_STATUS status, UINT8 id,
- UINT8 app_id, BD_ADDR peer_addr);
+extern void bta_hf_client_slc_seq(bool error);
+extern void bta_hf_client_collision_cback (tBTA_SYS_CONN_STATUS status, uint8_t id,
+ uint8_t app_id, BD_ADDR peer_addr);
extern void bta_hf_client_resume_open ();
/* SDP functions */
-extern BOOLEAN bta_hf_client_add_record(char *p_service_name,
- UINT8 scn, tBTA_HF_CLIENT_FEAT features,
- UINT32 sdp_handle);
+extern bool bta_hf_client_add_record(char *p_service_name,
+ uint8_t scn, tBTA_HF_CLIENT_FEAT features,
+ uint32_t sdp_handle);
extern void bta_hf_client_create_record(tBTA_HF_CLIENT_DATA *p_data);
extern void bta_hf_client_del_record(tBTA_HF_CLIENT_DATA *p_data);
-extern BOOLEAN bta_hf_client_sdp_find_attr(void);
+extern bool bta_hf_client_sdp_find_attr(void);
extern void bta_hf_client_do_disc(void);
extern void bta_hf_client_free_db(tBTA_HF_CLIENT_DATA *p_data);
/* RFCOMM functions */
-extern void bta_hf_client_setup_port(UINT16 handle);
+extern void bta_hf_client_setup_port(uint16_t handle);
extern void bta_hf_client_start_server(void);
extern void bta_hf_client_close_server(void);
extern void bta_hf_client_rfc_do_open(tBTA_HF_CLIENT_DATA *p_data);
@@ -232,34 +232,34 @@
extern void bta_hf_client_sco_conn_close(tBTA_HF_CLIENT_DATA *p_data);
extern void bta_hf_client_sco_open(tBTA_HF_CLIENT_DATA *p_data);
extern void bta_hf_client_sco_close(tBTA_HF_CLIENT_DATA *p_data);
-extern void bta_hf_client_cback_sco(UINT8 event);
+extern void bta_hf_client_cback_sco(uint8_t event);
/* AT command functions */
extern void bta_hf_client_at_parse(char *buf, unsigned int len);
extern void bta_hf_client_send_at_brsf(void);
extern void bta_hf_client_send_at_bac(void);
-extern void bta_hf_client_send_at_cind(BOOLEAN status);
-extern void bta_hf_client_send_at_cmer(BOOLEAN activate);
-extern void bta_hf_client_send_at_chld(char cmd, UINT32 idx);
-extern void bta_hf_client_send_at_clip(BOOLEAN activate);
-extern void bta_hf_client_send_at_ccwa(BOOLEAN activate);
-extern void bta_hf_client_send_at_cmee(BOOLEAN activate);
-extern void bta_hf_client_send_at_cops(BOOLEAN query);
+extern void bta_hf_client_send_at_cind(bool status);
+extern void bta_hf_client_send_at_cmer(bool activate);
+extern void bta_hf_client_send_at_chld(char cmd, uint32_t idx);
+extern void bta_hf_client_send_at_clip(bool activate);
+extern void bta_hf_client_send_at_ccwa(bool activate);
+extern void bta_hf_client_send_at_cmee(bool activate);
+extern void bta_hf_client_send_at_cops(bool query);
extern void bta_hf_client_send_at_clcc(void);
-extern void bta_hf_client_send_at_bvra(BOOLEAN enable);
-extern void bta_hf_client_send_at_vgs(UINT32 volume);
-extern void bta_hf_client_send_at_vgm(UINT32 volume);
-extern void bta_hf_client_send_at_atd(char *number, UINT32 memory);
+extern void bta_hf_client_send_at_bvra(bool enable);
+extern void bta_hf_client_send_at_vgs(uint32_t volume);
+extern void bta_hf_client_send_at_vgm(uint32_t volume);
+extern void bta_hf_client_send_at_atd(char *number, uint32_t memory);
extern void bta_hf_client_send_at_bldn(void);
extern void bta_hf_client_send_at_ata(void);
extern void bta_hf_client_send_at_chup(void);
-extern void bta_hf_client_send_at_btrh(BOOLEAN query, UINT32 val);
+extern void bta_hf_client_send_at_btrh(bool query, uint32_t val);
extern void bta_hf_client_send_at_vts(char code);
extern void bta_hf_client_send_at_bcc(void);
-extern void bta_hf_client_send_at_bcs(UINT32 codec);
+extern void bta_hf_client_send_at_bcs(uint32_t codec);
extern void bta_hf_client_send_at_cnum(void);
extern void bta_hf_client_send_at_nrec(void);
-extern void bta_hf_client_send_at_binp(UINT32 action);
+extern void bta_hf_client_send_at_binp(uint32_t action);
extern void bta_hf_client_send_at_bia(void);
/* Action functions */
@@ -278,14 +278,14 @@
extern void bta_hf_client_rfc_data(tBTA_HF_CLIENT_DATA *p_data);
extern void bta_hf_client_disc_int_res(tBTA_HF_CLIENT_DATA *p_data);
extern void bta_hf_client_svc_conn_open(tBTA_HF_CLIENT_DATA *p_data);
-extern void bta_hf_client_ind(tBTA_HF_CLIENT_IND_TYPE type, UINT16 value);
-extern void bta_hf_client_evt_val(tBTA_HF_CLIENT_EVT type, UINT16 value);
+extern void bta_hf_client_ind(tBTA_HF_CLIENT_IND_TYPE type, uint16_t value);
+extern void bta_hf_client_evt_val(tBTA_HF_CLIENT_EVT type, uint16_t value);
extern void bta_hf_client_operator_name(char *name);
extern void bta_hf_client_clip(char *number);
extern void bta_hf_client_ccwa(char *number);
-extern void bta_hf_client_at_result(tBTA_HF_CLIENT_AT_RESULT_TYPE type, UINT16 cme);
-extern void bta_hf_client_clcc(UINT32 idx, BOOLEAN incoming, UINT8 status, BOOLEAN mpty, char *number);
-extern void bta_hf_client_cnum(char *number, UINT16 service);
+extern void bta_hf_client_at_result(tBTA_HF_CLIENT_AT_RESULT_TYPE type, uint16_t cme);
+extern void bta_hf_client_clcc(uint32_t idx, bool incoming, uint8_t status, bool mpty, char *number);
+extern void bta_hf_client_cnum(char *number, uint16_t service);
extern void bta_hf_client_binp(char *number);
/* Commands handling functions */
diff --git a/bta/hf_client/bta_hf_client_main.c b/bta/hf_client/bta_hf_client_main.c
index 5df418b..96a7876 100644
--- a/bta/hf_client/bta_hf_client_main.c
+++ b/bta/hf_client/bta_hf_client_main.c
@@ -29,17 +29,17 @@
#include "bta_hf_client_int.h"
/* uncomment to enable extra debug */
-/* #define BTA_HF_CLIENT_DEBUG TRUE */
+/* #define BTA_HF_CLIENT_DEBUG true */
#ifndef BTA_HF_CLIENT_DEBUG
-#define BTA_HF_CLIENT_DEBUG FALSE
+#define BTA_HF_CLIENT_DEBUG false
#endif
extern fixed_queue_t *btu_bta_alarm_queue;
-#if BTA_HF_CLIENT_DEBUG == TRUE
-static char *bta_hf_client_evt_str(UINT16 event);
-static char *bta_hf_client_state_str(UINT8 state);
+#if (BTA_HF_CLIENT_DEBUG == TRUE)
+static char *bta_hf_client_evt_str(uint16_t event);
+static char *bta_hf_client_state_str(uint8_t state);
#endif
/* state machine states */
@@ -123,7 +123,7 @@
#define BTA_HF_CLIENT_NUM_COLS 3 /* number of columns in state tables */
/* state table for init state */
-const UINT8 bta_hf_client_st_init[][BTA_HF_CLIENT_NUM_COLS] =
+const uint8_t bta_hf_client_st_init[][BTA_HF_CLIENT_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* API_REGISTER_EVT */ {BTA_HF_CLIENT_REGISTER, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_INIT_ST},
@@ -146,7 +146,7 @@
};
/* state table for opening state */
-const UINT8 bta_hf_client_st_opening[][BTA_HF_CLIENT_NUM_COLS] =
+const uint8_t bta_hf_client_st_opening[][BTA_HF_CLIENT_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* API_REGISTER_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPENING_ST},
@@ -169,7 +169,7 @@
};
/* state table for open state */
-const UINT8 bta_hf_client_st_open[][BTA_HF_CLIENT_NUM_COLS] =
+const uint8_t bta_hf_client_st_open[][BTA_HF_CLIENT_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* API_REGISTER_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_OPEN_ST},
@@ -192,7 +192,7 @@
};
/* state table for closing state */
-const UINT8 bta_hf_client_st_closing[][BTA_HF_CLIENT_NUM_COLS] =
+const uint8_t bta_hf_client_st_closing[][BTA_HF_CLIENT_NUM_COLS] =
{
/* Event Action 1 Action 2 Next state */
/* API_REGISTER_EVT */ {BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_IGNORE, BTA_HF_CLIENT_CLOSING_ST},
@@ -215,7 +215,7 @@
};
/* type for state table */
-typedef const UINT8 (*tBTA_HF_CLIENT_ST_TBL)[BTA_HF_CLIENT_NUM_COLS];
+typedef const uint8_t (*tBTA_HF_CLIENT_ST_TBL)[BTA_HF_CLIENT_NUM_COLS];
/* state table */
const tBTA_HF_CLIENT_ST_TBL bta_hf_client_st_tbl[] =
@@ -241,7 +241,7 @@
*******************************************************************************/
void bta_hf_client_scb_init(void)
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
alarm_free(bta_hf_client_cb.scb.collision_timer);
alarm_free(bta_hf_client_cb.scb.at_cb.resp_timer);
@@ -265,7 +265,7 @@
*******************************************************************************/
void bta_hf_client_scb_disable(void)
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
bta_hf_client_scb_init();
@@ -284,7 +284,7 @@
*******************************************************************************/
void bta_hf_client_resume_open (void)
{
- APPL_TRACE_DEBUG ("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG ("%s", __func__);
/* resume opening process. */
if (bta_hf_client_cb.scb.state == BTA_HF_CLIENT_INIT_ST)
@@ -306,7 +306,7 @@
*******************************************************************************/
static void bta_hf_client_collision_timer_cback(UNUSED_ATTR void *data)
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
/* If the peer haven't opened connection, restart opening process */
bta_hf_client_resume_open();
@@ -322,8 +322,8 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_collision_cback (tBTA_SYS_CONN_STATUS status, UINT8 id,
- UINT8 app_id, BD_ADDR peer_addr)
+void bta_hf_client_collision_cback (tBTA_SYS_CONN_STATUS status, uint8_t id,
+ uint8_t app_id, BD_ADDR peer_addr)
{
UNUSED(status);
UNUSED(app_id);
@@ -390,7 +390,7 @@
osi_property_get("ro.bluetooth.hfp.ver", value, "0");
if (strcmp(value,"1.6") == 0)
{
- bta_hf_client_cb.msbc_enabled = TRUE;
+ bta_hf_client_cb.msbc_enabled = true;
}
bta_hf_client_cb.scb.negotiated_codec = BTM_SCO_CODEC_CVSD;
@@ -437,12 +437,12 @@
** Description Data HF Client main event handling function.
**
**
-** Returns BOOLEAN
+** Returns bool
**
*******************************************************************************/
-BOOLEAN bta_hf_client_hdl_event(BT_HDR *p_msg)
+bool bta_hf_client_hdl_event(BT_HDR *p_msg)
{
-#if BTA_HF_CLIENT_DEBUG == TRUE
+#if (BTA_HF_CLIENT_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hf_client_hdl_event %s (0x%x)", bta_hf_client_evt_str(p_msg->event), p_msg->event);
#endif
@@ -462,7 +462,7 @@
bta_hf_client_sm_execute(p_msg->event, (tBTA_HF_CLIENT_DATA *) p_msg);
break;
}
- return TRUE;
+ return true;
}
/*******************************************************************************
@@ -475,15 +475,15 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_sm_execute(UINT16 event, tBTA_HF_CLIENT_DATA *p_data)
+void bta_hf_client_sm_execute(uint16_t event, tBTA_HF_CLIENT_DATA *p_data)
{
tBTA_HF_CLIENT_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
int i;
-#if BTA_HF_CLIENT_DEBUG == TRUE
- UINT16 in_event = event;
- UINT8 in_state = bta_hf_client_cb.scb.state;
+#if (BTA_HF_CLIENT_DEBUG == TRUE)
+ uint16_t in_event = event;
+ uint8_t in_state = bta_hf_client_cb.scb.state;
/* Ignore displaying of AT results when not connected (Ignored in state machine) */
if (bta_hf_client_cb.scb.state == BTA_HF_CLIENT_OPEN_ST)
@@ -521,7 +521,7 @@
}
}
-#if BTA_HF_CLIENT_DEBUG == TRUE
+#if (BTA_HF_CLIENT_DEBUG == TRUE)
if (bta_hf_client_cb.scb.state != in_state)
{
APPL_TRACE_EVENT("BTA HF Client State Change: [%s] -> [%s] after Event [%s]",
@@ -537,11 +537,11 @@
bta_hf_client_cb.scb.at_cb.current_cmd = BTA_HF_CLIENT_AT_NONE;
bta_hf_client_send_at_bia();
- bta_hf_client_send_at_ccwa(TRUE);
- bta_hf_client_send_at_cmee(TRUE);
- bta_hf_client_send_at_cops(FALSE);
- bta_hf_client_send_at_btrh(TRUE, 0);
- bta_hf_client_send_at_clip(TRUE);
+ bta_hf_client_send_at_ccwa(true);
+ bta_hf_client_send_at_cmee(true);
+ bta_hf_client_send_at_cops(false);
+ bta_hf_client_send_at_btrh(true, 0);
+ bta_hf_client_send_at_clip(true);
}
/*******************************************************************************
@@ -554,7 +554,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_slc_seq(BOOLEAN error)
+void bta_hf_client_slc_seq(bool error)
{
APPL_TRACE_DEBUG("bta_hf_client_slc_seq cmd: %u", bta_hf_client_cb.scb.at_cb.current_cmd);
@@ -584,19 +584,19 @@
break;
}
- bta_hf_client_send_at_cind(FALSE);
+ bta_hf_client_send_at_cind(false);
break;
case BTA_HF_CLIENT_AT_BAC:
- bta_hf_client_send_at_cind(FALSE);
+ bta_hf_client_send_at_cind(false);
break;
case BTA_HF_CLIENT_AT_CIND:
- bta_hf_client_send_at_cind(TRUE);
+ bta_hf_client_send_at_cind(true);
break;
case BTA_HF_CLIENT_AT_CIND_STATUS:
- bta_hf_client_send_at_cmer(TRUE);
+ bta_hf_client_send_at_cmer(true);
break;
case BTA_HF_CLIENT_AT_CMER:
@@ -627,13 +627,13 @@
}
}
-#if BTA_HF_CLIENT_DEBUG == TRUE
+#if (BTA_HF_CLIENT_DEBUG == TRUE)
#ifndef CASE_RETURN_STR
#define CASE_RETURN_STR(const) case const: return #const;
#endif
-static char *bta_hf_client_evt_str(UINT16 event)
+static char *bta_hf_client_evt_str(uint16_t event)
{
switch (event)
{
@@ -661,7 +661,7 @@
}
}
-static char *bta_hf_client_state_str(UINT8 state)
+static char *bta_hf_client_state_str(uint8_t state)
{
switch (state)
{
diff --git a/bta/hf_client/bta_hf_client_rfc.c b/bta/hf_client/bta_hf_client_rfc.c
index dc422ae..08546a7 100644
--- a/bta/hf_client/bta_hf_client_rfc.c
+++ b/bta/hf_client/bta_hf_client_rfc.c
@@ -40,7 +40,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_hf_client_port_cback(UINT32 code, UINT16 port_handle)
+static void bta_hf_client_port_cback(uint32_t code, uint16_t port_handle)
{
UNUSED(code);
@@ -68,9 +68,9 @@
** Returns void
**
*******************************************************************************/
-static void bta_hf_client_mgmt_cback(UINT32 code, UINT16 port_handle)
+static void bta_hf_client_mgmt_cback(uint32_t code, uint16_t port_handle)
{
- UINT16 event;
+ uint16_t event;
APPL_TRACE_DEBUG("bta_hf_client_mgmt_cback : code = %d, port_handle = %d, conn_handle = %d, serv_handle = %d",
code, port_handle, bta_hf_client_cb.scb.conn_handle, bta_hf_client_cb.scb.serv_handle);
@@ -123,7 +123,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_setup_port(UINT16 handle)
+void bta_hf_client_setup_port(uint16_t handle)
{
PORT_SetEventMask(handle, PORT_EV_RXCHAR);
PORT_SetEventCallback(handle, bta_hf_client_port_cback);
@@ -145,15 +145,15 @@
if (bta_hf_client_cb.scb.serv_handle > 0)
{
- APPL_TRACE_DEBUG("%s already started, handle: %d", __FUNCTION__, bta_hf_client_cb.scb.serv_handle);
+ APPL_TRACE_DEBUG("%s already started, handle: %d", __func__, bta_hf_client_cb.scb.serv_handle);
return;
}
- BTM_SetSecurityLevel(FALSE, "", BTM_SEC_SERVICE_HF_HANDSFREE, bta_hf_client_cb.scb.serv_sec_mask,
+ BTM_SetSecurityLevel(false, "", BTM_SEC_SERVICE_HF_HANDSFREE, bta_hf_client_cb.scb.serv_sec_mask,
BT_PSM_RFCOMM, BTM_SEC_PROTO_RFCOMM, bta_hf_client_cb.scn);
port_status = RFCOMM_CreateConnection(UUID_SERVCLASS_HF_HANDSFREE, bta_hf_client_cb.scn,
- TRUE, BTA_HF_CLIENT_MTU, (UINT8 *) bd_addr_any, &(bta_hf_client_cb.scb.serv_handle),
+ true, BTA_HF_CLIENT_MTU, (uint8_t *) bd_addr_any, &(bta_hf_client_cb.scb.serv_handle),
bta_hf_client_mgmt_cback);
if (port_status == PORT_SUCCESS)
@@ -181,11 +181,11 @@
*******************************************************************************/
void bta_hf_client_close_server(void)
{
- APPL_TRACE_DEBUG("%s %d", __FUNCTION__, bta_hf_client_cb.scb.serv_handle);
+ APPL_TRACE_DEBUG("%s %d", __func__, bta_hf_client_cb.scb.serv_handle);
if (bta_hf_client_cb.scb.serv_handle == 0)
{
- APPL_TRACE_DEBUG("%s already stopped", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s already stopped", __func__);
return;
}
@@ -205,12 +205,12 @@
*******************************************************************************/
void bta_hf_client_rfc_do_open(tBTA_HF_CLIENT_DATA *p_data)
{
- BTM_SetSecurityLevel(TRUE, "", BTM_SEC_SERVICE_HF_HANDSFREE,
+ BTM_SetSecurityLevel(true, "", BTM_SEC_SERVICE_HF_HANDSFREE,
bta_hf_client_cb.scb.cli_sec_mask, BT_PSM_RFCOMM,
BTM_SEC_PROTO_RFCOMM, bta_hf_client_cb.scb.peer_scn);
if (RFCOMM_CreateConnection(UUID_SERVCLASS_HF_HANDSFREE, bta_hf_client_cb.scb.peer_scn,
- FALSE, BTA_HF_CLIENT_MTU, bta_hf_client_cb.scb.peer_addr, &(bta_hf_client_cb.scb.conn_handle),
+ false, BTA_HF_CLIENT_MTU, bta_hf_client_cb.scb.peer_addr, &(bta_hf_client_cb.scb.conn_handle),
bta_hf_client_mgmt_cback) == PORT_SUCCESS)
{
bta_hf_client_setup_port(bta_hf_client_cb.scb.conn_handle);
diff --git a/bta/hf_client/bta_hf_client_sco.c b/bta/hf_client/bta_hf_client_sco.c
index 1be82a5..14c9201 100644
--- a/bta/hf_client/bta_hf_client_sco.c
+++ b/bta/hf_client/bta_hf_client_sco.c
@@ -83,27 +83,27 @@
** Function bta_hf_client_remove_sco
**
** Description Removes the specified SCO from the system.
-** If only_active is TRUE, then SCO is only removed if connected
+** If only_active is true, then SCO is only removed if connected
**
-** Returns BOOLEAN - TRUE if Sco removal was started
+** Returns bool - true if Sco removal was started
**
*******************************************************************************/
-static BOOLEAN bta_hf_client_sco_remove(BOOLEAN only_active)
+static bool bta_hf_client_sco_remove(bool only_active)
{
- BOOLEAN removed_started = FALSE;
+ bool removed_started = false;
tBTM_STATUS status;
- APPL_TRACE_DEBUG("%s %d", __FUNCTION__, only_active);
+ APPL_TRACE_DEBUG("%s %d", __func__, only_active);
if (bta_hf_client_cb.scb.sco_idx != BTM_INVALID_SCO_INDEX)
{
status = BTM_RemoveSco(bta_hf_client_cb.scb.sco_idx);
- APPL_TRACE_DEBUG("%s idx 0x%04x, status:0x%x", __FUNCTION__, bta_hf_client_cb.scb.sco_idx, status);
+ APPL_TRACE_DEBUG("%s idx 0x%04x, status:0x%x", __func__, bta_hf_client_cb.scb.sco_idx, status);
if (status == BTM_CMD_STARTED)
{
- removed_started = TRUE;
+ removed_started = true;
}
/* If no connection reset the sco handle */
else if ( (status == BTM_SUCCESS) || (status == BTM_UNKNOWN_ADDR) )
@@ -124,7 +124,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hf_client_cback_sco(UINT8 event)
+void bta_hf_client_cback_sco(uint8_t event)
{
tBTA_HF_CLIENT evt;
@@ -147,9 +147,9 @@
static void bta_hf_client_sco_conn_rsp(tBTM_ESCO_CONN_REQ_EVT_DATA *p_data)
{
tBTM_ESCO_PARAMS resp;
- UINT8 hci_status = HCI_SUCCESS;
+ uint8_t hci_status = HCI_SUCCESS;
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
if (bta_hf_client_cb.scb.sco_state == BTA_HF_CLIENT_SCO_LISTEN_ST)
{
@@ -185,7 +185,7 @@
*******************************************************************************/
static void bta_hf_client_esco_connreq_cback(tBTM_ESCO_EVT event, tBTM_ESCO_EVT_DATA *p_data)
{
- APPL_TRACE_DEBUG("%s %d", __FUNCTION__, event);
+ APPL_TRACE_DEBUG("%s %d", __func__, event);
if (event != BTM_ESCO_CONN_REQ_EVT)
{
@@ -212,11 +212,11 @@
** Returns void
**
*******************************************************************************/
-static void bta_hf_client_sco_conn_cback(UINT16 sco_idx)
+static void bta_hf_client_sco_conn_cback(uint16_t sco_idx)
{
- UINT8 *rem_bd;
+ uint8_t *rem_bd;
- APPL_TRACE_DEBUG("%s %d", __FUNCTION__, sco_idx);
+ APPL_TRACE_DEBUG("%s %d", __func__, sco_idx);
rem_bd = BTM_ReadScoBdAddr(sco_idx);
@@ -246,7 +246,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_hf_client_sco_disc_cback(UINT16 sco_idx)
+static void bta_hf_client_sco_disc_cback(uint16_t sco_idx)
{
APPL_TRACE_DEBUG("%s %d", __func__, sco_idx);
@@ -268,18 +268,18 @@
** Returns void
**
*******************************************************************************/
-static void bta_hf_client_sco_create(BOOLEAN is_orig)
+static void bta_hf_client_sco_create(bool is_orig)
{
tBTM_STATUS status;
- UINT8 *p_bd_addr = NULL;
+ uint8_t *p_bd_addr = NULL;
tBTM_ESCO_PARAMS params;
- APPL_TRACE_DEBUG("%s %d", __FUNCTION__, is_orig);
+ APPL_TRACE_DEBUG("%s %d", __func__, is_orig);
/* Make sure this sco handle is not already in use */
if (bta_hf_client_cb.scb.sco_idx != BTM_INVALID_SCO_INDEX)
{
- APPL_TRACE_WARNING("%s: Index 0x%04x already in use", __FUNCTION__,
+ APPL_TRACE_WARNING("%s: Index 0x%04x already in use", __func__,
bta_hf_client_cb.scb.sco_idx);
return;
}
@@ -297,15 +297,15 @@
if((params.packet_types & BTM_ESCO_LINK_ONLY_MASK)
||!((params.packet_types & ~(BTM_ESCO_LINK_ONLY_MASK | BTM_SCO_LINK_ONLY_MASK)) ^ BTA_HF_CLIENT_NO_EDR_ESCO))
{
- bta_hf_client_cb.scb.retry_with_sco_only = TRUE;
- APPL_TRACE_API("Setting retry_with_sco_only to TRUE");
+ bta_hf_client_cb.scb.retry_with_sco_only = true;
+ APPL_TRACE_API("Setting retry_with_sco_only to true");
}
}
else
{
if(bta_hf_client_cb.scb.retry_with_sco_only)
APPL_TRACE_API("retrying with SCO only");
- bta_hf_client_cb.scb.retry_with_sco_only = FALSE;
+ bta_hf_client_cb.scb.retry_with_sco_only = false;
BTM_SetEScoMode(BTM_LINK_TYPE_SCO, ¶ms);
}
@@ -315,7 +315,7 @@
}
else
{
- bta_hf_client_cb.scb.retry_with_sco_only = FALSE;
+ bta_hf_client_cb.scb.retry_with_sco_only = false;
}
p_bd_addr = bta_hf_client_cb.scb.peer_addr;
@@ -326,11 +326,11 @@
if (status == BTM_CMD_STARTED && !is_orig)
{
if(!BTM_RegForEScoEvts(bta_hf_client_cb.scb.sco_idx, bta_hf_client_esco_connreq_cback))
- APPL_TRACE_DEBUG("%s SCO registration success", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s SCO registration success", __func__);
}
APPL_TRACE_API("%s: orig %d, inx 0x%04x, status 0x%x, pkt types 0x%04x",
- __FUNCTION__, is_orig, bta_hf_client_cb.scb.sco_idx,
+ __func__, is_orig, bta_hf_client_cb.scb.sco_idx,
status, params.packet_types);
}
@@ -345,9 +345,9 @@
** Returns void
**
*******************************************************************************/
-static void bta_hf_client_sco_event(UINT8 event)
+static void bta_hf_client_sco_event(uint8_t event)
{
- APPL_TRACE_DEBUG("%s state: %d event: %d", __FUNCTION__,
+ APPL_TRACE_DEBUG("%s state: %d event: %d", __func__,
bta_hf_client_cb.scb.sco_state, event);
switch (bta_hf_client_cb.scb.sco_state)
@@ -357,7 +357,7 @@
{
case BTA_HF_CLIENT_SCO_LISTEN_E:
/* create sco listen connection */
- bta_hf_client_sco_create(FALSE);
+ bta_hf_client_sco_create(false);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_LISTEN_ST;
break;
@@ -372,21 +372,21 @@
{
case BTA_HF_CLIENT_SCO_LISTEN_E:
/* create sco listen connection (Additional channel) */
- bta_hf_client_sco_create(FALSE);
+ bta_hf_client_sco_create(false);
break;
case BTA_HF_CLIENT_SCO_OPEN_E:
/* remove listening connection */
- bta_hf_client_sco_remove(FALSE);
+ bta_hf_client_sco_remove(false);
/* create sco connection to peer */
- bta_hf_client_sco_create(TRUE);
+ bta_hf_client_sco_create(true);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_OPENING_ST;
break;
case BTA_HF_CLIENT_SCO_SHUTDOWN_E:
/* remove listening connection */
- bta_hf_client_sco_remove(FALSE);
+ bta_hf_client_sco_remove(false);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_SHUTDOWN_ST;
break;
@@ -399,7 +399,7 @@
case BTA_HF_CLIENT_SCO_CONN_CLOSE_E:
/* sco failed; create sco listen connection */
- bta_hf_client_sco_create(FALSE);
+ bta_hf_client_sco_create(false);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_LISTEN_ST;
break;
@@ -426,7 +426,7 @@
case BTA_HF_CLIENT_SCO_CONN_CLOSE_E:
/* sco failed; create sco listen connection */
- bta_hf_client_sco_create(FALSE);
+ bta_hf_client_sco_create(false);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_LISTEN_ST;
break;
@@ -449,7 +449,7 @@
case BTA_HF_CLIENT_SCO_CONN_OPEN_E:
/* close sco connection */
- bta_hf_client_sco_remove(TRUE);
+ bta_hf_client_sco_remove(true);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_CLOSING_ST;
break;
@@ -471,7 +471,7 @@
{
case BTA_HF_CLIENT_SCO_CLOSE_E:
/* close sco connection if active */
- if (bta_hf_client_sco_remove(TRUE))
+ if (bta_hf_client_sco_remove(true))
{
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_CLOSING_ST;
}
@@ -479,14 +479,14 @@
case BTA_HF_CLIENT_SCO_SHUTDOWN_E:
/* remove all listening connections */
- bta_hf_client_sco_remove(FALSE);
+ bta_hf_client_sco_remove(false);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_SHUTTING_ST;
break;
case BTA_HF_CLIENT_SCO_CONN_CLOSE_E:
/* peer closed sco; create sco listen connection */
- bta_hf_client_sco_create(FALSE);
+ bta_hf_client_sco_create(false);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_LISTEN_ST;
break;
@@ -509,7 +509,7 @@
case BTA_HF_CLIENT_SCO_CONN_CLOSE_E:
/* peer closed sco; create sco listen connection */
- bta_hf_client_sco_create(FALSE);
+ bta_hf_client_sco_create(false);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_LISTEN_ST;
break;
@@ -533,7 +533,7 @@
case BTA_HF_CLIENT_SCO_CONN_CLOSE_E:
/* open sco connection */
- bta_hf_client_sco_create(TRUE);
+ bta_hf_client_sco_create(true);
bta_hf_client_cb.scb.sco_state = BTA_HF_CLIENT_SCO_OPENING_ST;
break;
@@ -548,7 +548,7 @@
{
case BTA_HF_CLIENT_SCO_CONN_OPEN_E:
/* close sco connection; wait for conn close event */
- bta_hf_client_sco_remove(TRUE);
+ bta_hf_client_sco_remove(true);
break;
case BTA_HF_CLIENT_SCO_CONN_CLOSE_E:
@@ -584,7 +584,7 @@
{
UNUSED(p_data);
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
bta_hf_client_sco_event(BTA_HF_CLIENT_SCO_LISTEN_E);
}
@@ -603,7 +603,7 @@
{
UNUSED(p_data);
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
bta_hf_client_sco_event(BTA_HF_CLIENT_SCO_SHUTDOWN_E);
}
@@ -622,7 +622,7 @@
{
UNUSED(p_data);
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
bta_hf_client_sco_event(BTA_HF_CLIENT_SCO_CONN_OPEN_E);
@@ -637,7 +637,7 @@
bta_hf_client_cback_sco(BTA_HF_CLIENT_AUDIO_OPEN_EVT);
}
- bta_hf_client_cb.scb.retry_with_sco_only = FALSE;
+ bta_hf_client_cb.scb.retry_with_sco_only = false;
}
/*******************************************************************************
@@ -652,7 +652,7 @@
*******************************************************************************/
void bta_hf_client_sco_conn_close(tBTA_HF_CLIENT_DATA *p_data)
{
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
/* clear current scb */
bta_hf_client_cb.scb.sco_idx = BTM_INVALID_SCO_INDEX;
@@ -661,7 +661,7 @@
** and HFClient is first trying to establish an eSCO connection */
if (bta_hf_client_cb.scb.retry_with_sco_only && bta_hf_client_cb.scb.svc_conn)
{
- bta_hf_client_sco_create(TRUE);
+ bta_hf_client_sco_create(true);
}
else
{
@@ -674,13 +674,13 @@
/* call app callback */
bta_hf_client_cback_sco(BTA_HF_CLIENT_AUDIO_CLOSE_EVT);
- if (bta_hf_client_cb.scb.sco_close_rfc == TRUE)
+ if (bta_hf_client_cb.scb.sco_close_rfc == true)
{
- bta_hf_client_cb.scb.sco_close_rfc = FALSE;
+ bta_hf_client_cb.scb.sco_close_rfc = false;
bta_hf_client_rfc_do_close(p_data);
}
}
- bta_hf_client_cb.scb.retry_with_sco_only = FALSE;
+ bta_hf_client_cb.scb.retry_with_sco_only = false;
}
/*******************************************************************************
@@ -697,7 +697,7 @@
{
UNUSED(p_data);
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
bta_hf_client_sco_event(BTA_HF_CLIENT_SCO_OPEN_E);
}
@@ -716,7 +716,7 @@
{
UNUSED(p_data);
- APPL_TRACE_DEBUG("%s 0x%x", __FUNCTION__, bta_hf_client_cb.scb.sco_idx);
+ APPL_TRACE_DEBUG("%s 0x%x", __func__, bta_hf_client_cb.scb.sco_idx);
if (bta_hf_client_cb.scb.sco_idx != BTM_INVALID_SCO_INDEX)
{
diff --git a/bta/hf_client/bta_hf_client_sdp.c b/bta/hf_client/bta_hf_client_sdp.c
index 822fe97..1cd9234 100644
--- a/bta/hf_client/bta_hf_client_sdp.c
+++ b/bta/hf_client/bta_hf_client_sdp.c
@@ -47,9 +47,9 @@
** Returns void
**
*******************************************************************************/
-static void bta_hf_client_sdp_cback(UINT16 status)
+static void bta_hf_client_sdp_cback(uint16_t status)
{
- UINT16 event;
+ uint16_t event;
tBTA_HF_CLIENT_DISC_RESULT *p_buf =
(tBTA_HF_CLIENT_DISC_RESULT *)osi_malloc(sizeof(tBTA_HF_CLIENT_DISC_RESULT));
@@ -76,21 +76,21 @@
** calling this function the application must call
** SDP_CreateRecord() to create an SDP record.
**
-** Returns TRUE if function execution succeeded,
-** FALSE if function execution failed.
+** Returns true if function execution succeeded,
+** false if function execution failed.
**
******************************************************************************/
-BOOLEAN bta_hf_client_add_record(char *p_service_name, UINT8 scn,
- tBTA_HF_CLIENT_FEAT features, UINT32 sdp_handle)
+bool bta_hf_client_add_record(char *p_service_name, uint8_t scn,
+ tBTA_HF_CLIENT_FEAT features, uint32_t sdp_handle)
{
tSDP_PROTOCOL_ELEM proto_elem_list[BTA_HF_CLIENT_NUM_PROTO_ELEMS];
- UINT16 svc_class_id_list[BTA_HF_CLIENT_NUM_SVC_ELEMS];
- UINT16 browse_list[] = {UUID_SERVCLASS_PUBLIC_BROWSE_GROUP};
- UINT16 version;
- UINT16 profile_uuid;
- BOOLEAN result = TRUE;
- UINT8 buf[2];
- UINT16 sdp_features = 0;
+ uint16_t svc_class_id_list[BTA_HF_CLIENT_NUM_SVC_ELEMS];
+ uint16_t browse_list[] = {UUID_SERVCLASS_PUBLIC_BROWSE_GROUP};
+ uint16_t version;
+ uint16_t profile_uuid;
+ bool result = true;
+ uint8_t buf[2];
+ uint16_t sdp_features = 0;
APPL_TRACE_DEBUG("bta_hf_client_add_record");
@@ -119,7 +119,7 @@
if (p_service_name != NULL && p_service_name[0] != 0)
{
result &= SDP_AddAttribute(sdp_handle, ATTR_ID_SERVICE_NAME, TEXT_STR_DESC_TYPE,
- (UINT32)(strlen(p_service_name)+1), (UINT8 *) p_service_name);
+ (uint32_t)(strlen(p_service_name)+1), (uint8_t *) p_service_name);
}
/* add features */
@@ -211,20 +211,20 @@
** Description Process SDP discovery results to find requested attribute
**
**
-** Returns TRUE if results found, FALSE otherwise.
+** Returns true if results found, false otherwise.
**
*******************************************************************************/
-BOOLEAN bta_hf_client_sdp_find_attr(void)
+bool bta_hf_client_sdp_find_attr(void)
{
tSDP_DISC_REC *p_rec = NULL;
tSDP_DISC_ATTR *p_attr;
tSDP_PROTOCOL_ELEM pe;
- BOOLEAN result = FALSE;
+ bool result = false;
bta_hf_client_cb.scb.peer_version = HFP_VERSION_1_1; /* Default version */
/* loop through all records we found */
- while (TRUE)
+ while (true)
{
/* get next record; if none found, we're done */
if ((p_rec = SDP_FindServiceInDb(bta_hf_client_cb.scb.p_disc_db, UUID_SERVCLASS_AG_HANDSFREE, p_rec)) == NULL)
@@ -237,7 +237,7 @@
{
if (SDP_FindProtocolListElemInRec(p_rec, UUID_PROTOCOL_RFCOMM, &pe))
{
- bta_hf_client_cb.scb.peer_scn = (UINT8) pe.params[0];
+ bta_hf_client_cb.scb.peer_scn = (uint8_t) pe.params[0];
}
else
{
@@ -277,12 +277,12 @@
}
/* found what we needed */
- result = TRUE;
+ result = true;
break;
}
APPL_TRACE_DEBUG("%s peer_version=0x%x peer_features=0x%x",
- __FUNCTION__, bta_hf_client_cb.scb.peer_version,
+ __func__, bta_hf_client_cb.scb.peer_version,
bta_hf_client_cb.scb.peer_features);
return result;
@@ -301,10 +301,10 @@
void bta_hf_client_do_disc(void)
{
tSDP_UUID uuid_list[2];
- UINT16 num_uuid = 1;
- UINT16 attr_list[4];
- UINT8 num_attr;
- BOOLEAN db_inited = FALSE;
+ uint16_t num_uuid = 1;
+ uint16_t attr_list[4];
+ uint8_t num_attr;
+ bool db_inited = false;
/* initiator; get proto list and features */
if (bta_hf_client_cb.scb.role == BTA_HF_CLIENT_INT)
diff --git a/bta/hh/bta_hh_act.cc b/bta/hh/bta_hh_act.cc
index 41c1e50..766fa07 100644
--- a/bta/hh/bta_hh_act.cc
+++ b/bta/hh/bta_hh_act.cc
@@ -24,7 +24,7 @@
#include "bt_target.h"
-#if defined(BTA_HH_INCLUDED) && (BTA_HH_INCLUDED == TRUE)
+#if (BTA_HH_INCLUDED == TRUE)
#include <string.h>
@@ -43,13 +43,13 @@
/*****************************************************************************
** Local Function prototypes
*****************************************************************************/
-static void bta_hh_cback (UINT8 dev_handle, BD_ADDR addr, UINT8 event,
- UINT32 data, BT_HDR *pdata);
-static tBTA_HH_STATUS bta_hh_get_trans_status(UINT32 result);
+static void bta_hh_cback (uint8_t dev_handle, BD_ADDR addr, uint8_t event,
+ uint32_t data, BT_HDR *pdata);
+static tBTA_HH_STATUS bta_hh_get_trans_status(uint32_t result);
-#if BTA_HH_DEBUG
-static const char* bta_hh_get_w4_event(UINT16 event);
-static const char * bta_hh_hid_event_name(UINT16 event);
+#if (BTA_HH_DEBUG == TRUE)
+static const char* bta_hh_get_w4_event(uint16_t event);
+static const char * bta_hh_hid_event_name(uint16_t event);
#endif
/*****************************************************************************
@@ -68,7 +68,7 @@
void bta_hh_api_enable(tBTA_HH_DATA *p_data)
{
tBTA_HH_STATUS status = BTA_HH_ERR;
- UINT8 xx;
+ uint8_t xx;
/* initialize BTE HID */
HID_HostInit();
@@ -119,7 +119,7 @@
*******************************************************************************/
void bta_hh_api_disable(void)
{
- UINT8 xx;
+ uint8_t xx;
/* service is not enabled */
if (bta_hh_cb.p_cback == NULL)
@@ -132,7 +132,7 @@
}
else /* otherwise, disconnect all live connections */
{
- bta_hh_cb.w4_disable = TRUE;
+ bta_hh_cb.w4_disable = true;
for(xx = 0; xx < BTA_HH_MAX_DEVICE; xx ++)
{
@@ -185,11 +185,11 @@
** Returns void
**
*******************************************************************************/
-static void bta_hh_sdp_cback(UINT16 result, UINT16 attr_mask,
+static void bta_hh_sdp_cback(uint16_t result, uint16_t attr_mask,
tHID_DEV_SDP_INFO *sdp_rec )
{
tBTA_HH_DEV_CB *p_cb = bta_hh_cb.p_cur;
- UINT8 hdl = 0;
+ uint8_t hdl = 0;
tBTA_HH_STATUS status = BTA_HH_ERR_SDP;
/* make sure sdp succeeded and hh has not been disabled */
@@ -199,7 +199,7 @@
if (p_cb->sec_mask)
attr_mask |= HID_SEC_REQUIRED;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_EVENT("bta_hh_sdp_cback: p_cb: %d result 0x%02x, \
attr_mask 0x%02x, handle %x", \
p_cb, result, attr_mask,p_cb->hid_handle);
@@ -266,13 +266,13 @@
** Returns void
**
*******************************************************************************/
-static void bta_hh_di_sdp_cback(UINT16 result)
+static void bta_hh_di_sdp_cback(uint16_t result)
{
tBTA_HH_DEV_CB *p_cb = bta_hh_cb.p_cur;
tBTA_HH_STATUS status = BTA_HH_ERR_SDP;
tSDP_DI_GET_RECORD di_rec;
tHID_STATUS ret;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_EVENT("bta_hh_di_sdp_cback: p_cb: %d result 0x%02x", p_cb, result);
#endif
@@ -305,7 +305,7 @@
}
else
{
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG ("bta_hh_di_sdp_cback: HID_HostGetSDPRecord failed: Status 0x%2x",
ret);
#endif
@@ -338,7 +338,7 @@
void bta_hh_start_sdp(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
{
tBTA_HH_STATUS status = BTA_HH_ERR_SDP;
- UINT8 hdl;
+ uint8_t hdl;
p_cb->sec_mask = p_data->api_conn.sec_mask;
p_cb->mode = p_data->api_conn.mode;
@@ -356,7 +356,7 @@
if (p_cb->app_id)
{
status = BTA_HH_OK;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_start_sdp:: skip SDP for known devices");
#endif
if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE)
@@ -390,7 +390,7 @@
bta_hh_cb.p_disc_db,
p_bta_hh_cfg->sdp_db_size,
bta_hh_di_sdp_cback) != SDP_SUCCESS) {
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_start_sdp: SDP_DiDiscover failed: \
Status 0x%2X",status);
#endif
@@ -431,7 +431,7 @@
tBTA_HH_CONN conn_dat;
tBTA_HH_STATUS status = p_data->status;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG ("bta_hh_sdp_cmpl: status 0x%2X",p_data->status);
#endif
@@ -467,7 +467,7 @@
}
else
{
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG ("%s: HID_HostOpenDev failed: Status 0x%2X", __func__, ret);
#endif
/* open fail, remove device from management device list */
@@ -506,7 +506,7 @@
/* clean up device control block */
bta_hh_clean_up_kdev(p_cb);
}
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
bta_hh_trace_dev_db();
#endif
}
@@ -528,14 +528,14 @@
tBTA_HH_CBDATA disc_dat;
tHID_STATUS status;
-#if BTA_HH_LE_INCLUDED == TRUE
+#if (BTA_HH_LE_INCLUDED == TRUE)
if (p_cb->is_le_device)
bta_hh_le_api_disc_act(p_cb);
else
#endif
{
/* found an active connection */
- disc_dat.handle = p_data ?(UINT8)p_data->hdr.layer_specific :p_cb->hid_handle;
+ disc_dat.handle = p_data ?(uint8_t)p_data->hdr.layer_specific :p_cb->hid_handle;
disc_dat.status = BTA_HH_ERR;
status = HID_HostCloseDev(disc_dat.handle);
@@ -560,7 +560,7 @@
void bta_hh_open_cmpl_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
{
tBTA_HH_CONN conn ;
- UINT8 dev_handle = p_data ? (UINT8)p_data->hid_cback.hdr.layer_specific : \
+ uint8_t dev_handle = p_data ? (uint8_t)p_data->hid_cback.hdr.layer_specific : \
p_cb->hid_handle;
memset((void *)&conn, 0, sizeof (tBTA_HH_CONN));
@@ -610,7 +610,7 @@
else
(* bta_hh_cb.p_cback)(BTA_HH_OPEN_EVT, (tBTA_HH *)&conn);
- p_cb->incoming_conn = FALSE;
+ p_cb->incoming_conn = false;
p_cb->incoming_hid_handle = BTA_HH_INVALID_HANDLE;
}
@@ -628,10 +628,10 @@
{
tBTA_HH_API_CONN conn_data;
- UINT8 dev_handle = p_data ? (UINT8)p_data->hid_cback.hdr.layer_specific : \
+ uint8_t dev_handle = p_data ? (uint8_t)p_data->hid_cback.hdr.layer_specific : \
p_cb->hid_handle;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_EVENT ("bta_hh_open_act: Device[%d] connected", dev_handle);
#endif
@@ -644,7 +644,7 @@
/* app_id == 0 indicates an incoming conenction request arrives without SDP
performed, do it first */
{
- p_cb->incoming_conn = TRUE;
+ p_cb->incoming_conn = true;
/* store the handle here in case sdp fails - need to disconnect */
p_cb->incoming_hid_handle = dev_handle;
@@ -670,9 +670,9 @@
void bta_hh_data_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA * p_data)
{
BT_HDR *pdata = p_data->hid_cback.p_data;
- UINT8 *p_rpt = (UINT8 *)(pdata + 1) + pdata->offset;
+ uint8_t *p_rpt = (uint8_t *)(pdata + 1) + pdata->offset;
- bta_hh_co_data((UINT8)p_data->hid_cback.hdr.layer_specific, p_rpt, pdata->len,
+ bta_hh_co_data((uint8_t)p_data->hid_cback.hdr.layer_specific, p_rpt, pdata->len,
p_cb->mode, p_cb->sub_class, p_cb->dscp_info.ctry_code, p_cb->addr, p_cb->app_id);
osi_free_and_reset((void **)&pdata);
@@ -695,7 +695,7 @@
tBTA_HH_HSDATA hs_data;
tBTA_HH_CONN conn ;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("HANDSHAKE received for: event = %s data= %d",
bta_hh_get_w4_event(p_cb->w4_evt), p_data->hid_cback.data);
#endif
@@ -736,7 +736,7 @@
conn.handle = p_cb->hid_handle;
bdcpy(conn.bda, p_cb->addr);
(* bta_hh_cb.p_cback)(p_cb->w4_evt, (tBTA_HH *)&conn);
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
bta_hh_trace_dev_db();
#endif
p_cb->w4_evt = 0;
@@ -765,10 +765,10 @@
void bta_hh_ctrl_dat_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA * p_data)
{
BT_HDR *pdata = p_data->hid_cback.p_data;
- UINT8 *data = (UINT8 *)(pdata + 1) + pdata->offset;
+ uint8_t *data = (uint8_t *)(pdata + 1) + pdata->offset;
tBTA_HH_HSDATA hs_data;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("Ctrl DATA received w4: event[%s]",
bta_hh_get_w4_event(p_cb->w4_evt));
#endif
@@ -787,7 +787,7 @@
/* match up BTE/BTA report/boot mode def*/
hs_data.rsp_data.proto_mode = ((*data) == HID_PAR_PROTOCOL_REPORT)? \
BTA_HH_PROTO_RPT_MODE : BTA_HH_PROTO_BOOT_MODE;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("GET_PROTOCOL Mode = [%s]",
(hs_data.rsp_data.proto_mode == BTA_HH_PROTO_RPT_MODE)? "Report" : "Boot");
#endif
@@ -800,7 +800,7 @@
case BTA_HH_SET_IDLE_EVT :
/* fall through */
default:
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("invalid transaction type for DATA payload: 4_evt[%s]",
bta_hh_get_w4_event(p_cb->w4_evt));
#endif
@@ -832,7 +832,7 @@
void bta_hh_open_failure(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
{
tBTA_HH_CONN conn_dat ;
- UINT32 reason = p_data->hid_cback.data; /* Reason for closing (32-bit) */
+ uint32_t reason = p_data->hid_cback.data; /* Reason for closing (32-bit) */
memset(&conn_dat, 0, sizeof(tBTA_HH_CONN));
conn_dat.handle = p_cb->hid_handle;
@@ -844,11 +844,11 @@
/* Report OPEN fail event */
(*bta_hh_cb.p_cback)(BTA_HH_OPEN_EVT, (tBTA_HH *)&conn_dat);
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
bta_hh_trace_dev_db();
#endif
/* clean up control block, but retain SDP info and device handle */
- p_cb->vp = FALSE;
+ p_cb->vp = false;
p_cb->w4_evt = 0;
/* if no connection is active and HH disable is signaled, disable service */
@@ -858,7 +858,7 @@
}
/* Error in opening hid connection, reset flags */
- p_cb->incoming_conn = FALSE;
+ p_cb->incoming_conn = false;
p_cb->incoming_hid_handle = BTA_HH_INVALID_HANDLE;
}
@@ -876,10 +876,10 @@
{
tBTA_HH_CONN conn_dat ;
tBTA_HH_CBDATA disc_dat = {BTA_HH_OK, 0};
- UINT32 reason = p_data->hid_cback.data; /* Reason for closing (32-bit) */
+ uint32_t reason = p_data->hid_cback.data; /* Reason for closing (32-bit) */
/* if HID_HDEV_EVT_VC_UNPLUG was received, report BTA_HH_VC_UNPLUG_EVT */
- UINT16 event = p_cb->vp ? BTA_HH_VC_UNPLUG_EVT : BTA_HH_CLOSE_EVT;
+ uint16_t event = p_cb->vp ? BTA_HH_VC_UNPLUG_EVT : BTA_HH_CLOSE_EVT;
disc_dat.handle = p_cb->hid_handle;
disc_dat.status = p_data->hid_cback.data;
@@ -898,7 +898,7 @@
/* Report OPEN fail event */
(*bta_hh_cb.p_cback)(BTA_HH_OPEN_EVT, (tBTA_HH *)&conn_dat);
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
bta_hh_trace_dev_db();
#endif
return;
@@ -925,13 +925,13 @@
bta_hh_clean_up_kdev(p_cb);
}
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
bta_hh_trace_dev_db();
#endif
}
/* clean up control block, but retain SDP info and device handle */
- p_cb->vp = FALSE;
+ p_cb->vp = false;
p_cb->w4_evt = 0;
/* if no connection is active and HH disable is signaled, disable service */
@@ -981,7 +981,7 @@
{
tBTA_HH_MAINT_DEV *p_dev_info = &p_data->api_maintdev;
tBTA_HH_DEV_INFO dev_info ;
- UINT8 dev_handle;
+ uint8_t dev_handle;
dev_info.status = BTA_HH_ERR;
dev_info.handle = BTA_HH_INVALID_HANDLE;
@@ -1008,7 +1008,7 @@
dev_info.handle = dev_handle;
dev_info.status = BTA_HH_OK;
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
/* update DI information */
bta_hh_update_di_info(p_cb,
p_dev_info->dscp_info.vendor_id,
@@ -1040,16 +1040,16 @@
dev_info.handle = p_cb->hid_handle;
dev_info.status = BTA_HH_OK;
}
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
bta_hh_trace_dev_db();
#endif
break;
case BTA_HH_RMV_DEV_EVT: /* remove device */
- dev_info.handle = (UINT8)p_dev_info->hdr.layer_specific;
+ dev_info.handle = (uint8_t)p_dev_info->hdr.layer_specific;
bdcpy(dev_info.bda, p_cb->addr);
-#if BTA_HH_LE_INCLUDED == TRUE
+#if (BTA_HH_LE_INCLUDED == TRUE)
if (p_cb->is_le_device)
{
bta_hh_le_remove_dev_bg_conn(p_cb);
@@ -1088,10 +1088,10 @@
void bta_hh_write_dev_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
{
tBTA_HH_CBDATA cbdata = {BTA_HH_OK, 0};
- UINT16 event = (p_data->api_sndcmd.t_type - BTA_HH_FST_BTE_TRANS_EVT) +
+ uint16_t event = (p_data->api_sndcmd.t_type - BTA_HH_FST_BTE_TRANS_EVT) +
BTA_HH_FST_TRANS_CB_EVT;
-#if BTA_HH_LE_INCLUDED == TRUE
+#if (BTA_HH_LE_INCLUDED == TRUE)
if (p_cb->is_le_device)
bta_hh_le_write_dev_act(p_cb, p_data);
else
@@ -1147,7 +1147,7 @@
/* no handshake event will be generated */
/* if VC_UNPLUG is issued, set flag */
if (p_data->api_sndcmd.param == BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG)
- p_cb->vp = TRUE;
+ p_cb->vp = true;
break;
/* currently not expected */
@@ -1192,13 +1192,13 @@
** Returns void
**
*******************************************************************************/
-static void bta_hh_cback (UINT8 dev_handle, BD_ADDR addr, UINT8 event,
- UINT32 data, BT_HDR *pdata)
+static void bta_hh_cback (uint8_t dev_handle, BD_ADDR addr, uint8_t event,
+ uint32_t data, BT_HDR *pdata)
{
- UINT16 sm_event = BTA_HH_INVALID_EVT;
- UINT8 xx = 0;
+ uint16_t sm_event = BTA_HH_INVALID_EVT;
+ uint8_t xx = 0;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_cback::HID_event [%s]", bta_hh_hid_event_name(event));
#endif
@@ -1231,7 +1231,7 @@
{
if (bta_hh_cb.kdev[xx].hid_handle == dev_handle)
{
- bta_hh_cb.kdev[xx].vp = TRUE;
+ bta_hh_cb.kdev[xx].vp = true;
break;
}
}
@@ -1243,7 +1243,7 @@
(tBTA_HH_CBACK_DATA *)osi_malloc(sizeof(tBTA_HH_CBACK_DATA) +
sizeof(BT_HDR));
p_buf->hdr.event = sm_event;
- p_buf->hdr.layer_specific = (UINT16)dev_handle;
+ p_buf->hdr.layer_specific = (uint16_t)dev_handle;
p_buf->data = data;
bdcpy(p_buf->addr, addr);
p_buf->p_data = pdata;
@@ -1260,7 +1260,7 @@
** status code
**
*******************************************************************************/
-static tBTA_HH_STATUS bta_hh_get_trans_status(UINT32 result)
+static tBTA_HH_STATUS bta_hh_get_trans_status(uint32_t result)
{
switch(result)
{
@@ -1282,8 +1282,8 @@
** Debug Functions
*****************************************************************************/
-#if (defined BTA_HH_DEBUG && BTA_HH_DEBUG == TRUE)
-static const char* bta_hh_get_w4_event(UINT16 event)
+#if (BTA_HH_DEBUG == TRUE)
+static const char* bta_hh_get_w4_event(uint16_t event)
{
switch (event)
{
@@ -1307,7 +1307,7 @@
}
-static const char * bta_hh_hid_event_name(UINT16 event)
+static const char * bta_hh_hid_event_name(uint16_t event)
{
switch (event)
{
diff --git a/bta/hh/bta_hh_api.cc b/bta/hh/bta_hh_api.cc
index 50424b6..7fb5cd7 100644
--- a/bta/hh/bta_hh_api.cc
+++ b/bta/hh/bta_hh_api.cc
@@ -28,7 +28,7 @@
#include "bt_target.h"
-#if defined(BTA_HH_INCLUDED) && (BTA_HH_INCLUDED == TRUE)
+#if (BTA_HH_INCLUDED == TRUE)
#include <stdio.h>
#include <stdlib.h>
@@ -109,12 +109,12 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhClose(UINT8 dev_handle)
+void BTA_HhClose(uint8_t dev_handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_calloc(sizeof(BT_HDR));
p_buf->event = BTA_HH_API_CLOSE_EVT;
- p_buf->layer_specific = (UINT16)dev_handle;
+ p_buf->layer_specific = (uint16_t)dev_handle;
bta_sys_sendmsg(p_buf);
}
@@ -148,14 +148,14 @@
** Function bta_hh_snd_write_dev
**
*******************************************************************************/
-static void bta_hh_snd_write_dev(UINT8 dev_handle, UINT8 t_type, UINT8 param,
- UINT16 data, UINT8 rpt_id, BT_HDR *p_data)
+static void bta_hh_snd_write_dev(uint8_t dev_handle, uint8_t t_type, uint8_t param,
+ uint16_t data, uint8_t rpt_id, BT_HDR *p_data)
{
tBTA_HH_CMD_DATA *p_buf =
(tBTA_HH_CMD_DATA *)osi_calloc(sizeof(tBTA_HH_CMD_DATA));
p_buf->hdr.event = BTA_HH_API_WRITE_DEV_EVT;
- p_buf->hdr.layer_specific = (UINT16)dev_handle;
+ p_buf->hdr.layer_specific = (uint16_t)dev_handle;
p_buf->t_type = t_type;
p_buf->data = data;
p_buf->param = param;
@@ -177,7 +177,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhSetReport(UINT8 dev_handle, tBTA_HH_RPT_TYPE r_type, BT_HDR *p_data)
+void BTA_HhSetReport(uint8_t dev_handle, tBTA_HH_RPT_TYPE r_type, BT_HDR *p_data)
{
bta_hh_snd_write_dev(dev_handle, HID_TRANS_SET_REPORT, r_type, 0, 0, p_data);
}
@@ -190,9 +190,9 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhGetReport(UINT8 dev_handle, tBTA_HH_RPT_TYPE r_type, UINT8 rpt_id, UINT16 buf_size)
+void BTA_HhGetReport(uint8_t dev_handle, tBTA_HH_RPT_TYPE r_type, uint8_t rpt_id, uint16_t buf_size)
{
- UINT8 param = (buf_size) ? (r_type | 0x08) : r_type;
+ uint8_t param = (buf_size) ? (r_type | 0x08) : r_type;
bta_hh_snd_write_dev(dev_handle, HID_TRANS_GET_REPORT, param,
buf_size, rpt_id, NULL);
@@ -206,9 +206,9 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhSetProtoMode(UINT8 dev_handle, tBTA_HH_PROTO_MODE p_type)
+void BTA_HhSetProtoMode(uint8_t dev_handle, tBTA_HH_PROTO_MODE p_type)
{
- bta_hh_snd_write_dev(dev_handle, HID_TRANS_SET_PROTOCOL, (UINT8)p_type,
+ bta_hh_snd_write_dev(dev_handle, HID_TRANS_SET_PROTOCOL, (uint8_t)p_type,
0, 0, NULL);
}
/*******************************************************************************
@@ -220,7 +220,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhGetProtoMode(UINT8 dev_handle)
+void BTA_HhGetProtoMode(uint8_t dev_handle)
{
bta_hh_snd_write_dev(dev_handle, HID_TRANS_GET_PROTOCOL, 0, 0, 0, NULL);
}
@@ -233,7 +233,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhSetIdle(UINT8 dev_handle, UINT16 idle_rate)
+void BTA_HhSetIdle(uint8_t dev_handle, uint16_t idle_rate)
{
bta_hh_snd_write_dev(dev_handle, HID_TRANS_SET_IDLE, 0, idle_rate, 0, NULL);
}
@@ -247,7 +247,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhGetIdle(UINT8 dev_handle)
+void BTA_HhGetIdle(uint8_t dev_handle)
{
bta_hh_snd_write_dev(dev_handle, HID_TRANS_GET_IDLE, 0, 0, 0, NULL);
}
@@ -260,9 +260,9 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhSendCtrl(UINT8 dev_handle, tBTA_HH_TRANS_CTRL_TYPE c_type)
+void BTA_HhSendCtrl(uint8_t dev_handle, tBTA_HH_TRANS_CTRL_TYPE c_type)
{
- bta_hh_snd_write_dev(dev_handle, HID_TRANS_CONTROL, (UINT8)c_type, 0, 0, NULL);
+ bta_hh_snd_write_dev(dev_handle, HID_TRANS_CONTROL, (uint8_t)c_type, 0, 0, NULL);
}
/*******************************************************************************
**
@@ -275,24 +275,24 @@
** p_data: data to be sent in the DATA transaction; or
** the data to be write into the Output Report of a LE HID
** device. The report is identified the report ID which is
-** the value of the byte (UINT8 *)(p_buf + 1) + p_buf->offset.
+** the value of the byte (uint8_t *)(p_buf + 1) + p_buf->offset.
** p_data->layer_specific needs to be set to the report type,
** it can be OUTPUT report, or FEATURE report.
**
** Returns void
**
*******************************************************************************/
-void BTA_HhSendData(UINT8 dev_handle, BD_ADDR dev_bda, BT_HDR *p_data)
+void BTA_HhSendData(uint8_t dev_handle, BD_ADDR dev_bda, BT_HDR *p_data)
{
UNUSED(dev_bda);
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
if (p_data->layer_specific != BTA_HH_RPTT_OUTPUT)
{
APPL_TRACE_ERROR("ERROR! Wrong report type! Write Command only valid for output report!");
return;
}
#endif
- bta_hh_snd_write_dev(dev_handle, HID_TRANS_DATA, (UINT8)p_data->layer_specific, 0, 0, p_data);
+ bta_hh_snd_write_dev(dev_handle, HID_TRANS_DATA, (uint8_t)p_data->layer_specific, 0, 0, p_data);
}
/*******************************************************************************
@@ -304,12 +304,12 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhGetDscpInfo(UINT8 dev_handle)
+void BTA_HhGetDscpInfo(uint8_t dev_handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_calloc(sizeof(BT_HDR));
p_buf->event = BTA_HH_API_GET_DSCP_EVT;
- p_buf->layer_specific = (UINT16)dev_handle;
+ p_buf->layer_specific = (uint16_t)dev_handle;
bta_sys_sendmsg(p_buf);
}
@@ -326,8 +326,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhAddDev(BD_ADDR bda, tBTA_HH_ATTR_MASK attr_mask, UINT8 sub_class,
- UINT8 app_id, tBTA_HH_DEV_DSCP_INFO dscp_info)
+void BTA_HhAddDev(BD_ADDR bda, tBTA_HH_ATTR_MASK attr_mask, uint8_t sub_class,
+ uint8_t app_id, tBTA_HH_DEV_DSCP_INFO dscp_info)
{
size_t len = sizeof(tBTA_HH_MAINT_DEV) + dscp_info.descriptor.dl_len;
tBTA_HH_MAINT_DEV *p_buf = (tBTA_HH_MAINT_DEV *)osi_calloc(len);
@@ -336,7 +336,7 @@
p_buf->sub_event = BTA_HH_ADD_DEV_EVT;
p_buf->hdr.layer_specific = BTA_HH_INVALID_HANDLE;
- p_buf->attr_mask = (UINT16) attr_mask;
+ p_buf->attr_mask = (uint16_t) attr_mask;
p_buf->sub_class = sub_class;
p_buf->app_id = app_id;
bdcpy(p_buf->bda, bda);
@@ -344,7 +344,7 @@
memcpy(&p_buf->dscp_info, &dscp_info, sizeof(tBTA_HH_DEV_DSCP_INFO));
if ( dscp_info.descriptor.dl_len != 0 && dscp_info.descriptor.dsc_list) {
p_buf->dscp_info.descriptor.dl_len = dscp_info.descriptor.dl_len;
- p_buf->dscp_info.descriptor.dsc_list = (UINT8 *)(p_buf + 1);
+ p_buf->dscp_info.descriptor.dsc_list = (uint8_t *)(p_buf + 1);
memcpy(p_buf->dscp_info.descriptor.dsc_list,
dscp_info.descriptor.dsc_list,
dscp_info.descriptor.dl_len);
@@ -365,14 +365,14 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhRemoveDev(UINT8 dev_handle )
+void BTA_HhRemoveDev(uint8_t dev_handle )
{
tBTA_HH_MAINT_DEV *p_buf =
(tBTA_HH_MAINT_DEV *)osi_calloc(sizeof(tBTA_HH_MAINT_DEV));
p_buf->hdr.event = BTA_HH_API_MAINT_DEV_EVT;
p_buf->sub_event = BTA_HH_RMV_DEV_EVT;
- p_buf->hdr.layer_specific = (UINT16)dev_handle;
+ p_buf->hdr.layer_specific = (uint16_t)dev_handle;
bta_sys_sendmsg(p_buf);
}
@@ -396,8 +396,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_HhParseBootRpt(tBTA_HH_BOOT_RPT *p_data, UINT8 *p_report,
- UINT16 report_len)
+void BTA_HhParseBootRpt(tBTA_HH_BOOT_RPT *p_data, uint8_t *p_report,
+ uint16_t report_len)
{
p_data->dev_type = BTA_HH_DEVT_UNKNOWN;
@@ -408,12 +408,12 @@
{
case BTA_HH_KEYBD_RPT_ID: /* key board report ID */
p_data->dev_type = p_report[0];
- bta_hh_parse_keybd_rpt(p_data, p_report + 1, (UINT16)(report_len -1));
+ bta_hh_parse_keybd_rpt(p_data, p_report + 1, (uint16_t)(report_len -1));
break;
case BTA_HH_MOUSE_RPT_ID: /* mouse report ID */
p_data->dev_type = p_report[0];
- bta_hh_parse_mice_rpt(p_data, p_report + 1, (UINT16)(report_len - 1));
+ bta_hh_parse_mice_rpt(p_data, p_report + 1, (uint16_t)(report_len - 1));
break;
default:
diff --git a/bta/hh/bta_hh_int.h b/bta/hh/bta_hh_int.h
index 51894d7..064b186 100644
--- a/bta/hh/bta_hh_int.h
+++ b/bta/hh/bta_hh_int.h
@@ -29,7 +29,7 @@
#include "utl.h"
#include "bta_hh_api.h"
-#if BTA_HH_LE_INCLUDED == TRUE
+#if (BTA_HH_LE_INCLUDED == TRUE)
#include "bta_gatt_api.h"
#endif
@@ -42,7 +42,7 @@
#if (BTA_GATT_INCLUDED == FALSE || BLE_INCLUDED == FALSE)
#undef BTA_HH_LE_INCLUDED
-#define BTA_HH_LE_INCLUDED FALSE
+#define BTA_HH_LE_INCLUDED false
#endif
/* state machine events, these events are handled by the state machine */
@@ -60,7 +60,7 @@
BTA_HH_API_GET_DSCP_EVT,
BTA_HH_API_MAINT_DEV_EVT,
BTA_HH_OPEN_CMPL_EVT,
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
BTA_HH_GATT_CLOSE_EVT,
BTA_HH_GATT_OPEN_EVT,
BTA_HH_START_ENC_EVT,
@@ -77,7 +77,7 @@
BTA_HH_API_DISABLE_EVT,
BTA_HH_DISC_CMPL_EVT
};
-typedef UINT16 tBTA_HH_INT_EVT; /* HID host internal events */
+typedef uint16_t tBTA_HH_INT_EVT; /* HID host internal events */
#define BTA_HH_INVALID_EVT (BTA_HH_DISC_CMPL_EVT + 1)
@@ -96,25 +96,25 @@
BTA_HH_IDLE_ST,
BTA_HH_W4_CONN_ST,
BTA_HH_CONN_ST
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
,BTA_HH_W4_SEC
#endif
,BTA_HH_INVALID_ST /* Used to check invalid states before executing SM function */
};
-typedef UINT8 tBTA_HH_STATE;
+typedef uint8_t tBTA_HH_STATE;
/* data structure used to send a command/data to HID device */
typedef struct
{
BT_HDR hdr;
- UINT8 t_type;
- UINT8 param;
- UINT8 rpt_id;
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
- UINT8 srvc_id;
+ uint8_t t_type;
+ uint8_t param;
+ uint8_t rpt_id;
+#if (BTA_HH_LE_INCLUDED == TRUE)
+ uint8_t srvc_id;
#endif
- UINT16 data;
+ uint16_t data;
BT_HDR *p_data;
}tBTA_HH_CMD_DATA;
@@ -122,8 +122,8 @@
typedef struct
{
BT_HDR hdr;
- UINT8 sec_mask;
- UINT8 service_name[BTA_SERVICE_NAME_LEN+1];
+ uint8_t sec_mask;
+ uint8_t service_name[BTA_SERVICE_NAME_LEN+1];
tBTA_HH_CBACK *p_cback;
} tBTA_HH_API_ENABLE;
@@ -131,7 +131,7 @@
{
BT_HDR hdr;
BD_ADDR bd_addr;
- UINT8 sec_mask;
+ uint8_t sec_mask;
tBTA_HH_PROTO_MODE mode;
}tBTA_HH_API_CONN;
@@ -140,7 +140,7 @@
{
BT_HDR hdr;
BD_ADDR addr;
- UINT32 data;
+ uint32_t data;
BT_HDR *p_data;
}tBTA_HH_CBACK_DATA;
@@ -148,18 +148,18 @@
{
BT_HDR hdr;
BD_ADDR bda;
- UINT16 attr_mask;
- UINT16 sub_event;
- UINT8 sub_class;
- UINT8 app_id;
+ uint16_t attr_mask;
+ uint16_t sub_event;
+ uint8_t sub_class;
+ uint8_t app_id;
tBTA_HH_DEV_DSCP_INFO dscp_info;
}tBTA_HH_MAINT_DEV;
-#if BTA_HH_LE_INCLUDED == TRUE
+#if (BTA_HH_LE_INCLUDED == TRUE)
typedef struct
{
BT_HDR hdr;
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATT_REASON reason; /* disconnect reason code, not useful when connect event is reported */
}tBTA_HH_LE_CLOSE;
@@ -167,8 +167,8 @@
typedef struct
{
BT_HDR hdr;
- UINT16 scan_int;
- UINT16 scan_win;
+ uint16_t scan_int;
+ uint16_t scan_win;
}tBTA_HH_SCPP_UPDATE;
#endif
/* union of all event data types */
@@ -181,7 +181,7 @@
tBTA_HH_CBACK_DATA hid_cback;
tBTA_HH_STATUS status;
tBTA_HH_MAINT_DEV api_maintdev;
-#if BTA_HH_LE_INCLUDED == TRUE
+#if (BTA_HH_LE_INCLUDED == TRUE)
tBTA_HH_LE_CLOSE le_close;
tBTA_GATTC_OPEN le_open;
tBTA_HH_SCPP_UPDATE le_scpp_update;
@@ -189,18 +189,18 @@
#endif
} tBTA_HH_DATA;
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
typedef struct
{
- UINT8 index;
- BOOLEAN in_use;
- UINT8 srvc_inst_id;
- UINT8 char_inst_id;
+ uint8_t index;
+ bool in_use;
+ uint8_t srvc_inst_id;
+ uint8_t char_inst_id;
tBTA_HH_RPT_TYPE rpt_type;
- UINT16 uuid;
- UINT8 rpt_id;
- BOOLEAN client_cfg_exist;
- UINT16 client_cfg_value;
+ uint16_t uuid;
+ uint8_t rpt_id;
+ bool client_cfg_exist;
+ uint16_t client_cfg_value;
}tBTA_HH_LE_RPT;
#ifndef BTA_HH_LE_RPT_MAX
@@ -209,26 +209,26 @@
typedef struct
{
- BOOLEAN in_use;
- UINT8 srvc_inst_id;
+ bool in_use;
+ uint8_t srvc_inst_id;
tBTA_HH_LE_RPT report[BTA_HH_LE_RPT_MAX];
- UINT16 proto_mode_handle;
- UINT8 control_point_handle;
+ uint16_t proto_mode_handle;
+ uint8_t control_point_handle;
- BOOLEAN expl_incl_srvc;
- UINT8 incl_srvc_inst; /* assuming only one included service : battery service */
- UINT8 cur_expl_char_idx; /* currently discovering service index */
- UINT8 *rpt_map;
- UINT16 ext_rpt_ref;
+ bool expl_incl_srvc;
+ uint8_t incl_srvc_inst; /* assuming only one included service : battery service */
+ uint8_t cur_expl_char_idx; /* currently discovering service index */
+ uint8_t *rpt_map;
+ uint16_t ext_rpt_ref;
tBTA_HH_DEV_DESCR descriptor;
}tBTA_HH_LE_HID_SRVC;
/* convert a HID handle to the LE CB index */
#define BTA_HH_GET_LE_CB_IDX(x) (((x) >> 4) - 1)
-/* convert a GATT connection ID to HID device handle, it is the hi 4 bits of a UINT8 */
-#define BTA_HH_GET_LE_DEV_HDL(x) (UINT8)(((x) + 1) << 4)
+/* convert a GATT connection ID to HID device handle, it is the hi 4 bits of a uint8_t */
+#define BTA_HH_GET_LE_DEV_HDL(x) (uint8_t)(((x) + 1) << 4)
/* check to see if th edevice handle is a LE device handle */
#define BTA_HH_IS_LE_DEV_HDL(x) ((x) & 0xf0)
#define BTA_HH_IS_LE_DEV_HDL_VALID(x) (((x)>>4) <= BTA_HH_LE_MAX_KNOWN)
@@ -239,19 +239,19 @@
{
tBTA_HH_DEV_DSCP_INFO dscp_info; /* report descriptor and DI information */
BD_ADDR addr; /* BD-Addr of the HID device */
- UINT16 attr_mask; /* attribute mask */
- UINT16 w4_evt; /* W4_handshake event name */
- UINT8 index; /* index number referenced to handle index */
- UINT8 sub_class; /* Cod sub class */
- UINT8 sec_mask; /* security mask */
- UINT8 app_id; /* application ID for this connection */
- UINT8 hid_handle; /* device handle : low 4 bits for regular HID: HID_HOST_MAX_DEVICES can not exceed 15;
+ uint16_t attr_mask; /* attribute mask */
+ uint16_t w4_evt; /* W4_handshake event name */
+ uint8_t index; /* index number referenced to handle index */
+ uint8_t sub_class; /* Cod sub class */
+ uint8_t sec_mask; /* security mask */
+ uint8_t app_id; /* application ID for this connection */
+ uint8_t hid_handle; /* device handle : low 4 bits for regular HID: HID_HOST_MAX_DEVICES can not exceed 15;
high 4 bits for LE HID: GATT_MAX_PHY_CHANNEL can not exceed 15 */
- BOOLEAN vp; /* virtually unplug flag */
- BOOLEAN in_use; /* control block currently in use */
- BOOLEAN incoming_conn; /* is incoming connection? */
- UINT8 incoming_hid_handle; /* temporary handle for incoming connection? */
- BOOLEAN opened; /* TRUE if device successfully opened HID connection */
+ bool vp; /* virtually unplug flag */
+ bool in_use; /* control block currently in use */
+ bool incoming_conn; /* is incoming connection? */
+ uint8_t incoming_hid_handle; /* temporary handle for incoming connection? */
+ bool opened; /* true if device successfully opened HID connection */
tBTA_HH_PROTO_MODE mode; /* protocol mode */
tBTA_HH_STATE state; /* CB state */
@@ -261,33 +261,33 @@
#define BTA_HH_LE_DISC_DIS 0x02
#define BTA_HH_LE_DISC_SCPS 0x04
- UINT8 disc_active;
+ uint8_t disc_active;
tBTA_HH_STATUS status;
tBTA_GATT_REASON reason;
- BOOLEAN is_le_device;
+ bool is_le_device;
tBTA_HH_LE_HID_SRVC hid_srvc;
- UINT16 conn_id;
- BOOLEAN in_bg_conn;
- UINT8 clt_cfg_idx;
- UINT16 scan_refresh_char_handle;
- BOOLEAN scps_supported;
+ uint16_t conn_id;
+ bool in_bg_conn;
+ uint8_t clt_cfg_idx;
+ uint16_t scan_refresh_char_handle;
+ bool scps_supported;
#define BTA_HH_LE_SCPS_NOTIFY_NONE 0
#define BTA_HH_LE_SCPS_NOTIFY_SPT 0x01
#define BTA_HH_LE_SCPS_NOTIFY_ENB 0x02
- UINT8 scps_notify; /* scan refresh supported/notification enabled */
+ uint8_t scps_notify; /* scan refresh supported/notification enabled */
#endif
- BOOLEAN security_pending;
+ bool security_pending;
} tBTA_HH_DEV_CB;
/* key board parsing control block */
typedef struct
{
- BOOLEAN mod_key[4]; /* ctrl, shift(upper), Alt, GUI */
- BOOLEAN num_lock;
- BOOLEAN caps_lock;
- UINT8 last_report[BTA_HH_MAX_RPT_CHARS];
+ bool mod_key[4]; /* ctrl, shift(upper), Alt, GUI */
+ bool num_lock;
+ bool caps_lock;
+ uint8_t last_report[BTA_HH_MAX_RPT_CHARS];
} tBTA_HH_KB_CB;
/******************************************************************************
@@ -302,21 +302,21 @@
tBTA_HH_DEV_CB kdev[BTA_HH_MAX_DEVICE]; /* device control block */
tBTA_HH_DEV_CB* p_cur; /* current device control
block idx, used in sdp */
- UINT8 cb_index[BTA_HH_MAX_KNOWN]; /* maintain a CB index
+ uint8_t cb_index[BTA_HH_MAX_KNOWN]; /* maintain a CB index
map to dev handle */
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
- UINT8 le_cb_index[BTA_HH_MAX_DEVICE]; /* maintain a CB index map to LE dev handle */
+#if (BTA_HH_LE_INCLUDED == TRUE)
+ uint8_t le_cb_index[BTA_HH_MAX_DEVICE]; /* maintain a CB index map to LE dev handle */
tBTA_GATTC_IF gatt_if;
#endif
tBTA_HH_CBACK *p_cback; /* Application callbacks */
tSDP_DISCOVERY_DB* p_disc_db;
- UINT8 trace_level; /* tracing level */
- UINT8 cnt_num; /* connected device number */
- BOOLEAN w4_disable; /* w4 disable flag */
+ uint8_t trace_level; /* tracing level */
+ uint8_t cnt_num; /* connected device number */
+ bool w4_disable; /* w4 disable flag */
}
tBTA_HH_CB;
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_HH_CB bta_hh_cb;
#else
extern tBTA_HH_CB *bta_hh_cb_ptr;
@@ -329,8 +329,8 @@
/*****************************************************************************
** Function prototypes
*****************************************************************************/
-extern BOOLEAN bta_hh_hdl_event(BT_HDR *p_msg);
-extern void bta_hh_sm_execute(tBTA_HH_DEV_CB *p_cb, UINT16 event,
+extern bool bta_hh_hdl_event(BT_HDR *p_msg);
+extern void bta_hh_sm_execute(tBTA_HH_DEV_CB *p_cb, uint16_t event,
tBTA_HH_DATA *p_data);
/* action functions */
@@ -349,41 +349,41 @@
extern void bta_hh_open_failure(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data);
/* utility functions */
-extern UINT8 bta_hh_find_cb(BD_ADDR bda);
+extern uint8_t bta_hh_find_cb(BD_ADDR bda);
extern void bta_hh_parse_keybd_rpt(tBTA_HH_BOOT_RPT *p_kb_data,
- UINT8 *p_report, UINT16 report_len);
+ uint8_t *p_report, uint16_t report_len);
extern void bta_hh_parse_mice_rpt(tBTA_HH_BOOT_RPT *p_kb_data,
- UINT8 *p_report, UINT16 report_len);
-extern BOOLEAN bta_hh_tod_spt(tBTA_HH_DEV_CB *p_cb,UINT8 sub_class);
+ uint8_t *p_report, uint16_t report_len);
+extern bool bta_hh_tod_spt(tBTA_HH_DEV_CB *p_cb,uint8_t sub_class);
extern void bta_hh_clean_up_kdev(tBTA_HH_DEV_CB *p_cb);
-extern void bta_hh_add_device_to_list(tBTA_HH_DEV_CB *p_cb, UINT8 handle,
- UINT16 attr_mask,
+extern void bta_hh_add_device_to_list(tBTA_HH_DEV_CB *p_cb, uint8_t handle,
+ uint16_t attr_mask,
tHID_DEV_DSCP_INFO *p_dscp_info,
- UINT8 sub_class, UINT16 max_latency, UINT16 min_tout, UINT8 app_id);
-extern void bta_hh_update_di_info(tBTA_HH_DEV_CB *p_cb, UINT16 vendor_id, UINT16 product_id,
- UINT16 version, UINT8 flag);
+ uint8_t sub_class, uint16_t max_latency, uint16_t min_tout, uint8_t app_id);
+extern void bta_hh_update_di_info(tBTA_HH_DEV_CB *p_cb, uint16_t vendor_id, uint16_t product_id,
+ uint16_t version, uint8_t flag);
extern void bta_hh_cleanup_disable(tBTA_HH_STATUS status);
-extern UINT8 bta_hh_dev_handle_to_cb_idx(UINT8 dev_handle);
+extern uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle);
/* action functions used outside state machine */
extern void bta_hh_api_enable(tBTA_HH_DATA *p_data);
extern void bta_hh_api_disable(void);
extern void bta_hh_disc_cmpl(void);
-extern tBTA_HH_STATUS bta_hh_read_ssr_param(BD_ADDR bd_addr, UINT16 *p_max_ssr_lat, UINT16 *p_min_ssr_tout);
+extern tBTA_HH_STATUS bta_hh_read_ssr_param(BD_ADDR bd_addr, uint16_t *p_max_ssr_lat, uint16_t *p_min_ssr_tout);
/* functions for LE HID */
extern void bta_hh_le_enable(void);
-extern BOOLEAN bta_hh_le_is_hh_gatt_if(tBTA_GATTC_IF client_if);
+extern bool bta_hh_le_is_hh_gatt_if(tBTA_GATTC_IF client_if);
extern void bta_hh_le_deregister(void);
-extern BOOLEAN bta_hh_is_le_device(tBTA_HH_DEV_CB *p_cb, BD_ADDR remote_bda);
+extern bool bta_hh_is_le_device(tBTA_HH_DEV_CB *p_cb, BD_ADDR remote_bda);
extern void bta_hh_le_open_conn(tBTA_HH_DEV_CB *p_cb, BD_ADDR remote_bda);
extern void bta_hh_le_api_disc_act(tBTA_HH_DEV_CB *p_cb);
extern void bta_hh_le_get_dscp_act(tBTA_HH_DEV_CB *p_cb);
extern void bta_hh_le_write_dev_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data);
-extern UINT8 bta_hh_le_add_device(tBTA_HH_DEV_CB *p_cb, tBTA_HH_MAINT_DEV *p_dev_info);
+extern uint8_t bta_hh_le_add_device(tBTA_HH_DEV_CB *p_cb, tBTA_HH_MAINT_DEV *p_dev_info);
extern void bta_hh_le_remove_dev_bg_conn(tBTA_HH_DEV_CB *p_cb);
extern void bta_hh_le_open_fail(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data);
extern void bta_hh_gatt_open(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data);
@@ -402,7 +402,7 @@
extern void bta_hh_le_notify_enc_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data);
extern void bta_hh_ci_load_rpt (tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf);
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
extern void bta_hh_trace_dev_db(void);
#endif
diff --git a/bta/hh/bta_hh_le.cc b/bta/hh/bta_hh_le.cc
index 1a8afbe..752237d 100644
--- a/bta/hh/bta_hh_le.cc
+++ b/bta/hh/bta_hh_le.cc
@@ -21,7 +21,7 @@
#include "bta_api.h"
#include "bta_hh_int.h"
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
#include <string.h>
@@ -44,7 +44,7 @@
using std::vector;
#ifndef BTA_HH_LE_RECONN
-#define BTA_HH_LE_RECONN TRUE
+#define BTA_HH_LE_RECONN true
#endif
#define BTA_HH_APP_ID_LE 0xff
@@ -55,7 +55,7 @@
#define BTA_HH_LE_PROTO_REPORT_MODE 0x01
#define BTA_LE_HID_RTP_UUID_MAX 5
-static const UINT16 bta_hh_uuid_to_rtp_type[BTA_LE_HID_RTP_UUID_MAX][2] =
+static const uint16_t bta_hh_uuid_to_rtp_type[BTA_LE_HID_RTP_UUID_MAX][2] =
{
{GATT_UUID_HID_REPORT, BTA_HH_RPTT_INPUT},
{GATT_UUID_HID_BT_KB_INPUT, BTA_HH_RPTT_INPUT},
@@ -66,11 +66,11 @@
static void bta_hh_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC *p_data);
-static void bta_hh_le_add_dev_bg_conn(tBTA_HH_DEV_CB *p_cb, BOOLEAN check_bond);
+static void bta_hh_le_add_dev_bg_conn(tBTA_HH_DEV_CB *p_cb, bool check_bond);
//TODO(jpawlowski): uncomment when fixed
// static void bta_hh_process_cache_rpt (tBTA_HH_DEV_CB *p_cb,
// tBTA_HH_RPT_CACHE_ENTRY *p_rpt_cache,
-// UINT8 num_rpt);
+// uint8_t num_rpt);
#define GATT_READ_CHAR 0
#define GATT_READ_DESC 1
@@ -79,8 +79,8 @@
/* Holds pending GATT operations */
struct gatt_operation {
- UINT8 type;
- UINT16 handle;
+ uint8_t type;
+ uint16_t handle;
/* write-specific fields */
tBTA_GATTC_WRITE_TYPE write_type;
@@ -101,7 +101,7 @@
gatt_op_queue_executing.erase(conn_id);
}
-static void gatt_execute_next_op(UINT16 conn_id) {
+static void gatt_execute_next_op(uint16_t conn_id) {
APPL_TRACE_DEBUG("%s:", __func__, conn_id);
if (gatt_op_queue.empty()) {
APPL_TRACE_DEBUG("%s: op queue is empty", __func__);
@@ -147,7 +147,7 @@
gatt_ops.pop_front();
}
-static void gatt_queue_read_op(UINT8 op_type, UINT16 conn_id, UINT16 handle) {
+static void gatt_queue_read_op(uint8_t op_type, uint16_t conn_id, uint16_t handle) {
gatt_operation op;
op.type = op_type;
op.handle = handle;
@@ -155,7 +155,7 @@
gatt_execute_next_op(conn_id);
}
-static void gatt_queue_write_op(UINT8 op_type, UINT16 conn_id, UINT16 handle,
+static void gatt_queue_write_op(uint8_t op_type, uint16_t conn_id, uint16_t handle,
vector<uint8_t> value,
tBTA_GATTC_WRITE_TYPE write_type) {
gatt_operation op;
@@ -168,7 +168,7 @@
gatt_execute_next_op(conn_id);
}
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
static const char *bta_hh_le_rpt_name[4] =
{
"UNKNOWN",
@@ -232,7 +232,7 @@
** Returns void
**
*******************************************************************************/
-static const char *bta_hh_uuid_to_str(UINT16 uuid)
+static const char *bta_hh_uuid_to_str(uint16_t uuid)
{
switch(uuid)
{
@@ -278,7 +278,7 @@
{
char app_name[LEN_UUID_128 + 1];
tBT_UUID app_uuid = {LEN_UUID_128,{0}};
- UINT8 xx;
+ uint8_t xx;
bta_hh_cb.gatt_if = BTA_GATTS_INVALID_IF;
@@ -330,7 +330,7 @@
** Returns whether it is HH GATT IF
**
*******************************************************************************/
-BOOLEAN bta_hh_le_is_hh_gatt_if(tBTA_GATTC_IF client_if)
+bool bta_hh_le_is_hh_gatt_if(tBTA_GATTC_IF client_if)
{
return (bta_hh_cb.gatt_if == client_if);
}
@@ -359,7 +359,7 @@
** Parameters:
**
*******************************************************************************/
-BOOLEAN bta_hh_is_le_device(tBTA_HH_DEV_CB *p_cb, BD_ADDR remote_bda)
+bool bta_hh_is_le_device(tBTA_HH_DEV_CB *p_cb, BD_ADDR remote_bda)
{
p_cb->is_le_device = BTM_UseLeLink (remote_bda);
@@ -381,9 +381,9 @@
p_cb->hid_handle = BTA_HH_GET_LE_DEV_HDL(p_cb->index);
memcpy(p_cb->addr, remote_bda, BD_ADDR_LEN);
bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(p_cb->hid_handle)] = p_cb->index;
- p_cb->in_use = TRUE;
+ p_cb->in_use = true;
- BTA_GATTC_Open(bta_hh_cb.gatt_if, remote_bda, TRUE, BTA_GATT_TRANSPORT_LE);
+ BTA_GATTC_Open(bta_hh_cb.gatt_if, remote_bda, true, BTA_GATT_TRANSPORT_LE);
}
/*******************************************************************************
@@ -393,9 +393,9 @@
** Description Utility function find a device control block by connection ID.
**
*******************************************************************************/
-tBTA_HH_DEV_CB * bta_hh_le_find_dev_cb_by_conn_id(UINT16 conn_id)
+tBTA_HH_DEV_CB * bta_hh_le_find_dev_cb_by_conn_id(uint16_t conn_id)
{
- UINT8 i;
+ uint8_t i;
tBTA_HH_DEV_CB *p_dev_cb = &bta_hh_cb.kdev[0];
for (i = 0; i < BTA_HH_MAX_DEVICE; i ++, p_dev_cb ++)
@@ -415,7 +415,7 @@
*******************************************************************************/
tBTA_HH_DEV_CB * bta_hh_le_find_dev_cb_by_bda(BD_ADDR bda)
{
- UINT8 i;
+ uint8_t i;
tBTA_HH_DEV_CB *p_dev_cb = &bta_hh_cb.kdev[0];
for (i = 0; i < BTA_HH_MAX_DEVICE; i ++, p_dev_cb ++)
@@ -434,7 +434,7 @@
** Description find HID service instance ID by battery service instance ID
**
*******************************************************************************/
-UINT8 bta_hh_le_find_service_inst_by_battery_inst_id(tBTA_HH_DEV_CB *p_cb, UINT8 ba_inst_id)
+uint8_t bta_hh_le_find_service_inst_by_battery_inst_id(tBTA_HH_DEV_CB *p_cb, uint8_t ba_inst_id)
{
if (p_cb->hid_srvc.in_use &&
p_cb->hid_srvc.incl_srvc_inst == ba_inst_id)
@@ -453,12 +453,12 @@
**
*******************************************************************************/
tBTA_HH_LE_RPT * bta_hh_le_find_report_entry(tBTA_HH_DEV_CB *p_cb,
- UINT8 srvc_inst_id, /* service instance ID */
- UINT16 rpt_uuid,
- UINT8 char_inst_id)
+ uint8_t srvc_inst_id, /* service instance ID */
+ uint16_t rpt_uuid,
+ uint8_t char_inst_id)
{
- UINT8 i;
- UINT8 hid_inst_id = srvc_inst_id;
+ uint8_t i;
+ uint8_t hid_inst_id = srvc_inst_id;
tBTA_HH_LE_RPT *p_rpt;
if (rpt_uuid == GATT_UUID_BATTERY_LEVEL)
@@ -494,13 +494,13 @@
** Returns void
**
*******************************************************************************/
-tBTA_HH_LE_RPT * bta_hh_le_find_rpt_by_idtype(tBTA_HH_LE_RPT*p_head, UINT8 mode,
- tBTA_HH_RPT_TYPE r_type, UINT8 rpt_id)
+tBTA_HH_LE_RPT * bta_hh_le_find_rpt_by_idtype(tBTA_HH_LE_RPT*p_head, uint8_t mode,
+ tBTA_HH_RPT_TYPE r_type, uint8_t rpt_id)
{
tBTA_HH_LE_RPT *p_rpt = p_head;
- UINT8 i;
+ uint8_t i;
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_le_find_rpt_by_idtype: r_type: %d rpt_id: %d", r_type, rpt_id);
#endif
@@ -531,11 +531,11 @@
**
*******************************************************************************/
tBTA_HH_LE_RPT * bta_hh_le_find_alloc_report_entry(tBTA_HH_DEV_CB *p_cb,
- UINT8 srvc_inst_id,
- UINT16 rpt_uuid,
- UINT8 inst_id)
+ uint8_t srvc_inst_id,
+ uint16_t rpt_uuid,
+ uint8_t inst_id)
{
- UINT8 i, hid_inst_id = srvc_inst_id;
+ uint8_t i, hid_inst_id = srvc_inst_id;
tBTA_HH_LE_RPT *p_rpt;
if (rpt_uuid == GATT_UUID_BATTERY_LEVEL)
@@ -556,7 +556,7 @@
{
if (!p_rpt->in_use)
{
- p_rpt->in_use = TRUE;
+ p_rpt->in_use = true;
p_rpt->index = i;
p_rpt->srvc_inst_id = srvc_inst_id;
p_rpt->char_inst_id = inst_id;
@@ -585,9 +585,9 @@
return NULL;
}
-static tBTA_GATTC_DESCRIPTOR *find_descriptor_by_short_uuid(UINT16 conn_id,
- UINT16 char_handle,
- UINT16 short_uuid) {
+static tBTA_GATTC_DESCRIPTOR *find_descriptor_by_short_uuid(uint16_t conn_id,
+ uint16_t char_handle,
+ uint16_t short_uuid) {
const tBTA_GATTC_CHARACTERISTIC *p_char =
BTA_GATTC_GetCharacteristic(conn_id, char_handle);
@@ -618,7 +618,7 @@
** Description read characteristic descriptor
**
*******************************************************************************/
-static tBTA_HH_STATUS bta_hh_le_read_char_dscrpt(tBTA_HH_DEV_CB *p_cb, UINT16 char_handle, UINT16 short_uuid)
+static tBTA_HH_STATUS bta_hh_le_read_char_dscrpt(tBTA_HH_DEV_CB *p_cb, uint16_t char_handle, uint16_t short_uuid)
{
const tBTA_GATTC_DESCRIPTOR *p_desc = find_descriptor_by_short_uuid(p_cb->conn_id, char_handle, short_uuid);
if (!p_desc)
@@ -644,7 +644,7 @@
if (p_data->status == BTA_GATT_OK &&
p_data->p_value && p_data->p_value->len == 2)
{
- UINT8 *pp = p_data->p_value->p_value;
+ uint8_t *pp = p_data->p_value->p_value;
STREAM_TO_UINT8(p_rpt->rpt_id, pp);
STREAM_TO_UINT8(p_rpt->rpt_type, pp);
@@ -652,7 +652,7 @@
if (p_rpt->rpt_type > BTA_HH_RPTT_FEATURE) /* invalid report type */
p_rpt->rpt_type = BTA_HH_RPTT_RESRV;
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("%s: report ID: %d", __func__, p_rpt->rpt_id);
#endif
tBTA_HH_RPT_CACHE_ENTRY rpt_entry;
@@ -697,10 +697,10 @@
assume it's a 16 bits UUID */
if (p_data->status == BTA_GATT_OK &&
p_data->p_value && p_data->p_value->len == 2) {
- UINT8 *pp = p_data->p_value->p_value;
+ uint8_t *pp = p_data->p_value->p_value;
STREAM_TO_UINT16(p_dev_cb->hid_srvc.ext_rpt_ref, pp);
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("%s: External Report Reference UUID 0x%04x", __func__,
p_dev_cb->hid_srvc.ext_rpt_ref);
#endif
@@ -717,11 +717,11 @@
** Parameters:
**
*******************************************************************************/
-void bta_hh_le_register_input_notif(tBTA_HH_DEV_CB *p_dev_cb, UINT8 proto_mode, BOOLEAN register_ba)
+void bta_hh_le_register_input_notif(tBTA_HH_DEV_CB *p_dev_cb, uint8_t proto_mode, bool register_ba)
{
tBTA_HH_LE_RPT *p_rpt = &p_dev_cb->hid_srvc.report[0];
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("%s: bta_hh_le_register_input_notif mode: %d", __func__, proto_mode);
#endif
@@ -790,16 +790,16 @@
{
if ( p_cb->disc_active == BTA_HH_LE_DISC_NONE)
{
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
bta_hh_le_hid_report_dbg(p_cb);
#endif
- bta_hh_le_register_input_notif(p_cb, p_cb->mode, TRUE);
+ bta_hh_le_register_input_notif(p_cb, p_cb->mode, true);
bta_hh_sm_execute(p_cb, BTA_HH_OPEN_CMPL_EVT, NULL);
#if (BTA_HH_LE_RECONN == TRUE)
if (p_cb->status == BTA_HH_OK)
{
- bta_hh_le_add_dev_bg_conn(p_cb, TRUE);
+ bta_hh_le_add_dev_bg_conn(p_cb, true);
}
#endif
}
@@ -813,14 +813,14 @@
** a characteristic
**
*******************************************************************************/
-BOOLEAN bta_hh_le_write_char_clt_cfg(tBTA_HH_DEV_CB *p_cb,
- UINT8 char_handle,
- UINT16 clt_cfg_value)
+bool bta_hh_le_write_char_clt_cfg(tBTA_HH_DEV_CB *p_cb,
+ uint8_t char_handle,
+ uint16_t clt_cfg_value)
{
tBTA_GATTC_DESCRIPTOR *p_desc = find_descriptor_by_short_uuid(p_cb->conn_id,
char_handle, GATT_UUID_CHAR_CLIENT_CONFIG);
if (!p_desc)
- return FALSE;
+ return false;
vector<uint8_t> value(2);
uint8_t* ptr = value.data();
@@ -828,7 +828,7 @@
gatt_queue_write_op(GATT_WRITE_DESC, p_cb->conn_id, p_desc->handle,
std::move(value), BTA_GATTC_TYPE_WRITE);
- return TRUE;
+ return true;
}
/*******************************************************************************
@@ -839,9 +839,9 @@
** enable all input notification upon connection open.
**
*******************************************************************************/
-BOOLEAN bta_hh_le_write_rpt_clt_cfg(tBTA_HH_DEV_CB *p_cb, UINT8 srvc_inst_id)
+bool bta_hh_le_write_rpt_clt_cfg(tBTA_HH_DEV_CB *p_cb, uint8_t srvc_inst_id)
{
- UINT8 i;
+ uint8_t i;
tBTA_HH_LE_RPT *p_rpt = &p_cb->hid_srvc.report[p_cb->clt_cfg_idx];
for (i = p_cb->clt_cfg_idx; i < BTA_HH_LE_RPT_MAX && p_rpt->in_use; i ++, p_rpt ++)
@@ -854,7 +854,7 @@
BTA_GATT_CLT_CONFIG_NOTIFICATION))
{
p_cb->clt_cfg_idx = i;
- return TRUE;
+ return true;
}
}
}
@@ -867,7 +867,7 @@
bta_hh_le_open_cmpl(p_cb);
}
- return FALSE;
+ return false;
}
/*******************************************************************************
@@ -877,7 +877,7 @@
** Description Set remote device protocol mode.
**
*******************************************************************************/
-BOOLEAN bta_hh_le_set_protocol_mode(tBTA_HH_DEV_CB *p_cb, tBTA_HH_PROTO_MODE mode)
+bool bta_hh_le_set_protocol_mode(tBTA_HH_DEV_CB *p_cb, tBTA_HH_PROTO_MODE mode)
{
tBTA_HH_CBDATA cback_data;
@@ -898,7 +898,7 @@
else
{
/* if set to report mode, need to de-register all input report notification */
- bta_hh_le_register_input_notif(p_cb, p_cb->mode, FALSE);
+ bta_hh_le_register_input_notif(p_cb, p_cb->mode, false);
cback_data.status = BTA_HH_OK;
}
if (p_cb->state == BTA_HH_W4_CONN_ST)
@@ -968,7 +968,7 @@
/* plug in the PnP info for this device */
if (p_dis_value->attr_mask & DIS_ATTR_PNP_ID_BIT)
{
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("Plug in PnP info: product_id = %02x, vendor_id = %04x, version = %04x",
p_dis_value->pnp_id.product_id,
p_dis_value->pnp_id.vendor_id,
@@ -1026,7 +1026,7 @@
void bta_hh_le_encrypt_cback(BD_ADDR bd_addr, tBTA_GATT_TRANSPORT transport,
void *p_ref_data, tBTM_STATUS result)
{
- UINT8 idx = bta_hh_find_cb(bd_addr);
+ uint8_t idx = bta_hh_find_cb(bd_addr);
tBTA_HH_DEV_CB *p_dev_cb;
UNUSED(p_ref_data);
UNUSED (transport);
@@ -1068,7 +1068,7 @@
/* start loading the cache if not in stack */
//TODO(jpawlowski): cache storage is broken, fix it
// tBTA_HH_RPT_CACHE_ENTRY *p_rpt_cache;
- // UINT8 num_rpt = 0;
+ // uint8_t num_rpt = 0;
// if ((p_rpt_cache = bta_hh_le_co_cache_load(p_cb->addr, &num_rpt, p_cb->app_id)) != NULL)
// {
// bta_hh_process_cache_rpt(p_cb, p_rpt_cache, num_rpt);
@@ -1079,7 +1079,7 @@
{
APPL_TRACE_DEBUG("%s: discovery has been done for HID service", __func__);
/* configure protocol mode */
- if (bta_hh_le_set_protocol_mode(p_cb, p_cb->mode) == FALSE)
+ if (bta_hh_le_set_protocol_mode(p_cb, p_cb->mode) == false)
{
bta_hh_le_open_cmpl(p_cb);
}
@@ -1094,7 +1094,7 @@
else
{
APPL_TRACE_ERROR("%s() - encryption failed; status=0x%04x, reason=0x%04x",
- __FUNCTION__, p_cb->status, p_cb->reason);
+ __func__, p_cb->status, p_cb->reason);
if (!(p_cb->status == BTA_HH_ERR_SEC && p_cb->reason == BTM_ERR_PROCESSING))
bta_hh_le_api_disc_act(p_cb);
}
@@ -1111,13 +1111,13 @@
*******************************************************************************/
void bta_hh_le_notify_enc_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf)
{
- if (p_cb == NULL || p_cb->security_pending == FALSE ||
+ if (p_cb == NULL || p_cb->security_pending == false ||
p_buf == NULL || p_buf->le_enc_cmpl.client_if != bta_hh_cb.gatt_if)
{
return;
}
- p_cb->security_pending = FALSE;
+ p_cb->security_pending = false;
bta_hh_start_security(p_cb, NULL);
}
@@ -1152,7 +1152,7 @@
*******************************************************************************/
void bta_hh_start_security(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf)
{
- UINT8 sec_flag=0;
+ uint8_t sec_flag=0;
tBTM_SEC_DEV_REC *p_dev_rec;
UNUSED(p_buf);
@@ -1163,7 +1163,7 @@
p_dev_rec->sec_state == BTM_SEC_STATE_AUTHENTICATING)
{
/* if security collision happened, wait for encryption done */
- p_cb->security_pending = TRUE;
+ p_cb->security_pending = true;
return;
}
}
@@ -1212,7 +1212,7 @@
void bta_hh_gatt_open(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf)
{
tBTA_GATTC_OPEN *p_data = &p_buf->le_open;
- UINT8 *p2;
+ uint8_t *p2;
tHID_STATUS status = BTA_HH_ERR;
/* if received invalid callback data , ignore it */
@@ -1227,8 +1227,8 @@
if (p_data->status == BTA_GATT_OK)
{
- p_cb->is_le_device = TRUE;
- p_cb->in_use = TRUE;
+ p_cb->is_le_device = true;
+ p_cb->in_use = true;
p_cb->conn_id = p_data->conn_id;
p_cb->hid_handle = BTA_HH_GET_LE_DEV_HDL(p_cb->index);
@@ -1236,7 +1236,7 @@
gatt_op_queue_clean(p_cb->conn_id);
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("hid_handle = %2x conn_id = %04x cb_index = %d", p_cb->hid_handle, p_cb->conn_id, p_cb->index);
#endif
@@ -1263,18 +1263,18 @@
void bta_hh_le_close(tBTA_GATTC_CLOSE * p_data)
{
tBTA_HH_DEV_CB *p_dev_cb = bta_hh_le_find_dev_cb_by_bda(p_data->remote_bda);
- UINT16 sm_event = BTA_HH_GATT_CLOSE_EVT;
+ uint16_t sm_event = BTA_HH_GATT_CLOSE_EVT;
if (p_dev_cb != NULL) {
tBTA_HH_LE_CLOSE *p_buf =
(tBTA_HH_LE_CLOSE *)osi_malloc(sizeof(tBTA_HH_LE_CLOSE));
p_buf->hdr.event = sm_event;
- p_buf->hdr.layer_specific = (UINT16)p_dev_cb->hid_handle;
+ p_buf->hdr.layer_specific = (uint16_t)p_dev_cb->hid_handle;
p_buf->conn_id = p_data->conn_id;
p_buf->reason = p_data->reason;
p_dev_cb->conn_id = BTA_GATT_INVALID_CONN_ID;
- p_dev_cb->security_pending = FALSE;
+ p_dev_cb->security_pending = false;
bta_sys_sendmsg(p_buf);
}
}
@@ -1471,7 +1471,7 @@
have_hid = true;
/* found HID primamry service */
- p_dev_cb->hid_srvc.in_use = TRUE;
+ p_dev_cb->hid_srvc.in_use = true;
p_dev_cb->hid_srvc.srvc_inst_id = service->handle;
p_dev_cb->hid_srvc.proto_mode_handle = 0;
p_dev_cb->hid_srvc.control_point_handle = 0;
@@ -1528,11 +1528,11 @@
** Parameters:
**
*******************************************************************************/
-void bta_hh_read_battery_level_cmpl(UINT8 status, tBTA_HH_DEV_CB *p_dev_cb, tBTA_GATTC_READ *p_data)
+void bta_hh_read_battery_level_cmpl(uint8_t status, tBTA_HH_DEV_CB *p_dev_cb, tBTA_GATTC_READ *p_data)
{
UNUSED(status);
UNUSED(p_data);
- p_dev_cb->hid_srvc.expl_incl_srvc = TRUE;
+ p_dev_cb->hid_srvc.expl_incl_srvc = true;
}
@@ -1552,11 +1552,11 @@
osi_free_and_reset((void **)&p_srvc->rpt_map);
if (p_data->p_value->len > 0)
- p_srvc->rpt_map = (UINT8 *)osi_malloc(p_data->p_value->len);
+ p_srvc->rpt_map = (uint8_t *)osi_malloc(p_data->p_value->len);
if (p_srvc->rpt_map != NULL)
{
- UINT8 *pp = p_data->p_value->p_value;
+ uint8_t *pp = p_data->p_value->p_value;
STREAM_TO_ARRAY(p_srvc->rpt_map, pp, p_data->p_value->len);
p_srvc->descriptor.dl_len = p_data->p_value->len;
p_srvc->descriptor.dsc_list = p_dev_cb->hid_srvc.rpt_map;
@@ -1578,7 +1578,7 @@
BT_HDR *p_buf = NULL;
tBTA_HH_LE_RPT *p_rpt;
tBTA_HH_HSDATA hs_data;
- UINT8 *pp ;
+ uint8_t *pp ;
if (p_dev_cb->w4_evt != BTA_HH_GET_RPT_EVT)
{
@@ -1609,7 +1609,7 @@
p_buf->offset = 0;
/* attach report ID as the first byte of the report before sending it to USB HID driver */
- pp = (UINT8*)(p_buf + 1);
+ pp = (uint8_t*)(p_buf + 1);
UINT8_TO_STREAM(pp, p_rpt->rpt_id);
memcpy(pp, p_data->p_value->p_value, p_data->p_value->len);
@@ -1652,7 +1652,7 @@
p_dev_cb->mode = hs_data.rsp_data.proto_mode;
}
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("LE GET_PROTOCOL Mode = [%s]",
(hs_data.rsp_data.proto_mode == BTA_HH_PROTO_RPT_MODE)? "Report" : "Boot");
#endif
@@ -1674,11 +1674,11 @@
void bta_hh_w4_le_read_char_cmpl(tBTA_HH_DEV_CB *p_dev_cb, tBTA_HH_DATA *p_buf)
{
tBTA_GATTC_READ * p_data = (tBTA_GATTC_READ *)p_buf;
- UINT8 *pp ;
+ uint8_t *pp ;
const tBTA_GATTC_CHARACTERISTIC *p_char = BTA_GATTC_GetCharacteristic(p_dev_cb->conn_id,
p_data->handle);
- UINT16 char_uuid = p_char->uuid.uu.uuid16;
+ uint16_t char_uuid = p_char->uuid.uu.uuid16;
if (char_uuid == GATT_UUID_BATTERY_LEVEL)
{
@@ -1687,8 +1687,8 @@
else if (char_uuid == GATT_UUID_GAP_PREF_CONN_PARAM)
{
//TODO(jpawlowski): this should be done by GAP profile, remove when GAP is fixed.
- UINT8 *pp = p_data->p_value->p_value;
- UINT16 min, max, latency, tout;
+ uint8_t *pp = p_data->p_value->p_value;
+ uint16_t min, max, latency, tout;
STREAM_TO_UINT16 (min, pp);
STREAM_TO_UINT16 (max, pp);
STREAM_TO_UINT16 (latency, pp);
@@ -1727,7 +1727,7 @@
return;
default:
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_ERROR("Unexpected read %s(0x%04x)",
bta_hh_uuid_to_str(char_uuid), char_uuid);
#endif
@@ -1736,7 +1736,7 @@
}
else
{
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_ERROR("read uuid %s[0x%04x] error: %d", bta_hh_uuid_to_str(char_uuid),
char_uuid, p_data->status);
#else
@@ -1762,7 +1762,7 @@
const tBTA_GATTC_CHARACTERISTIC *p_char = BTA_GATTC_GetCharacteristic(p_dev_cb->conn_id,
p_data->handle);
- UINT16 char_uuid = p_char->uuid.uu.uuid16;
+ uint16_t char_uuid = p_char->uuid.uu.uuid16;
switch (char_uuid)
{
@@ -1799,7 +1799,7 @@
{
tBTA_HH_LE_RPT *p_rpt;
tBTA_GATTC_READ * p_data = (tBTA_GATTC_READ *)p_buf;
- UINT8 *pp;
+ uint8_t *pp;
const tBTA_GATTC_DESCRIPTOR *p_desc = BTA_GATTC_GetDescriptor(p_data->conn_id, p_data->handle);
@@ -1832,7 +1832,7 @@
{
tBTA_HH_LE_RPT *p_rpt;
tBTA_GATTC_READ * p_data = (tBTA_GATTC_READ *)p_buf;
- UINT16 char_uuid16;
+ uint16_t char_uuid16;
if (p_data == NULL)
return;
@@ -1846,7 +1846,7 @@
char_uuid16 = p_desc->characteristic->uuid.uu.uuid16;
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_w4_le_read_descr_cmpl uuid: %s(0x%04x)",
bta_hh_uuid_to_str(p_desc->uuid.uu.uuid16),
p_desc->uuid.uu.uuid16);
@@ -1921,7 +1921,7 @@
{
tBTA_GATTC_WRITE *p_data = (tBTA_GATTC_WRITE *)p_buf;
tBTA_HH_CBDATA cback_data ;
- UINT16 cb_evt = p_dev_cb->w4_evt;
+ uint16_t cb_evt = p_dev_cb->w4_evt;
if (p_data == NULL || cb_evt == 0)
return;
@@ -1929,7 +1929,7 @@
const tBTA_GATTC_CHARACTERISTIC *p_char = BTA_GATTC_GetCharacteristic(p_dev_cb->conn_id,
p_data->handle);
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_le_write_cmpl w4_evt: %d", p_dev_cb->w4_evt);
#endif
switch (p_char->uuid.uu.uuid16)
@@ -1939,7 +1939,7 @@
cback_data.handle = p_dev_cb->hid_handle;
if (p_data->status == BTA_GATT_OK)
{
- bta_hh_le_register_input_notif(p_dev_cb, p_dev_cb->mode, FALSE);
+ bta_hh_le_register_input_notif(p_dev_cb, p_dev_cb->mode, false);
cback_data.status = BTA_HH_OK;
}
else
@@ -1977,13 +1977,13 @@
void bta_hh_le_write_char_descr_cmpl(tBTA_HH_DEV_CB *p_dev_cb, tBTA_HH_DATA *p_buf)
{
tBTA_GATTC_WRITE *p_data = (tBTA_GATTC_WRITE *)p_buf;
- UINT8 srvc_inst_id, hid_inst_id;
+ uint8_t srvc_inst_id, hid_inst_id;
const tBTA_GATTC_DESCRIPTOR *p_desc = BTA_GATTC_GetDescriptor(p_dev_cb->conn_id,
p_data->handle);
- UINT16 desc_uuid = p_desc->uuid.uu.uuid16;
- UINT16 char_uuid = p_desc->characteristic->uuid.uu.uuid16;
+ uint16_t desc_uuid = p_desc->uuid.uu.uuid16;
+ uint16_t char_uuid = p_desc->characteristic->uuid.uu.uuid16;
/* only write client configuration possible */
if (desc_uuid == GATT_UUID_CHAR_CLIENT_CONFIG)
{
@@ -2011,7 +2011,7 @@
}
else
{
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_ERROR("Unexpected write to %s(0x%04x)",
bta_hh_uuid_to_str(desc_uuid), desc_uuid);
#else
@@ -2033,8 +2033,8 @@
void bta_hh_le_input_rpt_notify(tBTA_GATTC_NOTIFY *p_data)
{
tBTA_HH_DEV_CB *p_dev_cb = bta_hh_le_find_dev_cb_by_conn_id(p_data->conn_id);
- UINT8 app_id;
- UINT8 *p_buf;
+ uint8_t app_id;
+ uint8_t *p_buf;
tBTA_HH_LE_RPT *p_rpt;
if (p_dev_cb == NULL)
@@ -2068,7 +2068,7 @@
/* need to append report ID to the head of data */
if (p_rpt->rpt_id != 0)
{
- p_buf = (UINT8 *)osi_malloc(p_data->len + 1);
+ p_buf = (uint8_t *)osi_malloc(p_data->len + 1);
p_buf[0] = p_rpt->rpt_id;
memcpy(&p_buf[1], p_data->value, p_data->len);
@@ -2077,7 +2077,7 @@
p_buf = p_data->value;
}
- bta_hh_co_data((UINT8)p_dev_cb->hid_handle,
+ bta_hh_co_data((uint8_t)p_dev_cb->hid_handle,
p_buf,
p_data->len,
p_dev_cb->mode,
@@ -2113,7 +2113,7 @@
/* Failure in opening connection or GATT discovery failure */
conn_dat.handle = p_cb->hid_handle;
memcpy(conn_dat.bda, p_cb->addr, BD_ADDR_LEN);
- conn_dat.le_hid = TRUE;
+ conn_dat.le_hid = true;
conn_dat.scps_supported = p_cb->scps_supported;
if (p_cb->status == BTA_HH_OK)
@@ -2159,7 +2159,7 @@
#if (BTA_HH_LE_RECONN == TRUE)
if (p_data->le_close.reason == BTA_GATT_CONN_TIMEOUT)
{
- bta_hh_le_add_dev_bg_conn(p_cb, FALSE);
+ bta_hh_le_add_dev_bg_conn(p_cb, false);
}
#endif
}
@@ -2198,7 +2198,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hh_le_get_rpt(tBTA_HH_DEV_CB *p_cb, tBTA_HH_RPT_TYPE r_type, UINT8 rpt_id)
+void bta_hh_le_get_rpt(tBTA_HH_DEV_CB *p_cb, tBTA_HH_RPT_TYPE r_type, uint8_t rpt_id)
{
tBTA_HH_LE_RPT *p_rpt = bta_hh_le_find_rpt_by_idtype(p_cb->hid_srvc.report, p_cb->mode, r_type, rpt_id);
@@ -2222,10 +2222,10 @@
*******************************************************************************/
void bta_hh_le_write_rpt(tBTA_HH_DEV_CB *p_cb,
tBTA_HH_RPT_TYPE r_type,
- BT_HDR *p_buf, UINT16 w4_evt )
+ BT_HDR *p_buf, uint16_t w4_evt )
{
tBTA_HH_LE_RPT *p_rpt;
- UINT8 rpt_id;
+ uint8_t rpt_id;
if (p_buf == NULL || p_buf->len == 0)
{
@@ -2234,7 +2234,7 @@
}
/* strip report ID from the data */
- uint8_t *vec_start = (UINT8 *)(p_buf + 1) + p_buf->offset;
+ uint8_t *vec_start = (uint8_t *)(p_buf + 1) + p_buf->offset;
STREAM_TO_UINT8(rpt_id, vec_start);
vector<uint8_t> value(vec_start, vec_start + p_buf->len - 1);
@@ -2364,10 +2364,10 @@
** Returns void
**
*******************************************************************************/
-static void bta_hh_le_add_dev_bg_conn(tBTA_HH_DEV_CB *p_cb, BOOLEAN check_bond)
+static void bta_hh_le_add_dev_bg_conn(tBTA_HH_DEV_CB *p_cb, bool check_bond)
{
- UINT8 sec_flag=0;
- BOOLEAN to_add = TRUE;
+ uint8_t sec_flag=0;
+ bool to_add = true;
if (check_bond)
{
@@ -2376,15 +2376,15 @@
BTM_GetSecurityFlagsByTransport(p_cb->addr, &sec_flag, BT_TRANSPORT_LE);
if ((sec_flag & BTM_SEC_FLAG_LKEY_KNOWN) == 0)
- to_add = FALSE;
+ to_add = false;
}
if (/*p_cb->dscp_info.flag & BTA_HH_LE_NORMAL_CONN &&*/
!p_cb->in_bg_conn && to_add)
{
/* add device into BG connection to accept remote initiated connection */
- BTA_GATTC_Open(bta_hh_cb.gatt_if, p_cb->addr, FALSE, BTA_GATT_TRANSPORT_LE);
- p_cb->in_bg_conn = TRUE;
+ BTA_GATTC_Open(bta_hh_cb.gatt_if, p_cb->addr, false, BTA_GATT_TRANSPORT_LE);
+ p_cb->in_bg_conn = true;
BTA_DmBleSetBgConnType(BTA_DM_BLE_CONN_AUTO, NULL);
}
@@ -2401,7 +2401,7 @@
** Returns void
**
*******************************************************************************/
-UINT8 bta_hh_le_add_device(tBTA_HH_DEV_CB *p_cb, tBTA_HH_MAINT_DEV *p_dev_info)
+uint8_t bta_hh_le_add_device(tBTA_HH_DEV_CB *p_cb, tBTA_HH_MAINT_DEV *p_dev_info)
{
p_cb->hid_handle = BTA_HH_GET_LE_DEV_HDL(p_cb->index);
bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(p_cb->hid_handle)] = p_cb->index;
@@ -2422,7 +2422,7 @@
p_dev_info->dscp_info.ssr_min_tout,
p_dev_info->app_id);
- bta_hh_le_add_dev_bg_conn(p_cb, FALSE);
+ bta_hh_le_add_dev_bg_conn(p_cb, false);
return p_cb->hid_handle;
}
@@ -2440,9 +2440,9 @@
{
if (p_dev_cb->in_bg_conn)
{
- p_dev_cb->in_bg_conn = FALSE;
+ p_dev_cb->in_bg_conn = false;
- BTA_GATTC_CancelOpen(bta_hh_cb.gatt_if, p_dev_cb->addr, FALSE);
+ BTA_GATTC_CancelOpen(bta_hh_cb.gatt_if, p_dev_cb->addr, false);
}
}
@@ -2458,8 +2458,8 @@
static void bta_hh_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC *p_data)
{
tBTA_HH_DEV_CB *p_dev_cb;
- UINT16 evt;
-#if BTA_HH_DEBUG
+ uint16_t evt;
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_gattc_callback event = %d", event);
#endif
if (p_data == NULL)
@@ -2542,11 +2542,11 @@
** Returns void
**
*******************************************************************************/
-void bta_hh_le_hid_read_rpt_clt_cfg(BD_ADDR bd_addr, UINT8 rpt_id)
+void bta_hh_le_hid_read_rpt_clt_cfg(BD_ADDR bd_addr, uint8_t rpt_id)
{
tBTA_HH_DEV_CB *p_cb = NULL;
tBTA_HH_LE_RPT *p_rpt ;
- UINT8 index = BTA_HH_IDX_INVALID;
+ uint8_t index = BTA_HH_IDX_INVALID;
index = bta_hh_find_cb(bd_addr);
if ((index = bta_hh_find_cb(bd_addr))== BTA_HH_IDX_INVALID)
@@ -2581,14 +2581,14 @@
//TODO(jpawlowski): uncomment when fixed
// static void bta_hh_process_cache_rpt (tBTA_HH_DEV_CB *p_cb,
// tBTA_HH_RPT_CACHE_ENTRY *p_rpt_cache,
-// UINT8 num_rpt)
+// uint8_t num_rpt)
// {
-// UINT8 i = 0;
+// uint8_t i = 0;
// tBTA_HH_LE_RPT *p_rpt;
// if (num_rpt != 0) /* no cache is found */
// {
-// p_cb->hid_srvc.in_use = TRUE;
+// p_cb->hid_srvc.in_use = true;
// /* set the descriptor info */
// p_cb->hid_srvc.descriptor.dl_len =
diff --git a/bta/hh/bta_hh_main.cc b/bta/hh/bta_hh_main.cc
index bd19659..1d565e0 100644
--- a/bta/hh/bta_hh_main.cc
+++ b/bta/hh/bta_hh_main.cc
@@ -24,7 +24,7 @@
#include "bt_target.h"
-#if defined(BTA_HH_INCLUDED) && (BTA_HH_INCLUDED == TRUE)
+#if (BTA_HH_INCLUDED == TRUE)
#include <string.h>
@@ -52,7 +52,7 @@
BTA_HH_MAINT_DEV_ACT,
BTA_HH_OPEN_CMPL_ACT,
BTA_HH_OPEN_FAILURE,
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
BTA_HH_GATT_CLOSE,
BTA_HH_LE_OPEN_FAIL,
BTA_HH_GATT_OPEN,
@@ -91,7 +91,7 @@
bta_hh_maint_dev_act,
bta_hh_open_cmpl_act,
bta_hh_open_failure
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
,bta_hh_gatt_close
,bta_hh_le_open_fail
,bta_hh_gatt_open
@@ -114,7 +114,7 @@
#define BTA_HH_NUM_COLS 2 /* number of columns */
/* state table for idle state */
-const UINT8 bta_hh_st_idle[][BTA_HH_NUM_COLS] =
+const uint8_t bta_hh_st_idle[][BTA_HH_NUM_COLS] =
{
/* Event Action Next state */
/* BTA_HH_API_OPEN_EVT */ {BTA_HH_START_SDP, BTA_HH_W4_CONN_ST },
@@ -129,7 +129,7 @@
/* BTA_HH_API_GET_DSCP_EVT */ {BTA_HH_IGNORE, BTA_HH_IDLE_ST },
/* BTA_HH_API_MAINT_DEV_EVT */ {BTA_HH_MAINT_DEV_ACT, BTA_HH_IDLE_ST },
/* BTA_HH_OPEN_CMPL_EVT */ {BTA_HH_OPEN_CMPL_ACT, BTA_HH_CONN_ST }
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
/* BTA_HH_GATT_CLOSE_EVT */ ,{BTA_HH_IGNORE, BTA_HH_IDLE_ST }
/* BTA_HH_GATT_OPEN_EVT */ ,{BTA_HH_GATT_OPEN, BTA_HH_W4_CONN_ST }
/* BTA_HH_START_ENC_EVT */ ,{BTA_HH_IGNORE, BTA_HH_IDLE_ST }
@@ -144,7 +144,7 @@
};
-const UINT8 bta_hh_st_w4_conn[][BTA_HH_NUM_COLS] =
+const uint8_t bta_hh_st_w4_conn[][BTA_HH_NUM_COLS] =
{
/* Event Action Next state */
/* BTA_HH_API_OPEN_EVT */ {BTA_HH_IGNORE, BTA_HH_W4_CONN_ST },
@@ -159,7 +159,7 @@
/* BTA_HH_API_GET_DSCP_EVT */ {BTA_HH_IGNORE, BTA_HH_W4_CONN_ST },
/* BTA_HH_API_MAINT_DEV_EVT */ {BTA_HH_MAINT_DEV_ACT, BTA_HH_IDLE_ST },
/* BTA_HH_OPEN_CMPL_EVT */ {BTA_HH_OPEN_CMPL_ACT, BTA_HH_CONN_ST }
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
/* BTA_HH_GATT_CLOSE_EVT */ ,{BTA_HH_LE_OPEN_FAIL, BTA_HH_IDLE_ST }
/* BTA_HH_GATT_OPEN_EVT */ ,{BTA_HH_GATT_OPEN, BTA_HH_W4_CONN_ST }
/* BTA_HH_START_ENC_EVT */ ,{BTA_HH_START_SEC, BTA_HH_W4_SEC }
@@ -173,7 +173,7 @@
};
-const UINT8 bta_hh_st_connected[][BTA_HH_NUM_COLS] =
+const uint8_t bta_hh_st_connected[][BTA_HH_NUM_COLS] =
{
/* Event Action Next state */
/* BTA_HH_API_OPEN_EVT */ {BTA_HH_IGNORE, BTA_HH_CONN_ST },
@@ -188,7 +188,7 @@
/* BTA_HH_API_GET_DSCP_EVT */ {BTA_HH_GET_DSCP_ACT, BTA_HH_CONN_ST },
/* BTA_HH_API_MAINT_DEV_EVT */ {BTA_HH_MAINT_DEV_ACT, BTA_HH_CONN_ST },
/* BTA_HH_OPEN_CMPL_EVT */ {BTA_HH_IGNORE, BTA_HH_CONN_ST }
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
/* BTA_HH_GATT_CLOSE_EVT */ ,{BTA_HH_GATT_CLOSE, BTA_HH_IDLE_ST }
/* BTA_HH_GATT_OPEN_EVT */ ,{BTA_HH_IGNORE, BTA_HH_CONN_ST }
/* BTA_HH_START_ENC_EVT */ ,{BTA_HH_IGNORE, BTA_HH_CONN_ST }
@@ -200,8 +200,8 @@
/* BTA_HH_GATT_ENC_CMPL_EVT */ ,{BTA_HH_IGNORE, BTA_HH_CONN_ST }
#endif
};
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
-const UINT8 bta_hh_st_w4_sec[][BTA_HH_NUM_COLS] =
+#if (BTA_HH_LE_INCLUDED == TRUE)
+const uint8_t bta_hh_st_w4_sec[][BTA_HH_NUM_COLS] =
{
/* Event Action Next state */
/* BTA_HH_API_OPEN_EVT */ {BTA_HH_IGNORE, BTA_HH_W4_SEC },
@@ -229,7 +229,7 @@
#endif
/* type for state table */
-typedef const UINT8 (*tBTA_HH_ST_TBL)[BTA_HH_NUM_COLS];
+typedef const uint8_t (*tBTA_HH_ST_TBL)[BTA_HH_NUM_COLS];
/* state table */
const tBTA_HH_ST_TBL bta_hh_st_tbl[] =
@@ -237,7 +237,7 @@
bta_hh_st_idle,
bta_hh_st_w4_conn,
bta_hh_st_connected
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
,bta_hh_st_w4_sec
#endif
};
@@ -245,13 +245,13 @@
/*****************************************************************************
** Global data
*****************************************************************************/
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_HH_CB bta_hh_cb;
#endif
/*****************************************************************************
** Static functions
*****************************************************************************/
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
static const char *bta_hh_evt_code(tBTA_HH_INT_EVT evt_code);
static const char *bta_hh_state_code(tBTA_HH_STATE state_code);
#endif
@@ -266,15 +266,15 @@
** Returns void
**
*******************************************************************************/
-void bta_hh_sm_execute(tBTA_HH_DEV_CB *p_cb, UINT16 event, tBTA_HH_DATA * p_data)
+void bta_hh_sm_execute(tBTA_HH_DEV_CB *p_cb, uint16_t event, tBTA_HH_DATA * p_data)
{
tBTA_HH_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
tBTA_HH cback_data;
tBTA_HH_EVT cback_event = 0;
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
tBTA_HH_STATE in_state ;
- UINT16 debug_event = event;
+ uint16_t debug_event = event;
#endif
memset(&cback_data, 0, sizeof(tBTA_HH));
@@ -308,7 +308,7 @@
else
{
cback_data.dev_info.status = BTA_HH_ERR_HDL;
- cback_data.dev_info.handle = (UINT8)p_data->api_maintdev.hdr.layer_specific;
+ cback_data.dev_info.handle = (uint8_t)p_data->api_maintdev.hdr.layer_specific;
}
break;
case BTA_HH_API_WRITE_DEV_EVT:
@@ -320,12 +320,12 @@
p_data->api_sndcmd.t_type == HID_TRANS_SET_IDLE)
{
cback_data.dev_status.status = BTA_HH_ERR_HDL;
- cback_data.dev_status.handle = (UINT8)p_data->api_sndcmd.hdr.layer_specific;
+ cback_data.dev_status.handle = (uint8_t)p_data->api_sndcmd.hdr.layer_specific;
}
else if (p_data->api_sndcmd.t_type != HID_TRANS_DATA &&
p_data->api_sndcmd.t_type != HID_TRANS_CONTROL)
{
- cback_data.hs_data.handle = (UINT8)p_data->api_sndcmd.hdr.layer_specific;
+ cback_data.hs_data.handle = (uint8_t)p_data->api_sndcmd.hdr.layer_specific;
cback_data.hs_data.status = BTA_HH_ERR_HDL;
/* hs_data.rsp_data will be all zero, which is not valid value */
}
@@ -343,7 +343,7 @@
cback_event = BTA_HH_CLOSE_EVT;
cback_data.dev_status.status = BTA_HH_ERR_HDL;
- cback_data.dev_status.handle = (UINT8)p_data->api_sndcmd.hdr.layer_specific;
+ cback_data.dev_status.handle = (uint8_t)p_data->api_sndcmd.hdr.layer_specific;
break;
default:
@@ -361,7 +361,7 @@
/* corresponding CB is found, go to state machine */
else
{
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
in_state = p_cb->state;
APPL_TRACE_EVENT("bta_hh_sm_execute: State 0x%02x [%s], Event [%s]",
in_state, bta_hh_state_code(in_state),
@@ -385,7 +385,7 @@
(*bta_hh_action[action])(p_cb, p_data);
}
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
if (in_state != p_cb->state)
{
APPL_TRACE_DEBUG("HH State Change: [%s] -> [%s] after Event [%s]",
@@ -408,9 +408,9 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_hh_hdl_event(BT_HDR *p_msg)
+bool bta_hh_hdl_event(BT_HDR *p_msg)
{
- UINT8 index = BTA_HH_IDX_INVALID;
+ uint8_t index = BTA_HH_IDX_INVALID;
tBTA_HH_DEV_CB *p_cb = NULL;
switch (p_msg->event)
@@ -443,15 +443,15 @@
}
else /* else remove device by handle */
{
- index = bta_hh_dev_handle_to_cb_idx((UINT8)p_msg->layer_specific);
+ index = bta_hh_dev_handle_to_cb_idx((uint8_t)p_msg->layer_specific);
/* If BT disable is done while the HID device is connected and Link_Key uses unauthenticated combination
* then we can get into a situation where remove_bonding is called with the index set to 0 (without getting
* cleaned up). Only when VIRTUAL_UNPLUG is called do we cleanup the index and make it MAX_KNOWN.
- * So if REMOVE_DEVICE is called and in_use is FALSE then we should treat this as a NULL p_cb. Hence we
+ * So if REMOVE_DEVICE is called and in_use is false then we should treat this as a NULL p_cb. Hence we
* force the index to be IDX_INVALID
*/
if ((index != BTA_HH_IDX_INVALID) &&
- (bta_hh_cb.kdev[index].in_use == FALSE)) {
+ (bta_hh_cb.kdev[index].in_use == false)) {
index = BTA_HH_IDX_INVALID;
}
}
@@ -461,23 +461,23 @@
index = bta_hh_find_cb(((tBTA_HH_CBACK_DATA *)p_msg)->addr);
}
else
- index = bta_hh_dev_handle_to_cb_idx((UINT8)p_msg->layer_specific);
+ index = bta_hh_dev_handle_to_cb_idx((uint8_t)p_msg->layer_specific);
if (index != BTA_HH_IDX_INVALID)
p_cb = &bta_hh_cb.kdev[index];
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_hdl_event:: handle = %d dev_cb[%d] ", p_msg->layer_specific, index);
#endif
bta_hh_sm_execute(p_cb, p_msg->event, (tBTA_HH_DATA *) p_msg);
}
- return (TRUE);
+ return (true);
}
/*****************************************************************************
** Debug Functions
*****************************************************************************/
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
/*******************************************************************************
**
** Function bta_hh_evt_code
@@ -521,7 +521,7 @@
return "BTA_HH_API_GET_DSCP_EVT";
case BTA_HH_OPEN_CMPL_EVT:
return "BTA_HH_OPEN_CMPL_EVT";
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
case BTA_HH_GATT_CLOSE_EVT:
return "BTA_HH_GATT_CLOSE_EVT";
case BTA_HH_GATT_OPEN_EVT:
@@ -565,7 +565,7 @@
return "BTA_HH_W4_CONN_ST";
case BTA_HH_CONN_ST:
return "BTA_HH_CONN_ST";
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
case BTA_HH_W4_SEC:
return "BTA_HH_W4_SEC";
#endif
diff --git a/bta/hh/bta_hh_utils.cc b/bta/hh/bta_hh_utils.cc
index c8ea864..2a336aa 100644
--- a/bta/hh/bta_hh_utils.cc
+++ b/bta/hh/bta_hh_utils.cc
@@ -18,7 +18,7 @@
#include <string.h>
#include "bt_target.h"
-#if defined(BTA_HH_INCLUDED) && (BTA_HH_INCLUDED == TRUE)
+#if (BTA_HH_INCLUDED == TRUE)
#include "bta_hh_int.h"
@@ -41,7 +41,7 @@
#define BTA_HH_MAX_RPT_CHARS 8
-static const UINT8 bta_hh_mod_key_mask[BTA_HH_MOD_MAX_KEY] =
+static const uint8_t bta_hh_mod_key_mask[BTA_HH_MOD_MAX_KEY] =
{
BTA_HH_KB_CTRL_MASK,
BTA_HH_KB_SHIFT_MASK,
@@ -60,9 +60,9 @@
** Returns void
**
*******************************************************************************/
-UINT8 bta_hh_find_cb(BD_ADDR bda)
+uint8_t bta_hh_find_cb(BD_ADDR bda)
{
- UINT8 xx;
+ uint8_t xx;
/* See how many active devices there are. */
for (xx = 0; xx < BTA_HH_MAX_DEVICE; xx++)
@@ -71,13 +71,13 @@
if ((!bdcmp (bda, bta_hh_cb.kdev[xx].addr) &&
bdcmp(bda, bd_addr_null) != 0) )
{
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("found kdev_cb[%d] hid_handle = %d ", xx,
bta_hh_cb.kdev[xx].hid_handle)
#endif
return xx;
}
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
else
APPL_TRACE_DEBUG("in_use ? [%d] kdev[%d].hid_handle = %d state = [%d]",
bta_hh_cb.kdev[xx].in_use, xx,
@@ -96,7 +96,7 @@
}
}
/* If device list full, report BTA_HH_IDX_INVALID */
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_find_cb:: index = %d while max = %d",
xx, BTA_HH_MAX_DEVICE);
#endif
@@ -119,11 +119,11 @@
*******************************************************************************/
void bta_hh_clean_up_kdev(tBTA_HH_DEV_CB *p_cb)
{
- UINT8 index;
+ uint8_t index;
if (p_cb->hid_handle != BTA_HH_INVALID_HANDLE )
{
-#if BTA_HH_LE_INCLUDED == TRUE
+#if (BTA_HH_LE_INCLUDED == TRUE)
if (p_cb->is_le_device)
bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(p_cb->hid_handle)] = BTA_HH_IDX_INVALID;
else
@@ -153,17 +153,17 @@
** Returns void
**
*******************************************************************************/
-void bta_hh_update_di_info(tBTA_HH_DEV_CB *p_cb, UINT16 vendor_id, UINT16 product_id,
- UINT16 version, UINT8 flag)
+void bta_hh_update_di_info(tBTA_HH_DEV_CB *p_cb, uint16_t vendor_id, uint16_t product_id,
+ uint16_t version, uint8_t flag)
{
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("vendor_id = 0x%2x product_id = 0x%2x version = 0x%2x",
vendor_id, product_id, version);
#endif
p_cb->dscp_info.vendor_id = vendor_id;
p_cb->dscp_info.product_id = product_id;
p_cb->dscp_info.version = version;
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
p_cb->dscp_info.flag = flag;
#else
UNUSED(flag);
@@ -178,20 +178,20 @@
** Returns void
**
*******************************************************************************/
-void bta_hh_add_device_to_list(tBTA_HH_DEV_CB *p_cb, UINT8 handle,
- UINT16 attr_mask,
+void bta_hh_add_device_to_list(tBTA_HH_DEV_CB *p_cb, uint8_t handle,
+ uint16_t attr_mask,
tHID_DEV_DSCP_INFO *p_dscp_info,
- UINT8 sub_class,
- UINT16 ssr_max_latency,
- UINT16 ssr_min_tout,
- UINT8 app_id)
+ uint8_t sub_class,
+ uint16_t ssr_max_latency,
+ uint16_t ssr_min_tout,
+ uint8_t app_id)
{
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("subclass = 0x%2x", sub_class);
#endif
p_cb->hid_handle = handle;
- p_cb->in_use = TRUE;
+ p_cb->in_use = true;
p_cb->attr_mask = attr_mask;
p_cb->sub_class = sub_class;
@@ -206,7 +206,7 @@
if (p_dscp_info->dl_len) {
p_cb->dscp_info.descriptor.dsc_list =
- (UINT8 *)osi_malloc(p_dscp_info->dl_len);
+ (uint8_t *)osi_malloc(p_dscp_info->dl_len);
p_cb->dscp_info.descriptor.dl_len = p_dscp_info->dl_len;
memcpy(p_cb->dscp_info.descriptor.dsc_list, p_dscp_info->dsc_list,
p_dscp_info->dl_len);
@@ -223,26 +223,26 @@
** Returns
**
*******************************************************************************/
-BOOLEAN bta_hh_tod_spt(tBTA_HH_DEV_CB *p_cb,UINT8 sub_class)
+bool bta_hh_tod_spt(tBTA_HH_DEV_CB *p_cb,uint8_t sub_class)
{
- UINT8 xx;
- UINT8 cod = (sub_class >> 2); /* lower two bits are reserved */
+ uint8_t xx;
+ uint8_t cod = (sub_class >> 2); /* lower two bits are reserved */
for (xx = 0 ; xx < p_bta_hh_cfg->max_devt_spt; xx ++)
{
- if (cod == (UINT8) p_bta_hh_cfg->p_devt_list[xx].tod)
+ if (cod == (uint8_t) p_bta_hh_cfg->p_devt_list[xx].tod)
{
p_cb->app_id = p_bta_hh_cfg->p_devt_list[xx].app_id;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_EVENT("bta_hh_tod_spt sub_class:0x%x supported", sub_class);
#endif
- return TRUE;
+ return true;
}
}
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_EVENT("bta_hh_tod_spt sub_class:0x%x NOT supported", sub_class);
#endif
- return FALSE;
+ return false;
}
@@ -255,17 +255,17 @@
** Returns void
**
*******************************************************************************/
-void bta_hh_parse_keybd_rpt(tBTA_HH_BOOT_RPT *p_kb_data, UINT8 *p_report,
- UINT16 report_len)
+void bta_hh_parse_keybd_rpt(tBTA_HH_BOOT_RPT *p_kb_data, uint8_t *p_report,
+ uint16_t report_len)
{
tBTA_HH_KB_CB *p_kb = &bta_hh_cb.kb_cb;
tBTA_HH_KEYBD_RPT *p_data = &p_kb_data->data_rpt.keybd_rpt;
- UINT8 this_char, ctl_shift;
- UINT16 xx, yy, key_idx = 0;
- UINT8 this_report[BTA_HH_MAX_RPT_CHARS];
+ uint8_t this_char, ctl_shift;
+ uint16_t xx, yy, key_idx = 0;
+ uint8_t this_report[BTA_HH_MAX_RPT_CHARS];
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_parse_keybd_rpt: (report=%p, report_len=%d) called",
p_report, report_len);
#endif
@@ -289,11 +289,11 @@
if (ctl_shift & bta_hh_mod_key_mask[xx])
{
APPL_TRACE_DEBUG("Mod Key[%02x] pressed", bta_hh_mod_key_mask[xx] );
- p_kb->mod_key[xx] = TRUE;
+ p_kb->mod_key[xx] = true;
}
else if (p_kb->mod_key[xx])
{
- p_kb->mod_key[xx] = FALSE;
+ p_kb->mod_key[xx] = false;
}
/* control key flag is set */
p_data->mod_key[xx] = p_kb->mod_key[xx];
@@ -317,20 +317,20 @@
/***************************************************************************/
for (xx = 0; xx < report_len; xx++)
{
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("this_char = %02x", this_report[xx]);
#endif
if ((this_char = this_report[xx]) == 0)
continue;
/* take the key code as the report data */
if (this_report[xx] == BTA_HH_KB_CAPS_LOCK)
- p_kb->caps_lock = p_kb->caps_lock ? FALSE : TRUE;
+ p_kb->caps_lock = p_kb->caps_lock ? false : true;
else if (this_report[xx] == BTA_HH_KB_NUM_LOCK)
- p_kb->num_lock = p_kb->num_lock ? FALSE : TRUE;
+ p_kb->num_lock = p_kb->num_lock ? false : true;
else
p_data->this_char[key_idx ++] = this_char;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("found keycode %02x ", this_report[xx]);
#endif
p_data->caps_lock = p_kb->caps_lock;
@@ -352,12 +352,12 @@
** Returns void
**
*******************************************************************************/
-void bta_hh_parse_mice_rpt(tBTA_HH_BOOT_RPT *p_mice_data, UINT8 *p_report,
- UINT16 report_len)
+void bta_hh_parse_mice_rpt(tBTA_HH_BOOT_RPT *p_mice_data, uint8_t *p_report,
+ uint16_t report_len)
{
tBTA_HH_MICE_RPT *p_data = &p_mice_data->data_rpt.mice_rpt;
-#if BTA_HH_DEBUG
- UINT8 xx;
+#if (BTA_HH_DEBUG == TRUE)
+ uint8_t xx;
APPL_TRACE_DEBUG("bta_hh_parse_mice_rpt: bta_keybd_rpt_rcvd(report=%p, \
report_len=%d) called", p_report, report_len);
@@ -369,7 +369,7 @@
if (report_len > BTA_HH_MAX_RPT_CHARS)
report_len = BTA_HH_MAX_RPT_CHARS;
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
for (xx = 0; xx < report_len; xx++)
{
APPL_TRACE_DEBUG("this_char = %02x", p_report[xx]);
@@ -385,7 +385,7 @@
/* y displacement */
p_data->delta_y = p_report[2];
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("mice button: 0x%2x", p_data->mouse_button);
APPL_TRACE_DEBUG("mice move: x = %d y = %d", p_data->delta_x,
p_data->delta_y );
@@ -404,12 +404,12 @@
** Returns tBTA_HH_STATUS operation status
**
*******************************************************************************/
-tBTA_HH_STATUS bta_hh_read_ssr_param(BD_ADDR bd_addr, UINT16 *p_max_ssr_lat, UINT16 *p_min_ssr_tout)
+tBTA_HH_STATUS bta_hh_read_ssr_param(BD_ADDR bd_addr, uint16_t *p_max_ssr_lat, uint16_t *p_min_ssr_tout)
{
tBTA_HH_STATUS status = BTA_HH_ERR;
tBTA_HH_CB *p_cb = &bta_hh_cb;
- UINT8 i;
- UINT16 ssr_max_latency;
+ uint8_t i;
+ uint16_t ssr_max_latency;
for (i = 0; i < BTA_HH_MAX_KNOWN; i ++)
{
if (memcmp(p_cb->kdev[i].addr, bd_addr, BD_ADDR_LEN) == 0)
@@ -460,7 +460,7 @@
*******************************************************************************/
void bta_hh_cleanup_disable(tBTA_HH_STATUS status)
{
- UINT8 xx;
+ uint8_t xx;
/* free buffer in CB holding report descriptors */
for (xx = 0; xx < BTA_HH_MAX_DEVICE; xx ++) {
osi_free_and_reset((void **)&bta_hh_cb.kdev[xx].dscp_info.descriptor.dsc_list);
@@ -479,19 +479,19 @@
** Description convert a HID device handle to the device control block index.
**
**
-** Returns UINT8: index of the device control block.
+** Returns uint8_t: index of the device control block.
**
*******************************************************************************/
-UINT8 bta_hh_dev_handle_to_cb_idx(UINT8 dev_handle)
+uint8_t bta_hh_dev_handle_to_cb_idx(uint8_t dev_handle)
{
- UINT8 index = BTA_HH_IDX_INVALID;
+ uint8_t index = BTA_HH_IDX_INVALID;
-#if BTA_HH_LE_INCLUDED == TRUE
+#if (BTA_HH_LE_INCLUDED == TRUE)
if (BTA_HH_IS_LE_DEV_HDL(dev_handle))
{
if (BTA_HH_IS_LE_DEV_HDL_VALID(dev_handle))
index = bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(dev_handle)];
-#if BTA_HH_DEBUG == TRUE
+#if (BTA_HH_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hh_dev_handle_to_cb_idx dev_handle = %d index = %d", dev_handle, index);
#endif
}
@@ -504,7 +504,7 @@
return index;
}
-#if BTA_HH_DEBUG
+#if (BTA_HH_DEBUG == TRUE)
/*******************************************************************************
**
** Function bta_hh_trace_dev_db
@@ -516,7 +516,7 @@
*******************************************************************************/
void bta_hh_trace_dev_db(void)
{
- UINT8 xx;
+ uint8_t xx;
APPL_TRACE_DEBUG("bta_hh_trace_dev_db:: Device DB list********************");
diff --git a/bta/hl/bta_hl_act.c b/bta/hl/bta_hl_act.c
index fe7fc2c..df1dae9 100644
--- a/bta/hl/bta_hl_act.c
+++ b/bta/hl/bta_hl_act.c
@@ -26,7 +26,7 @@
#include <string.h>
#include "bt_target.h"
-#if defined(HL_INCLUDED) && (HL_INCLUDED == TRUE)
+#if (HL_INCLUDED == TRUE)
#include "bt_common.h"
#include "sdp_api.h"
@@ -43,19 +43,19 @@
** Local Function prototypes
*****************************************************************************/
#if (BTA_HL_DEBUG == TRUE && BT_TRACE_VERBOSE == TRUE)
-static char *bta_hl_mcap_evt_code(UINT8 evt_code);
+static char *bta_hl_mcap_evt_code(uint8_t evt_code);
static char *bta_hl_dch_oper_code(tBTA_HL_DCH_OPER oper_code);
-static char *bta_hl_cback_evt_code(UINT8 evt_code);
+static char *bta_hl_cback_evt_code(uint8_t evt_code);
#endif
-static void bta_hl_sdp_cback(UINT8 sdp_op, UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx, UINT16 status);
-static void bta_hl_sdp_cback0(UINT16 status);
-static void bta_hl_sdp_cback1(UINT16 status);
-static void bta_hl_sdp_cback2(UINT16 status);
-static void bta_hl_sdp_cback3(UINT16 status);
-static void bta_hl_sdp_cback4(UINT16 status);
-static void bta_hl_sdp_cback5(UINT16 status);
-static void bta_hl_sdp_cback6(UINT16 status);
+static void bta_hl_sdp_cback(uint8_t sdp_op, uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx, uint16_t status);
+static void bta_hl_sdp_cback0(uint16_t status);
+static void bta_hl_sdp_cback1(uint16_t status);
+static void bta_hl_sdp_cback2(uint16_t status);
+static void bta_hl_sdp_cback3(uint16_t status);
+static void bta_hl_sdp_cback4(uint16_t status);
+static void bta_hl_sdp_cback5(uint16_t status);
+static void bta_hl_sdp_cback6(uint16_t status);
static tSDP_DISC_CMPL_CB * const bta_hl_sdp_cback_arr[] =
@@ -80,7 +80,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_cong_change(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_cong_change(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -114,7 +114,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_echo_test(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_echo_test(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -144,7 +144,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_sdp_init(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_sdp_init(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
@@ -190,7 +190,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_close_echo_test(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_close_echo_test(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
@@ -229,7 +229,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_rcv_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_rcv_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -295,7 +295,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_ci_put_echo_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_ci_put_echo_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
@@ -324,7 +324,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_ci_get_echo_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_ci_get_echo_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
@@ -366,7 +366,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_ci_put_rx_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_ci_put_rx_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -407,7 +407,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_ci_get_tx_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_ci_get_tx_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -415,8 +415,8 @@
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
tMCA_RESULT result;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- BOOLEAN free_buf = FALSE;
- BOOLEAN close_dch = FALSE;
+ bool free_buf = false;
+ bool close_dch = false;
tBTA_HL evt_data;
@@ -429,11 +429,11 @@
if (p_dcb->close_pending)
{
status = BTA_HL_STATUS_FAIL;
- free_buf = TRUE;
+ free_buf = true;
if (!p_dcb->cout_oper)
{
- close_dch = TRUE;
+ close_dch = true;
}
}
else
@@ -448,7 +448,7 @@
{
status = BTA_HL_STATUS_FAIL;
}
- free_buf = TRUE;
+ free_buf = true;
}
else
{
@@ -482,14 +482,14 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_send_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_send_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
tBTA_HL evt_data;
- BOOLEAN success = TRUE;
+ bool success = true;
#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_dch_send_data");
@@ -498,7 +498,7 @@
if (!(p_dcb->cout_oper & BTA_HL_CO_GET_TX_DATA_MASK))
{
// p_dcb->chnl_cfg.fcs may be BTA_HL_MCA_USE_FCS (0x11) or BTA_HL_MCA_NO_FCS (0x10) or BTA_HL_DEFAULT_SOURCE_FCS (1)
- BOOLEAN fcs_use = (BOOLEAN) (p_dcb->chnl_cfg.fcs & BTA_HL_MCA_FCS_USE_MASK);
+ bool fcs_use = (bool) (p_dcb->chnl_cfg.fcs & BTA_HL_MCA_FCS_USE_MASK);
if ((p_dcb->p_tx_pkt = bta_hl_get_buf(p_data->api_send_data.pkt_size, fcs_use)) != NULL)
{
bta_hl_co_get_tx_data( p_acb->app_id,
@@ -510,12 +510,12 @@
}
else
{
- success = FALSE;
+ success = false;
}
}
else
{
- success = FALSE;
+ success = false;
}
if (!success)
@@ -538,7 +538,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_close_cmpl(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_close_cmpl(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -546,7 +546,7 @@
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
tBTA_HL evt_data;
tBTA_HL_EVT event = 0;
- BOOLEAN send_evt=TRUE;
+ bool send_evt=true;
tBTA_HL_STATUS status;
#if (BTA_HL_DEBUG == TRUE)
@@ -646,7 +646,7 @@
/* this is normal echo test close */
case BTA_HL_DCH_OP_REMOTE_CREATE:
case BTA_HL_DCH_OP_REMOTE_RECONNECT:
- send_evt=FALSE;
+ send_evt=false;
break;
default:
@@ -657,14 +657,14 @@
APPL_TRACE_ERROR("DCH operation not found oper=%d", p_dcb->dch_oper);
#endif
#endif
- send_evt=FALSE;
+ send_evt=false;
break;
}
if ( p_dcb->local_mdep_id == BTA_HL_ECHO_TEST_MDEP_ID )
{
- p_mcb->echo_test = FALSE;
- send_evt=FALSE;
+ p_mcb->echo_test = false;
+ send_evt=false;
if ( p_dcb->dch_oper != BTA_HL_DCH_OP_LOCAL_CLOSE_ECHO_TEST)
{
@@ -677,7 +677,7 @@
case BTA_HL_ECHO_OP_LOOP_BACK:
status = BTA_HL_STATUS_FAIL;
- send_evt = TRUE;
+ send_evt = true;
break;
case BTA_HL_ECHO_OP_OPEN_IND:
case BTA_HL_ECHO_OP_ECHO_PKT:
@@ -690,7 +690,7 @@
else
{
status = p_dcb->ci_put_echo_data_status;
- send_evt = TRUE;
+ send_evt = true;
}
if (send_evt)
@@ -720,7 +720,7 @@
}
}
/* check cch close is in progress or not */
- bta_hl_check_cch_close(app_idx, mcl_idx, p_data, FALSE);
+ bta_hl_check_cch_close(app_idx, mcl_idx, p_data, false);
}
/*******************************************************************************
**
@@ -731,7 +731,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_close_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_close_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
@@ -744,10 +744,10 @@
#endif
#endif
- p_dcb->intentional_close = FALSE;
+ p_dcb->intentional_close = false;
if (p_data->mca_evt.mca_data.close_ind.reason == L2CAP_DISC_OK)
{
- p_dcb->intentional_close = TRUE;
+ p_dcb->intentional_close = true;
}
if (!p_dcb->cout_oper)
@@ -761,7 +761,7 @@
}
else
{
- p_dcb->close_pending = TRUE;
+ p_dcb->close_pending = true;
}
}
@@ -774,7 +774,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_close_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_close_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
@@ -821,7 +821,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_close(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_close(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -835,7 +835,7 @@
#endif
if (!p_dcb->cout_oper)
{
- p_dcb->close_pending = FALSE;
+ p_dcb->close_pending = false;
if (MCA_CloseReq((tMCA_DL)p_dcb->mdl_handle)== MCA_SUCCESS)
{
p_dcb->dch_oper = BTA_HL_DCH_OP_LOCAL_CLOSE;
@@ -858,7 +858,7 @@
}
else
{
- p_dcb->close_pending = TRUE;
+ p_dcb->close_pending = true;
}
}
@@ -872,7 +872,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_open_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_open_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -881,8 +881,8 @@
tMCA_DL_OPEN *p_open_ind = &p_data->mca_evt.mca_data.open_ind;
tBTA_HL evt_data;
tBTA_HL_EVT event;
- UINT8 old_dch_oper = BTA_HL_DCH_OP_NONE;
- BOOLEAN send_event = FALSE;
+ uint8_t old_dch_oper = BTA_HL_DCH_OP_NONE;
+ bool send_event = false;
#if (BTA_HL_DEBUG == TRUE)
@@ -907,7 +907,7 @@
evt_data.dch_open_ind.dch_mode = BTA_HL_DCH_MODE_RELIABLE;
if (!bta_hl_is_the_first_reliable_existed(app_idx, mcl_idx))
{
- p_dcb->is_the_first_reliable = TRUE;
+ p_dcb->is_the_first_reliable = true;
}
}
else
@@ -931,7 +931,7 @@
{
bta_hl_save_mdl_cfg(app_idx, mcl_idx,mdl_idx);
event= BTA_HL_DCH_OPEN_IND_EVT;
- send_event= TRUE;
+ send_event= true;
}
else
{
@@ -946,7 +946,7 @@
{
bta_hl_save_mdl_cfg(app_idx, mcl_idx,mdl_idx);
event= BTA_HL_DCH_RECONNECT_IND_EVT;
- send_event= TRUE;
+ send_event= true;
}
else
{
@@ -979,7 +979,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_open_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_open_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -988,9 +988,9 @@
tMCA_DL_OPEN *p_open_cfm = &p_data->mca_evt.mca_data.open_cfm;
tBTA_HL evt_data;
tBTA_HL_EVT event;
- UINT8 old_dch_oper = BTA_HL_DCH_OP_NONE;
+ uint8_t old_dch_oper = BTA_HL_DCH_OP_NONE;
tBTA_HL_DCH_MODE dch_mode = BTA_HL_DCH_MODE_STREAMING;
- BOOLEAN send_event = FALSE;
+ bool send_event = false;
#if (BTA_HL_DEBUG == TRUE)
@@ -1014,7 +1014,7 @@
{
if (!bta_hl_is_the_first_reliable_existed(app_idx, mcl_idx))
{
- p_dcb->is_the_first_reliable = TRUE;
+ p_dcb->is_the_first_reliable = true;
}
}
}
@@ -1046,7 +1046,7 @@
{
bta_hl_save_mdl_cfg(app_idx, mcl_idx, mdl_idx);
event= BTA_HL_DCH_OPEN_CFM_EVT;
- send_event= TRUE;
+ send_event= true;
}
else
{
@@ -1068,7 +1068,7 @@
{
bta_hl_save_mdl_cfg(app_idx, mcl_idx,mdl_idx);
event= BTA_HL_DCH_RECONNECT_CFM_EVT;
- send_event= TRUE;
+ send_event= true;
}
else
{
@@ -1100,7 +1100,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_abort_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_abort_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
@@ -1123,7 +1123,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_abort_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_abort_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -1168,7 +1168,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_abort(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_abort(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -1208,7 +1208,7 @@
BTA_HL_STATUS_FAIL);
p_acb->p_cback(BTA_HL_DCH_ABORT_CFM_EVT ,(tBTA_HL *) &evt_data );
}
- bta_hl_check_cch_close(app_idx, mcl_idx, p_data, FALSE);
+ bta_hl_check_cch_close(app_idx, mcl_idx, p_data, false);
}
@@ -1229,15 +1229,15 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_reconnect_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_reconnect_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
tBTA_HL_MDL_CFG *p_mdl_cfg;
tMCA_EVT_HDR *p_reconnect_ind = &p_data->mca_evt.mca_data.reconnect_ind;
- UINT8 mdl_cfg_idx, in_use_mdl_idx, mdep_cfg_idx;
- UINT8 rsp_code = MCA_RSP_SUCCESS;
+ uint8_t mdl_cfg_idx, in_use_mdl_idx, mdep_cfg_idx;
+ uint8_t rsp_code = MCA_RSP_SUCCESS;
#if (BTA_HL_DEBUG == TRUE)
@@ -1252,7 +1252,7 @@
if (bta_hl_find_mdep_cfg_idx(app_idx, p_mdl_cfg->local_mdep_id, &mdep_cfg_idx))
{
- p_dcb->in_use = TRUE;
+ p_dcb->in_use = true;
p_dcb->dch_oper = BTA_HL_DCH_OP_REMOTE_RECONNECT;
p_dcb->sec_mask = (BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT);
p_dcb->peer_mdep_id = 0xFF;
@@ -1260,7 +1260,7 @@
p_dcb->local_mdep_cfg_idx = mdep_cfg_idx;
p_dcb->local_cfg = BTA_HL_DCH_CFG_UNKNOWN;
p_dcb->mdl_id = p_reconnect_ind->mdl_id;
- p_dcb->mdl_cfg_idx_included = TRUE;
+ p_dcb->mdl_cfg_idx_included = true;
p_dcb->mdl_cfg_idx = mdl_cfg_idx;
p_dcb->dch_mode = p_mdl_cfg->dch_mode;
bta_hl_find_rxtx_apdu_size(app_idx, mdep_cfg_idx,
@@ -1303,7 +1303,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_reconnect_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_reconnect_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
@@ -1352,13 +1352,13 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_reconnect(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_reconnect(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
tMCA_CHNL_CFG *p_chnl_cfg=NULL;
- UINT8 sdp_idx;
+ uint8_t sdp_idx;
#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_dch_mca_reconnect");
@@ -1391,13 +1391,13 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_create_rsp(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_create_rsp(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
tBTA_HL_API_DCH_CREATE_RSP *p_create_rsp = &p_data->api_dch_create_rsp;
- UINT8 mca_rsp_code = MCA_RSP_SUCCESS;
+ uint8_t mca_rsp_code = MCA_RSP_SUCCESS;
#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_dch_create_rsp");
@@ -1436,17 +1436,17 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_create_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_create_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
tMCA_CREATE_IND *p_create_ind = &p_data->mca_evt.mca_data.create_ind;
- UINT8 mdep_cfg_idx;
- UINT8 cfg_rsp;
- UINT8 rsp_code = MCA_RSP_SUCCESS;
- BOOLEAN send_create_ind_evt = FALSE;
+ uint8_t mdep_cfg_idx;
+ uint8_t cfg_rsp;
+ uint8_t rsp_code = MCA_RSP_SUCCESS;
+ bool send_create_ind_evt = false;
tBTA_HL evt_data;
tBTA_HL_ECHO_CFG *p_echo_cfg;
@@ -1460,14 +1460,14 @@
{
if (bta_hl_find_echo_cfg_rsp(app_idx, mcl_idx, mdep_cfg_idx,p_create_ind->cfg, &cfg_rsp ))
{
- p_dcb->in_use = TRUE;
+ p_dcb->in_use = true;
p_dcb->dch_oper = BTA_HL_DCH_OP_REMOTE_OPEN;
p_dcb->local_mdep_id = p_create_ind->dep_id ;
p_dcb->local_mdep_cfg_idx = mdep_cfg_idx;
p_dcb->local_cfg = cfg_rsp;
p_dcb->remote_cfg = p_create_ind->cfg ;
p_dcb->mdl_id = p_create_ind->mdl_id;
- p_dcb->mdl_cfg_idx_included = FALSE;
+ p_dcb->mdl_cfg_idx_included = false;
p_echo_cfg = BTA_HL_GET_ECHO_CFG_PTR(app_idx);
p_dcb->max_rx_apdu_size = p_echo_cfg->max_rx_apdu_size;
p_dcb->max_tx_apdu_size = p_echo_cfg->max_tx_apdu_size;
@@ -1482,18 +1482,18 @@
else
{
- p_dcb->in_use = TRUE;
+ p_dcb->in_use = true;
p_dcb->dch_oper = BTA_HL_DCH_OP_REMOTE_CREATE;
p_dcb->local_mdep_id = p_create_ind->dep_id ;
p_dcb->local_mdep_cfg_idx = mdep_cfg_idx;
p_dcb->local_cfg = BTA_HL_DCH_CFG_UNKNOWN;
p_dcb->remote_cfg = p_create_ind->cfg;
p_dcb->mdl_id = p_create_ind->mdl_id;
- p_dcb->mdl_cfg_idx_included = FALSE;
+ p_dcb->mdl_cfg_idx_included = false;
bta_hl_find_rxtx_apdu_size(app_idx, mdep_cfg_idx,
&p_dcb->max_rx_apdu_size,
&p_dcb->max_tx_apdu_size);
- send_create_ind_evt = TRUE;
+ send_create_ind_evt = true;
}
}
else
@@ -1526,7 +1526,7 @@
{
if (p_dcb->local_mdep_id == BTA_HL_ECHO_TEST_MDEP_ID)
{
- p_mcb->echo_test = TRUE;
+ p_mcb->echo_test = true;
p_dcb->echo_oper = BTA_HL_ECHO_OP_OPEN_IND;
}
}
@@ -1542,7 +1542,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_create_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_create_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
@@ -1606,15 +1606,15 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_mca_create(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_mca_create(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
tMCA_RESULT result;
- UINT8 sdp_idx;
+ uint8_t sdp_idx;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_dch_mca_create");
#endif
@@ -1654,7 +1654,7 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_sdp_fail(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+void bta_hl_dch_sdp_fail(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data)
{
@@ -1678,8 +1678,8 @@
** Returns void.
**
******************************************************************************/
-static void bta_hl_sdp_cback(UINT8 sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx, UINT16 status)
+static void bta_hl_sdp_cback(uint8_t sdp_oper, uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx, uint16_t status)
{
tBTA_HL_MCL_CB *p_cb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_SDP_REC *p_hdp_rec;
@@ -1688,15 +1688,15 @@
tSDP_DISC_REC *p_rec = NULL;
tSDP_PROTOCOL_ELEM pe;
tSDP_DISC_ATTR *p_attr;
- UINT8 i, rec_cnt;
+ uint8_t i, rec_cnt;
tBTA_HL_SUP_FEATURE_LIST_ELEM sup_feature;
- BOOLEAN sdp_parsing_ok =FALSE, result=FALSE;
- UINT16 event;
+ bool sdp_parsing_ok =false, result=false;
+ uint16_t event;
tBTA_HL_MDL_CB *p_dcb;
- UINT16 service_uuid;
- UINT16 name_len;
+ uint16_t service_uuid;
+ uint16_t name_len;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_sdp_cback status:%d sdp_oper=%d app_idx=%d, mcl_idx=%d, mdl_idx=%d",
status, sdp_oper, app_idx, mcl_idx, mdl_idx);
#endif
@@ -1721,7 +1721,7 @@
if (SDP_FindProtocolListElemInRec(p_rec, UUID_PROTOCOL_L2CAP, &pe))
{
- p_hdp_rec->ctrl_psm = (UINT16) pe.params[0];
+ p_hdp_rec->ctrl_psm = (uint16_t) pe.params[0];
}
else
{
@@ -1730,7 +1730,7 @@
}
if (SDP_FindAddProtoListsElemInRec(p_rec, UUID_PROTOCOL_L2CAP, &pe))
{
- p_hdp_rec->data_psm = (UINT16) pe.params[0];
+ p_hdp_rec->data_psm = (uint16_t) pe.params[0];
}
else
{
@@ -1742,7 +1742,7 @@
if ((p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SERVICE_NAME)) != NULL)
{
if (SDP_DISC_ATTR_LEN(p_attr->attr_len_type) < BT_MAX_SERVICE_NAME_LEN)
- name_len = (UINT16)SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
+ name_len = (uint16_t)SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
else
name_len = BT_MAX_SERVICE_NAME_LEN;
memcpy(p_hdp_rec->srv_name, p_attr->attr_value.v.array, name_len);
@@ -1752,7 +1752,7 @@
if ((p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SERVICE_DESCRIPTION)) != NULL)
{
if (SDP_DISC_ATTR_LEN(p_attr->attr_len_type) < BT_MAX_SERVICE_NAME_LEN)
- name_len = (UINT16)SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
+ name_len = (uint16_t)SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
else
name_len = BT_MAX_SERVICE_NAME_LEN;
memcpy(p_hdp_rec->srv_desp, p_attr->attr_value.v.array, name_len);
@@ -1763,7 +1763,7 @@
if ((p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_PROVIDER_NAME)) != NULL)
{
if (SDP_DISC_ATTR_LEN(p_attr->attr_len_type) < BT_MAX_SERVICE_NAME_LEN)
- name_len = (UINT16)SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
+ name_len = (uint16_t)SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
else
name_len = BT_MAX_SERVICE_NAME_LEN;
memcpy(p_hdp_rec->provider_name, p_attr->attr_value.v.array, name_len);
@@ -1783,7 +1783,7 @@
{
if (bta_hl_fill_sup_feature_list (p_attr, &sup_feature))
{
- p_hdp_rec->num_mdeps = (UINT8) sup_feature.num_elems;
+ p_hdp_rec->num_mdeps = (uint8_t) sup_feature.num_elems;
APPL_TRACE_WARNING("bta_hl_sdp_cback num_mdeps %d",sup_feature.num_elems);
for (i=0; i<sup_feature.num_elems; i++)
{
@@ -1803,7 +1803,7 @@
}
}
- sdp_parsing_ok = TRUE;
+ sdp_parsing_ok = true;
}
else
{
@@ -1816,7 +1816,7 @@
APPL_TRACE_WARNING("HDP supported feature list not found");
break;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("record=%d ctrl_psm=%0x data_psm=%x",
rec_cnt+1,
p_hdp_rec->ctrl_psm,
@@ -1844,7 +1844,7 @@
}
- } while (TRUE);
+ } while (true);
}
osi_free_and_reset((void **)&p_cb->p_db);
@@ -1853,7 +1853,7 @@
p_cb->sdp.num_recs &&
sdp_parsing_ok)
{
- result = TRUE;
+ result = true;
}
else
{
@@ -1890,9 +1890,9 @@
p_cch_buf->app_idx = app_idx;
p_cch_buf->mcl_idx = mcl_idx;
- p_cch_buf->release_mcl_cb = FALSE;
+ p_cch_buf->release_mcl_cb = false;
if (sdp_oper == BTA_HL_SDP_OP_SDP_QUERY_NEW)
- p_cch_buf->release_mcl_cb = TRUE;
+ p_cch_buf->release_mcl_cb = true;
bta_sys_sendmsg(p_cch_buf);
break;
@@ -1906,7 +1906,7 @@
p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
if (p_dcb->abort_oper & BTA_HL_ABORT_PENDING_MASK) {
p_dcb->abort_oper &= ~BTA_HL_ABORT_PENDING_MASK;
- result = FALSE;
+ result = false;
}
if (result) {
if (sdp_oper == BTA_HL_SDP_OP_DCH_OPEN_INIT) {
@@ -1936,7 +1936,7 @@
** Returns void.
**
******************************************************************************/
-static void bta_hl_sdp_cback0(UINT16 status)
+static void bta_hl_sdp_cback0(uint16_t status)
{
bta_hl_sdp_cback(bta_hl_cb.scb[0].sdp_oper,
bta_hl_cb.scb[0].app_idx,
@@ -1957,7 +1957,7 @@
** Returns void.
**
******************************************************************************/
-static void bta_hl_sdp_cback1(UINT16 status)
+static void bta_hl_sdp_cback1(uint16_t status)
{
bta_hl_sdp_cback(bta_hl_cb.scb[1].sdp_oper,
bta_hl_cb.scb[1].app_idx,
@@ -1976,7 +1976,7 @@
** Returns void.
**
******************************************************************************/
-static void bta_hl_sdp_cback2(UINT16 status)
+static void bta_hl_sdp_cback2(uint16_t status)
{
bta_hl_sdp_cback(bta_hl_cb.scb[2].sdp_oper,
bta_hl_cb.scb[2].app_idx,
@@ -1995,7 +1995,7 @@
** Returns void.
**
******************************************************************************/
-static void bta_hl_sdp_cback3(UINT16 status)
+static void bta_hl_sdp_cback3(uint16_t status)
{
bta_hl_sdp_cback(bta_hl_cb.scb[3].sdp_oper,
bta_hl_cb.scb[3].app_idx,
@@ -2016,7 +2016,7 @@
** Returns void.
**
******************************************************************************/
-static void bta_hl_sdp_cback4(UINT16 status)
+static void bta_hl_sdp_cback4(uint16_t status)
{
bta_hl_sdp_cback(bta_hl_cb.scb[4].sdp_oper,
bta_hl_cb.scb[4].app_idx,
@@ -2037,7 +2037,7 @@
** Returns void.
**
******************************************************************************/
-static void bta_hl_sdp_cback5(UINT16 status)
+static void bta_hl_sdp_cback5(uint16_t status)
{
bta_hl_sdp_cback(bta_hl_cb.scb[5].sdp_oper,
bta_hl_cb.scb[5].app_idx,
@@ -2056,7 +2056,7 @@
** Returns void.
**
******************************************************************************/
-static void bta_hl_sdp_cback6(UINT16 status)
+static void bta_hl_sdp_cback6(uint16_t status)
{
bta_hl_sdp_cback(bta_hl_cb.scb[6].sdp_oper,
bta_hl_cb.scb[6].app_idx,
@@ -2073,17 +2073,17 @@
**
** Description Deallocate a SDP control block
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-void bta_hl_deallocate_spd_cback(UINT8 sdp_cback_idx)
+void bta_hl_deallocate_spd_cback(uint8_t sdp_cback_idx)
{
tBTA_HL_SDP_CB *p_spd_cb = &bta_hl_cb.scb[sdp_cback_idx];
memset(p_spd_cb, 0, sizeof(tBTA_HL_SDP_CB));
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_deallocate_spd_cback index=%d", sdp_cback_idx);
#endif
@@ -2097,15 +2097,15 @@
** Description Finds a not in used SDP control block index
**
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-tSDP_DISC_CMPL_CB *bta_hl_allocate_spd_cback(tBTA_HL_SDP_OPER sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx,
- UINT8 *p_sdp_cback_idx)
+tSDP_DISC_CMPL_CB *bta_hl_allocate_spd_cback(tBTA_HL_SDP_OPER sdp_oper, uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx,
+ uint8_t *p_sdp_cback_idx)
{
- UINT8 i;
+ uint8_t i;
tSDP_DISC_CMPL_CB *p_cbcak=NULL;
@@ -2114,7 +2114,7 @@
if (!bta_hl_cb.scb[i].in_use)
{
p_cbcak = bta_hl_sdp_cback_arr[i];
- bta_hl_cb.scb[i].in_use = TRUE;
+ bta_hl_cb.scb[i].in_use = true;
bta_hl_cb.scb[i].sdp_oper = sdp_oper;
bta_hl_cb.scb[i].app_idx = app_idx;
bta_hl_cb.scb[i].mcl_idx = mcl_idx;
@@ -2130,7 +2130,7 @@
}
else
{
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_allocate_spd_cback cback_idx=%d ",i );
APPL_TRACE_DEBUG("sdp_oper=%d, app_idx=%d, mcl_idx=%d, mdl_idx=%d",
bta_hl_cb.scb[i].sdp_oper,
@@ -2152,16 +2152,16 @@
** Returns void
**
*******************************************************************************/
-tBTA_HL_STATUS bta_hl_init_sdp(tBTA_HL_SDP_OPER sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx)
+tBTA_HL_STATUS bta_hl_init_sdp(tBTA_HL_SDP_OPER sdp_oper, uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx)
{
tBTA_HL_MCL_CB *p_cb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tSDP_UUID uuid_list;
- UINT16 attr_list[BTA_HL_NUM_SRCH_ATTR];
- UINT16 num_attrs = BTA_HL_NUM_SRCH_ATTR;
+ uint16_t attr_list[BTA_HL_NUM_SRCH_ATTR];
+ uint16_t num_attrs = BTA_HL_NUM_SRCH_ATTR;
tBTA_HL_STATUS status;
- UINT8 sdp_cback_idx;
-#if BTA_HL_DEBUG == TRUE
+ uint8_t sdp_cback_idx;
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_init_sdp sdp_oper=%d app_idx=%d mcl_idx=%d, mdl_idx=%d",
sdp_oper, app_idx, mcl_idx, mdl_idx);
#endif
@@ -2212,10 +2212,10 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_cch_sdp_init(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data)
+void bta_hl_cch_sdp_init(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_cb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_cch_init_sdp");
#endif
if ( p_cb->sdp_oper == BTA_HL_SDP_OP_NONE)
@@ -2245,13 +2245,13 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_cch_mca_open(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data)
+void bta_hl_cch_mca_open(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- UINT8 sdp_idx;
+ uint8_t sdp_idx;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_cch_mca_open");
#endif
@@ -2283,11 +2283,11 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_cch_mca_close(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data)
+void bta_hl_cch_mca_close(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_cch_mca_close mcl_handle=%d", p_mcb->mcl_handle);
#endif
if (p_mcb->sdp_oper != BTA_HL_SDP_OP_CCH_INIT)
@@ -2301,13 +2301,13 @@
}
else
{
- p_mcb->close_pending = TRUE;
+ p_mcb->close_pending = true;
APPL_TRACE_DEBUG("No valid mcl_handle to stop the CCH setup now so wait until CCH is up then close it" );
}
}
else
{
- p_mcb->close_pending = TRUE;
+ p_mcb->close_pending = true;
APPL_TRACE_DEBUG("can not stop the CCH setup becasue SDP is in progress so wait until it is done" );
}
}
@@ -2321,15 +2321,15 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_cch_close_cmpl(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data)
+void bta_hl_cch_close_cmpl(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL evt_data;
tBTA_HL_EVT event;
- BOOLEAN send_evt=TRUE;
-#if BTA_HL_DEBUG == TRUE
+ bool send_evt=true;
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_cch_close_cmpl");
#endif
bta_sys_conn_close(BTA_ID_HL, p_acb->app_id, p_mcb->bd_addr);
@@ -2363,7 +2363,7 @@
event = BTA_HL_CCH_CLOSE_IND_EVT;
break;
default:
- send_evt=FALSE;
+ send_evt=false;
break;
}
@@ -2384,20 +2384,20 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_cch_mca_disconnect(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data)
+void bta_hl_cch_mca_disconnect(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb;
- UINT8 i;
-#if BTA_HL_DEBUG == TRUE
+ uint8_t i;
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_cch_mca_disconnect");
#endif
- p_mcb->intentional_close = FALSE;
+ p_mcb->intentional_close = false;
if (p_data->mca_evt.mca_data.disconnect_ind.reason == L2CAP_DISC_OK)
{
- p_mcb->intentional_close = TRUE;
+ p_mcb->intentional_close = true;
}
for (i=0; i< BTA_HL_NUM_MDLS_PER_MCL; i++)
@@ -2427,15 +2427,15 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_cch_mca_disc_open(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data)
+void bta_hl_cch_mca_disc_open(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_cch_mca_disc_open mcl_handle=0x%x close_pending=%d", p_data->mca_evt.mcl_handle, p_mcb->close_pending );
#endif
- p_mcb->close_pending = FALSE;
+ p_mcb->close_pending = false;
p_mcb->mcl_handle = p_data->mca_evt.mcl_handle;
bta_hl_cch_mca_close(app_idx, mcl_idx, p_data);
}
@@ -2449,17 +2449,17 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_cch_mca_rsp_tout(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data)
+void bta_hl_cch_mca_rsp_tout(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_cch_mca_rsp_tout");
#endif
- p_mcb->rsp_tout = TRUE;
+ p_mcb->rsp_tout = true;
- bta_hl_check_cch_close(app_idx,mcl_idx,p_data,TRUE);
+ bta_hl_check_cch_close(app_idx,mcl_idx,p_data,true);
}
/*******************************************************************************
@@ -2471,15 +2471,15 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_cch_mca_connect(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data)
+void bta_hl_cch_mca_connect(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL evt_data;
tBTA_HL_EVT event;
- BOOLEAN send_event=TRUE;
+ bool send_event=true;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_cch_mca_connect mcl_handle=%d ", p_data->mca_evt.mcl_handle);
#endif
@@ -2504,7 +2504,7 @@
event = BTA_HL_CCH_OPEN_IND_EVT;
break;
default:
- send_event = FALSE;
+ send_event = false;
break;
}
@@ -2521,11 +2521,11 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_mcap_ctrl_cback (tMCA_HANDLE handle, tMCA_CL mcl, UINT8 event,
+void bta_hl_mcap_ctrl_cback (tMCA_HANDLE handle, tMCA_CL mcl, uint8_t event,
tMCA_CTRL *p_data)
{
- BOOLEAN send_event=TRUE;
- UINT16 mca_event;
+ bool send_event=true;
+ uint16_t mca_event;
#if (BTA_HL_DEBUG == TRUE)
#if (BT_TRACE_VERBOSE == TRUE)
@@ -2539,57 +2539,57 @@
{
case MCA_CREATE_IND_EVT:
- mca_event = (UINT16) BTA_HL_MCA_CREATE_IND_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_CREATE_IND_EVT;
break;
case MCA_CREATE_CFM_EVT:
- mca_event = (UINT16) BTA_HL_MCA_CREATE_CFM_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_CREATE_CFM_EVT;
break;
case MCA_RECONNECT_IND_EVT:
- mca_event = (UINT16) BTA_HL_MCA_RECONNECT_IND_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_RECONNECT_IND_EVT;
break;
case MCA_RECONNECT_CFM_EVT:
- mca_event = (UINT16) BTA_HL_MCA_RECONNECT_CFM_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_RECONNECT_CFM_EVT;
break;
case MCA_ABORT_IND_EVT:
- mca_event = (UINT16) BTA_HL_MCA_ABORT_IND_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_ABORT_IND_EVT;
break;
case MCA_ABORT_CFM_EVT:
- mca_event = (UINT16) BTA_HL_MCA_ABORT_CFM_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_ABORT_CFM_EVT;
break;
case MCA_DELETE_IND_EVT:
- mca_event = (UINT16) BTA_HL_MCA_DELETE_IND_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_DELETE_IND_EVT;
break;
case MCA_DELETE_CFM_EVT:
- mca_event = (UINT16) BTA_HL_MCA_DELETE_CFM_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_DELETE_CFM_EVT;
break;
case MCA_CONNECT_IND_EVT:
- mca_event = (UINT16) BTA_HL_MCA_CONNECT_IND_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_CONNECT_IND_EVT;
break;
case MCA_DISCONNECT_IND_EVT:
- mca_event = (UINT16) BTA_HL_MCA_DISCONNECT_IND_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_DISCONNECT_IND_EVT;
break;
case MCA_OPEN_IND_EVT:
- mca_event = (UINT16) BTA_HL_MCA_OPEN_IND_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_OPEN_IND_EVT;
break;
case MCA_OPEN_CFM_EVT:
- mca_event = (UINT16) BTA_HL_MCA_OPEN_CFM_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_OPEN_CFM_EVT;
break;
case MCA_CLOSE_IND_EVT:
- mca_event = (UINT16) BTA_HL_MCA_CLOSE_IND_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_CLOSE_IND_EVT;
break;
case MCA_CLOSE_CFM_EVT:
- mca_event = (UINT16) BTA_HL_MCA_CLOSE_CFM_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_CLOSE_CFM_EVT;
break;
case MCA_CONG_CHG_EVT:
- mca_event = (UINT16) BTA_HL_MCA_CONG_CHG_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_CONG_CHG_EVT;
break;
case MCA_RSP_TOUT_IND_EVT:
- mca_event = (UINT16) BTA_HL_MCA_RSP_TOUT_IND_EVT;
+ mca_event = (uint16_t) BTA_HL_MCA_RSP_TOUT_IND_EVT;
break;
case MCA_ERROR_RSP_EVT:
default:
- send_event=FALSE;
+ send_event=false;
break;
}
@@ -2615,7 +2615,7 @@
*******************************************************************************/
void bta_hl_mcap_data_cback (tMCA_DL mdl, BT_HDR *p_pkt)
{
- UINT8 app_idx, mcl_idx, mdl_idx;
+ uint8_t app_idx, mcl_idx, mdl_idx;
if (bta_hl_find_mdl_idx_using_handle ((tBTA_HL_MDL_HANDLE)mdl, &app_idx, &mcl_idx, &mdl_idx))
{
tBTA_HL_MCA_RCV_DATA_EVT *p_msg =
@@ -2643,7 +2643,7 @@
** Returns char * - event string pointer
**
*******************************************************************************/
-static char *bta_hl_mcap_evt_code(UINT8 evt_code)
+static char *bta_hl_mcap_evt_code(uint8_t evt_code)
{
switch (evt_code)
@@ -2699,7 +2699,7 @@
** Returns char * - event string pointer
**
*******************************************************************************/
-static char *bta_hl_cback_evt_code(UINT8 evt_code)
+static char *bta_hl_cback_evt_code(uint8_t evt_code)
{
switch (evt_code)
diff --git a/bta/hl/bta_hl_api.c b/bta/hl/bta_hl_api.c
index 81813f3..7b57e04 100644
--- a/bta/hl/bta_hl_api.c
+++ b/bta/hl/bta_hl_api.c
@@ -27,7 +27,7 @@
#include <string.h>
#include "bt_target.h"
-#if defined(HL_INCLUDED) && (HL_INCLUDED == TRUE)
+#if (HL_INCLUDED == TRUE)
#include "bt_common.h"
#include "bta_hl_api.h"
@@ -104,8 +104,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_HlUpdate(UINT8 app_id, tBTA_HL_REG_PARAM *p_reg_param,
- BOOLEAN is_register, tBTA_HL_CBACK *p_cback)
+void BTA_HlUpdate(uint8_t app_id, tBTA_HL_REG_PARAM *p_reg_param,
+ bool is_register, tBTA_HL_CBACK *p_cback)
{
tBTA_HL_API_UPDATE *p_buf =
(tBTA_HL_API_UPDATE *)osi_malloc(sizeof(tBTA_HL_API_UPDATE));
@@ -152,7 +152,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HlRegister(UINT8 app_id,
+void BTA_HlRegister(uint8_t app_id,
tBTA_HL_REG_PARAM *p_reg_param,
tBTA_HL_CBACK *p_cback)
{
@@ -193,7 +193,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HlDeregister(UINT8 app_id,tBTA_HL_APP_HANDLE app_handle)
+void BTA_HlDeregister(uint8_t app_id,tBTA_HL_APP_HANDLE app_handle)
{
tBTA_HL_API_DEREGISTER *p_buf =
(tBTA_HL_API_DEREGISTER *)osi_malloc(sizeof(tBTA_HL_API_DEREGISTER));
@@ -221,7 +221,7 @@
** multiple HDP instances. Also, if the control PSM value is zero
** then the first HDP instance is used for the control channel setup
*******************************************************************************/
-void BTA_HlCchOpen(UINT8 app_id, tBTA_HL_APP_HANDLE app_handle,
+void BTA_HlCchOpen(uint8_t app_id, tBTA_HL_APP_HANDLE app_handle,
tBTA_HL_CCH_OPEN_PARAM *p_open_param)
{
tBTA_HL_API_CCH_OPEN *p_buf =
@@ -374,7 +374,7 @@
**
*******************************************************************************/
void BTA_HlSendData(tBTA_HL_MDL_HANDLE mdl_handle,
- UINT16 pkt_size)
+ uint16_t pkt_size)
{
tBTA_HL_API_SEND_DATA *p_buf =
(tBTA_HL_API_SEND_DATA *)osi_malloc(sizeof(tBTA_HL_API_SEND_DATA));
@@ -454,7 +454,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HlSdpQuery(UINT8 app_id,tBTA_HL_APP_HANDLE app_handle,
+void BTA_HlSdpQuery(uint8_t app_id,tBTA_HL_APP_HANDLE app_handle,
BD_ADDR bd_addr)
{
tBTA_HL_API_SDP_QUERY *p_buf =
diff --git a/bta/hl/bta_hl_ci.c b/bta/hl/bta_hl_ci.c
index 9aaa963..41f0130 100644
--- a/bta/hl/bta_hl_ci.c
+++ b/bta/hl/bta_hl_ci.c
@@ -48,12 +48,12 @@
*******************************************************************************/
extern void bta_hl_ci_get_tx_data( tBTA_HL_MDL_HANDLE mdl_handle,
tBTA_HL_STATUS status,
- UINT16 evt )
+ uint16_t evt )
{
tBTA_HL_CI_GET_PUT_DATA *p_evt =
(tBTA_HL_CI_GET_PUT_DATA *)osi_malloc(sizeof(tBTA_HL_CI_GET_PUT_DATA));
-#if (BTA_HL_DEBUG == TRUE)
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("%s mdl_handle=%d status=%d evt=%d\n", __func__,
mdl_handle, status, evt);
#endif
@@ -82,12 +82,12 @@
*******************************************************************************/
extern void bta_hl_ci_put_rx_data( tBTA_HL_MDL_HANDLE mdl_handle,
tBTA_HL_STATUS status,
- UINT16 evt )
+ uint16_t evt )
{
tBTA_HL_CI_GET_PUT_DATA *p_evt =
(tBTA_HL_CI_GET_PUT_DATA *)osi_malloc(sizeof(tBTA_HL_CI_GET_PUT_DATA));
-#if (BTA_HL_DEBUG == TRUE)
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("%s mdl_handle=%d status=%d evt=%d\n", __func__,
mdl_handle, status, evt);
#endif
@@ -116,12 +116,12 @@
*******************************************************************************/
extern void bta_hl_ci_get_echo_data( tBTA_HL_MCL_HANDLE mcl_handle,
tBTA_HL_STATUS status,
- UINT16 evt )
+ uint16_t evt )
{
tBTA_HL_CI_ECHO_DATA *p_evt =
(tBTA_HL_CI_ECHO_DATA *)osi_malloc(sizeof(tBTA_HL_CI_ECHO_DATA));
-#if (BTA_HL_DEBUG == TRUE)
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("%s mcl_handle=%d status=%d evt=%d\n", __func__,
mcl_handle, status, evt);
#endif
@@ -150,12 +150,12 @@
*******************************************************************************/
extern void bta_hl_ci_put_echo_data( tBTA_HL_MCL_HANDLE mcl_handle,
tBTA_HL_STATUS status,
- UINT16 evt )
+ uint16_t evt )
{
tBTA_HL_CI_ECHO_DATA *p_evt =
(tBTA_HL_CI_ECHO_DATA *)osi_malloc(sizeof(tBTA_HL_CI_ECHO_DATA));
-#if (BTA_HL_DEBUG == TRUE)
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("%s mcl_handle=%d status=%d evt=%d\n", __func__,
mcl_handle, status, evt);
#endif
diff --git a/bta/hl/bta_hl_int.h b/bta/hl/bta_hl_int.h
index 1a03fcf..0a83d6f 100644
--- a/bta/hl/bta_hl_int.h
+++ b/bta/hl/bta_hl_int.h
@@ -35,7 +35,7 @@
extern "C" {
#endif
-typedef UINT16 (tBTA_HL_ALLOCATE_PSM) (void);
+typedef uint16_t (tBTA_HL_ALLOCATE_PSM) (void);
/*****************************************************************************
** Constants and data types
@@ -70,7 +70,7 @@
#define BTA_HL_SDP_OP_SDP_QUERY_NEW 4
#define BTA_HL_SDP_OP_SDP_QUERY_CURRENT 5
-typedef UINT8 tBTA_HL_SDP_OPER;
+typedef uint8_t tBTA_HL_SDP_OPER;
/* CCH Operations */
#define BTA_HL_CCH_OP_NONE 0
@@ -79,13 +79,13 @@
#define BTA_HL_CCH_OP_LOCAL_CLOSE 3
#define BTA_HL_CCH_OP_REMOTE_CLOSE 4
-typedef UINT8 tBTA_HL_CCH_OPER;
+typedef uint8_t tBTA_HL_CCH_OPER;
/* Pending DCH close operations when closing a CCH */
#define BTA_HL_CCH_CLOSE_OP_DCH_NONE 0
#define BTA_HL_CCH_CLOSE_OP_DCH_ABORT 1
#define BTA_HL_CCH_CLOSE_OP_DCH_CLOSE 2
-typedef UINT8 tBTA_HL_CCH_CLOSE_DCH_OPER;
+typedef uint8_t tBTA_HL_CCH_CLOSE_DCH_OPER;
/* DCH Operations */
#define BTA_HL_DCH_OP_NONE 0
@@ -101,7 +101,7 @@
#define BTA_HL_DCH_OP_LOCAL_CLOSE_ECHO_TEST 10
#define BTA_HL_DCH_OP_LOCAL_CLOSE_RECONNECT 11
-typedef UINT8 tBTA_HL_DCH_OPER;
+typedef uint8_t tBTA_HL_DCH_OPER;
/* Echo test Operations */
#define BTA_HL_ECHO_OP_NONE 0
@@ -115,7 +115,7 @@
#define BTA_HL_ECHO_OP_OPEN_IND 8
#define BTA_HL_ECHO_OP_ECHO_PKT 9
-typedef UINT8 tBTA_HL_ECHO_OPER;
+typedef uint8_t tBTA_HL_ECHO_OPER;
/* abort status mask for abort_oper */
@@ -134,8 +134,8 @@
typedef struct
{
- UINT16 mtu;
- UINT8 fcs; /* '0' No FCS, otherwise '1' */
+ uint16_t mtu;
+ uint8_t fcs; /* '0' No FCS, otherwise '1' */
} tBTA_HL_L2CAP_CFG_INFO;
@@ -205,7 +205,7 @@
BTA_HL_MCA_DELETE_IND_EVT,
BTA_HL_MCA_DELETE_CFM_EVT
};
-typedef UINT16 tBTA_HL_INT_EVT;
+typedef uint16_t tBTA_HL_INT_EVT;
#define BTA_HL_DCH_EVT_MIN BTA_HL_DCH_SDP_INIT_EVT
#define BTA_HL_DCH_EVT_MAX 0xFFFF
@@ -219,7 +219,7 @@
BTA_HL_CCH_OPEN_ST, /* Connection is open */
BTA_HL_CCH_CLOSING_ST /* Closing is in progress */
};
-typedef UINT8 tBTA_HL_CCH_STATE;
+typedef uint8_t tBTA_HL_CCH_STATE;
enum
{
@@ -228,7 +228,7 @@
BTA_HL_DCH_OPEN_ST, /* Connection is open */
BTA_HL_DCH_CLOSING_ST /* Closing is in progress */
};
-typedef UINT8 tBTA_HL_DCH_STATE;
+typedef uint8_t tBTA_HL_DCH_STATE;
typedef struct
@@ -240,8 +240,8 @@
typedef struct
{
BT_HDR hdr;
- UINT8 app_id;
- BOOLEAN is_register; /* Update HL application due to register or deregister */
+ uint8_t app_id;
+ bool is_register; /* Update HL application due to register or deregister */
tBTA_HL_CBACK *p_cback; /* pointer to application callback function */
tBTA_HL_DEVICE_TYPE dev_type; /* sink, source or dual roles */
tBTA_SEC sec_mask; /* security mask for accepting conenction*/
@@ -254,7 +254,7 @@
typedef struct
{
BT_HDR hdr;
- UINT8 app_id;
+ uint8_t app_id;
tBTA_HL_CBACK *p_cback; /* pointer to application callback function */
tBTA_HL_DEVICE_TYPE dev_type; /* sink, source or dual roles */
tBTA_SEC sec_mask; /* security mask for accepting conenction*/
@@ -266,7 +266,7 @@
typedef struct
{
BT_HDR hdr;
- UINT8 app_id;
+ uint8_t app_id;
tBTA_HL_CBACK *p_cback; /* pointer to application callback function */
tBTA_HL_APP_HANDLE app_handle;
} tBTA_HL_API_DEREGISTER;
@@ -274,9 +274,9 @@
typedef struct
{
BT_HDR hdr;
- UINT8 app_id;
+ uint8_t app_id;
tBTA_HL_APP_HANDLE app_handle;
- UINT16 ctrl_psm;
+ uint16_t ctrl_psm;
BD_ADDR bd_addr; /* Address of peer device */
tBTA_SEC sec_mask; /* security mask for initiating connection*/
} tBTA_HL_API_CCH_OPEN;
@@ -294,7 +294,7 @@
{
BT_HDR hdr;
tBTA_HL_MCL_HANDLE mcl_handle;
- UINT16 ctrl_psm;
+ uint16_t ctrl_psm;
tBTA_HL_MDEP_ID local_mdep_id; /* local MDEP ID */
tBTA_HL_MDEP_ID peer_mdep_id; /* peer mdep id */
tBTA_HL_DCH_CFG local_cfg;
@@ -307,7 +307,7 @@
BT_HDR hdr;
tBTA_HL_MCL_HANDLE mcl_handle;
- UINT16 ctrl_psm;
+ uint16_t ctrl_psm;
tBTA_HL_MDL_ID mdl_id;
} tBTA_HL_API_DCH_RECONNECT;
@@ -335,24 +335,24 @@
{
BT_HDR hdr;
tBTA_HL_MDL_HANDLE mdl_handle;
- UINT16 pkt_size;
+ uint16_t pkt_size;
} tBTA_HL_API_SEND_DATA;
typedef struct
{
BT_HDR hdr;
tBTA_HL_MCL_HANDLE mcl_handle;
- UINT16 ctrl_psm;
- UINT16 pkt_size;
+ uint16_t ctrl_psm;
+ uint16_t pkt_size;
tBTA_HL_DCH_CFG local_cfg;
} tBTA_HL_API_DCH_ECHO_TEST;
typedef struct
{
BT_HDR hdr;
- UINT8 app_idx;
- UINT8 mcl_idx;
- BOOLEAN release_mcl_cb;
+ uint8_t app_idx;
+ uint8_t mcl_idx;
+ bool release_mcl_cb;
}tBTA_HL_CCH_SDP;
@@ -370,9 +370,9 @@
typedef struct
{
BT_HDR hdr;
- UINT8 app_idx;
- UINT8 mcl_idx;
- UINT8 mdl_idx;
+ uint8_t app_idx;
+ uint8_t mcl_idx;
+ uint8_t mdl_idx;
BT_HDR *p_pkt;
} tBTA_HL_MCA_RCV_DATA_EVT;
@@ -380,16 +380,16 @@
typedef struct
{
BT_HDR hdr;
- UINT8 app_idx;
- UINT8 mcl_idx;
- UINT8 mdl_idx;
+ uint8_t app_idx;
+ uint8_t mcl_idx;
+ uint8_t mdl_idx;
}tBTA_HL_DCH_SDP;
typedef struct
{
BT_HDR hdr;
tBTA_HL_APP_HANDLE app_handle;
- UINT8 app_id;
+ uint8_t app_id;
BD_ADDR bd_addr; /* Address of peer device */
} tBTA_HL_API_SDP_QUERY;
@@ -448,37 +448,37 @@
typedef struct
{
- BOOLEAN in_use;
- UINT16 mdl_id;
+ bool in_use;
+ uint16_t mdl_id;
tBTA_HL_MDL_HANDLE mdl_handle;
tBTA_HL_DCH_OPER dch_oper;
- BOOLEAN intentional_close;
+ bool intentional_close;
tBTA_HL_DCH_STATE dch_state;
- UINT8 abort_oper;
- UINT16 req_data_psm;
- UINT16 max_rx_apdu_size;
- UINT16 max_tx_apdu_size;
+ uint8_t abort_oper;
+ uint16_t req_data_psm;
+ uint16_t max_rx_apdu_size;
+ uint16_t max_tx_apdu_size;
BT_HDR *p_tx_pkt;
BT_HDR *p_rx_pkt;
tBTA_HL_MDEP_ID local_mdep_id;
- UINT8 local_mdep_cfg_idx;
+ uint8_t local_mdep_cfg_idx;
tBTA_HL_DCH_CFG local_cfg;
tBTA_HL_DCH_CFG remote_cfg;
tBTA_HL_MDEP_ID peer_mdep_id;
- UINT16 peer_data_type;
+ uint16_t peer_data_type;
tBTA_HL_MDEP_ROLE peer_mdep_role;
tBTA_HL_DCH_MODE dch_mode;
tBTA_SEC sec_mask;
- BOOLEAN is_the_first_reliable;
- BOOLEAN delete_mdl;
- UINT16 mtu;
+ bool is_the_first_reliable;
+ bool delete_mdl;
+ uint16_t mtu;
tMCA_CHNL_CFG chnl_cfg;
- BOOLEAN mdl_cfg_idx_included;
- UINT8 mdl_cfg_idx;
- UINT8 echo_oper;
- BOOLEAN cong;
- BOOLEAN close_pending;
- UINT8 cout_oper;
+ bool mdl_cfg_idx_included;
+ uint8_t mdl_cfg_idx;
+ uint8_t echo_oper;
+ bool cong;
+ bool close_pending;
+ uint8_t cout_oper;
BT_HDR *p_echo_tx_pkt;
BT_HDR *p_echo_rx_pkt;
tBTA_HL_STATUS ci_put_echo_data_status;
@@ -488,47 +488,47 @@
{
tBTA_HL_MDL_CB mdl[BTA_HL_NUM_MDLS_PER_MCL];
tBTA_HL_DELETE_MDL delete_mdl;
- BOOLEAN in_use;
+ bool in_use;
tBTA_HL_CCH_STATE cch_state;
- UINT16 req_ctrl_psm;
- UINT16 ctrl_psm;
- UINT16 data_psm;
+ uint16_t req_ctrl_psm;
+ uint16_t ctrl_psm;
+ uint16_t data_psm;
BD_ADDR bd_addr;
- UINT16 cch_mtu;
- UINT16 sec_mask;
+ uint16_t cch_mtu;
+ uint16_t sec_mask;
tBTA_HL_MCL_HANDLE mcl_handle;
tSDP_DISCOVERY_DB *p_db; /* pointer to discovery database */
tSDP_DISC_CMPL_CB *sdp_cback;
tBTA_HL_SDP_OPER sdp_oper;
- BOOLEAN close_pending;
- UINT8 sdp_mdl_idx;
+ bool close_pending;
+ uint8_t sdp_mdl_idx;
tBTA_HL_SDP sdp;
- UINT8 cch_oper;
- UINT8 force_close_local_cch_opening;
- BOOLEAN intentional_close;
- BOOLEAN rsp_tout;
- UINT8 timer_oper;
- BOOLEAN echo_test;
- UINT8 echo_mdl_idx;
- UINT8 cch_close_dch_oper;
- UINT8 app_id;
+ uint8_t cch_oper;
+ uint8_t force_close_local_cch_opening;
+ bool intentional_close;
+ bool rsp_tout;
+ uint8_t timer_oper;
+ bool echo_test;
+ uint8_t echo_mdl_idx;
+ uint8_t cch_close_dch_oper;
+ uint8_t app_id;
}tBTA_HL_MCL_CB;
typedef struct
{
tBTA_HL_MCL_CB mcb[BTA_HL_NUM_MCLS]; /* application Control Blocks */
tBTA_HL_CBACK *p_cback; /* pointer to control callback function */
- BOOLEAN in_use; /* this CB is in use*/
- BOOLEAN deregistering;
- UINT8 app_id;
- UINT32 sdp_handle; /* SDP record handle */
+ bool in_use; /* this CB is in use*/
+ bool deregistering;
+ uint8_t app_id;
+ uint32_t sdp_handle; /* SDP record handle */
tBTA_HL_SUP_FEATURE sup_feature;
tBTA_HL_MDL_CFG mdl_cfg[BTA_HL_NUM_MDL_CFGS];
tBTA_HL_DEVICE_TYPE dev_type;
tBTA_HL_APP_HANDLE app_handle;
- UINT16 ctrl_psm; /* L2CAP PSM for the MCAP control channel */
- UINT16 data_psm; /* L2CAP PSM for the MCAP data channel */
- UINT16 sec_mask; /* Security mask for BTM_SetSecurityLevel() */
+ uint16_t ctrl_psm; /* L2CAP PSM for the MCAP control channel */
+ uint16_t data_psm; /* L2CAP PSM for the MCAP data channel */
+ uint16_t sec_mask; /* Security mask for BTM_SetSecurityLevel() */
char srv_name[BTA_SERVICE_NAME_LEN +1]; /* service name to be used in the SDP; null terminated*/
char srv_desp[BTA_SERVICE_DESP_LEN +1]; /* service description to be used in the SDP; null terminated */
@@ -541,30 +541,30 @@
typedef struct
{
- BOOLEAN in_use;
+ bool in_use;
tBTA_HL_SDP_OPER sdp_oper;
- UINT8 app_idx;
- UINT8 mcl_idx;
- UINT8 mdl_idx;
+ uint8_t app_idx;
+ uint8_t mcl_idx;
+ uint8_t mdl_idx;
}tBTA_HL_SDP_CB;
typedef struct
{
- BOOLEAN in_use;
- UINT8 app_idx;
- UINT8 mcl_idx;
+ bool in_use;
+ uint8_t app_idx;
+ uint8_t mcl_idx;
}tBTA_HL_TIMER_CB;
typedef struct
{
tBTA_HL_APP_CB acb[BTA_HL_NUM_APPS]; /* HL Control Blocks */
tBTA_HL_CTRL_CBACK *p_ctrl_cback; /* pointer to control callback function */
- BOOLEAN enable;
- BOOLEAN disabling;
+ bool enable;
+ bool disabling;
tBTA_HL_SDP_CB scb[BTA_HL_NUM_SDP_CBACKS];
tBTA_HL_TIMER_CB tcb[BTA_HL_NUM_TIMERS];
- BOOLEAN enable_random_psm;
+ bool enable_random_psm;
tBTA_HL_ALLOCATE_PSM *p_alloc_psm;
}tBTA_HL_CB;
@@ -578,7 +578,7 @@
*****************************************************************************/
/* HL control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_HL_CB bta_hl_cb;
#else
extern tBTA_HL_CB *bta_hl_cb_ptr;
@@ -594,205 +594,205 @@
#define BTA_HL_GET_MDEP_CFG_PTR(app_idx, mdep_cfg_idx) &(bta_hl_cb.acb[(app_idx)].sup_feature.mdep[mdep_cfg_idx].mdep_cfg)
#define BTA_HL_GET_DATA_CFG_PTR(app_idx, mdep_cfg_idx, data_cfg_idx) \
&(bta_hl_cb.acb[(app_idx)].sup_feature.mdep[mdep_cfg_idx].mdep_cfg.data_cfg[data_cfg_idx])
-#define BTA_HL_GET_BUF_PTR(p_pkt) ((UINT8 *)((UINT8 *) ((p_pkt)+1) + (p_pkt)->offset))
+#define BTA_HL_GET_BUF_PTR(p_pkt) ((uint8_t *)((uint8_t *) ((p_pkt)+1) + (p_pkt)->offset))
/*****************************************************************************
** Function prototypes
*****************************************************************************/
/* main */
- extern BOOLEAN bta_hl_hdl_event(BT_HDR *p_msg);
+ extern bool bta_hl_hdl_event(BT_HDR *p_msg);
/* sdp */
- extern BOOLEAN bta_hl_fill_sup_feature_list( const tSDP_DISC_ATTR *p_attr,
+ extern bool bta_hl_fill_sup_feature_list( const tSDP_DISC_ATTR *p_attr,
tBTA_HL_SUP_FEATURE_LIST_ELEM *p_list);
- extern tBTA_HL_STATUS bta_hl_sdp_update (UINT8 app_id);
- extern tBTA_HL_STATUS bta_hl_sdp_register (UINT8 app_idx);
+ extern tBTA_HL_STATUS bta_hl_sdp_update (uint8_t app_id);
+ extern tBTA_HL_STATUS bta_hl_sdp_register (uint8_t app_idx);
extern tSDP_DISC_REC *bta_hl_find_sink_or_src_srv_class_in_db (const tSDP_DISCOVERY_DB *p_db,
const tSDP_DISC_REC *p_start_rec);
/* action routines */
- extern void bta_hl_dch_ci_get_tx_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_ci_get_tx_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_ci_put_rx_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_ci_put_rx_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_ci_get_echo_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_ci_get_echo_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_echo_test(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_echo_test(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_ci_put_echo_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_ci_put_echo_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_send_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_send_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_sdp_fail(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_sdp_fail(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_cong_change(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_cong_change(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_reconnect_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_reconnect_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_reconnect_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_reconnect_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_reconnect(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_reconnect(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_sdp_init(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_sdp_init(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_close_echo_test(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_close_echo_test(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_create_rsp(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_create_rsp(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_rcv_data(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_rcv_data(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_close_cmpl(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_close_cmpl(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_close_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_close_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_close_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_close_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_close(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_close(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_delete_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_delete_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_delete_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_delete_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_delete(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_delete(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_abort_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_abort_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_abort_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_abort_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_abort(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_abort(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_open_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_open_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_open_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_open_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_create_ind(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_create_ind(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_create_cfm(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_create_cfm(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_mca_create(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern void bta_hl_dch_mca_create(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_DATA *p_data);
- extern void bta_hl_deallocate_spd_cback(UINT8 sdp_cback_idx);
- extern tSDP_DISC_CMPL_CB *bta_hl_allocate_spd_cback(tBTA_HL_SDP_OPER sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx,
- UINT8 *p_sdp_cback_idx);
- extern tBTA_HL_STATUS bta_hl_init_sdp(tBTA_HL_SDP_OPER sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx);
- extern void bta_hl_cch_sdp_init(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data);
- extern void bta_hl_cch_mca_open(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data);
- extern void bta_hl_cch_mca_close(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data);
- extern void bta_hl_cch_close_cmpl(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data);
- extern void bta_hl_cch_mca_disconnect(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data);
- extern void bta_hl_cch_mca_disc_open(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data);
- extern void bta_hl_cch_mca_rsp_tout(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data);
- extern void bta_hl_cch_mca_connect(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data);
+ extern void bta_hl_deallocate_spd_cback(uint8_t sdp_cback_idx);
+ extern tSDP_DISC_CMPL_CB *bta_hl_allocate_spd_cback(tBTA_HL_SDP_OPER sdp_oper, uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx,
+ uint8_t *p_sdp_cback_idx);
+ extern tBTA_HL_STATUS bta_hl_init_sdp(tBTA_HL_SDP_OPER sdp_oper, uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx);
+ extern void bta_hl_cch_sdp_init(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data);
+ extern void bta_hl_cch_mca_open(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data);
+ extern void bta_hl_cch_mca_close(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data);
+ extern void bta_hl_cch_close_cmpl(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data);
+ extern void bta_hl_cch_mca_disconnect(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data);
+ extern void bta_hl_cch_mca_disc_open(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data);
+ extern void bta_hl_cch_mca_rsp_tout(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data);
+ extern void bta_hl_cch_mca_connect(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data);
/* State machine drivers */
- extern void bta_hl_cch_sm_execute(UINT8 inst_idx, UINT8 mcl_idx,
- UINT16 event, tBTA_HL_DATA *p_data);
- extern void bta_hl_dch_sm_execute(UINT8 inst_idx, UINT8 mcl_idx, UINT8 mdl_idx,
- UINT16 event, tBTA_HL_DATA *p_data);
+ extern void bta_hl_cch_sm_execute(uint8_t inst_idx, uint8_t mcl_idx,
+ uint16_t event, tBTA_HL_DATA *p_data);
+ extern void bta_hl_dch_sm_execute(uint8_t inst_idx, uint8_t mcl_idx, uint8_t mdl_idx,
+ uint16_t event, tBTA_HL_DATA *p_data);
/* MCAP callback functions */
- extern void bta_hl_mcap_ctrl_cback(tMCA_HANDLE handle, tMCA_CL mcl, UINT8 event,
+ extern void bta_hl_mcap_ctrl_cback(tMCA_HANDLE handle, tMCA_CL mcl, uint8_t event,
tMCA_CTRL *p_data);
extern void bta_hl_mcap_data_cback(tMCA_DL mdl, BT_HDR *p_pkt);
/* utility functions */
- extern BOOLEAN bta_hl_set_ctrl_psm_for_dch(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx, UINT16 ctrl_psm);
- extern BOOLEAN bta_hl_find_sdp_idx_using_ctrl_psm(tBTA_HL_SDP *p_sdp,
- UINT16 ctrl_psm,
- UINT8 *p_sdp_idx);
- extern UINT16 bta_hl_set_user_tx_buf_size(UINT16 max_tx_size);
- extern UINT16 bta_hl_set_user_rx_buf_size(UINT16 mtu);
- extern UINT8 bta_hl_set_tx_win_size(UINT16 mtu, UINT16 mps);
- extern UINT16 bta_hl_set_mps(UINT16 mtu);
- extern void bta_hl_clean_mdl_cb(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx);
- extern BT_HDR * bta_hl_get_buf(UINT16 data_size, BOOLEAN fcs_use);
- extern BOOLEAN bta_hl_find_service_in_db( UINT8 app_idx, UINT8 mcl_idx,
- UINT16 service_uuid,
+ extern bool bta_hl_set_ctrl_psm_for_dch(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx, uint16_t ctrl_psm);
+ extern bool bta_hl_find_sdp_idx_using_ctrl_psm(tBTA_HL_SDP *p_sdp,
+ uint16_t ctrl_psm,
+ uint8_t *p_sdp_idx);
+ extern uint16_t bta_hl_set_user_tx_buf_size(uint16_t max_tx_size);
+ extern uint16_t bta_hl_set_user_rx_buf_size(uint16_t mtu);
+ extern uint8_t bta_hl_set_tx_win_size(uint16_t mtu, uint16_t mps);
+ extern uint16_t bta_hl_set_mps(uint16_t mtu);
+ extern void bta_hl_clean_mdl_cb(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx);
+ extern BT_HDR * bta_hl_get_buf(uint16_t data_size, bool fcs_use);
+ extern bool bta_hl_find_service_in_db( uint8_t app_idx, uint8_t mcl_idx,
+ uint16_t service_uuid,
tSDP_DISC_REC **pp_rec );
- extern UINT16 bta_hl_get_service_uuids(UINT8 sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx );
- extern BOOLEAN bta_hl_find_echo_cfg_rsp(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdep_idx, UINT8 cfg,
- UINT8 *p_cfg_rsp);
- extern BOOLEAN bta_hl_validate_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
- UINT8 cfg);
- extern BOOLEAN bta_hl_find_cch_cb_indexes(tBTA_HL_DATA *p_msg,
- UINT8 *p_app_idx,
- UINT8 *p_mcl_idx);
- extern BOOLEAN bta_hl_find_dch_cb_indexes(tBTA_HL_DATA *p_msg,
- UINT8 *p_app_idx,
- UINT8 *p_mcl_idx,
- UINT8 *p_mdl_idx);
- extern UINT16 bta_hl_allocate_mdl_id(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx );
- extern BOOLEAN bta_hl_find_mdl_idx_using_handle(tBTA_HL_MDL_HANDLE mdl_handle,
- UINT8 *p_app_idx, UINT8 *p_mcl_idx,
- UINT8 *p_mdl_idx);
- extern BOOLEAN bta_hl_find_mdl_idx(UINT8 app_idx, UINT8 mcl_idx, UINT16 mdl_id,
- UINT8 *p_mdl_idx);
- extern BOOLEAN bta_hl_find_an_active_mdl_idx(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 *p_mdl_idx);
- extern BOOLEAN bta_hl_find_dch_setup_mdl_idx(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 *p_mdl_idx);
- extern BOOLEAN bta_hl_find_an_in_use_mcl_idx(UINT8 app_idx,
- UINT8 *p_mcl_idx);
- extern BOOLEAN bta_hl_find_an_in_use_app_idx(UINT8 *p_app_idx);
- extern BOOLEAN bta_hl_find_app_idx(UINT8 app_id, UINT8 *p_app_idx);
- extern BOOLEAN bta_hl_find_app_idx_using_handle(tBTA_HL_APP_HANDLE app_handle,
- UINT8 *p_app_idx);
- extern BOOLEAN bta_hl_find_mcl_idx_using_handle( tBTA_HL_MCL_HANDLE mcl_handle,
- UINT8 *p_app_idx, UINT8 *p_mcl_idx);
- extern BOOLEAN bta_hl_find_mcl_idx(UINT8 app_idx, BD_ADDR p_bd_addr, UINT8 *p_mcl_idx);
- extern BOOLEAN bta_hl_is_the_first_reliable_existed(UINT8 app_idx, UINT8 mcl_idx );
- extern BOOLEAN bta_hl_find_non_active_mdl_cfg(UINT8 app_idx, UINT8 start_mdl_cfg_idx,
- UINT8 *p_mdl_cfg_idx);
- extern BOOLEAN bta_hl_find_avail_mdl_cfg_idx(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 *p_mdl_cfg_idx);
- extern BOOLEAN bta_hl_find_mdl_cfg_idx(UINT8 app_idx, UINT8 mcl_idx,
- tBTA_HL_MDL_ID mdl_id, UINT8 *p_mdl_cfg_idx);
- extern BOOLEAN bta_hl_get_cur_time(UINT8 app_idx, UINT8 *p_cur_time);
- extern void bta_hl_sort_cfg_time_idx(UINT8 app_idx, UINT8 *a, UINT8 n);
- extern void bta_hl_compact_mdl_cfg_time(UINT8 app_idx, UINT8 mdep_id);
- extern BOOLEAN bta_hl_is_mdl_exsit_in_mcl(UINT8 app_idx, BD_ADDR bd_addr,
+ extern uint16_t bta_hl_get_service_uuids(uint8_t sdp_oper, uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx );
+ extern bool bta_hl_find_echo_cfg_rsp(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdep_idx, uint8_t cfg,
+ uint8_t *p_cfg_rsp);
+ extern bool bta_hl_validate_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
+ uint8_t cfg);
+ extern bool bta_hl_find_cch_cb_indexes(tBTA_HL_DATA *p_msg,
+ uint8_t *p_app_idx,
+ uint8_t *p_mcl_idx);
+ extern bool bta_hl_find_dch_cb_indexes(tBTA_HL_DATA *p_msg,
+ uint8_t *p_app_idx,
+ uint8_t *p_mcl_idx,
+ uint8_t *p_mdl_idx);
+ extern uint16_t bta_hl_allocate_mdl_id(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx );
+ extern bool bta_hl_find_mdl_idx_using_handle(tBTA_HL_MDL_HANDLE mdl_handle,
+ uint8_t *p_app_idx, uint8_t *p_mcl_idx,
+ uint8_t *p_mdl_idx);
+ extern bool bta_hl_find_mdl_idx(uint8_t app_idx, uint8_t mcl_idx, uint16_t mdl_id,
+ uint8_t *p_mdl_idx);
+ extern bool bta_hl_find_an_active_mdl_idx(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t *p_mdl_idx);
+ extern bool bta_hl_find_dch_setup_mdl_idx(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t *p_mdl_idx);
+ extern bool bta_hl_find_an_in_use_mcl_idx(uint8_t app_idx,
+ uint8_t *p_mcl_idx);
+ extern bool bta_hl_find_an_in_use_app_idx(uint8_t *p_app_idx);
+ extern bool bta_hl_find_app_idx(uint8_t app_id, uint8_t *p_app_idx);
+ extern bool bta_hl_find_app_idx_using_handle(tBTA_HL_APP_HANDLE app_handle,
+ uint8_t *p_app_idx);
+ extern bool bta_hl_find_mcl_idx_using_handle( tBTA_HL_MCL_HANDLE mcl_handle,
+ uint8_t *p_app_idx, uint8_t *p_mcl_idx);
+ extern bool bta_hl_find_mcl_idx(uint8_t app_idx, BD_ADDR p_bd_addr, uint8_t *p_mcl_idx);
+ extern bool bta_hl_is_the_first_reliable_existed(uint8_t app_idx, uint8_t mcl_idx );
+ extern bool bta_hl_find_non_active_mdl_cfg(uint8_t app_idx, uint8_t start_mdl_cfg_idx,
+ uint8_t *p_mdl_cfg_idx);
+ extern bool bta_hl_find_avail_mdl_cfg_idx(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t *p_mdl_cfg_idx);
+ extern bool bta_hl_find_mdl_cfg_idx(uint8_t app_idx, uint8_t mcl_idx,
+ tBTA_HL_MDL_ID mdl_id, uint8_t *p_mdl_cfg_idx);
+ extern bool bta_hl_get_cur_time(uint8_t app_idx, uint8_t *p_cur_time);
+ extern void bta_hl_sort_cfg_time_idx(uint8_t app_idx, uint8_t *a, uint8_t n);
+ extern void bta_hl_compact_mdl_cfg_time(uint8_t app_idx, uint8_t mdep_id);
+ extern bool bta_hl_is_mdl_exsit_in_mcl(uint8_t app_idx, BD_ADDR bd_addr,
tBTA_HL_MDL_ID mdl_id);
- extern BOOLEAN bta_hl_delete_mdl_cfg(UINT8 app_idx, BD_ADDR bd_addr,
+ extern bool bta_hl_delete_mdl_cfg(uint8_t app_idx, BD_ADDR bd_addr,
tBTA_HL_MDL_ID mdl_id);
- extern BOOLEAN bta_hl_is_mdl_value_valid(tBTA_HL_MDL_ID mdl_id);
- extern BOOLEAN bta_hl_find_mdep_cfg_idx(UINT8 app_idx,
- tBTA_HL_MDEP_ID local_mdep_id, UINT8 *p_mdep_cfg_idx);
- extern void bta_hl_find_rxtx_apdu_size(UINT8 app_idx, UINT8 mdep_cfg_idx,
- UINT16 *p_rx_apu_size,
- UINT16 *p_tx_apu_size);
- extern BOOLEAN bta_hl_validate_peer_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+ extern bool bta_hl_is_mdl_value_valid(tBTA_HL_MDL_ID mdl_id);
+ extern bool bta_hl_find_mdep_cfg_idx(uint8_t app_idx,
+ tBTA_HL_MDEP_ID local_mdep_id, uint8_t *p_mdep_cfg_idx);
+ extern void bta_hl_find_rxtx_apdu_size(uint8_t app_idx, uint8_t mdep_cfg_idx,
+ uint16_t *p_rx_apu_size,
+ uint16_t *p_tx_apu_size);
+ extern bool bta_hl_validate_peer_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_MDEP_ID peer_mdep_id,
tBTA_HL_MDEP_ROLE peer_mdep_role,
- UINT8 sdp_idx);
- extern tBTA_HL_STATUS bta_hl_chk_local_cfg(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdep_cfg_idx,
+ uint8_t sdp_idx);
+ extern tBTA_HL_STATUS bta_hl_chk_local_cfg(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdep_cfg_idx,
tBTA_HL_DCH_CFG local_cfg);
- extern BOOLEAN bta_hl_validate_reconnect_params(UINT8 app_idx, UINT8 mcl_idx,
+ extern bool bta_hl_validate_reconnect_params(uint8_t app_idx, uint8_t mcl_idx,
tBTA_HL_API_DCH_RECONNECT *p_reconnect,
- UINT8 *p_mdep_cfg_idx, UINT8 *p_mdl_cfg_idx);
- extern BOOLEAN bta_hl_find_avail_mcl_idx(UINT8 app_idx, UINT8 *p_mcl_idx);
- extern BOOLEAN bta_hl_find_avail_mdl_idx(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 *p_mdl_idx);
- extern BOOLEAN bta_hl_is_a_duplicate_id(UINT8 app_id);
- extern BOOLEAN bta_hl_find_avail_app_idx(UINT8 *p_idx);
- extern tBTA_HL_STATUS bta_hl_app_update(UINT8 app_id, BOOLEAN is_register);
- extern tBTA_HL_STATUS bta_hl_app_registration(UINT8 app_idx);
- extern void bta_hl_discard_data(UINT16 event, tBTA_HL_DATA *p_data);
- extern void bta_hl_save_mdl_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx );
- extern void bta_hl_set_dch_chan_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx, tBTA_HL_DATA *p_data);
- extern BOOLEAN bta_hl_get_l2cap_cfg(tBTA_HL_MDL_HANDLE mdl_hnd, tBTA_HL_L2CAP_CFG_INFO *p_cfg);
- extern BOOLEAN bta_hl_validate_chan_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx);
- extern BOOLEAN bta_hl_is_cong_on(UINT8 app_id, BD_ADDR bd_addr, tBTA_HL_MDL_ID mdl_id);
- extern void bta_hl_check_cch_close(UINT8 app_idx, UINT8 mcl_idx,
- tBTA_HL_DATA *p_data, BOOLEAN check_dch_setup);
- extern void bta_hl_clean_app(UINT8 app_idx);
- extern void bta_hl_check_deregistration(UINT8 app_idx, tBTA_HL_DATA *p_data );
+ uint8_t *p_mdep_cfg_idx, uint8_t *p_mdl_cfg_idx);
+ extern bool bta_hl_find_avail_mcl_idx(uint8_t app_idx, uint8_t *p_mcl_idx);
+ extern bool bta_hl_find_avail_mdl_idx(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t *p_mdl_idx);
+ extern bool bta_hl_is_a_duplicate_id(uint8_t app_id);
+ extern bool bta_hl_find_avail_app_idx(uint8_t *p_idx);
+ extern tBTA_HL_STATUS bta_hl_app_update(uint8_t app_id, bool is_register);
+ extern tBTA_HL_STATUS bta_hl_app_registration(uint8_t app_idx);
+ extern void bta_hl_discard_data(uint16_t event, tBTA_HL_DATA *p_data);
+ extern void bta_hl_save_mdl_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx );
+ extern void bta_hl_set_dch_chan_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx, tBTA_HL_DATA *p_data);
+ extern bool bta_hl_get_l2cap_cfg(tBTA_HL_MDL_HANDLE mdl_hnd, tBTA_HL_L2CAP_CFG_INFO *p_cfg);
+ extern bool bta_hl_validate_chan_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx);
+ extern bool bta_hl_is_cong_on(uint8_t app_id, BD_ADDR bd_addr, tBTA_HL_MDL_ID mdl_id);
+ extern void bta_hl_check_cch_close(uint8_t app_idx, uint8_t mcl_idx,
+ tBTA_HL_DATA *p_data, bool check_dch_setup);
+ extern void bta_hl_clean_app(uint8_t app_idx);
+ extern void bta_hl_check_deregistration(uint8_t app_idx, tBTA_HL_DATA *p_data );
extern void bta_hl_check_disable(tBTA_HL_DATA *p_data );
extern void bta_hl_build_abort_ind(tBTA_HL *p_evt_data,
tBTA_HL_APP_HANDLE app_handle,
@@ -810,7 +810,7 @@
tBTA_HL_APP_HANDLE app_handle,
tBTA_HL_MCL_HANDLE mcl_handle,
tBTA_HL_MDL_HANDLE mdl_handle,
- BOOLEAN intentional);
+ bool intentional);
extern void bta_hl_build_send_data_cfm(tBTA_HL *p_evt_data,
tBTA_HL_APP_HANDLE app_handle,
tBTA_HL_MCL_HANDLE mcl_handle,
@@ -821,7 +821,7 @@
tBTA_HL_MCL_HANDLE mcl_handle,
tBTA_HL_MDL_HANDLE mdl_handle);
extern void bta_hl_build_cch_open_cfm(tBTA_HL *p_evt_data,
- UINT8 app_id,
+ uint8_t app_id,
tBTA_HL_APP_HANDLE app_handle,
tBTA_HL_MCL_HANDLE mcl_handle,
BD_ADDR bd_addr,
@@ -837,7 +837,7 @@
extern void bta_hl_build_cch_close_ind(tBTA_HL *p_evt_data,
tBTA_HL_APP_HANDLE app_handle,
tBTA_HL_MCL_HANDLE mcl_handle,
- BOOLEAN intentional);
+ bool intentional);
extern void bta_hl_build_dch_open_cfm(tBTA_HL *p_evt_data,
tBTA_HL_APP_HANDLE app_handle,
@@ -846,8 +846,8 @@
tBTA_HL_MDEP_ID local_mdep_id,
tBTA_HL_MDL_ID mdl_id,
tBTA_HL_DCH_MODE dch_mode,
- BOOLEAN first_reliable,
- UINT16 mtu,
+ bool first_reliable,
+ uint16_t mtu,
tBTA_HL_STATUS status);
extern void bta_hl_build_delete_mdl_cfm(tBTA_HL *p_evt_data,
@@ -860,7 +860,7 @@
tBTA_HL_MCL_HANDLE mcl_handle,
tBTA_HL_STATUS status );
extern void bta_hl_build_sdp_query_cfm(tBTA_HL *p_evt_data,
- UINT8 app_id,
+ uint8_t app_id,
tBTA_HL_APP_HANDLE app_handle,
BD_ADDR bd_addr,
tBTA_HL_SDP *p_sdp,
diff --git a/bta/hl/bta_hl_main.c b/bta/hl/bta_hl_main.c
index b4d96cd..4b3e8ab 100644
--- a/bta/hl/bta_hl_main.c
+++ b/bta/hl/bta_hl_main.c
@@ -25,7 +25,7 @@
#include <string.h>
#include "bt_target.h"
-#if defined(HL_INCLUDED) && (HL_INCLUDED == TRUE)
+#if (HL_INCLUDED == TRUE)
@@ -37,13 +37,13 @@
#include "mca_defs.h"
-#if (BTA_HL_DEBUG == TRUE) && (BT_USE_TRACES == TRUE)
+#if (BTA_HL_DEBUG == TRUE && BT_USE_TRACES == TRUE)
static char *bta_hl_cch_state_code(tBTA_HL_CCH_STATE state_code);
static char *bta_hl_dch_state_code(tBTA_HL_DCH_STATE state_code);
#endif
-extern UINT16 L2CA_AllocateRandomPsm(void);
-extern UINT16 L2CA_AllocatePsm(void);
+extern uint16_t L2CA_AllocateRandomPsm(void);
+extern uint16_t L2CA_AllocatePsm(void);
/*****************************************************************************
** DCH State Table
*****************************************************************************/
@@ -86,7 +86,7 @@
BTA_HL_DCH_IGNORE
};
-typedef void (*tBTA_HL_DCH_ACTION)(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx, tBTA_HL_DATA *p_data);
+typedef void (*tBTA_HL_DCH_ACTION)(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx, tBTA_HL_DATA *p_data);
static const tBTA_HL_DCH_ACTION bta_hl_dch_action[] =
{
@@ -129,7 +129,7 @@
#define BTA_HL_DCH_NUM_COLS 2 /* number of columns in state tables */
/* state table for idle state */
-static const UINT8 bta_hl_dch_st_idle[][BTA_HL_DCH_NUM_COLS] =
+static const uint8_t bta_hl_dch_st_idle[][BTA_HL_DCH_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_HL_DCH_SDP_INIT_EVT */ {BTA_HL_DCH_SDP_INIT, BTA_HL_DCH_OPENING_ST},
@@ -166,7 +166,7 @@
};
/* state table for opening state */
-static const UINT8 bta_hl_dch_st_opening[][BTA_HL_DCH_NUM_COLS] =
+static const uint8_t bta_hl_dch_st_opening[][BTA_HL_DCH_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_HL_DCH_SDP_INIT_EVT */ {BTA_HL_DCH_SDP_INIT, BTA_HL_DCH_OPENING_ST},
@@ -201,7 +201,7 @@
};
/* state table for open state */
-static const UINT8 bta_hl_dch_st_open[][BTA_HL_DCH_NUM_COLS] =
+static const uint8_t bta_hl_dch_st_open[][BTA_HL_DCH_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_HL_DCH_SDP_INIT_EVT */ {BTA_HL_DCH_IGNORE, BTA_HL_DCH_OPEN_ST},
@@ -237,7 +237,7 @@
/* state table for closing state */
-static const UINT8 bta_hl_dch_st_closing[][BTA_HL_DCH_NUM_COLS] =
+static const uint8_t bta_hl_dch_st_closing[][BTA_HL_DCH_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_HL_DCH_SDP_INIT_EVT */ {BTA_HL_DCH_IGNORE, BTA_HL_DCH_CLOSING_ST},
@@ -272,7 +272,7 @@
};
/* type for state table */
-typedef const UINT8 (*tBTA_HL_DCH_ST_TBL)[BTA_HL_DCH_NUM_COLS];
+typedef const uint8_t (*tBTA_HL_DCH_ST_TBL)[BTA_HL_DCH_NUM_COLS];
/* state table */
const tBTA_HL_DCH_ST_TBL bta_hl_dch_st_tbl[] =
@@ -304,7 +304,7 @@
};
/* type for action functions */
-typedef void (*tBTA_HL_CCH_ACTION)(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data);
+typedef void (*tBTA_HL_CCH_ACTION)(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data);
/* action function list for MAS */
const tBTA_HL_CCH_ACTION bta_hl_cch_action[] =
@@ -327,7 +327,7 @@
/* state table for MAS idle state */
-static const UINT8 bta_hl_cch_st_idle[][BTA_HL_CCH_NUM_COLS] =
+static const uint8_t bta_hl_cch_st_idle[][BTA_HL_CCH_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_HL_CCH_OPEN_EVT */ {BTA_HL_CCH_SDP_INIT, BTA_HL_CCH_OPENING_ST},
@@ -341,7 +341,7 @@
};
/* state table for obex/rfcomm connection state */
-static const UINT8 bta_hl_cch_st_opening[][BTA_HL_CCH_NUM_COLS] =
+static const uint8_t bta_hl_cch_st_opening[][BTA_HL_CCH_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_HL_CCH_OPEN_EVT */ {BTA_HL_CCH_IGNORE, BTA_HL_CCH_OPENING_ST},
@@ -355,7 +355,7 @@
};
/* state table for open state */
-static const UINT8 bta_hl_cch_st_open[][BTA_HL_CCH_NUM_COLS] =
+static const uint8_t bta_hl_cch_st_open[][BTA_HL_CCH_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_HL_CCH_OPEN_EVT */ {BTA_HL_CCH_IGNORE, BTA_HL_CCH_OPEN_ST},
@@ -369,7 +369,7 @@
};
/* state table for closing state */
-static const UINT8 bta_hl_cch_st_closing[][BTA_HL_CCH_NUM_COLS] =
+static const uint8_t bta_hl_cch_st_closing[][BTA_HL_CCH_NUM_COLS] =
{
/* Event Action 1 Next state */
/* BTA_HL_CCH_OPEN_EVT */ {BTA_HL_CCH_IGNORE, BTA_HL_CCH_CLOSING_ST},
@@ -383,7 +383,7 @@
};
/* type for state table CCH */
-typedef const UINT8 (*tBTA_HL_CCH_ST_TBL)[BTA_HL_CCH_NUM_COLS];
+typedef const uint8_t (*tBTA_HL_CCH_ST_TBL)[BTA_HL_CCH_NUM_COLS];
/* MAS state table */
const tBTA_HL_CCH_ST_TBL bta_hl_cch_st_tbl[] =
@@ -400,7 +400,7 @@
*****************************************************************************/
/* HL control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_HL_CB bta_hl_cb;
#endif
@@ -414,17 +414,17 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_cch_sm_execute(UINT8 app_idx, UINT8 mcl_idx,
- UINT16 event, tBTA_HL_DATA *p_data)
+void bta_hl_cch_sm_execute(uint8_t app_idx, uint8_t mcl_idx,
+ uint16_t event, tBTA_HL_DATA *p_data)
{
tBTA_HL_CCH_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
int i;
tBTA_HL_MCL_CB *p_cb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
-#if (BTA_HL_DEBUG == TRUE) && (BT_USE_TRACES == TRUE)
+#if (BTA_HL_DEBUG == TRUE && BT_USE_TRACES == TRUE)
tBTA_HL_CCH_STATE in_state = p_cb->cch_state;
- UINT16 cur_evt = event;
+ uint16_t cur_evt = event;
APPL_TRACE_DEBUG("HDP CCH Event Handler: State 0x%02x [%s], Event [%s]", in_state,
bta_hl_cch_state_code(in_state),
bta_hl_evt_code(cur_evt));
@@ -451,7 +451,7 @@
break;
}
}
-#if (BTA_HL_DEBUG == TRUE) && (BT_USE_TRACES == TRUE)
+#if (BTA_HL_DEBUG == TRUE && BT_USE_TRACES == TRUE)
if (in_state != p_cb->cch_state)
{
APPL_TRACE_DEBUG("HL CCH State Change: [%s] -> [%s] after [%s]",
@@ -472,17 +472,17 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_dch_sm_execute(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
- UINT16 event, tBTA_HL_DATA *p_data)
+void bta_hl_dch_sm_execute(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
+ uint16_t event, tBTA_HL_DATA *p_data)
{
tBTA_HL_DCH_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
int i;
tBTA_HL_MDL_CB *p_cb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
-#if (BTA_HL_DEBUG == TRUE) && (BT_USE_TRACES == TRUE)
+#if (BTA_HL_DEBUG == TRUE && BT_USE_TRACES == TRUE)
tBTA_HL_DCH_STATE in_state = p_cb->dch_state;
- UINT16 cur_evt = event;
+ uint16_t cur_evt = event;
APPL_TRACE_DEBUG("HDP DCH Event Handler: State 0x%02x [%s], Event [%s]", in_state,
bta_hl_dch_state_code(in_state),
bta_hl_evt_code(cur_evt));
@@ -510,7 +510,7 @@
}
-#if (BTA_HL_DEBUG == TRUE) && (BT_USE_TRACES == TRUE)
+#if (BTA_HL_DEBUG == TRUE && BT_USE_TRACES == TRUE)
if (in_state != p_cb->dch_state)
{
APPL_TRACE_DEBUG("HL DCH State Change: [%s] -> [%s] after [%s]",
@@ -546,7 +546,7 @@
/* Done with checking. now perform the enable oepration*/
/* initialize control block */
memset(p_cb, 0, sizeof(tBTA_HL_CB));
- p_cb->enable = TRUE;
+ p_cb->enable = true;
p_cb->p_ctrl_cback = p_data->api_enable.p_cback;
evt_data.enable_cfm.status = BTA_HL_STATUS_OK;
if (p_data->api_enable.p_cback)
@@ -569,7 +569,7 @@
if (p_cb->enable)
{
- p_cb->disabling = TRUE;
+ p_cb->disabling = true;
bta_hl_check_disable(p_data);
}
else
@@ -580,7 +580,7 @@
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_disable status =%s", bta_hl_status_code(status));
@@ -636,7 +636,7 @@
memset(p_acb, 0, sizeof(tBTA_HL_APP_CB));
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_register status =%s", bta_hl_status_code(status));
@@ -680,7 +680,7 @@
static void bta_hl_api_register(tBTA_HL_CB *p_cb, tBTA_HL_DATA *p_data)
{
tBTA_HL evt_data;
- UINT8 app_idx;
+ uint8_t app_idx;
tBTA_HL_APP_CB *p_acb = NULL;
tBTA_HL_STATUS status = BTA_HL_STATUS_FAIL;
@@ -692,7 +692,7 @@
if (bta_hl_find_avail_app_idx(&app_idx))
{
p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
- p_acb->in_use = TRUE;
+ p_acb->in_use = true;
p_acb->app_id = p_data->api_reg.app_id;
p_acb->p_cback = p_data->api_reg.p_cback;
p_acb->sec_mask = p_data->api_reg.sec_mask;
@@ -726,7 +726,7 @@
memset(p_acb, 0, sizeof(tBTA_HL_APP_CB));
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_register status =%s", bta_hl_status_code(status));
@@ -769,14 +769,14 @@
*******************************************************************************/
static void bta_hl_api_deregister(tBTA_HL_CB *p_cb, tBTA_HL_DATA *p_data)
{
- UINT8 app_idx;
+ uint8_t app_idx;
tBTA_HL_APP_CB *p_acb;
UNUSED(p_cb);
if (bta_hl_find_app_idx_using_handle(p_data->api_dereg.app_handle, &app_idx))
{
p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
- p_acb->deregistering= TRUE;
+ p_acb->deregistering= true;
bta_hl_check_deregistration(app_idx,p_data);
}
else
@@ -798,7 +798,7 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx;
+ uint8_t app_idx, mcl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
UNUSED(p_cb);
@@ -811,7 +811,7 @@
if (bta_hl_find_avail_mcl_idx(app_idx, &mcl_idx))
{
p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- p_mcb->in_use = TRUE;
+ p_mcb->in_use = true;
p_mcb->req_ctrl_psm = p_data->api_cch_open.ctrl_psm;
p_mcb->sec_mask = p_data->api_cch_open.sec_mask;
bdcpy(p_mcb->bd_addr, p_data->api_cch_open.bd_addr);
@@ -849,7 +849,7 @@
{
status = BTA_HL_STATUS_INVALID_APP_HANDLE;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_cch_open status =%s", bta_hl_status_code(status));
@@ -897,7 +897,7 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx;
+ uint8_t app_idx, mcl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
UNUSED(p_cb);
@@ -911,7 +911,7 @@
{
status = BTA_HL_STATUS_INVALID_MCL_HANDLE;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_cch_close status =%s", bta_hl_status_code(status));
@@ -920,7 +920,7 @@
switch (status)
{
case BTA_HL_STATUS_OK:
- bta_hl_check_cch_close(app_idx, mcl_idx, p_data, TRUE);
+ bta_hl_check_cch_close(app_idx, mcl_idx, p_data, true);
break;
case BTA_HL_STATUS_INVALID_MCL_HANDLE:
@@ -958,12 +958,12 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx, mdl_idx;
+ uint8_t app_idx, mcl_idx, mdl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb = NULL;
tBTA_HL_MDL_CB *p_dcb;
tBTA_HL_MDEP_CFG *p_mdep_cfg;
- UINT8 mdep_cfg_idx;
+ uint8_t mdep_cfg_idx;
UNUSED(p_cb);
if (bta_hl_find_mcl_idx_using_handle(p_data->api_dch_open.mcl_handle, &app_idx, &mcl_idx))
@@ -995,7 +995,7 @@
if (bta_hl_set_ctrl_psm_for_dch(app_idx, mcl_idx, mdl_idx, p_data->api_dch_open.ctrl_psm))
{
p_mdep_cfg = BTA_HL_GET_MDEP_CFG_PTR(app_idx, mdep_cfg_idx);
- p_dcb->in_use = TRUE;
+ p_dcb->in_use = true;
p_dcb->dch_oper = BTA_HL_DCH_OP_LOCAL_OPEN;
p_dcb->sec_mask = p_data->api_dch_open.sec_mask;
p_dcb->local_mdep_id = p_data->api_dch_open.local_mdep_id;
@@ -1017,7 +1017,7 @@
&p_dcb->max_rx_apdu_size,
&p_dcb->max_tx_apdu_size);
p_dcb->mdl_id = bta_hl_allocate_mdl_id(app_idx,mcl_idx,mdl_idx);
- p_dcb->mdl_cfg_idx_included = FALSE;
+ p_dcb->mdl_cfg_idx_included = false;
}
else
{
@@ -1051,7 +1051,7 @@
status = BTA_HL_STATUS_INVALID_MCL_HANDLE;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_dch_open status =%s", bta_hl_status_code(status));
@@ -1112,7 +1112,7 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx, mdl_idx;
+ uint8_t app_idx, mcl_idx, mdl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
tBTA_HL_MDL_CB *p_dcb;
@@ -1131,7 +1131,7 @@
status = BTA_HL_STATUS_INVALID_MDL_HANDLE;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_dch_close status =%s", bta_hl_status_code(status));
@@ -1181,12 +1181,12 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx, mdl_idx;
+ uint8_t app_idx, mcl_idx, mdl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb = NULL;
tBTA_HL_MDL_CB *p_dcb;
- UINT8 mdep_cfg_idx;
- UINT8 mdl_cfg_idx;
+ uint8_t mdep_cfg_idx;
+ uint8_t mdl_cfg_idx;
tBTA_HL_MDEP_CFG *p_mdep_cfg;
UNUSED(p_cb);
@@ -1211,14 +1211,14 @@
{
if (bta_hl_set_ctrl_psm_for_dch(app_idx, mcl_idx, mdl_idx, p_data->api_dch_open.ctrl_psm))
{
- p_dcb->in_use = TRUE;
+ p_dcb->in_use = true;
p_dcb->dch_oper = BTA_HL_DCH_OP_LOCAL_RECONNECT;
p_dcb->sec_mask = (BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT);
p_dcb->local_mdep_id = p_acb->mdl_cfg[mdl_cfg_idx].local_mdep_id;
p_dcb->local_mdep_cfg_idx = mdep_cfg_idx;
p_dcb->local_cfg = BTA_HL_DCH_CFG_UNKNOWN;
p_dcb->mdl_id = p_data->api_dch_reconnect.mdl_id;
- p_dcb->mdl_cfg_idx_included = TRUE;
+ p_dcb->mdl_cfg_idx_included = true;
p_dcb->mdl_cfg_idx = mdl_cfg_idx;
p_dcb->dch_mode = p_acb->mdl_cfg[mdl_cfg_idx].dch_mode;
@@ -1265,7 +1265,7 @@
status = BTA_HL_STATUS_INVALID_MCL_HANDLE;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_dch_reconnect status=%s", bta_hl_status_code(status));
@@ -1322,7 +1322,7 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx, mdl_idx;
+ uint8_t app_idx, mcl_idx, mdl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb = NULL;
tBTA_HL_MDL_CB *p_dcb;
@@ -1344,12 +1344,12 @@
if ((p_data->api_dch_echo_test.local_cfg == BTA_HL_DCH_CFG_RELIABLE) ||
(p_data->api_dch_echo_test.local_cfg == BTA_HL_DCH_CFG_STREAMING))
{
- BOOLEAN fcs_use = (BOOLEAN) (p_dcb->chnl_cfg.fcs & BTA_HL_MCA_FCS_USE_MASK);
+ bool fcs_use = (bool) (p_dcb->chnl_cfg.fcs & BTA_HL_MCA_FCS_USE_MASK);
if ((p_dcb->p_echo_tx_pkt = bta_hl_get_buf(p_data->api_dch_echo_test.pkt_size, fcs_use)) != NULL )
{
if (bta_hl_set_ctrl_psm_for_dch(app_idx, mcl_idx, mdl_idx, p_data->api_dch_open.ctrl_psm))
{
- p_dcb->in_use = TRUE;
+ p_dcb->in_use = true;
p_dcb->dch_oper = BTA_HL_DCH_OP_LOCAL_OPEN;
p_dcb->sec_mask = (BTA_SEC_AUTHENTICATE | BTA_SEC_ENCRYPT);
p_dcb->local_mdep_cfg_idx = BTA_HL_ECHO_TEST_MDEP_CFG_IDX;
@@ -1357,11 +1357,11 @@
p_dcb->local_mdep_id = BTA_HL_ECHO_TEST_MDEP_ID;
p_dcb->peer_mdep_id = BTA_HL_ECHO_TEST_MDEP_ID;
p_dcb->mdl_id = bta_hl_allocate_mdl_id(app_idx,mcl_idx,mdl_idx);
- p_dcb->mdl_cfg_idx_included = FALSE;
+ p_dcb->mdl_cfg_idx_included = false;
p_echo_cfg = BTA_HL_GET_ECHO_CFG_PTR(app_idx);
p_dcb->max_rx_apdu_size = p_echo_cfg->max_rx_apdu_size;
p_dcb->max_tx_apdu_size = p_echo_cfg->max_tx_apdu_size;
- p_mcb->echo_test = TRUE;
+ p_mcb->echo_test = true;
p_mcb->echo_mdl_idx = mdl_idx;
}
else
@@ -1399,7 +1399,7 @@
status = BTA_HL_STATUS_NO_MCL;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_dch_echo_test status=%s", bta_hl_status_code(status));
@@ -1456,7 +1456,7 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx;
+ uint8_t app_idx, mcl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
UNUSED(p_cb);
@@ -1468,7 +1468,7 @@
if (bta_hl_find_avail_mcl_idx(app_idx, &mcl_idx))
{
p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- p_mcb->in_use = TRUE;
+ p_mcb->in_use = true;
bdcpy(p_mcb->bd_addr, p_data->api_sdp_query.bd_addr);
APPL_TRACE_DEBUG("bta_hl_api_sdp_query p_mcb->app_id %d app_idx %d mcl_idx %d", p_mcb->app_id, app_idx, mcl_idx);
p_mcb->app_id = p_data->api_sdp_query.app_id;
@@ -1507,7 +1507,7 @@
memset(p_mcb, 0 ,sizeof(tBTA_HL_MCL_CB));
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_sdp_query status=%s", bta_hl_status_code(status));
@@ -1558,13 +1558,13 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx = p_data->cch_sdp.app_idx;
- UINT8 mcl_idx = p_data->cch_sdp.mcl_idx;
+ uint8_t app_idx = p_data->cch_sdp.app_idx;
+ uint8_t mcl_idx = p_data->cch_sdp.mcl_idx;
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR( app_idx);
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR( app_idx, mcl_idx);
tBTA_HL_SDP *p_sdp=NULL;
- UINT16 event;
- BOOLEAN release_sdp_buf=FALSE;
+ uint16_t event;
+ bool release_sdp_buf=false;
UNUSED(p_cb);
event = p_data->hdr.event;
@@ -1572,12 +1572,12 @@
if (event == BTA_HL_SDP_QUERY_OK_EVT) {
p_sdp = (tBTA_HL_SDP *)osi_malloc(sizeof(tBTA_HL_SDP));
memcpy(p_sdp, &p_mcb->sdp, sizeof(tBTA_HL_SDP));
- release_sdp_buf = TRUE;
+ release_sdp_buf = true;
} else {
status = BTA_HL_STATUS_SDP_FAIL;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_sdp_query_results status=%s", bta_hl_status_code(status));
@@ -1596,7 +1596,7 @@
memset(p_mcb, 0, sizeof(tBTA_HL_MCL_CB));
} else {
if (p_mcb->close_pending)
- bta_hl_check_cch_close(app_idx, mcl_idx, p_data, TRUE);
+ bta_hl_check_cch_close(app_idx, mcl_idx, p_data, true);
if (!p_mcb->ctrl_psm) {
/* Control channel acceptor: do not store the SDP records */
@@ -1619,7 +1619,7 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx;
+ uint8_t app_idx, mcl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
UNUSED(p_cb);
@@ -1637,7 +1637,7 @@
p_mcb->delete_mdl.mcl_handle = p_data->api_delete_mdl.mcl_handle;
p_mcb->delete_mdl.mdl_id = p_data->api_delete_mdl.mdl_id;
- p_mcb->delete_mdl.delete_req_pending = TRUE;
+ p_mcb->delete_mdl.delete_req_pending = true;
if (MCA_Delete((tMCA_CL) p_mcb->mcl_handle,
p_data->api_delete_mdl.mdl_id)!= MCA_SUCCESS)
@@ -1661,7 +1661,7 @@
status = BTA_HL_STATUS_INVALID_MCL_HANDLE;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_delete_mdl status=%s", bta_hl_status_code(status));
@@ -1708,10 +1708,10 @@
{
tBTA_HL evt_data;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx;
+ uint8_t app_idx, mcl_idx;
tMCA_RSP_EVT *p_delete_cfm = &p_data->mca_evt.mca_data.delete_cfm;
tBTA_HL_MCL_CB *p_mcb;
- BOOLEAN send_cfm_evt = TRUE;
+ bool send_cfm_evt = true;
tBTA_HL_APP_CB *p_acb;
UNUSED(p_cb);
@@ -1739,15 +1739,15 @@
}
else
{
- send_cfm_evt = FALSE;
+ send_cfm_evt = false;
}
}
else
{
- send_cfm_evt = FALSE;
+ send_cfm_evt = false;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_delete_mdl status=%s", bta_hl_status_code(status));
@@ -1787,11 +1787,11 @@
static void bta_hl_mca_delete_mdl_ind(tBTA_HL_CB *p_cb, tBTA_HL_DATA *p_data)
{
tBTA_HL evt_data;
- UINT8 app_idx, mcl_idx, mdl_idx;
+ uint8_t app_idx, mcl_idx, mdl_idx;
tMCA_EVT_HDR *p_delete_ind = &p_data->mca_evt.mca_data.delete_ind;
tBTA_HL_MCL_CB *p_mcb;
tBTA_HL_MDL_CB *p_dcb;
- BOOLEAN send_ind_evt = FALSE;
+ bool send_ind_evt = false;
tBTA_HL_APP_CB *p_acb;
UNUSED(p_cb);
@@ -1808,11 +1808,11 @@
p_mcb->bd_addr ,
p_delete_ind->mdl_id))
{
- send_ind_evt = TRUE;
+ send_ind_evt = true;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!send_ind_evt)
{
APPL_TRACE_DEBUG("bta_hl_mca_delete_mdl_ind is_send_ind_evt =%d", send_ind_evt);
@@ -1850,7 +1850,7 @@
static void bta_hl_api_dch_abort(tBTA_HL_CB *p_cb, tBTA_HL_DATA *p_data)
{
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
- UINT8 app_idx, mcl_idx, mdl_idx;
+ uint8_t app_idx, mcl_idx, mdl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
tBTA_HL_MDL_CB *p_dcb;
@@ -1884,7 +1884,7 @@
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (status != BTA_HL_STATUS_OK)
{
APPL_TRACE_DEBUG("bta_hl_api_dch_abort status=%s", bta_hl_status_code(status));
@@ -1932,12 +1932,12 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_hl_hdl_event(BT_HDR *p_msg)
+bool bta_hl_hdl_event(BT_HDR *p_msg)
{
- UINT8 app_idx, mcl_idx, mdl_idx;
- BOOLEAN success = TRUE;
+ uint8_t app_idx, mcl_idx, mdl_idx;
+ bool success = true;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("BTA HL Event Handler: Event [%s]",
bta_hl_evt_code(p_msg->event));
#endif
@@ -2014,13 +2014,13 @@
}
else
{
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_ERROR("unable to find control block indexes for CCH: [event=%s]",
bta_hl_evt_code(p_msg->event));
#else
APPL_TRACE_ERROR("unable to find control block indexes for CCH: [event=%d]", p_msg->event);
#endif
- success = FALSE;
+ success = false;
}
}
else
@@ -2035,13 +2035,13 @@
else
{
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_ERROR("unable to find control block indexes for DCH : [event=%s]",
bta_hl_evt_code(p_msg->event));
#else
APPL_TRACE_ERROR("unable to find control block indexes for DCH: [event=%d]", p_msg->event);
#endif
- success = FALSE;
+ success = false;
}
}
@@ -2055,7 +2055,7 @@
/*****************************************************************************
** Debug Functions
*****************************************************************************/
-#if (BTA_HL_DEBUG == TRUE) && (BT_USE_TRACES == TRUE)
+#if (BTA_HL_DEBUG == TRUE && BT_USE_TRACES == TRUE)
/*******************************************************************************
**
diff --git a/bta/hl/bta_hl_sdp.c b/bta/hl/bta_hl_sdp.c
index 826adcd..4f62ffe 100644
--- a/bta/hl/bta_hl_sdp.c
+++ b/bta/hl/bta_hl_sdp.c
@@ -19,7 +19,7 @@
#include <string.h>
#include "bt_target.h"
-#if defined(HL_INCLUDED) && (HL_INCLUDED == TRUE)
+#if (HL_INCLUDED == TRUE)
#include "sdp_api.h"
#include "bta_hl_int.h"
@@ -31,24 +31,24 @@
**
** Description Fill the supported features from teh SDP record
**
-** Returns TRUE if found, FALSE if not
+** Returns true if found, false if not
** If found, the passed protocol list element is filled in.
**
*******************************************************************************/
-BOOLEAN bta_hl_fill_sup_feature_list( const tSDP_DISC_ATTR *p_attr,
+bool bta_hl_fill_sup_feature_list( const tSDP_DISC_ATTR *p_attr,
tBTA_HL_SUP_FEATURE_LIST_ELEM *p_list)
{
tSDP_DISC_ATTR *p_sattr;
- UINT8 item_cnt;
- UINT8 list_cnt=0;
- BOOLEAN status=TRUE;
+ uint8_t item_cnt;
+ uint8_t list_cnt=0;
+ bool status=true;
for (p_attr = p_attr->attr_value.v.p_sub_attr; p_attr; p_attr = p_attr->p_next_attr)
{
/* mdep sequence */
if (SDP_DISC_ATTR_TYPE(p_attr->attr_len_type) != DATA_ELE_SEQ_DESC_TYPE)
{
- return(FALSE);
+ return(false);
}
item_cnt=0;
@@ -92,11 +92,11 @@
** Returns the length of the data sequence
**
*******************************************************************************/
-int bta_hl_compose_supported_feature_list( UINT8 *p, UINT16 num_elem,
+int bta_hl_compose_supported_feature_list( uint8_t *p, uint16_t num_elem,
const tBTA_HL_SUP_FEATURE_ELEM *p_elem_list)
{
- UINT16 xx, str_len, seq_len;
- UINT8 *p_head = p;
+ uint16_t xx, str_len, seq_len;
+ uint8_t *p_head = p;
for (xx = 0; xx < num_elem; xx++, p_elem_list++)
{
@@ -109,7 +109,7 @@
seq_len += str_len+2; /* todo add a # symbol for 2 */
}
- *p++ = (UINT8) seq_len;
+ *p++ = (uint8_t) seq_len;
UINT8_TO_BE_STREAM (p, (UINT_DESC_TYPE << 3) | SIZE_ONE_BYTE);
UINT8_TO_BE_STREAM (p, p_elem_list->mdep_id);
@@ -138,20 +138,20 @@
** If the protocol list already exists in the record, it is replaced
** with the new list.
**
-** Returns TRUE if added OK, else FALSE
+** Returns true if added OK, else false
**
*******************************************************************************/
-BOOLEAN bta_hl_add_sup_feature_list (UINT32 handle, UINT16 num_elem,
+bool bta_hl_add_sup_feature_list (uint32_t handle, uint16_t num_elem,
const tBTA_HL_SUP_FEATURE_ELEM *p_elem_list)
{
int offset;
- BOOLEAN result;
- UINT8 *p_buf = (UINT8 *)osi_malloc(BTA_HL_SUP_FEATURE_SDP_BUF_SIZE);
+ bool result;
+ uint8_t *p_buf = (uint8_t *)osi_malloc(BTA_HL_SUP_FEATURE_SDP_BUF_SIZE);
offset = bta_hl_compose_supported_feature_list(p_buf, num_elem,
p_elem_list);
result = SDP_AddAttribute(handle, ATTR_ID_HDP_SUP_FEAT_LIST,
- DATA_ELE_SEQ_DESC_TYPE, (UINT32) offset, p_buf);
+ DATA_ELE_SEQ_DESC_TYPE, (uint32_t) offset, p_buf);
osi_free(p_buf);
return result;
@@ -168,21 +168,21 @@
** Returns: void
**
*****************************************************************************/
-tBTA_HL_STATUS bta_hl_sdp_update (UINT8 app_id)
+tBTA_HL_STATUS bta_hl_sdp_update (uint8_t app_id)
{
- UINT16 svc_class_id_list[BTA_HL_NUM_SVC_ELEMS];
+ uint16_t svc_class_id_list[BTA_HL_NUM_SVC_ELEMS];
tSDP_PROTOCOL_ELEM proto_elem_list[BTA_HL_NUM_PROTO_ELEMS];
tSDP_PROTO_LIST_ELEM add_proto_list;
tBTA_HL_SUP_FEATURE_LIST_ELEM sup_feature_list;
- UINT16 browse_list[] = {UUID_SERVCLASS_PUBLIC_BROWSE_GROUP};
- UINT8 i,j, cnt,mdep_id, mdep_role;
- UINT8 data_exchange_spec = BTA_HL_SDP_IEEE_11073_20601;
- UINT8 mcap_sup_proc = BTA_HL_MCAP_SUP_PROC_MASK;
- UINT16 profile_uuid = UUID_SERVCLASS_HDP_PROFILE;
- UINT16 version = BTA_HL_VERSION;
- UINT8 num_services=1;
+ uint16_t browse_list[] = {UUID_SERVCLASS_PUBLIC_BROWSE_GROUP};
+ uint8_t i,j, cnt,mdep_id, mdep_role;
+ uint8_t data_exchange_spec = BTA_HL_SDP_IEEE_11073_20601;
+ uint8_t mcap_sup_proc = BTA_HL_MCAP_SUP_PROC_MASK;
+ uint16_t profile_uuid = UUID_SERVCLASS_HDP_PROFILE;
+ uint16_t version = BTA_HL_VERSION;
+ uint8_t num_services=1;
tBTA_HL_APP_CB *p_cb = BTA_HL_GET_APP_CB_PTR(0);
- BOOLEAN result = TRUE;
+ bool result = true;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
UNUSED(app_id);
@@ -240,10 +240,10 @@
if (p_cb->srv_name[0] )
{
result &= SDP_AddAttribute(p_cb->sdp_handle,
- (UINT16)ATTR_ID_SERVICE_NAME,
- (UINT8)TEXT_STR_DESC_TYPE,
- (UINT32)(strlen(p_cb->srv_name) + 1),
- (UINT8 *)p_cb->srv_name);
+ (uint16_t)ATTR_ID_SERVICE_NAME,
+ (uint8_t)TEXT_STR_DESC_TYPE,
+ (uint32_t)(strlen(p_cb->srv_name) + 1),
+ (uint8_t *)p_cb->srv_name);
} /* end of setting optional service name */
}
@@ -252,10 +252,10 @@
if (p_cb->srv_desp[0] )
{
result &= SDP_AddAttribute(p_cb->sdp_handle,
- (UINT16)ATTR_ID_SERVICE_DESCRIPTION,
- (UINT8)TEXT_STR_DESC_TYPE,
- (UINT32)(strlen(p_cb->srv_desp) + 1),
- (UINT8 *)p_cb->srv_desp);
+ (uint16_t)ATTR_ID_SERVICE_DESCRIPTION,
+ (uint8_t)TEXT_STR_DESC_TYPE,
+ (uint32_t)(strlen(p_cb->srv_desp) + 1),
+ (uint8_t *)p_cb->srv_desp);
} /* end of setting optional service description */
@@ -266,10 +266,10 @@
if (p_cb->provider_name[0] )
{
result &= SDP_AddAttribute(p_cb->sdp_handle,
- (UINT16)ATTR_ID_PROVIDER_NAME,
- (UINT8)TEXT_STR_DESC_TYPE,
- (UINT32)(strlen(p_cb->provider_name) + 1),
- (UINT8 *)p_cb->provider_name);
+ (uint16_t)ATTR_ID_PROVIDER_NAME,
+ (uint8_t)TEXT_STR_DESC_TYPE,
+ (uint32_t)(strlen(p_cb->provider_name) + 1),
+ (uint8_t *)p_cb->provider_name);
} /* end of setting optional provider name */
}
@@ -282,8 +282,8 @@
{
if (p_cb->sup_feature.mdep[i].mdep_id)
{
- mdep_id = (UINT8)p_cb->sup_feature.mdep[i].mdep_id;
- mdep_role = (UINT8)p_cb->sup_feature.mdep[i].mdep_cfg.mdep_role;
+ mdep_id = (uint8_t)p_cb->sup_feature.mdep[i].mdep_id;
+ mdep_role = (uint8_t)p_cb->sup_feature.mdep[i].mdep_cfg.mdep_role;
APPL_TRACE_DEBUG("num_of_mdep_data_types %d ", p_cb->sup_feature.mdep[i].mdep_cfg.num_of_mdep_data_types);
for (j=0; j<p_cb->sup_feature.mdep[i].mdep_cfg.num_of_mdep_data_types; j++)
@@ -303,7 +303,7 @@
cnt++;
if (cnt==BTA_HL_NUM_SUP_FEATURE_ELEMS)
{
- result = FALSE;
+ result = false;
break;
}
}
@@ -317,14 +317,14 @@
if (result)
{
result &= SDP_AddAttribute(p_cb->sdp_handle, ATTR_ID_HDP_DATA_EXCH_SPEC, UINT_DESC_TYPE,
- (UINT32)1, (UINT8*)&data_exchange_spec);
+ (uint32_t)1, (uint8_t*)&data_exchange_spec);
}
if (result)
{
result &= SDP_AddAttribute(p_cb->sdp_handle, ATTR_ID_HDP_MCAP_SUP_PROC, UINT_DESC_TYPE,
- (UINT32)1, (UINT8*)&mcap_sup_proc);
+ (uint32_t)1, (uint8_t*)&mcap_sup_proc);
}
if (result)
@@ -349,7 +349,7 @@
}
status = BTA_HL_STATUS_SDP_FAIL;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_sdp_update status=%s", bta_hl_status_code(status));
#endif
return status;
@@ -371,24 +371,24 @@
** Returns: void
**
*****************************************************************************/
-tBTA_HL_STATUS bta_hl_sdp_register (UINT8 app_idx)
+tBTA_HL_STATUS bta_hl_sdp_register (uint8_t app_idx)
{
- UINT16 svc_class_id_list[BTA_HL_NUM_SVC_ELEMS];
+ uint16_t svc_class_id_list[BTA_HL_NUM_SVC_ELEMS];
tSDP_PROTOCOL_ELEM proto_elem_list[BTA_HL_NUM_PROTO_ELEMS];
tSDP_PROTO_LIST_ELEM add_proto_list;
tBTA_HL_SUP_FEATURE_LIST_ELEM sup_feature_list;
- UINT16 browse_list[] = {UUID_SERVCLASS_PUBLIC_BROWSE_GROUP};
- UINT8 i,j, cnt,mdep_id, mdep_role;
- UINT8 data_exchange_spec = BTA_HL_SDP_IEEE_11073_20601;
- UINT8 mcap_sup_proc = BTA_HL_MCAP_SUP_PROC_MASK;
- UINT16 profile_uuid = UUID_SERVCLASS_HDP_PROFILE;
- UINT16 version = BTA_HL_VERSION;
- UINT8 num_services=1;
+ uint16_t browse_list[] = {UUID_SERVCLASS_PUBLIC_BROWSE_GROUP};
+ uint8_t i,j, cnt,mdep_id, mdep_role;
+ uint8_t data_exchange_spec = BTA_HL_SDP_IEEE_11073_20601;
+ uint8_t mcap_sup_proc = BTA_HL_MCAP_SUP_PROC_MASK;
+ uint16_t profile_uuid = UUID_SERVCLASS_HDP_PROFILE;
+ uint16_t version = BTA_HL_VERSION;
+ uint8_t num_services=1;
tBTA_HL_APP_CB *p_cb = BTA_HL_GET_APP_CB_PTR(app_idx);
- BOOLEAN result = TRUE;
+ bool result = true;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_sdp_register app_idx=%d",app_idx);
#endif
@@ -451,10 +451,10 @@
if (p_cb->srv_name[0] )
{
result &= SDP_AddAttribute(p_cb->sdp_handle,
- (UINT16)ATTR_ID_SERVICE_NAME,
- (UINT8)TEXT_STR_DESC_TYPE,
- (UINT32)(strlen(p_cb->srv_name) + 1),
- (UINT8 *)p_cb->srv_name);
+ (uint16_t)ATTR_ID_SERVICE_NAME,
+ (uint8_t)TEXT_STR_DESC_TYPE,
+ (uint32_t)(strlen(p_cb->srv_name) + 1),
+ (uint8_t *)p_cb->srv_name);
} /* end of setting optional service name */
}
@@ -463,10 +463,10 @@
if (p_cb->srv_desp[0] )
{
result &= SDP_AddAttribute(p_cb->sdp_handle,
- (UINT16)ATTR_ID_SERVICE_DESCRIPTION,
- (UINT8)TEXT_STR_DESC_TYPE,
- (UINT32)(strlen(p_cb->srv_desp) + 1),
- (UINT8 *)p_cb->srv_desp);
+ (uint16_t)ATTR_ID_SERVICE_DESCRIPTION,
+ (uint8_t)TEXT_STR_DESC_TYPE,
+ (uint32_t)(strlen(p_cb->srv_desp) + 1),
+ (uint8_t *)p_cb->srv_desp);
} /* end of setting optional service description */
@@ -477,10 +477,10 @@
if (p_cb->provider_name[0] )
{
result &= SDP_AddAttribute(p_cb->sdp_handle,
- (UINT16)ATTR_ID_PROVIDER_NAME,
- (UINT8)TEXT_STR_DESC_TYPE,
- (UINT32)(strlen(p_cb->provider_name) + 1),
- (UINT8 *)p_cb->provider_name);
+ (uint16_t)ATTR_ID_PROVIDER_NAME,
+ (uint8_t)TEXT_STR_DESC_TYPE,
+ (uint32_t)(strlen(p_cb->provider_name) + 1),
+ (uint8_t *)p_cb->provider_name);
} /* end of setting optional provider name */
}
@@ -491,8 +491,8 @@
cnt=0;
for (i=1; i<= p_cb->sup_feature.num_of_mdeps; i++)
{
- mdep_id = (UINT8)p_cb->sup_feature.mdep[i].mdep_id;
- mdep_role = (UINT8)p_cb->sup_feature.mdep[i].mdep_cfg.mdep_role;
+ mdep_id = (uint8_t)p_cb->sup_feature.mdep[i].mdep_id;
+ mdep_role = (uint8_t)p_cb->sup_feature.mdep[i].mdep_cfg.mdep_role;
for (j=0; j<p_cb->sup_feature.mdep[i].mdep_cfg.num_of_mdep_data_types; j++)
{
@@ -511,7 +511,7 @@
cnt++;
if (cnt==BTA_HL_NUM_SUP_FEATURE_ELEMS)
{
- result = FALSE;
+ result = false;
break;
}
}
@@ -524,14 +524,14 @@
if (result)
{
result &= SDP_AddAttribute(p_cb->sdp_handle, ATTR_ID_HDP_DATA_EXCH_SPEC, UINT_DESC_TYPE,
- (UINT32)1, (UINT8*)&data_exchange_spec);
+ (uint32_t)1, (uint8_t*)&data_exchange_spec);
}
if (result)
{
result &= SDP_AddAttribute(p_cb->sdp_handle, ATTR_ID_HDP_MCAP_SUP_PROC, UINT_DESC_TYPE,
- (UINT32)1, (UINT8*)&mcap_sup_proc);
+ (uint32_t)1, (uint8_t*)&mcap_sup_proc);
}
if (result)
@@ -556,7 +556,7 @@
}
status = BTA_HL_STATUS_SDP_FAIL;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_sdp_register status=%s", bta_hl_status_code(status));
#endif
return status;
@@ -578,7 +578,7 @@
tSDP_DISC_REC *bta_hl_find_sink_or_src_srv_class_in_db (const tSDP_DISCOVERY_DB *p_db,
const tSDP_DISC_REC *p_start_rec)
{
-#if SDP_CLIENT_ENABLED == TRUE
+#if (SDP_CLIENT_ENABLED == TRUE)
tSDP_DISC_REC *p_rec;
tSDP_DISC_ATTR *p_attr, *p_sattr;
@@ -626,7 +626,7 @@
#endif
/* If here, no matching UUID found */
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_find_sink_or_src_srv_class_in_db failed");
#endif
diff --git a/bta/hl/bta_hl_utils.c b/bta/hl/bta_hl_utils.c
index 4e8c2b3..3939e16 100644
--- a/bta/hl/bta_hl_utils.c
+++ b/bta/hl/bta_hl_utils.c
@@ -27,7 +27,7 @@
#include <string.h>
#include "bt_target.h"
-#if defined(HL_INCLUDED) && (HL_INCLUDED == TRUE)
+#if (HL_INCLUDED == TRUE)
#include "bt_common.h"
@@ -44,13 +44,13 @@
**
** Description This function set the control PSM for the DCH setup
**
-** Returns BOOLEAN - TRUE - control PSM setting is successful
+** Returns bool - true - control PSM setting is successful
*******************************************************************************/
-BOOLEAN bta_hl_set_ctrl_psm_for_dch(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx, UINT16 ctrl_psm)
+bool bta_hl_set_ctrl_psm_for_dch(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx, uint16_t ctrl_psm)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- BOOLEAN success = TRUE, update_ctrl_psm = FALSE;
+ bool success = true, update_ctrl_psm = false;
UNUSED(mdl_idx);
if (p_mcb->sdp.num_recs)
@@ -58,13 +58,13 @@
if (p_mcb->ctrl_psm != ctrl_psm)
{
/* can not use a different ctrl PSM than the current one*/
- success = FALSE;
+ success = false;
}
}
else
{
/* No SDP info control i.e. channel was opened by the peer */
- update_ctrl_psm = TRUE;
+ update_ctrl_psm = true;
}
if (success && update_ctrl_psm)
@@ -73,7 +73,7 @@
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!success)
{
APPL_TRACE_DEBUG("bta_hl_set_ctrl_psm_for_dch num_recs=%d success=%d update_ctrl_psm=%d ctrl_psm=0x%x ",
@@ -91,16 +91,16 @@
**
** Description
**
-** Returns TRUE if found
+** Returns true if found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_sdp_idx_using_ctrl_psm(tBTA_HL_SDP *p_sdp,
- UINT16 ctrl_psm,
- UINT8 *p_sdp_idx)
+bool bta_hl_find_sdp_idx_using_ctrl_psm(tBTA_HL_SDP *p_sdp,
+ uint16_t ctrl_psm,
+ uint8_t *p_sdp_idx)
{
- BOOLEAN found=FALSE;
+ bool found=false;
tBTA_HL_SDP_REC *p_rec;
- UINT8 i;
+ uint8_t i;
if (ctrl_psm != 0)
{
@@ -110,7 +110,7 @@
if (p_rec->ctrl_psm == ctrl_psm)
{
*p_sdp_idx = i;
- found = TRUE;
+ found = true;
break;
}
}
@@ -118,10 +118,10 @@
else
{
*p_sdp_idx = 0;
- found = TRUE;
+ found = true;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_sdp_idx_using_ctrl_psm found=%d sdp_idx=%d ctrl_psm=0x%x ",
@@ -137,11 +137,11 @@
**
** Description This function sets the user tx buffer size
**
-** Returns UINT16 buf_size
+** Returns uint16_t buf_size
**
*******************************************************************************/
-UINT16 bta_hl_set_user_tx_buf_size(UINT16 max_tx_size)
+uint16_t bta_hl_set_user_tx_buf_size(uint16_t max_tx_size)
{
if (max_tx_size > BT_DEFAULT_BUFFER_SIZE)
return BTA_HL_LRG_DATA_BUF_SIZE;
@@ -154,11 +154,11 @@
**
** Description This function sets the user rx buffer size
**
-** Returns UINT16 buf_size
+** Returns uint16_t buf_size
**
*******************************************************************************/
-UINT16 bta_hl_set_user_rx_buf_size(UINT16 mtu)
+uint16_t bta_hl_set_user_rx_buf_size(uint16_t mtu)
{
if (mtu > BT_DEFAULT_BUFFER_SIZE)
return BTA_HL_LRG_DATA_BUF_SIZE;
@@ -173,12 +173,12 @@
**
** Description This function sets the tx window size
**
-** Returns UINT8 tx_win_size
+** Returns uint8_t tx_win_size
**
*******************************************************************************/
-UINT8 bta_hl_set_tx_win_size(UINT16 mtu, UINT16 mps)
+uint8_t bta_hl_set_tx_win_size(uint16_t mtu, uint16_t mps)
{
- UINT8 tx_win_size;
+ uint8_t tx_win_size;
if (mtu <= mps)
{
@@ -197,7 +197,7 @@
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_set_tx_win_size win_size=%d mtu=%d mps=%d",
tx_win_size, mtu, mps);
#endif
@@ -210,12 +210,12 @@
**
** Description This function sets the MPS
**
-** Returns UINT16 MPS
+** Returns uint16_t MPS
**
*******************************************************************************/
-UINT16 bta_hl_set_mps(UINT16 mtu)
+uint16_t bta_hl_set_mps(uint16_t mtu)
{
- UINT16 mps;
+ uint16_t mps;
if (mtu > BTA_HL_L2C_MPS)
{
mps = BTA_HL_L2C_MPS;
@@ -224,7 +224,7 @@
{
mps = mtu;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_set_mps mps=%d mtu=%d",
mps, mtu);
#endif
@@ -241,10 +241,10 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_clean_mdl_cb(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx)
+void bta_hl_clean_mdl_cb(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx)
{
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_clean_mdl_cb app_idx=%d mcl_idx=%d mdl_idx=%d",
app_idx, mcl_idx, mdl_idx);
#endif
@@ -266,7 +266,7 @@
** Returns BT_HDR *.
**
*******************************************************************************/
-BT_HDR * bta_hl_get_buf(UINT16 data_size, BOOLEAN fcs_use)
+BT_HDR * bta_hl_get_buf(uint16_t data_size, bool fcs_use)
{
size_t size = data_size + L2CAP_MIN_OFFSET + BT_HDR_SIZE + L2CAP_FCS_LEN
+ L2CAP_EXT_CONTROL_OVERHEAD;
@@ -288,16 +288,16 @@
** Description This function check the specified service class(es) can be find in
** the received SDP database
**
-** Returns BOOLEAN TRUE - found
-** FALSE - not found
+** Returns bool true - found
+** false - not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_service_in_db( UINT8 app_idx, UINT8 mcl_idx,
- UINT16 service_uuid,
+bool bta_hl_find_service_in_db( uint8_t app_idx, uint8_t mcl_idx,
+ uint16_t service_uuid,
tSDP_DISC_REC **pp_rec )
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- BOOLEAN found = TRUE;
+ bool found = true;
switch (service_uuid)
{
@@ -306,14 +306,14 @@
if ((*pp_rec = SDP_FindServiceInDb(p_mcb->p_db, service_uuid,
*pp_rec)) == NULL)
{
- found = FALSE;
+ found = false;
}
break;
default:
if (((*pp_rec = bta_hl_find_sink_or_src_srv_class_in_db(p_mcb->p_db,
*pp_rec)) == NULL))
{
- found = FALSE;
+ found = false;
}
break;
}
@@ -327,16 +327,16 @@
**
** Description This function finds the service class(es) for both CCH and DCH oeprations
**
-** Returns UINT16 - service_id
+** Returns uint16_t - service_id
** if service_uuid = 0xFFFF then it means service uuid
** can be either Sink or Source
**
*******************************************************************************/
-UINT16 bta_hl_get_service_uuids(UINT8 sdp_oper, UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdl_idx )
+uint16_t bta_hl_get_service_uuids(uint8_t sdp_oper, uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdl_idx )
{
tBTA_HL_MDL_CB *p_dcb;
- UINT16 service_uuid = 0xFFFF; /* both Sink and Source */
+ uint16_t service_uuid = 0xFFFF; /* both Sink and Source */
switch (sdp_oper)
{
@@ -361,7 +361,7 @@
/* use default that is both Sink and Source */
break;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_get_service_uuids service_uuid=0x%x",service_uuid );
#endif
return service_uuid;
@@ -374,16 +374,16 @@
**
** Description This function finds the configuration response for the echo test
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_echo_cfg_rsp(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdep_idx, UINT8 cfg,
- UINT8 *p_cfg_rsp)
+bool bta_hl_find_echo_cfg_rsp(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdep_idx, uint8_t cfg,
+ uint8_t *p_cfg_rsp)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MDEP *p_mdep= &p_acb->sup_feature.mdep[mdep_idx];
- BOOLEAN status =TRUE;
+ bool status =true;
if (p_mdep->mdep_id == BTA_HL_ECHO_TEST_MDEP_ID)
{
@@ -397,13 +397,13 @@
}
else
{
- status = FALSE;
+ status = false;
APPL_TRACE_ERROR("Inavlid echo cfg value");
}
return status;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!status)
{
APPL_TRACE_DEBUG("bta_hl_find_echo_cfg_rsp status=failed app_idx=%d mcl_idx=%d mdep_idx=%d cfg=%d",
@@ -420,15 +420,15 @@
**
** Description This function validate the DCH configuration
**
-** Returns BOOLEAN - TRUE cfg is valid
-** FALSE not valid
+** Returns bool - true cfg is valid
+** false not valid
**
*******************************************************************************/
-BOOLEAN bta_hl_validate_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
- UINT8 cfg)
+bool bta_hl_validate_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
+ uint8_t cfg)
{
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
- BOOLEAN is_valid =FALSE;
+ bool is_valid =false;
if (!bta_hl_is_the_first_reliable_existed(app_idx, mcl_idx) &&
@@ -444,21 +444,21 @@
if ((cfg == BTA_HL_DCH_CFG_RELIABLE) || (cfg == BTA_HL_DCH_CFG_STREAMING))
{
- is_valid = TRUE;
+ is_valid = true;
}
break;
case BTA_HL_DCH_CFG_RELIABLE:
case BTA_HL_DCH_CFG_STREAMING:
if (p_dcb->local_cfg == cfg )
{
- is_valid = TRUE;
+ is_valid = true;
}
break;
default:
break;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!is_valid)
{
APPL_TRACE_DEBUG("bta_hl_validate_dch_open_cfg is_valid=%d, cfg=%d", is_valid, cfg );
@@ -473,17 +473,17 @@
**
** Description This function finds the indexes needed for the CCH state machine
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_cch_cb_indexes(tBTA_HL_DATA *p_msg,
- UINT8 *p_app_idx,
- UINT8 *p_mcl_idx)
+bool bta_hl_find_cch_cb_indexes(tBTA_HL_DATA *p_msg,
+ uint8_t *p_app_idx,
+ uint8_t *p_mcl_idx)
{
- BOOLEAN found = FALSE;
+ bool found = false;
tBTA_HL_MCL_CB *p_mcb;
- UINT8 app_idx = 0, mcl_idx = 0;
+ uint8_t app_idx = 0, mcl_idx = 0;
switch (p_msg->hdr.event)
{
@@ -491,7 +491,7 @@
case BTA_HL_CCH_SDP_FAIL_EVT:
app_idx = p_msg->cch_sdp.app_idx;
mcl_idx = p_msg->cch_sdp.mcl_idx;
- found = TRUE;
+ found = true;
break;
case BTA_HL_MCA_CONNECT_IND_EVT:
@@ -501,16 +501,16 @@
if (bta_hl_find_mcl_idx(app_idx, p_msg->mca_evt.mca_data.connect_ind.bd_addr, &mcl_idx))
{
/* local initiated */
- found = TRUE;
+ found = true;
}
else if (!bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx)&&
bta_hl_find_avail_mcl_idx(app_idx, &mcl_idx))
{
/* remote initiated */
p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- p_mcb->in_use = TRUE;
+ p_mcb->in_use = true;
p_mcb->cch_oper = BTA_HL_CCH_OP_REMOTE_OPEN;
- found = TRUE;
+ found = true;
}
}
break;
@@ -519,12 +519,12 @@
if (bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx))
{
- found = TRUE;
+ found = true;
}
else if (bta_hl_find_app_idx_using_handle(p_msg->mca_evt.app_handle, &app_idx) &&
bta_hl_find_mcl_idx(app_idx, p_msg->mca_evt.mca_data.disconnect_ind.bd_addr, &mcl_idx))
{
- found = TRUE;
+ found = true;
}
if (found)
@@ -541,7 +541,7 @@
if (bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx))
{
- found = TRUE;
+ found = true;
}
if (found)
@@ -564,7 +564,7 @@
*p_mcl_idx = mcl_idx;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_cch_cb_indexes event=%s found=%d app_idx=%d mcl_idx=%d",
@@ -581,18 +581,18 @@
**
** Description This function finds the indexes needed for the DCH state machine
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_dch_cb_indexes(tBTA_HL_DATA *p_msg,
- UINT8 *p_app_idx,
- UINT8 *p_mcl_idx,
- UINT8 *p_mdl_idx)
+bool bta_hl_find_dch_cb_indexes(tBTA_HL_DATA *p_msg,
+ uint8_t *p_app_idx,
+ uint8_t *p_mcl_idx,
+ uint8_t *p_mdl_idx)
{
- BOOLEAN found = FALSE;
+ bool found = false;
tBTA_HL_MCL_CB *p_mcb;
- UINT8 app_idx = 0, mcl_idx = 0, mdl_idx = 0;
+ uint8_t app_idx = 0, mcl_idx = 0, mdl_idx = 0;
switch (p_msg->hdr.event)
{
@@ -600,7 +600,7 @@
if (bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx) &&
bta_hl_find_mdl_idx( app_idx, mcl_idx, p_msg->mca_evt.mca_data.create_cfm.mdl_id, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
@@ -609,7 +609,7 @@
if (bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx) &&
bta_hl_find_avail_mdl_idx( app_idx, mcl_idx, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
@@ -617,7 +617,7 @@
if (bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx) &&
bta_hl_find_mdl_idx( app_idx, mcl_idx, p_msg->mca_evt.mca_data.open_cfm.mdl_id, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
@@ -625,7 +625,7 @@
if (bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx) &&
bta_hl_find_mdl_idx( app_idx, mcl_idx, p_msg->mca_evt.mca_data.open_ind.mdl_id, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
@@ -634,7 +634,7 @@
if (bta_hl_find_mdl_idx_using_handle((tBTA_HL_MDL_HANDLE)p_msg->mca_evt.mca_data.close_cfm.mdl,
&app_idx, &mcl_idx, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
case BTA_HL_MCA_CLOSE_IND_EVT:
@@ -642,7 +642,7 @@
if (bta_hl_find_mdl_idx_using_handle((tBTA_HL_MDL_HANDLE)p_msg->mca_evt.mca_data.close_ind.mdl,
&app_idx, &mcl_idx, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
case BTA_HL_API_SEND_DATA_EVT:
@@ -650,7 +650,7 @@
if (bta_hl_find_mdl_idx_using_handle(p_msg->api_send_data.mdl_handle,
&app_idx, &mcl_idx, &mdl_idx ))
{
- found = TRUE;
+ found = true;
}
break;
@@ -660,7 +660,7 @@
if (bta_hl_find_mdl_idx_using_handle((tBTA_HL_MDL_HANDLE)p_msg->mca_evt.mca_data.cong_chg.mdl,
&app_idx, &mcl_idx, &mdl_idx ))
{
- found = TRUE;
+ found = true;
}
break;
@@ -669,7 +669,7 @@
app_idx = p_msg->mca_rcv_data_evt.app_idx;
mcl_idx = p_msg->mca_rcv_data_evt.mcl_idx;
mdl_idx = p_msg->mca_rcv_data_evt.mdl_idx;
- found = TRUE;
+ found = true;
break;
case BTA_HL_DCH_RECONNECT_EVT:
case BTA_HL_DCH_OPEN_EVT:
@@ -678,13 +678,13 @@
app_idx = p_msg->dch_sdp.app_idx;
mcl_idx = p_msg->dch_sdp.mcl_idx;
mdl_idx = p_msg->dch_sdp.mdl_idx;
- found = TRUE;
+ found = true;
break;
case BTA_HL_MCA_RECONNECT_CFM_EVT:
if (bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx) &&
bta_hl_find_mdl_idx( app_idx, mcl_idx, p_msg->mca_evt.mca_data.reconnect_cfm.mdl_id, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
@@ -693,28 +693,28 @@
if (bta_hl_find_mcl_idx_using_handle(p_msg->api_dch_create_rsp.mcl_handle, &app_idx, &mcl_idx)&&
bta_hl_find_mdl_idx( app_idx, mcl_idx,p_msg->api_dch_create_rsp.mdl_id, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
case BTA_HL_MCA_ABORT_IND_EVT:
if (bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx) &&
bta_hl_find_mdl_idx( app_idx, mcl_idx,p_msg->mca_evt.mca_data.abort_ind.mdl_id, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
case BTA_HL_MCA_ABORT_CFM_EVT:
if (bta_hl_find_mcl_idx_using_handle(p_msg->mca_evt.mcl_handle, &app_idx, &mcl_idx) &&
bta_hl_find_mdl_idx( app_idx, mcl_idx, p_msg->mca_evt.mca_data.abort_cfm.mdl_id, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
case BTA_HL_CI_GET_TX_DATA_EVT:
case BTA_HL_CI_PUT_RX_DATA_EVT:
if (bta_hl_find_mdl_idx_using_handle(p_msg->ci_get_put_data.mdl_handle, &app_idx, &mcl_idx, &mdl_idx))
{
- found = TRUE;
+ found = true;
}
break;
case BTA_HL_CI_GET_ECHO_DATA_EVT:
@@ -723,7 +723,7 @@
{
p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
mdl_idx = p_mcb->echo_mdl_idx;
- found = TRUE;
+ found = true;
}
break;
@@ -738,7 +738,7 @@
*p_mcl_idx = mcl_idx;
*p_mdl_idx = mdl_idx;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_dch_cb_indexes event=%s found=%d app_idx=%d mcl_idx=%d mdl_idx=%d",
@@ -755,19 +755,19 @@
**
** Description This function allocates a MDL ID
**
-** Returns UINT16 - MDL ID
+** Returns uint16_t - MDL ID
**
*******************************************************************************/
-UINT16 bta_hl_allocate_mdl_id(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx )
+uint16_t bta_hl_allocate_mdl_id(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx )
{
- UINT16 mdl_id=0;
+ uint16_t mdl_id=0;
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- BOOLEAN duplicate_id;
- UINT8 i, mdl_cfg_idx;
+ bool duplicate_id;
+ uint8_t i, mdl_cfg_idx;
do
{
- duplicate_id = FALSE;
+ duplicate_id = false;
mdl_id = ((mdl_id+1) & 0xFEFF);
/* check mdl_ids that are used for the current conenctions */
for (i=0; i< BTA_HL_NUM_MDLS_PER_MCL; i++)
@@ -776,7 +776,7 @@
(i != mdl_idx) &&
(p_mcb->mdl[i].mdl_id == mdl_id) )
{
- duplicate_id = TRUE;
+ duplicate_id = true;
break;
}
}
@@ -791,7 +791,7 @@
/* check mdl_ids that are stored in the persistent memory */
if (bta_hl_find_mdl_cfg_idx(app_idx,mcl_idx, mdl_id, &mdl_cfg_idx))
{
- duplicate_id = TRUE;
+ duplicate_id = true;
}
else
{
@@ -800,9 +800,9 @@
}
}
- }while (TRUE);
+ }while (true);
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_allocate_mdl OK mdl_id=%d", mdl_id);
#endif
return mdl_id;
@@ -813,15 +813,15 @@
**
** Description This function finds the MDL index based on mdl_id
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_mdl_idx(UINT8 app_idx, UINT8 mcl_idx, UINT16 mdl_id,
- UINT8 *p_mdl_idx)
+bool bta_hl_find_mdl_idx(uint8_t app_idx, uint8_t mcl_idx, uint16_t mdl_id,
+ uint8_t *p_mdl_idx)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_MDLS_PER_MCL ; i ++)
{
@@ -829,13 +829,13 @@
(mdl_id !=0) &&
(p_mcb->mdl[i].mdl_id== mdl_id))
{
- found = TRUE;
+ found = true;
*p_mdl_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_mdl_idx found=%d mdl_id=%d mdl_idx=%d ",
@@ -852,28 +852,28 @@
**
** Description This function finds an active MDL
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_an_active_mdl_idx(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 *p_mdl_idx)
+bool bta_hl_find_an_active_mdl_idx(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t *p_mdl_idx)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_MDLS_PER_MCL ; i ++)
{
if (p_mcb->mdl[i].in_use &&
(p_mcb->mdl[i].dch_state == BTA_HL_DCH_OPEN_ST))
{
- found = TRUE;
+ found = true;
*p_mdl_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (found)
{
APPL_TRACE_DEBUG("bta_hl_find_an_opened_mdl_idx found=%d app_idx=%d mcl_idx=%d mdl_idx=%d",
@@ -890,28 +890,28 @@
**
** Description This function finds a MDL which in the DCH setup state
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_dch_setup_mdl_idx(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 *p_mdl_idx)
+bool bta_hl_find_dch_setup_mdl_idx(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t *p_mdl_idx)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_MDLS_PER_MCL ; i ++)
{
if (p_mcb->mdl[i].in_use &&
(p_mcb->mdl[i].dch_state == BTA_HL_DCH_OPENING_ST))
{
- found = TRUE;
+ found = true;
*p_mdl_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (found)
{
APPL_TRACE_DEBUG("bta_hl_find_dch_setup_mdl_idx found=%d app_idx=%d mcl_idx=%d mdl_idx=%d",
@@ -928,15 +928,15 @@
**
** Description This function finds an in-use MCL control block index
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_an_in_use_mcl_idx(UINT8 app_idx,
- UINT8 *p_mcl_idx)
+bool bta_hl_find_an_in_use_mcl_idx(uint8_t app_idx,
+ uint8_t *p_mcl_idx)
{
tBTA_HL_MCL_CB *p_mcb;
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_MCLS ; i ++)
{
@@ -944,13 +944,13 @@
if (p_mcb->in_use &&
(p_mcb->cch_state != BTA_HL_CCH_IDLE_ST))
{
- found = TRUE;
+ found = true;
*p_mcl_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (found)
{
APPL_TRACE_DEBUG("bta_hl_find_an_in_use_mcl_idx found=%d app_idx=%d mcl_idx=%d ",
@@ -968,27 +968,27 @@
**
** Description This function finds an in-use application control block index
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_an_in_use_app_idx(UINT8 *p_app_idx)
+bool bta_hl_find_an_in_use_app_idx(uint8_t *p_app_idx)
{
tBTA_HL_APP_CB *p_acb ;
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_APPS ; i ++)
{
p_acb = BTA_HL_GET_APP_CB_PTR(i);
if (p_acb->in_use)
{
- found = TRUE;
+ found = true;
*p_app_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (found)
{
APPL_TRACE_DEBUG("bta_hl_find_an_in_use_app_idx found=%d app_idx=%d ",
@@ -1005,26 +1005,26 @@
** Description This function finds the application control block index based on
** the application ID
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_app_idx(UINT8 app_id, UINT8 *p_app_idx)
+bool bta_hl_find_app_idx(uint8_t app_id, uint8_t *p_app_idx)
{
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_APPS ; i ++)
{
if (bta_hl_cb.acb[i].in_use &&
(bta_hl_cb.acb[i].app_id == app_id))
{
- found = TRUE;
+ found = true;
*p_app_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_find_app_idx found=%d app_id=%d idx=%d ",
found, app_id, i);
#endif
@@ -1040,27 +1040,27 @@
** Description This function finds the application control block index based on
** the application handle
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_app_idx_using_handle(tBTA_HL_APP_HANDLE app_handle,
- UINT8 *p_app_idx)
+bool bta_hl_find_app_idx_using_handle(tBTA_HL_APP_HANDLE app_handle,
+ uint8_t *p_app_idx)
{
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_APPS ; i ++)
{
if (bta_hl_cb.acb[i].in_use &&
(bta_hl_cb.acb[i].app_handle == app_handle))
{
- found = TRUE;
+ found = true;
*p_app_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_app_idx_using_mca_handle status=%d handle=%d app_idx=%d ",
@@ -1079,15 +1079,15 @@
** Description This function finds the MCL control block index based on
** the MCL handle
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_mcl_idx_using_handle( tBTA_HL_MCL_HANDLE mcl_handle,
- UINT8 *p_app_idx, UINT8 *p_mcl_idx)
+bool bta_hl_find_mcl_idx_using_handle( tBTA_HL_MCL_HANDLE mcl_handle,
+ uint8_t *p_app_idx, uint8_t *p_mcl_idx)
{
tBTA_HL_APP_CB *p_acb;
- BOOLEAN found=FALSE;
- UINT8 i = 0,j = 0;
+ bool found=false;
+ uint8_t i = 0,j = 0;
for (i=0; i<BTA_HL_NUM_APPS; i++)
{
@@ -1098,7 +1098,7 @@
{
if ( p_acb->mcb[j].mcl_handle == mcl_handle )
{
- found = TRUE;
+ found = true;
*p_app_idx = i;
*p_mcl_idx = j;
break;
@@ -1107,7 +1107,7 @@
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_mcl_idx_using_handle found=%d app_idx=%d mcl_idx=%d",
@@ -1124,26 +1124,26 @@
** Description This function finds the MCL control block index based on
** the peer BD address
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_mcl_idx(UINT8 app_idx, BD_ADDR p_bd_addr, UINT8 *p_mcl_idx)
+bool bta_hl_find_mcl_idx(uint8_t app_idx, BD_ADDR p_bd_addr, uint8_t *p_mcl_idx)
{
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_MCLS ; i ++)
{
if (bta_hl_cb.acb[app_idx].mcb[i].in_use &&
(!memcmp (bta_hl_cb.acb[app_idx].mcb[i].bd_addr, p_bd_addr, BD_ADDR_LEN)))
{
- found = TRUE;
+ found = true;
*p_mcl_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_mcl_idx found=%d idx=%d",
@@ -1162,18 +1162,18 @@
** Description This function finds the MDL control block index based on
** the MDL handle
**
-** Returns BOOLEAN TRUE-found
+** Returns bool true-found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_mdl_idx_using_handle(tBTA_HL_MDL_HANDLE mdl_handle,
- UINT8 *p_app_idx,UINT8 *p_mcl_idx,
- UINT8 *p_mdl_idx)
+bool bta_hl_find_mdl_idx_using_handle(tBTA_HL_MDL_HANDLE mdl_handle,
+ uint8_t *p_app_idx,uint8_t *p_mcl_idx,
+ uint8_t *p_mdl_idx)
{
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
tBTA_HL_MDL_CB *p_dcb;
- BOOLEAN found=FALSE;
- UINT8 i,j,k;
+ bool found=false;
+ uint8_t i,j,k;
for (i=0; i < BTA_HL_NUM_APPS ; i ++)
{
@@ -1192,7 +1192,7 @@
{
if (p_dcb->mdl_handle == mdl_handle)
{
- found = TRUE;
+ found = true;
*p_app_idx = i;
*p_mcl_idx =j;
*p_mdl_idx = k;
@@ -1206,7 +1206,7 @@
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_mdl_idx_using_handle found=%d mdl_handle=%d ",
@@ -1222,26 +1222,26 @@
** Description This function checks whether the first reliable DCH channel
** has been setup on the MCL or not
**
-** Returns BOOLEAN - TRUE exist
-** FALSE does not exist
+** Returns bool - true exist
+** false does not exist
**
*******************************************************************************/
-BOOLEAN bta_hl_is_the_first_reliable_existed(UINT8 app_idx, UINT8 mcl_idx )
+bool bta_hl_is_the_first_reliable_existed(uint8_t app_idx, uint8_t mcl_idx )
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- BOOLEAN is_existed =FALSE;
- UINT8 i ;
+ bool is_existed =false;
+ uint8_t i ;
for (i=0; i< BTA_HL_NUM_MDLS_PER_MCL; i++)
{
if (p_mcb->mdl[i].in_use && p_mcb->mdl[i].is_the_first_reliable)
{
- is_existed = TRUE;
+ is_existed = true;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_is_the_first_reliable_existed is_existed=%d ",is_existed );
#endif
return is_existed;
@@ -1254,24 +1254,24 @@
** Description This function finds a valid MDL configiration index and this
** MDL ID is not active
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_non_active_mdl_cfg(UINT8 app_idx, UINT8 start_mdl_cfg_idx,
- UINT8 *p_mdl_cfg_idx)
+bool bta_hl_find_non_active_mdl_cfg(uint8_t app_idx, uint8_t start_mdl_cfg_idx,
+ uint8_t *p_mdl_cfg_idx)
{
tBTA_HL_MCL_CB *p_mcb;
tBTA_HL_MDL_CB *p_dcb;
tBTA_HL_MDL_CFG *p_mdl;
- BOOLEAN mdl_in_use;
- BOOLEAN found = FALSE;
- UINT8 i,j,k;
+ bool mdl_in_use;
+ bool found = false;
+ uint8_t i,j,k;
for (i = start_mdl_cfg_idx; i< BTA_HL_NUM_MDL_CFGS; i++)
{
- mdl_in_use = FALSE;
+ mdl_in_use = false;
p_mdl = BTA_HL_GET_MDL_CFG_PTR(app_idx, i);
for (j=0; j< BTA_HL_NUM_MCLS; j++)
{
@@ -1286,7 +1286,7 @@
if (p_dcb->in_use && p_mdl->mdl_id == p_dcb->mdl_id)
{
- mdl_in_use = TRUE;
+ mdl_in_use = true;
break;
}
}
@@ -1301,7 +1301,7 @@
if (!mdl_in_use)
{
*p_mdl_cfg_idx = i;
- found = TRUE;
+ found = true;
break;
}
}
@@ -1315,18 +1315,18 @@
**
** Description This function finds an available MDL configuration index
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_avail_mdl_cfg_idx(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 *p_mdl_cfg_idx)
+bool bta_hl_find_avail_mdl_cfg_idx(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t *p_mdl_cfg_idx)
{
tBTA_HL_MDL_CFG *p_mdl, *p_mdl1, *p_mdl2;
- UINT8 i;
- BOOLEAN found=FALSE;
- UINT8 first_mdl_cfg_idx, second_mdl_cfg_idx, older_mdl_cfg_idx;
- BOOLEAN done;
+ uint8_t i;
+ bool found=false;
+ uint8_t first_mdl_cfg_idx, second_mdl_cfg_idx, older_mdl_cfg_idx;
+ bool done;
UNUSED(mcl_idx);
for (i=0; i< BTA_HL_NUM_MDL_CFGS; i++)
@@ -1335,7 +1335,7 @@
if (!p_mdl->active )
{
/* found an unused space to store mdl cfg*/
- found=TRUE;
+ found=true;
*p_mdl_cfg_idx =i;
break;
}
@@ -1346,12 +1346,12 @@
/* all available mdl cfg spaces are in use so we need to find the mdl cfg which is
not currently in use and has the the oldest time stamp to remove*/
- found = TRUE;
+ found = true;
if (bta_hl_find_non_active_mdl_cfg(app_idx,0, &first_mdl_cfg_idx))
{
- if (bta_hl_find_non_active_mdl_cfg(app_idx,(UINT8) (first_mdl_cfg_idx+1), &second_mdl_cfg_idx))
+ if (bta_hl_find_non_active_mdl_cfg(app_idx,(uint8_t) (first_mdl_cfg_idx+1), &second_mdl_cfg_idx))
{
- done = FALSE;
+ done = false;
while (!done)
{
p_mdl1 = BTA_HL_GET_MDL_CFG_PTR(app_idx, first_mdl_cfg_idx);
@@ -1366,13 +1366,13 @@
older_mdl_cfg_idx = second_mdl_cfg_idx;
}
- if (bta_hl_find_non_active_mdl_cfg(app_idx,(UINT8) (second_mdl_cfg_idx+1), &second_mdl_cfg_idx))
+ if (bta_hl_find_non_active_mdl_cfg(app_idx,(uint8_t) (second_mdl_cfg_idx+1), &second_mdl_cfg_idx))
{
first_mdl_cfg_idx = older_mdl_cfg_idx;
}
else
{
- done = TRUE;
+ done = true;
}
}
@@ -1387,11 +1387,11 @@
}
else
{
- found = FALSE;
+ found = false;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_avail_mdl_cfg_idx found=%d mdl_cfg_idx=%d ",found, *p_mdl_cfg_idx );
@@ -1410,17 +1410,17 @@
** Description This function finds the MDL configuration index based on
** the MDL ID
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_mdl_cfg_idx(UINT8 app_idx, UINT8 mcl_idx,
- tBTA_HL_MDL_ID mdl_id, UINT8 *p_mdl_cfg_idx)
+bool bta_hl_find_mdl_cfg_idx(uint8_t app_idx, uint8_t mcl_idx,
+ tBTA_HL_MDL_ID mdl_id, uint8_t *p_mdl_cfg_idx)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CFG *p_mdl;
- UINT8 i ;
- BOOLEAN found=FALSE;
+ uint8_t i ;
+ bool found=false;
*p_mdl_cfg_idx = 0;
for (i=0; i< BTA_HL_NUM_MDL_CFGS; i++)
@@ -1433,13 +1433,13 @@
(!memcmp (p_mcb->bd_addr, p_mdl->peer_bd_addr, BD_ADDR_LEN))&&
(p_mdl->mdl_id == mdl_id))
{
- found=TRUE;
+ found=true;
*p_mdl_cfg_idx =i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_mdl_cfg_idx found=%d mdl_cfg_idx=%d ",found, i );
@@ -1458,22 +1458,22 @@
**
** Description This function get the cuurent time value
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_get_cur_time(UINT8 app_idx, UINT8 *p_cur_time)
+bool bta_hl_get_cur_time(uint8_t app_idx, uint8_t *p_cur_time)
{
tBTA_HL_MDL_CFG *p_mdl;
- UINT8 i, j, time_latest, time;
- BOOLEAN found=FALSE, result=TRUE;
+ uint8_t i, j, time_latest, time;
+ bool found=false, result=true;
for (i=0; i< BTA_HL_NUM_MDL_CFGS; i++)
{
p_mdl = BTA_HL_GET_MDL_CFG_PTR(app_idx, i);
if (p_mdl->active)
{
- found=TRUE;
+ found=true;
time_latest = p_mdl->time;
for (j=(i+1); j< BTA_HL_NUM_MDL_CFGS; j++ )
{
@@ -1501,7 +1501,7 @@
else
{
/* need to wrap around */
- result = FALSE;
+ result = false;
}
}
else
@@ -1509,7 +1509,7 @@
*p_cur_time = BTA_HL_MIN_TIME;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!result)
{
APPL_TRACE_DEBUG("bta_hl_get_cur_time result=%s cur_time=%d",
@@ -1527,15 +1527,15 @@
** Description This function sort the mdl configuration idx stored in array a
** based on decending time value
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-void bta_hl_sort_cfg_time_idx(UINT8 app_idx, UINT8 *a, UINT8 n)
+void bta_hl_sort_cfg_time_idx(uint8_t app_idx, uint8_t *a, uint8_t n)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
- UINT8 temp_time, temp_idx;
- INT16 i, j;
+ uint8_t temp_time, temp_idx;
+ int16_t i, j;
for (i = 1; i < n; ++i)
{
temp_idx = a[i];
@@ -1557,15 +1557,15 @@
** Description This function finds the MDL configuration index based on
** the MDL ID
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-void bta_hl_compact_mdl_cfg_time(UINT8 app_idx, UINT8 mdep_id)
+void bta_hl_compact_mdl_cfg_time(uint8_t app_idx, uint8_t mdep_id)
{
tBTA_HL_MDL_CFG *p_mdl;
- UINT8 i, time_min, cnt=0;
- UINT8 s_arr[BTA_HL_NUM_MDL_CFGS];
+ uint8_t i, time_min, cnt=0;
+ uint8_t s_arr[BTA_HL_NUM_MDL_CFGS];
for (i=0; i< BTA_HL_NUM_MDL_CFGS; i++)
@@ -1580,7 +1580,7 @@
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_compact_mdl_cfg_time cnt=%d ",cnt );
#endif
@@ -1609,16 +1609,16 @@
** Description This function checks whether the MDL ID
** has already existed in teh MCL or not
**
-** Returns BOOLEAN - TRUE exist
-** FALSE does not exist
+** Returns bool - true exist
+** false does not exist
**
*******************************************************************************/
-BOOLEAN bta_hl_is_mdl_exsit_in_mcl(UINT8 app_idx, BD_ADDR bd_addr,
+bool bta_hl_is_mdl_exsit_in_mcl(uint8_t app_idx, BD_ADDR bd_addr,
tBTA_HL_MDL_ID mdl_id)
{
tBTA_HL_MDL_CFG *p_mdl;
- BOOLEAN found = FALSE;
- UINT8 i;
+ bool found = false;
+ uint8_t i;
for (i = 0; i< BTA_HL_NUM_MDL_CFGS; i++)
{
@@ -1630,13 +1630,13 @@
{
if (p_mdl->mdl_id == mdl_id)
{
- found = TRUE;
+ found = true;
break;
}
}
else
{
- found = TRUE;
+ found = true;
break;
}
}
@@ -1651,16 +1651,16 @@
**
** Description This function delete the specified MDL ID
**
-** Returns BOOLEAN - TRUE Success
-** FALSE Failed
+** Returns bool - true Success
+** false Failed
**
*******************************************************************************/
-BOOLEAN bta_hl_delete_mdl_cfg(UINT8 app_idx, BD_ADDR bd_addr,
+bool bta_hl_delete_mdl_cfg(uint8_t app_idx, BD_ADDR bd_addr,
tBTA_HL_MDL_ID mdl_id)
{
tBTA_HL_MDL_CFG *p_mdl;
- BOOLEAN success = FALSE;
- UINT8 i;
+ bool success = false;
+ uint8_t i;
for (i = 0; i< BTA_HL_NUM_MDL_CFGS; i++)
{
@@ -1674,7 +1674,7 @@
{
bta_hl_co_delete_mdl(p_mdl->local_mdep_id, i);
memset(p_mdl, 0, sizeof(tBTA_HL_MDL_CFG));
- success = TRUE;
+ success = true;
break;
}
}
@@ -1682,7 +1682,7 @@
{
bta_hl_co_delete_mdl(p_mdl->local_mdep_id, i);
memset(p_mdl, 0, sizeof(tBTA_HL_MDL_CFG));
- success = TRUE;
+ success = true;
}
}
}
@@ -1698,8 +1698,8 @@
**
** Description This function checks the specified MDL ID is in valid range or not
**
-** Returns BOOLEAN - TRUE Success
-** FALSE Failed
+** Returns bool - true Success
+** false Failed
**
** note: mdl_id range 0x0000 reserved,
** 0x0001-oxFEFF dynamic range,
@@ -1707,9 +1707,9 @@
** 0xFFFF indicates all MDLs (for delete operation only)
**
*******************************************************************************/
-BOOLEAN bta_hl_is_mdl_value_valid(tBTA_HL_MDL_ID mdl_id)
+bool bta_hl_is_mdl_value_valid(tBTA_HL_MDL_ID mdl_id)
{
- BOOLEAN status = TRUE;
+ bool status = true;
if (mdl_id != BTA_HL_DELETE_ALL_MDL_IDS)
{
@@ -1717,12 +1717,12 @@
{
if (mdl_id > BTA_HL_MAX_MDL_VAL )
{
- status = FALSE;
+ status = false;
}
}
else
{
- status = FALSE;
+ status = false;
}
}
@@ -1736,29 +1736,29 @@
** Description This function finds the MDEP configuration index based
** on the local MDEP ID
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_mdep_cfg_idx(UINT8 app_idx, tBTA_HL_MDEP_ID local_mdep_id,
- UINT8 *p_mdep_cfg_idx)
+bool bta_hl_find_mdep_cfg_idx(uint8_t app_idx, tBTA_HL_MDEP_ID local_mdep_id,
+ uint8_t *p_mdep_cfg_idx)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_SUP_FEATURE *p_sup_feature= &p_acb->sup_feature;
- BOOLEAN found =FALSE;
- UINT8 i;
+ bool found =false;
+ uint8_t i;
for (i=0; i< p_sup_feature->num_of_mdeps; i++)
{
if ( p_sup_feature->mdep[i].mdep_id == local_mdep_id)
{
- found = TRUE;
+ found = true;
*p_mdep_cfg_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_mdep_cfg_idx found=%d mdep_idx=%d local_mdep_id=%d ",
@@ -1779,14 +1779,14 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_find_rxtx_apdu_size(UINT8 app_idx, UINT8 mdep_cfg_idx,
- UINT16 *p_rx_apu_size,
- UINT16 *p_tx_apu_size)
+void bta_hl_find_rxtx_apdu_size(uint8_t app_idx, uint8_t mdep_cfg_idx,
+ uint16_t *p_rx_apu_size,
+ uint16_t *p_tx_apu_size)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MDEP_CFG *p_mdep_cfg;
- UINT8 i;
- UINT16 max_rx_apdu_size=0, max_tx_apdu_size=0;
+ uint8_t i;
+ uint16_t max_rx_apdu_size=0, max_tx_apdu_size=0;
p_mdep_cfg = &p_acb->sup_feature.mdep[mdep_cfg_idx].mdep_cfg;
@@ -1809,7 +1809,7 @@
*p_rx_apu_size = max_rx_apdu_size;
*p_tx_apu_size = max_tx_apdu_size;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_find_rxtx_apdu_size max_rx_apdu_size=%d max_tx_apdu_size=%d ",
max_rx_apdu_size, max_tx_apdu_size );
#endif
@@ -1823,27 +1823,27 @@
**
** Description This function validates the peer DCH configuration
**
-** Returns BOOLEAN - TRUE validation is successful
-** FALSE validation failed
+** Returns bool - true validation is successful
+** false validation failed
**
*******************************************************************************/
-BOOLEAN bta_hl_validate_peer_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,
+bool bta_hl_validate_peer_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,
tBTA_HL_MDEP_ID peer_mdep_id,
tBTA_HL_MDEP_ROLE peer_mdep_role,
- UINT8 sdp_idx)
+ uint8_t sdp_idx)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
tBTA_HL_SDP_REC *p_rec;
- BOOLEAN peer_found =FALSE;
- UINT8 i;
+ bool peer_found =false;
+ uint8_t i;
APPL_TRACE_DEBUG("bta_hl_validate_peer_cfg sdp_idx=%d app_idx %d", sdp_idx, app_idx);
if (p_dcb->local_mdep_id == BTA_HL_ECHO_TEST_MDEP_ID)
{
- return TRUE;
+ return true;
}
p_rec = &p_mcb->sdp.sdp_rec[sdp_idx];
@@ -1855,13 +1855,13 @@
if ( (p_rec->mdep_cfg[i].mdep_id == peer_mdep_id) &&
(p_rec->mdep_cfg[i].mdep_role == peer_mdep_role))
{
- peer_found = TRUE;
+ peer_found = true;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!peer_found)
{
APPL_TRACE_DEBUG("bta_hl_validate_peer_cfg failed num_mdeps=%d",p_rec->num_mdeps);
@@ -1882,8 +1882,8 @@
** reliable DCH configuration
**
*******************************************************************************/
-tBTA_HL_STATUS bta_hl_chk_local_cfg(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 mdep_cfg_idx,
+tBTA_HL_STATUS bta_hl_chk_local_cfg(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t mdep_cfg_idx,
tBTA_HL_DCH_CFG local_cfg)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
@@ -1908,31 +1908,31 @@
**
** Description This function validates the reconnect parameters
**
-** Returns BOOLEAN - TRUE validation is successful
-** FALSE validation failed
+** Returns bool - true validation is successful
+** false validation failed
*******************************************************************************/
-BOOLEAN bta_hl_validate_reconnect_params(UINT8 app_idx, UINT8 mcl_idx,
+bool bta_hl_validate_reconnect_params(uint8_t app_idx, uint8_t mcl_idx,
tBTA_HL_API_DCH_RECONNECT *p_reconnect,
- UINT8 *p_mdep_cfg_idx, UINT8 *p_mdl_cfg_idx)
+ uint8_t *p_mdep_cfg_idx, uint8_t *p_mdl_cfg_idx)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_SUP_FEATURE *p_sup_feature = &p_acb->sup_feature;
- UINT8 num_mdeps;
- UINT8 mdl_cfg_idx;
- BOOLEAN local_mdep_id_found =FALSE;
- BOOLEAN mdl_cfg_found =FALSE;
- BOOLEAN status=FALSE;
- UINT8 i, in_use_mdl_idx = 0;
+ uint8_t num_mdeps;
+ uint8_t mdl_cfg_idx;
+ bool local_mdep_id_found =false;
+ bool mdl_cfg_found =false;
+ bool status=false;
+ uint8_t i, in_use_mdl_idx = 0;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_validate_reconnect_params mdl_id=%d app_idx=%d", p_reconnect->mdl_id, app_idx);
#endif
if (bta_hl_find_mdl_cfg_idx(app_idx, mcl_idx, p_reconnect->mdl_id, &mdl_cfg_idx))
{
- mdl_cfg_found = TRUE;
+ mdl_cfg_found = true;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!mdl_cfg_found)
{
APPL_TRACE_DEBUG("mdl_cfg_found not found");
@@ -1947,7 +1947,7 @@
{
if ( p_sup_feature->mdep[i].mdep_id == p_acb->mdl_cfg[mdl_cfg_idx].local_mdep_id)
{
- local_mdep_id_found = TRUE;
+ local_mdep_id_found = true;
*p_mdep_cfg_idx =i;
*p_mdl_cfg_idx = mdl_cfg_idx;
break;
@@ -1955,7 +1955,7 @@
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!local_mdep_id_found)
{
APPL_TRACE_DEBUG("local_mdep_id not found");
@@ -1967,7 +1967,7 @@
{
if (!bta_hl_find_mdl_idx(app_idx,mcl_idx, p_reconnect->mdl_id, &in_use_mdl_idx))
{
- status= TRUE;
+ status= true;
}
else
{
@@ -1975,7 +1975,7 @@
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!status)
{
APPL_TRACE_DEBUG("Reconnect validation failed local_mdep_id found=%d mdl_cfg_idx found=%d in_use_mdl_idx=%d ",
@@ -1989,26 +1989,26 @@
**
** Function bta_hl_find_avail_mcl_idx
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_avail_mcl_idx(UINT8 app_idx, UINT8 *p_mcl_idx)
+bool bta_hl_find_avail_mcl_idx(uint8_t app_idx, uint8_t *p_mcl_idx)
{
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_MCLS ; i ++)
{
if (!bta_hl_cb.acb[app_idx].mcb[i].in_use)
{
- found = TRUE;
+ found = true;
*p_mcl_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_avail_mcl_idx found=%d idx=%d",
@@ -2026,29 +2026,29 @@
**
** Description This function finds an available MDL control block index
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_avail_mdl_idx(UINT8 app_idx, UINT8 mcl_idx,
- UINT8 *p_mdl_idx)
+bool bta_hl_find_avail_mdl_idx(uint8_t app_idx, uint8_t mcl_idx,
+ uint8_t *p_mdl_idx)
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_MDLS_PER_MCL ; i ++)
{
if (!p_mcb->mdl[i].in_use)
{
memset((void *)&p_mcb->mdl[i],0, sizeof(tBTA_HL_MDL_CB));
- found = TRUE;
+ found = true;
*p_mdl_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_avail_mdl_idx found=%d idx=%d",
@@ -2064,26 +2064,26 @@
**
** Description This function finds the application has been used or not
**
-** Returns BOOLEAN - TRUE the app_id is a duplicate ID
-** FALSE not a duplicate ID
+** Returns bool - true the app_id is a duplicate ID
+** false not a duplicate ID
*******************************************************************************/
-BOOLEAN bta_hl_is_a_duplicate_id(UINT8 app_id)
+bool bta_hl_is_a_duplicate_id(uint8_t app_id)
{
- BOOLEAN is_duplicate=FALSE;
- UINT8 i;
+ bool is_duplicate=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_APPS ; i ++)
{
if (bta_hl_cb.acb[i].in_use &&
(bta_hl_cb.acb[i].app_id == app_id))
{
- is_duplicate = TRUE;
+ is_duplicate = true;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (is_duplicate)
{
@@ -2102,26 +2102,26 @@
**
** Description This function finds an available application control block index
**
-** Returns BOOLEAN - TRUE found
-** FALSE not found
+** Returns bool - true found
+** false not found
**
*******************************************************************************/
-BOOLEAN bta_hl_find_avail_app_idx(UINT8 *p_idx)
+bool bta_hl_find_avail_app_idx(uint8_t *p_idx)
{
- BOOLEAN found=FALSE;
- UINT8 i;
+ bool found=false;
+ uint8_t i;
for (i=0; i < BTA_HL_NUM_APPS ; i ++)
{
if (!bta_hl_cb.acb[i].in_use)
{
- found = TRUE;
+ found = true;
*p_idx = i;
break;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!found)
{
APPL_TRACE_DEBUG("bta_hl_find_avail_app_idx found=%d app_idx=%d",
@@ -2140,16 +2140,16 @@
** Returns tBTA_HL_STATUS -registration status
**
*******************************************************************************/
-tBTA_HL_STATUS bta_hl_app_update(UINT8 app_id, BOOLEAN is_register)
+tBTA_HL_STATUS bta_hl_app_update(uint8_t app_id, bool is_register)
{
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(0);
tMCA_CS mca_cs;
- UINT8 i, mdep_idx, num_of_mdeps;
- UINT8 mdep_counter = 0;
+ uint8_t i, mdep_idx, num_of_mdeps;
+ uint8_t mdep_counter = 0;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_app_update app_id=%d", app_id);
#endif
@@ -2301,16 +2301,16 @@
** Returns tBTA_HL_STATUS -registration status
**
*******************************************************************************/
-tBTA_HL_STATUS bta_hl_app_registration(UINT8 app_idx)
+tBTA_HL_STATUS bta_hl_app_registration(uint8_t app_idx)
{
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tMCA_REG reg;
tMCA_CS mca_cs;
- UINT8 i, num_of_mdeps;
- UINT8 mdep_counter = 0;
+ uint8_t i, num_of_mdeps;
+ uint8_t mdep_counter = 0;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_app_registration app_idx=%d", app_idx);
#endif
@@ -2442,10 +2442,10 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_discard_data(UINT16 event, tBTA_HL_DATA *p_data)
+void bta_hl_discard_data(uint16_t event, tBTA_HL_DATA *p_data)
{
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_ERROR("BTA HL Discard event=%s",bta_hl_evt_code(event));
#endif
@@ -2474,25 +2474,25 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_save_mdl_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx )
+void bta_hl_save_mdl_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx )
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
- UINT8 mdl_cfg_idx;
+ uint8_t mdl_cfg_idx;
tBTA_HL_MDL_ID mdl_id;
- BOOLEAN found=TRUE;
+ bool found=true;
tBTA_HL_MDL_CFG mdl_cfg;
tBTA_HL_MDEP *p_mdep_cfg;
tBTA_HL_L2CAP_CFG_INFO l2cap_cfg;
- UINT8 time_val = 0;
+ uint8_t time_val = 0;
mdl_id = p_dcb->mdl_id;
if (!bta_hl_find_mdl_cfg_idx(app_idx, mcl_idx, mdl_id, &mdl_cfg_idx))
{
if (!bta_hl_find_avail_mdl_cfg_idx(app_idx, mcl_idx, &mdl_cfg_idx))
{
APPL_TRACE_ERROR("No space to save the MDL config");
- found= FALSE; /*no space available*/
+ found= false; /*no space available*/
}
}
@@ -2504,7 +2504,7 @@
bta_hl_compact_mdl_cfg_time(app_idx,p_dcb->local_mdep_id);
bta_hl_get_cur_time(app_idx, &time_val);
}
- mdl_cfg.active = TRUE;
+ mdl_cfg.active = true;
mdl_cfg.time = time_val;
mdl_cfg.mdl_id = p_dcb->mdl_id;
mdl_cfg.dch_mode = p_dcb->dch_mode;
@@ -2519,7 +2519,7 @@
bta_hl_co_save_mdl(mdl_cfg.local_mdep_id, mdl_cfg_idx, &mdl_cfg);
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (found)
{
if (p_dcb->mtu != l2cap_cfg.mtu)
@@ -2545,13 +2545,13 @@
**
** Returns void
*******************************************************************************/
-void bta_hl_set_dch_chan_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx,tBTA_HL_DATA *p_data)
+void bta_hl_set_dch_chan_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx,tBTA_HL_DATA *p_data)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
- UINT8 l2cap_mode = L2CAP_FCR_ERTM_MODE;
+ uint8_t l2cap_mode = L2CAP_FCR_ERTM_MODE;
tBTA_HL_SUP_FEATURE *p_sup_feature= &p_acb->sup_feature;
- UINT8 local_mdep_cfg_idx = p_dcb->local_mdep_cfg_idx;
+ uint8_t local_mdep_cfg_idx = p_dcb->local_mdep_cfg_idx;
switch (p_dcb->dch_oper)
{
@@ -2600,7 +2600,7 @@
p_dcb->chnl_cfg.fcs = BTA_HL_MCA_USE_FCS;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("L2CAP Params l2cap_mode[3-ERTM 4-STREAM]=%d", l2cap_mode);
APPL_TRACE_DEBUG("Use FCS =%s mtu=%d", ((p_dcb->chnl_cfg.fcs & 1)?"YES":"NO"),
p_dcb->chnl_cfg.data_mtu);
@@ -2634,12 +2634,12 @@
**
** Description This function get the current L2CAP channel configuration
**
-** Returns BOOLEAN - TRUE - operation is successful
+** Returns bool - true - operation is successful
*******************************************************************************/
-BOOLEAN bta_hl_get_l2cap_cfg(tBTA_HL_MDL_HANDLE mdl_hnd, tBTA_HL_L2CAP_CFG_INFO *p_cfg)
+bool bta_hl_get_l2cap_cfg(tBTA_HL_MDL_HANDLE mdl_hnd, tBTA_HL_L2CAP_CFG_INFO *p_cfg)
{
- BOOLEAN success = FALSE;
- UINT16 lcid;
+ bool success = false;
+ uint16_t lcid;
tL2CAP_CFG_INFO *p_our_cfg;
tL2CAP_CH_CFG_BITS our_cfg_bits;
tL2CAP_CFG_INFO *p_peer_cfg;
@@ -2681,7 +2681,7 @@
{
p_cfg->mtu = L2CAP_DEFAULT_MTU;
}
- success = TRUE;
+ success = true;
}
else
{
@@ -2689,7 +2689,7 @@
p_cfg->fcs = BTA_HL_L2C_NO_FCS;
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (!success)
{
APPL_TRACE_DEBUG("bta_hl_get_l2cap_cfg success=%d mdl=%d lcid=%d", success, mdl_hnd, lcid);
@@ -2706,16 +2706,16 @@
**
** Description This function validates the L2CAP channel configuration
**
-** Returns BOOLEAN - TRUE - validation is successful
+** Returns bool - true - validation is successful
*******************************************************************************/
-BOOLEAN bta_hl_validate_chan_cfg(UINT8 app_idx, UINT8 mcl_idx, UINT8 mdl_idx)
+bool bta_hl_validate_chan_cfg(uint8_t app_idx, uint8_t mcl_idx, uint8_t mdl_idx)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
- BOOLEAN success = FALSE;
- UINT8 mdl_cfg_idx = 0;
+ bool success = false;
+ uint8_t mdl_cfg_idx = 0;
tBTA_HL_L2CAP_CFG_INFO l2cap_cfg;
- BOOLEAN get_l2cap_result, get_mdl_result;
+ bool get_l2cap_result, get_mdl_result;
get_l2cap_result = bta_hl_get_l2cap_cfg(p_dcb->mdl_handle, &l2cap_cfg);
get_mdl_result = bta_hl_find_mdl_cfg_idx(app_idx, mcl_idx, p_dcb->mdl_id, &mdl_cfg_idx);
@@ -2726,12 +2726,12 @@
(p_acb->mdl_cfg[mdl_cfg_idx].fcs == l2cap_cfg.fcs) &&
(p_acb->mdl_cfg[mdl_cfg_idx].dch_mode == p_dcb->dch_mode))
{
- success = TRUE;
+ success = true;
}
}
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
if (p_dcb->mtu != l2cap_cfg.mtu)
{
@@ -2758,16 +2758,16 @@
**
** Description This function checks whether the congestion condition is on or not
**
-** Returns BOOLEAN - TRUE DCH is congested
-** FALSE not congested
+** Returns bool - true DCH is congested
+** false not congested
**
*******************************************************************************/
-BOOLEAN bta_hl_is_cong_on(UINT8 app_id, BD_ADDR bd_addr, tBTA_HL_MDL_ID mdl_id)
+bool bta_hl_is_cong_on(uint8_t app_id, BD_ADDR bd_addr, tBTA_HL_MDL_ID mdl_id)
{
tBTA_HL_MDL_CB *p_dcb;
- UINT8 app_idx = 0, mcl_idx, mdl_idx;
- BOOLEAN cong_status = TRUE;
+ uint8_t app_idx = 0, mcl_idx, mdl_idx;
+ bool cong_status = true;
if (bta_hl_find_app_idx(app_id, &app_idx))
{
@@ -2793,11 +2793,11 @@
**
** Returns void
*******************************************************************************/
-void bta_hl_check_cch_close(UINT8 app_idx, UINT8 mcl_idx, tBTA_HL_DATA *p_data, BOOLEAN check_dch_setup )
+void bta_hl_check_cch_close(uint8_t app_idx, uint8_t mcl_idx, tBTA_HL_DATA *p_data, bool check_dch_setup )
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb;
- UINT8 mdl_idx;
+ uint8_t mdl_idx;
#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_check_cch_close cch_close_dch_oper=%d",p_mcb->cch_close_dch_oper );
@@ -2846,12 +2846,12 @@
** Returns void
**
*******************************************************************************/
-void bta_hl_clean_app(UINT8 app_idx)
+void bta_hl_clean_app(uint8_t app_idx)
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
int i, num_act_apps=0;
-#if BTA_HL_DEBUG == TRUE
+#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG("bta_hl_clean_app");
#endif
MCA_Deregister((tMCA_HANDLE)p_acb->app_handle);
@@ -2882,11 +2882,11 @@
**
** Returns void
*******************************************************************************/
-void bta_hl_check_deregistration(UINT8 app_idx, tBTA_HL_DATA *p_data )
+void bta_hl_check_deregistration(uint8_t app_idx, tBTA_HL_DATA *p_data )
{
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MCL_CB *p_mcb;
- UINT8 mcl_idx;
+ uint8_t mcl_idx;
tBTA_HL evt_data;
#if (BTA_HL_DEBUG == TRUE)
@@ -2901,10 +2901,10 @@
if (p_mcb->cch_oper != BTA_HL_CCH_OP_LOCAL_CLOSE)
{
if (p_mcb->cch_state == BTA_HL_CCH_OPENING_ST)
- p_mcb->force_close_local_cch_opening = TRUE;
+ p_mcb->force_close_local_cch_opening = true;
p_mcb->cch_oper = BTA_HL_CCH_OP_LOCAL_CLOSE;
APPL_TRACE_DEBUG("p_mcb->force_close_local_cch_opening=%d", p_mcb->force_close_local_cch_opening );
- bta_hl_check_cch_close(app_idx,mcl_idx,p_data, TRUE);
+ bta_hl_check_cch_close(app_idx,mcl_idx,p_data, true);
}
}
else
@@ -2935,7 +2935,7 @@
{
tBTA_HL_CB *p_cb= &bta_hl_cb;
tBTA_HL_APP_CB *p_acb;
- UINT8 app_idx;
+ uint8_t app_idx;
tBTA_HL_CTRL evt_data;
#if (BTA_HL_DEBUG == TRUE)
@@ -2949,7 +2949,7 @@
p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
if (!p_acb->deregistering)
{
- p_acb->deregistering = TRUE;
+ p_acb->deregistering = true;
bta_hl_check_deregistration(app_idx, p_data);
}
}
@@ -3033,7 +3033,7 @@
tBTA_HL_APP_HANDLE app_handle,
tBTA_HL_MCL_HANDLE mcl_handle,
tBTA_HL_MDL_HANDLE mdl_handle,
- BOOLEAN intentional)
+ bool intentional)
{
p_evt_data->dch_close_ind.mdl_handle = mdl_handle;
p_evt_data->dch_close_ind.mcl_handle = mcl_handle;
@@ -3093,7 +3093,7 @@
**
*******************************************************************************/
void bta_hl_build_cch_open_cfm(tBTA_HL *p_evt_data,
- UINT8 app_id,
+ uint8_t app_id,
tBTA_HL_APP_HANDLE app_handle,
tBTA_HL_MCL_HANDLE mcl_handle,
BD_ADDR bd_addr,
@@ -3158,7 +3158,7 @@
void bta_hl_build_cch_close_ind(tBTA_HL *p_evt_data,
tBTA_HL_APP_HANDLE app_handle,
tBTA_HL_MCL_HANDLE mcl_handle,
- BOOLEAN intentional)
+ bool intentional)
{
p_evt_data->cch_close_ind.mcl_handle = mcl_handle;
p_evt_data->cch_close_ind.app_handle = app_handle;
@@ -3181,8 +3181,8 @@
tBTA_HL_MDEP_ID local_mdep_id,
tBTA_HL_MDL_ID mdl_id,
tBTA_HL_DCH_MODE dch_mode,
- BOOLEAN first_reliable,
- UINT16 mtu,
+ bool first_reliable,
+ uint16_t mtu,
tBTA_HL_STATUS status)
{
@@ -3208,7 +3208,7 @@
**
*******************************************************************************/
void bta_hl_build_sdp_query_cfm(tBTA_HL *p_evt_data,
- UINT8 app_id,
+ uint8_t app_id,
tBTA_HL_APP_HANDLE app_handle,
BD_ADDR bd_addr,
tBTA_HL_SDP *p_sdp,
diff --git a/bta/include/bta_ag_api.h b/bta/include/bta_ag_api.h
index bedf646..c180d58 100644
--- a/bta/include/bta_ag_api.h
+++ b/bta/include/bta_ag_api.h
@@ -53,13 +53,13 @@
#define BTA_AG_FEAT_NOSCO 0x00040000 /* No SCO control performed by BTA AG */
#define BTA_AG_FEAT_NO_ESCO 0x00080000 /* Do not allow or use eSCO */
-typedef UINT32 tBTA_AG_FEAT;
+typedef uint32_t tBTA_AG_FEAT;
/* AG parse mode */
#define BTA_AG_PARSE 0 /* Perform AT command parsing in AG */
-#define BTA_AG_PASS_THROUGH 1 /* Pass data directly to phoneÂ’s AT command interpreter */
+#define BTA_AG_PASS_THROUGH 1 /* Pass data directly to phone's AT command interpreter */
-typedef UINT8 tBTA_AG_PARSE_MODE;
+typedef uint8_t tBTA_AG_PARSE_MODE;
/* AG open status */
#define BTA_AG_SUCCESS 0 /* Connection successfully opened */
@@ -67,7 +67,7 @@
#define BTA_AG_FAIL_RFCOMM 2 /* Open failed due to RFCOMM */
#define BTA_AG_FAIL_RESOURCES 3 /* out of resources failure */
-typedef UINT8 tBTA_AG_STATUS;
+typedef uint8_t tBTA_AG_STATUS;
/* handle values used with BTA_AgResult */
#define BTA_AG_HANDLE_NONE 0
@@ -103,7 +103,7 @@
#define BTA_AG_UNAT_RES 20 /* Response to unknown AT command event */
#define BTA_AG_MULTI_CALL_RES 21 /* SLC at three way call */
-typedef UINT8 tBTA_AG_RES;
+typedef uint8_t tBTA_AG_RES;
/* HFP peer features */
#define BTA_AG_PEER_FEAT_ECNR 0x0001 /* Echo cancellation and/or noise reduction */
@@ -116,7 +116,7 @@
#define BTA_AG_PEER_FEAT_CODEC 0x0080 /* Codec Negotiation */
#define BTA_AG_PEER_FEAT_VOIP 0x0100 /* VoIP call */
-typedef UINT16 tBTA_AG_PEER_FEAT;
+typedef uint16_t tBTA_AG_PEER_FEAT;
/* HFP peer supported codec masks */
// TODO(google) This should use common definitions
@@ -124,7 +124,7 @@
#define BTA_AG_CODEC_NONE BTM_SCO_CODEC_NONE
#define BTA_AG_CODEC_CVSD BTM_SCO_CODEC_CVSD /* CVSD */
#define BTA_AG_CODEC_MSBC BTM_SCO_CODEC_MSBC /* mSBC */
-typedef UINT16 tBTA_AG_PEER_CODEC;
+typedef uint16_t tBTA_AG_PEER_CODEC;
/* HFP errcode - Set when BTA_AG_OK_ERROR is returned in 'ok_flag' */
#define BTA_AG_ERR_PHONE_FAILURE 0 /* Phone Failure */
@@ -208,8 +208,8 @@
/* data associated with BTA_AG_IND_RES */
typedef struct
{
- UINT16 id;
- UINT16 value;
+ uint16_t id;
+ uint16_t value;
} tBTA_AG_IND;
/* data type for BTA_AgResult() */
@@ -217,11 +217,11 @@
{
char str[BTA_AG_AT_MAX_LEN+1];
tBTA_AG_IND ind;
- UINT16 num;
- UINT16 audio_handle;
- UINT16 errcode; /* Valid only if 'ok_flag' is set to BTA_AG_OK_ERROR */
- UINT8 ok_flag; /* Indicates if response is finished, and if error occurred */
- BOOLEAN state;
+ uint16_t num;
+ uint16_t audio_handle;
+ uint16_t errcode; /* Valid only if 'ok_flag' is set to BTA_AG_OK_ERROR */
+ uint8_t ok_flag; /* Indicates if response is finished, and if error occurred */
+ bool state;
} tBTA_AG_RES_DATA;
/* AG callback events */
@@ -236,7 +236,7 @@
#define BTA_AG_MIC_EVT 8 /* Microphone volume changed */
#define BTA_AG_AT_CKPD_EVT 9 /* CKPD from the HS */
#define BTA_AG_DISABLE_EVT 30 /* AG disabled */
-#if (BTM_WBS_INCLUDED == TRUE )
+#if (BTM_WBS_INCLUDED == TRUE)
#define BTA_AG_WBS_EVT 31 /* SCO codec info */
#endif
/* Values below are for HFP only */
@@ -259,13 +259,13 @@
#define BTA_AG_AT_BAC_EVT 26 /* avablable codec */
#define BTA_AG_AT_BCS_EVT 27 /* Codec select */
-typedef UINT8 tBTA_AG_EVT;
+typedef uint8_t tBTA_AG_EVT;
/* data associated with most non-AT events */
typedef struct
{
- UINT16 handle;
- UINT8 app_id;
+ uint16_t handle;
+ uint8_t app_id;
tBTA_AG_STATUS status;
} tBTA_AG_HDR;
@@ -307,8 +307,8 @@
tBTA_AG_HDR hdr;
BD_ADDR bd_addr;
char str[BTA_AG_AT_MAX_LEN+1];
- UINT16 num;
- UINT8 idx; /* call number used by CLCC and CHLD */
+ uint16_t num;
+ uint8_t idx; /* call number used by CLCC and CHLD */
} tBTA_AG_VAL;
/* union of data associated with AG callback */
@@ -376,8 +376,8 @@
typedef struct
{
char *cind_info;
- INT32 conn_tout;
- UINT16 sco_pkt_types;
+ int32_t conn_tout;
+ uint16_t sco_pkt_types;
char *chld_val_ecc;
char *chld_val;
} tBTA_AG_CFG;
@@ -424,7 +424,7 @@
**
*******************************************************************************/
void BTA_AgRegister(tBTA_SERVICE_MASK services, tBTA_SEC sec_mask,
- tBTA_AG_FEAT features, const char *p_service_names[], UINT8 app_id);
+ tBTA_AG_FEAT features, const char *p_service_names[], uint8_t app_id);
/*******************************************************************************
**
@@ -436,7 +436,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgDeregister(UINT16 handle);
+void BTA_AgDeregister(uint16_t handle);
/*******************************************************************************
**
@@ -451,7 +451,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgOpen(UINT16 handle, BD_ADDR bd_addr, tBTA_SEC sec_mask, tBTA_SERVICE_MASK services);
+void BTA_AgOpen(uint16_t handle, BD_ADDR bd_addr, tBTA_SEC sec_mask, tBTA_SERVICE_MASK services);
/*******************************************************************************
**
@@ -464,7 +464,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgClose(UINT16 handle);
+void BTA_AgClose(uint16_t handle);
/*******************************************************************************
**
@@ -477,7 +477,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgAudioOpen(UINT16 handle);
+void BTA_AgAudioOpen(uint16_t handle);
/*******************************************************************************
**
@@ -490,7 +490,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgAudioClose(UINT16 handle);
+void BTA_AgAudioClose(uint16_t handle);
/*******************************************************************************
**
@@ -504,7 +504,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgResult(UINT16 handle, tBTA_AG_RES result, tBTA_AG_RES_DATA *p_data);
+void BTA_AgResult(uint16_t handle, tBTA_AG_RES result, tBTA_AG_RES_DATA *p_data);
/*******************************************************************************
**
@@ -518,7 +518,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AgSetCodec(UINT16 handle, tBTA_AG_PEER_CODEC codec);
+void BTA_AgSetCodec(uint16_t handle, tBTA_AG_PEER_CODEC codec);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_ag_ci.h b/bta/include/bta_ag_ci.h
index 9eb2b25..4c2a4ff 100644
--- a/bta/include/bta_ag_ci.h
+++ b/bta/include/bta_ag_ci.h
@@ -45,7 +45,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_ag_ci_rx_write(UINT16 handle, char *p_data, UINT16 len);
+extern void bta_ag_ci_rx_write(uint16_t handle, char *p_data, uint16_t len);
/******************************************************************************
**
@@ -58,7 +58,7 @@
** Returns void
**
******************************************************************************/
-extern void bta_ag_ci_slc_ready(UINT16 handle);
+extern void bta_ag_ci_slc_ready(uint16_t handle);
/******************************************************************************
**
@@ -70,7 +70,7 @@
** Returns void
**
******************************************************************************/
-extern void bta_ag_ci_wbs_command (UINT16 handle, char *p_data, UINT16 len);
+extern void bta_ag_ci_wbs_command (uint16_t handle, char *p_data, uint16_t len);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_ag_co.h b/bta/include/bta_ag_co.h
index 6f661e0..b5d56b4 100644
--- a/bta/include/bta_ag_co.h
+++ b/bta/include/bta_ag_co.h
@@ -63,12 +63,12 @@
** Returns void
**
*******************************************************************************/
-#if (BTM_WBS_INCLUDED == TRUE )
-extern void bta_ag_co_audio_state(UINT16 handle, UINT8 app_id, UINT8 state,
+#if (BTM_WBS_INCLUDED == TRUE)
+extern void bta_ag_co_audio_state(uint16_t handle, uint8_t app_id, uint8_t state,
tBTA_AG_PEER_CODEC codec);
#else
-extern void bta_ag_co_audio_state(UINT16 handle, UINT8 app_id, UINT8 state);
+extern void bta_ag_co_audio_state(uint16_t handle, uint8_t app_id, uint8_t state);
#endif
/*******************************************************************************
@@ -84,7 +84,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_ag_co_data_open(UINT16 handle, tBTA_SERVICE_ID service);
+extern void bta_ag_co_data_open(uint16_t handle, tBTA_SERVICE_ID service);
/*******************************************************************************
**
@@ -97,7 +97,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_ag_co_data_close(UINT16 handle);
+extern void bta_ag_co_data_close(uint16_t handle);
/*******************************************************************************
**
@@ -106,12 +106,12 @@
** Description This function is called by the AG to send data to the
** phone when the AG is configured for AT command pass-through.
** The implementation of this function must copy the data to
-** the phoneÂ’s memory.
+** the phone's memory.
**
** Returns void
**
*******************************************************************************/
-extern void bta_ag_co_tx_write(UINT16 handle, UINT8 *p_data, UINT16 len);
+extern void bta_ag_co_tx_write(uint16_t handle, uint8_t *p_data, uint16_t len);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_api.h b/bta/include/bta_api.h
index 68b0ad8..5422c9d 100644
--- a/bta/include/bta_api.h
+++ b/bta/include/bta_api.h
@@ -29,7 +29,7 @@
#include "bt_types.h"
#include "btm_api.h"
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
#include "btm_ble_api.h"
#endif
@@ -49,7 +49,7 @@
#define BTA_NO_RESOURCES 4
#define BTA_WRONG_MODE 5
-typedef UINT8 tBTA_STATUS;
+typedef uint8_t tBTA_STATUS;
/*
* Service ID
@@ -89,7 +89,7 @@
#define BTA_HDP_SERVICE_ID 27 /* Health Device Profile */
#define BTA_PCE_SERVICE_ID 28 /* PhoneBook Access Client*/
#define BTA_SDP_SERVICE_ID 29 /* SDP Search*/
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
/* BLE profile service ID */
#define BTA_BLE_SERVICE_ID 30 /* GATT profile */
@@ -105,7 +105,7 @@
#define BTA_FIRST_JV_SERVICE_ID (BTM_SEC_SERVICE_FIRST_EMPTY + 1)
#define BTA_LAST_JV_SERVICE_ID (BTM_SEC_MAX_SERVICES - 1)
-typedef UINT8 tBTA_SERVICE_ID;
+typedef uint8_t tBTA_SERVICE_ID;
/* Service ID Mask */
#define BTA_RES_SERVICE_MASK 0x00000001 /* Reserved */
@@ -138,26 +138,26 @@
#define BTA_HL_SERVICE_MASK 0x08000000 /* Health Device Profile */
#define BTA_PCE_SERVICE_MASK 0x10000000 /* Phone Book Client */
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
#define BTA_BLE_SERVICE_MASK 0x20000000 /* GATT based service */
#define BTA_USER_SERVICE_MASK 0x40000000 /* Message Notification Profile */
#else
#define BTA_USER_SERVICE_MASK 0x20000000 /* Message Notification Profile */
#endif
-#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
#define BTA_ALL_SERVICE_MASK 0x3FFFFFFF /* All services supported by BTA. */
#else
#define BTA_ALL_SERVICE_MASK 0x1FFFFFFF /* All services supported by BTA. */
#endif
-typedef UINT32 tBTA_SERVICE_MASK;
+typedef uint32_t tBTA_SERVICE_MASK;
/* extended service mask, including mask with one or more GATT UUID */
typedef struct
{
tBTA_SERVICE_MASK srvc_mask;
- UINT8 num_uuid;
+ uint8_t num_uuid;
tBT_UUID *p_uuid;
}tBTA_SERVICE_MASK_EXT;
@@ -170,7 +170,7 @@
#define BTA_SEC_MITM (BTM_SEC_IN_MITM | BTM_SEC_OUT_MITM) /* Man-In-The_Middle protection */
#define BTA_SEC_IN_16_DIGITS (BTM_SEC_IN_MIN_16_DIGIT_PIN) /* Min 16 digit for pin code */
-typedef UINT16 tBTA_SEC;
+typedef uint16_t tBTA_SEC;
/* Ignore for Discoverable, Connectable, Pairable and Connectable Paired only device modes */
#define BTA_DM_IGNORE 0x00FF
@@ -185,22 +185,22 @@
#define BTA_DM_NON_DISC BTM_NON_DISCOVERABLE /* Device is not discoverable. */
#define BTA_DM_GENERAL_DISC BTM_GENERAL_DISCOVERABLE /* General discoverable. */
#define BTA_DM_LIMITED_DISC BTM_LIMITED_DISCOVERABLE /* Limited discoverable. */
-#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE)
#define BTA_DM_BLE_NON_DISCOVERABLE BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */
#define BTA_DM_BLE_GENERAL_DISCOVERABLE BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */
#define BTA_DM_BLE_LIMITED_DISCOVERABLE BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */
#endif
-typedef UINT16 tBTA_DM_DISC; /* this discoverability mode is a bit mask among BR mode and LE mode */
+typedef uint16_t tBTA_DM_DISC; /* this discoverability mode is a bit mask among BR mode and LE mode */
/* Connectable Modes */
#define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */
#define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */
-#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE)
#define BTA_DM_BLE_NON_CONNECTABLE BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */
#define BTA_DM_BLE_CONNECTABLE BTM_BLE_CONNECTABLE /* Device is LE connectable. */
#endif
-typedef UINT16 tBTA_DM_CONN;
+typedef uint16_t tBTA_DM_CONN;
#define BTA_TRANSPORT_UNKNOWN 0
#define BTA_TRANSPORT_BR_EDR BT_TRANSPORT_BR_EDR
@@ -220,26 +220,26 @@
#define BTA_DM_GENERAL_INQUIRY BTM_GENERAL_INQUIRY /* Perform general inquiry. */
#define BTA_DM_LIMITED_INQUIRY BTM_LIMITED_INQUIRY /* Perform limited inquiry. */
-#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE)
#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
#define BTA_BLE_GENERAL_INQUIRY BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
#define BTA_BLE_LIMITED_INQUIRY BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
#endif
-typedef UINT8 tBTA_DM_INQ_MODE;
+typedef uint8_t tBTA_DM_INQ_MODE;
/* Inquiry Filter Type */
#define BTA_DM_INQ_CLR BTM_CLR_INQUIRY_FILTER /* Clear inquiry filter. */
#define BTA_DM_INQ_DEV_CLASS BTM_FILTER_COND_DEVICE_CLASS /* Filter on device class. */
#define BTA_DM_INQ_BD_ADDR BTM_FILTER_COND_BD_ADDR /* Filter on a specific BD address. */
-typedef UINT8 tBTA_DM_INQ_FILT;
+typedef uint8_t tBTA_DM_INQ_FILT;
/* Authorize Response */
#define BTA_DM_AUTH_PERM 0 /* Authorized for future connections to the service */
#define BTA_DM_AUTH_TEMP 1 /* Authorized for current connection only */
#define BTA_DM_NOT_AUTH 2 /* Not authorized for the service */
-typedef UINT8 tBTA_AUTH_RESP;
+typedef uint8_t tBTA_AUTH_RESP;
/* M/S preferred roles */
#define BTA_ANY_ROLE 0x00
@@ -247,7 +247,7 @@
#define BTA_MASTER_ROLE_ONLY 0x02
#define BTA_SLAVE_ROLE_ONLY 0x03 /* Used for PANU only, skip role switch to master */
-typedef UINT8 tBTA_PREF_ROLES;
+typedef uint8_t tBTA_PREF_ROLES;
enum
{
@@ -284,35 +284,35 @@
typedef struct
{
tBTA_DM_INQ_MODE mode; /* Inquiry mode, limited or general. */
- UINT8 duration; /* Inquiry duration in 1.28 sec units. */
- UINT8 max_resps; /* Maximum inquiry responses. Set to zero for unlimited responses. */
- BOOLEAN report_dup; /* report duplicated inquiry response with higher RSSI value */
+ uint8_t duration; /* Inquiry duration in 1.28 sec units. */
+ uint8_t max_resps; /* Maximum inquiry responses. Set to zero for unlimited responses. */
+ bool report_dup; /* report duplicated inquiry response with higher RSSI value */
tBTA_DM_INQ_FILT filter_type; /* Filter condition type. */
tBTA_DM_INQ_COND filter_cond; /* Filter condition data. */
-#if (defined(BTA_HOST_INTERLEAVE_SEARCH) && BTA_HOST_INTERLEAVE_SEARCH == TRUE)
- UINT8 intl_duration[4];/*duration array storing the interleave scan's time portions*/
+#if (BTA_HOST_INTERLEAVE_SEARCH == TRUE)
+ uint8_t intl_duration[4];/*duration array storing the interleave scan's time portions*/
#endif
} tBTA_DM_INQ;
typedef struct
{
- UINT8 bta_dm_eir_min_name_len; /* minimum length of local name when it is shortened */
+ uint8_t bta_dm_eir_min_name_len; /* minimum length of local name when it is shortened */
#if (BTA_EIR_CANNED_UUID_LIST == TRUE)
- UINT8 bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */
- UINT8 *bta_dm_eir_uuid16; /* 16-bit UUIDs */
+ uint8_t bta_dm_eir_uuid16_len; /* length of 16-bit UUIDs */
+ uint8_t *bta_dm_eir_uuid16; /* 16-bit UUIDs */
#else
- UINT32 uuid_mask[BTM_EIR_SERVICE_ARRAY_SIZE]; /* mask of UUID list in EIR */
+ uint32_t uuid_mask[BTM_EIR_SERVICE_ARRAY_SIZE]; /* mask of UUID list in EIR */
#endif
- INT8 *bta_dm_eir_inq_tx_power; /* Inquiry TX power */
- UINT8 bta_dm_eir_flag_len; /* length of flags in bytes */
- UINT8 *bta_dm_eir_flags; /* flags for EIR */
- UINT8 bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in bytes */
- UINT8 *bta_dm_eir_manufac_spec; /* manufacturer specific */
- UINT8 bta_dm_eir_additional_len; /* length of additional data in bytes */
- UINT8 *bta_dm_eir_additional; /* additional data */
+ int8_t *bta_dm_eir_inq_tx_power; /* Inquiry TX power */
+ uint8_t bta_dm_eir_flag_len; /* length of flags in bytes */
+ uint8_t *bta_dm_eir_flags; /* flags for EIR */
+ uint8_t bta_dm_eir_manufac_spec_len; /* length of manufacturer specific in bytes */
+ uint8_t *bta_dm_eir_manufac_spec; /* manufacturer specific */
+ uint8_t bta_dm_eir_additional_len; /* length of additional data in bytes */
+ uint8_t *bta_dm_eir_additional; /* additional data */
} tBTA_DM_EIR_CONF;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/* ADV data flag bit definition used for BTM_BLE_AD_TYPE_FLAG */
#define BTA_BLE_LIMIT_DISC_FLAG BTM_BLE_LIMIT_DISC_FLAG
#define BTA_BLE_GEN_DISC_FLAG BTM_BLE_GEN_DISC_FLAG
@@ -362,9 +362,9 @@
tBTA_BLE_128SERVICE sol_service_128b;/* List of 128 bit Service Solicitation UUIDs */
tBTA_BLE_PROPRIETARY proprietary; /* proprietary data */
tBTA_BLE_SERVICE_DATA service_data; /* service data */
- UINT16 appearance; /* appearance data */
- UINT8 flag;
- UINT8 tx_power;
+ uint16_t appearance; /* appearance data */
+ uint8_t flag;
+ uint8_t tx_power;
}tBTA_BLE_ADV_DATA;
typedef void (tBTA_SET_ADV_DATA_CMPL_CBACK) (tBTA_STATUS status);
@@ -383,7 +383,7 @@
#define BTA_BLE_CONNECT_DIR_EVT BTM_BLE_CONNECT_DIR_EVT /* Connectable directed advertising */
#define BTA_BLE_DISCOVER_EVT BTM_BLE_DISCOVER_EVT /* Scannable undirected advertising */
#define BTA_BLE_NON_CONNECT_EVT BTM_BLE_NON_CONNECT_EVT /* Non connectable undirected advertising */
-typedef UINT8 tBTA_BLE_ADV_EVT;
+typedef uint8_t tBTA_BLE_ADV_EVT;
/* adv tx power level */
#define BTA_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */
@@ -391,13 +391,13 @@
#define BTA_BLE_ADV_TX_POWER_MID 2 /* middle tx power */
#define BTA_BLE_ADV_TX_POWER_UPPER 3 /* upper tx power */
#define BTA_BLE_ADV_TX_POWER_MAX 4 /* maximum tx power */
-typedef UINT8 tBTA_BLE_ADV_TX_POWER;
+typedef uint8_t tBTA_BLE_ADV_TX_POWER;
/* advertising instance parameters */
typedef struct
{
- UINT16 adv_int_min; /* minimum adv interval */
- UINT16 adv_int_max; /* maximum adv interval */
+ uint16_t adv_int_min; /* minimum adv interval */
+ uint16_t adv_int_max; /* maximum adv interval */
tBTA_BLE_ADV_EVT adv_type; /* adv event type */
tBTA_BLE_ADV_CHNL_MAP channel_map; /* adv channel map */
tBTA_BLE_AFP adv_filter_policy; /* advertising filter policy */
@@ -409,12 +409,12 @@
*/
typedef struct
{
- UINT8 conn_mode;
+ uint8_t conn_mode;
tBTA_BLE_AD_MASK ad_mask; /* mask of the valid adv data field */
- UINT8 flag;
- UINT8 tx_power_level;
- UINT8 remote_name_len;
- UINT8 *p_remote_name;
+ uint8_t flag;
+ uint8_t tx_power_level;
+ uint8_t remote_name_len;
+ uint8_t *p_remote_name;
tBTA_BLE_SERVICE service;
} tBTA_BLE_INQ_DATA;
@@ -424,21 +424,21 @@
BTA_BLE_BATCH_SCAN_MODE_ACTI = 2,
BTA_BLE_BATCH_SCAN_MODE_PASS_ACTI = 3
};
-typedef UINT8 tBTA_BLE_BATCH_SCAN_MODE;
+typedef uint8_t tBTA_BLE_BATCH_SCAN_MODE;
enum
{
BTA_BLE_DISCARD_OLD_ITEMS=0,
BTA_BLE_DISCARD_LOWER_RSSI_ITEMS=1
};
-typedef UINT8 tBTA_BLE_DISCARD_RULE;
+typedef uint8_t tBTA_BLE_DISCARD_RULE;
enum
{
BTA_BLE_ADV_SEEN_FIRST_TIME=0,
BTA_BLE_ADV_TRACKING_TIMEOUT=1
};
-typedef UINT8 tBTA_BLE_ADV_CHANGE_REASON;
+typedef uint8_t tBTA_BLE_ADV_CHANGE_REASON;
enum
{
@@ -459,16 +459,16 @@
#define BTA_BLE_RSSI_ALERT_HI 0
#define BTA_BLE_RSSI_ALERT_RANGE 1
#define BTA_BLE_RSSI_ALERT_LO 2
-typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_TYPE;
+typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_TYPE;
#define BTA_BLE_RSSI_ALERT_NONE BTM_BLE_RSSI_ALERT_NONE /* (0) */
#define BTA_BLE_RSSI_ALERT_HI_BIT BTM_BLE_RSSI_ALERT_HI_BIT /* (1) */
#define BTA_BLE_RSSI_ALERT_RANGE_BIT BTM_BLE_RSSI_ALERT_RANGE_BIT /* (1 << 1) */
#define BTA_BLE_RSSI_ALERT_LO_BIT BTM_BLE_RSSI_ALERT_LO_BIT /* (1 << 2) */
-typedef UINT8 tBTA_DM_BLE_RSSI_ALERT_MASK;
+typedef uint8_t tBTA_DM_BLE_RSSI_ALERT_MASK;
-typedef void (tBTA_DM_BLE_RSSI_CBACK) (BD_ADDR bd_addr, tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type, INT8 rssi);
+typedef void (tBTA_DM_BLE_RSSI_CBACK) (BD_ADDR bd_addr, tBTA_DM_BLE_RSSI_ALERT_TYPE alert_type, int8_t rssi);
/* max number of filter spot for different filter type */
#define BTA_DM_BLE_MAX_UUID_FILTER BTM_BLE_MAX_UUID_FILTER /* 8 */
@@ -478,7 +478,7 @@
#define BTA_DM_BLE_PF_LOGIC_OR 0
#define BTA_DM_BLE_PF_LOGIC_AND 1
-typedef UINT8 tBTA_DM_BLE_PF_LOGIC_TYPE;
+typedef uint8_t tBTA_DM_BLE_PF_LOGIC_TYPE;
enum
{
@@ -486,7 +486,7 @@
BTA_DM_BLE_SCAN_COND_DELETE,
BTA_DM_BLE_SCAN_COND_CLEAR = 2
};
-typedef UINT8 tBTA_DM_BLE_SCAN_COND_OP;
+typedef uint8_t tBTA_DM_BLE_SCAN_COND_OP;
/* ADV payload filtering vendor specific call event */
enum
@@ -505,13 +505,13 @@
#define BTA_DM_BLE_PF_SRVC_DATA_PATTERN BTM_BLE_PF_SRVC_DATA_PATTERN
#define BTA_DM_BLE_PF_TYPE_ALL BTM_BLE_PF_TYPE_ALL
#define BTA_DM_BLE_PF_TYPE_MAX BTM_BLE_PF_TYPE_MAX
-typedef UINT8 tBTA_DM_BLE_PF_COND_TYPE;
+typedef uint8_t tBTA_DM_BLE_PF_COND_TYPE;
typedef union
{
- UINT16 uuid16_mask;
- UINT32 uuid32_mask;
- UINT8 uuid128_mask[LEN_UUID_128];
+ uint16_t uuid16_mask;
+ uint32_t uuid32_mask;
+ uint8_t uuid128_mask[LEN_UUID_128];
}tBTA_DM_BLE_PF_COND_MASK;
typedef struct
@@ -524,26 +524,26 @@
typedef struct
{
- UINT8 data_len; /* <= 20 bytes */
- UINT8 *p_data;
+ uint8_t data_len; /* <= 20 bytes */
+ uint8_t *p_data;
}tBTA_DM_BLE_PF_LOCAL_NAME_COND;
typedef struct
{
- UINT16 company_id; /* company ID */
- UINT8 data_len; /* <= 20 bytes */
- UINT8 *p_pattern;
- UINT16 company_id_mask; /* UUID value mask */
- UINT8 *p_pattern_mask; /* Manufacturer data matching mask, same length
+ uint16_t company_id; /* company ID */
+ uint8_t data_len; /* <= 20 bytes */
+ uint8_t *p_pattern;
+ uint16_t company_id_mask; /* UUID value mask */
+ uint8_t *p_pattern_mask; /* Manufacturer data matching mask, same length
as data pattern, set to all 0xff, match exact data */
}tBTA_DM_BLE_PF_MANU_COND;
typedef struct
{
- UINT16 uuid; /* service ID */
- UINT8 data_len; /* <= 20 bytes */
- UINT8 *p_pattern;
- UINT8 *p_pattern_mask; /* Service data matching mask, same length
+ uint16_t uuid; /* service ID */
+ uint8_t data_len; /* <= 20 bytes */
+ uint8_t *p_pattern;
+ uint8_t *p_pattern_mask; /* Service data matching mask, same length
as data pattern, set to all 0xff, match exact data */
}tBTA_DM_BLE_PF_SRVC_PATTERN_COND;
@@ -557,14 +557,14 @@
tBTA_DM_BLE_PF_SRVC_PATTERN_COND srvc_data; /* service data pattern */
}tBTA_DM_BLE_PF_COND_PARAM;
-typedef UINT8 tBTA_DM_BLE_PF_FILT_INDEX;
-typedef UINT8 tBTA_DM_BLE_PF_AVBL_SPACE;
+typedef uint8_t tBTA_DM_BLE_PF_FILT_INDEX;
+typedef uint8_t tBTA_DM_BLE_PF_AVBL_SPACE;
-typedef INT8 tBTA_DM_RSSI_VALUE;
-typedef UINT8 tBTA_DM_LINK_QUALITY_VALUE;
+typedef int8_t tBTA_DM_RSSI_VALUE;
+typedef uint8_t tBTA_DM_LINK_QUALITY_VALUE;
-typedef UINT8 tBTA_SIG_STRENGTH_MASK;
+typedef uint8_t tBTA_SIG_STRENGTH_MASK;
/* Security Callback Events */
@@ -597,7 +597,7 @@
#define BTA_DM_HW_ERROR_EVT 26 /* BT Chip H/W error */
#define BTA_DM_LE_FEATURES_READ 27 /* Cotroller specific LE features are read */
#define BTA_DM_ENER_INFO_READ 28 /* Energy info read */
-typedef UINT8 tBTA_DM_SEC_EVT;
+typedef uint8_t tBTA_DM_SEC_EVT;
/* Structure associated with BTA_DM_ENABLE_EVT */
typedef struct
@@ -612,7 +612,7 @@
BD_ADDR bd_addr; /* BD address peer device. */
DEV_CLASS dev_class; /* Class of Device */
BD_NAME bd_name; /* Name of peer device. */
- BOOLEAN min_16_digit; /* TRUE if the pin returned must be at least 16 digits */
+ bool min_16_digit; /* true if the pin returned must be at least 16 digits */
} tBTA_DM_PIN_REQ;
/* BLE related definition */
@@ -656,7 +656,7 @@
#define BTA_LE_KEY_LENC BTM_LE_KEY_LENC /* master role security information:div */
#define BTA_LE_KEY_LID BTM_LE_KEY_LID /* master device ID key */
#define BTA_LE_KEY_LCSRK BTM_LE_KEY_LCSRK /* local CSRK has been deliver to peer */
-typedef UINT8 tBTA_LE_KEY_TYPE; /* can be used as a bit mask */
+typedef uint8_t tBTA_LE_KEY_TYPE; /* can be used as a bit mask */
typedef tBTM_LE_PENC_KEYS tBTA_LE_PENC_KEYS ;
@@ -677,7 +677,7 @@
#define BTA_BLE_LOCAL_KEY_TYPE_ID 1
#define BTA_BLE_LOCAL_KEY_TYPE_ER 2
-typedef UINT8 tBTA_DM_BLE_LOCAL_KEY_MASK;
+typedef uint8_t tBTA_DM_BLE_LOCAL_KEY_MASK;
typedef struct
{
@@ -689,15 +689,15 @@
#define BTA_DM_SEC_GRANTED BTA_SUCCESS
#define BTA_DM_SEC_PAIR_NOT_SPT BTA_DM_AUTH_SMP_PAIR_NOT_SUPPORT
#define BTA_DM_SEC_REP_ATTEMPTS BTA_DM_AUTH_SMP_REPEATED_ATTEMPT
-typedef UINT8 tBTA_DM_BLE_SEC_GRANT;
+typedef uint8_t tBTA_DM_BLE_SEC_GRANT;
#define BTA_DM_BLE_ONN_NONE BTM_BLE_CONN_NONE
#define BTA_DM_BLE_CONN_AUTO BTM_BLE_CONN_AUTO
#define BTA_DM_BLE_CONN_SELECTIVE BTM_BLE_CONN_SELECTIVE
-typedef UINT8 tBTA_DM_BLE_CONN_TYPE;
+typedef uint8_t tBTA_DM_BLE_CONN_TYPE;
-typedef BOOLEAN (tBTA_DM_BLE_SEL_CBACK)(BD_ADDR random_bda, UINT8 *p_remote_name);
+typedef bool (tBTA_DM_BLE_SEL_CBACK)(BD_ADDR random_bda, uint8_t *p_remote_name);
/* Structure associated with BTA_DM_BLE_SEC_REQ_EVT */
typedef struct
@@ -718,11 +718,11 @@
{
BD_ADDR bd_addr; /* BD address peer device. */
BD_NAME bd_name; /* Name of peer device. */
- BOOLEAN key_present; /* Valid link key value in key element */
+ bool key_present; /* Valid link key value in key element */
LINK_KEY key; /* Link key associated with peer device. */
- UINT8 key_type; /* The type of Link Key */
- BOOLEAN success; /* TRUE of authentication succeeded, FALSE if failed. */
- UINT8 fail_reason; /* The HCI reason/error code for when success=FALSE */
+ uint8_t key_type; /* The type of Link Key */
+ bool success; /* true of authentication succeeded, false if failed. */
+ uint8_t fail_reason; /* The HCI reason/error code for when success=false */
tBLE_ADDR_TYPE addr_type; /* Peer device address type */
tBT_DEVICE_TYPE dev_type;
} tBTA_DM_AUTH_CMPL;
@@ -741,7 +741,7 @@
typedef struct
{
BD_ADDR bd_addr; /* BD address peer device. */
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
tBTA_TRANSPORT link_type;
#endif
} tBTA_DM_LINK_UP;
@@ -750,9 +750,9 @@
typedef struct
{
BD_ADDR bd_addr; /* BD address peer device. */
- UINT8 status; /* connection open/closed */
- BOOLEAN is_removed; /* TRUE if device is removed when link is down */
-#if BLE_INCLUDED == TRUE
+ uint8_t status; /* connection open/closed */
+ bool is_removed; /* true if device is removed when link is down */
+#if (BLE_INCLUDED == TRUE)
tBTA_TRANSPORT link_type;
#endif
} tBTA_DM_LINK_DOWN;
@@ -761,22 +761,22 @@
typedef struct
{
BD_ADDR bd_addr; /* BD address peer device. */
- UINT8 new_role; /* the new connection role */
+ uint8_t new_role; /* the new connection role */
} tBTA_DM_ROLE_CHG;
/* Structure associated with BTA_DM_BUSY_LEVEL_EVT */
typedef struct
{
- UINT8 level; /* when paging or inquiring, level is 10.
+ uint8_t level; /* when paging or inquiring, level is 10.
Otherwise, the number of ACL links */
- UINT8 level_flags; /* indicates individual flags */
+ uint8_t level_flags; /* indicates individual flags */
} tBTA_DM_BUSY_LEVEL;
#define BTA_IO_CAP_OUT BTM_IO_CAP_OUT /* 0 DisplayOnly */
#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */
#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */
#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */
-#if BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
#define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */
#endif
typedef tBTM_IO_CAP tBTA_IO_CAP;
@@ -822,8 +822,8 @@
BD_ADDR bd_addr; /* peer address */
DEV_CLASS dev_class; /* peer CoD */
BD_NAME bd_name; /* peer device name */
- 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 */
+ 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 */
tBTA_AUTH_REQ loc_auth_req; /* Authentication required for local device */
tBTA_AUTH_REQ rmt_auth_req; /* Authentication required for peer device */
tBTA_IO_CAP loc_io_caps; /* IO Capabilities of local device */
@@ -838,7 +838,7 @@
BTA_SP_KEY_CLEARED, /* passkey cleared */
BTA_SP_KEY_COMPLT /* passkey entry completed */
};
-typedef UINT8 tBTA_SP_KEY_TYPE;
+typedef uint8_t tBTA_SP_KEY_TYPE;
/* Structure associated with BTA_DM_SP_KEYPRESS_EVT */
typedef struct
@@ -854,7 +854,7 @@
BD_ADDR bd_addr; /* peer address */
DEV_CLASS dev_class; /* peer CoD */
BD_NAME bd_name; /* peer device name */
- UINT32 passkey; /* the numeric value for comparison. If just_works, do not show this number to UI */
+ uint32_t passkey; /* the numeric value for comparison. If just_works, do not show this number to UI */
} tBTA_DM_SP_KEY_NOTIF;
/* Structure associated with BTA_DM_SP_RMT_OOB_EVT */
@@ -869,7 +869,7 @@
/* Structure associated with BTA_DM_BOND_CANCEL_CMPL_EVT */
typedef struct
{
- tBTA_STATUS result; /* TRUE of bond cancel succeeded, FALSE if failed. */
+ tBTA_STATUS result; /* true of bond cancel succeeded, false if failed. */
} tBTA_DM_BOND_CANCEL_CMPL;
/* Union of all security callback structures */
@@ -905,20 +905,20 @@
#define BTA_BLE_MULTI_ADV_PARAM_EVT 3
#define BTA_BLE_MULTI_ADV_DATA_EVT 4
-typedef UINT8 tBTA_BLE_MULTI_ADV_EVT;
+typedef uint8_t tBTA_BLE_MULTI_ADV_EVT;
/* multi adv callback */
typedef void (tBTA_BLE_MULTI_ADV_CBACK)(tBTA_BLE_MULTI_ADV_EVT event,
- UINT8 inst_id, void *p_ref, tBTA_STATUS status);
-typedef UINT32 tBTA_DM_BLE_REF_VALUE;
+ uint8_t inst_id, void *p_ref, tBTA_STATUS status);
+typedef uint32_t tBTA_DM_BLE_REF_VALUE;
#define BTA_DM_BLE_PF_ENABLE_EVT BTM_BLE_PF_ENABLE
#define BTA_DM_BLE_PF_CONFIG_EVT BTM_BLE_PF_CONFIG
-typedef UINT8 tBTA_DM_BLE_PF_EVT;
+typedef uint8_t tBTA_DM_BLE_PF_EVT;
#define BTA_DM_BLE_PF_ENABLE 1
#define BTA_DM_BLE_PF_CONFIG 2
-typedef UINT8 tBTA_DM_BLE_PF_ACTION;
+typedef uint8_t tBTA_DM_BLE_PF_ACTION;
/* Config callback */
typedef void (tBTA_DM_BLE_PF_CFG_CBACK) (tBTA_DM_BLE_PF_ACTION action,
@@ -926,11 +926,11 @@
tBTA_DM_BLE_PF_AVBL_SPACE avbl_space, tBTA_STATUS status,
tBTA_DM_BLE_REF_VALUE ref_value);
/* Param callback */
-typedef void (tBTA_DM_BLE_PF_PARAM_CBACK) (UINT8 action_type, tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
+typedef void (tBTA_DM_BLE_PF_PARAM_CBACK) (uint8_t action_type, tBTA_DM_BLE_PF_AVBL_SPACE avbl_space,
tBTA_DM_BLE_REF_VALUE ref_value, tBTA_STATUS status);
/* Status callback */
-typedef void (tBTA_DM_BLE_PF_STATUS_CBACK) (UINT8 action, tBTA_STATUS status,
+typedef void (tBTA_DM_BLE_PF_STATUS_CBACK) (uint8_t action, tBTA_STATUS status,
tBTA_DM_BLE_REF_VALUE ref_value);
@@ -941,21 +941,21 @@
#define BTA_DM_BLE_PF_LOC_NAME_CHECK 16
#define BTA_DM_BLE_PF_MANUF_NAME_CHECK 32
#define BTA_DM_BLE_PF_SERV_DATA_CHECK 64
-typedef UINT16 tBTA_DM_BLE_PF_FEAT_SEL;
+typedef uint16_t tBTA_DM_BLE_PF_FEAT_SEL;
#define BTA_DM_BLE_PF_LIST_LOGIC_OR 1
#define BTA_DM_BLE_PF_LIST_LOGIC_AND 2
-typedef UINT16 tBTA_DM_BLE_PF_LIST_LOGIC_TYPE;
+typedef uint16_t tBTA_DM_BLE_PF_LIST_LOGIC_TYPE;
#define BTA_DM_BLE_PF_FILT_LOGIC_OR 0
#define BTA_DM_BLE_PF_FILT_LOGIC_AND 1
-typedef UINT16 tBTA_DM_BLE_PF_FILT_LOGIC_TYPE;
+typedef uint16_t tBTA_DM_BLE_PF_FILT_LOGIC_TYPE;
-typedef UINT8 tBTA_DM_BLE_PF_RSSI_THRESHOLD;
-typedef UINT8 tBTA_DM_BLE_PF_DELIVERY_MODE;
-typedef UINT16 tBTA_DM_BLE_PF_TIMEOUT;
-typedef UINT8 tBTA_DM_BLE_PF_TIMEOUT_CNT;
-typedef UINT16 tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES;
+typedef uint8_t tBTA_DM_BLE_PF_RSSI_THRESHOLD;
+typedef uint8_t tBTA_DM_BLE_PF_DELIVERY_MODE;
+typedef uint16_t tBTA_DM_BLE_PF_TIMEOUT;
+typedef uint8_t tBTA_DM_BLE_PF_TIMEOUT_CNT;
+typedef uint16_t tBTA_DM_BLE_PF_ADV_TRACK_ENTRIES;
typedef struct
{
@@ -980,7 +980,7 @@
#define BTA_DM_DI_DISC_CMPL_EVT 5 /* Discovery complete. */
#define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */
-typedef UINT8 tBTA_DM_SEARCH_EVT;
+typedef uint8_t tBTA_DM_SEARCH_EVT;
#define BTA_DM_INQ_RES_IGNORE_RSSI BTM_INQ_RES_IGNORE_RSSI /* 0x7f RSSI value not supplied (ignore it) */
@@ -989,17 +989,17 @@
{
BD_ADDR bd_addr; /* BD address peer device. */
DEV_CLASS dev_class; /* Device class of peer device. */
- BOOLEAN remt_name_not_required; /* Application sets this flag if it already knows the name of the device */
+ bool remt_name_not_required; /* Application sets this flag if it already knows the name of the device */
/* If the device name is known to application BTA skips the remote name request */
- BOOLEAN is_limited; /* TRUE, if the limited inquiry bit is set in the CoD */
- INT8 rssi; /* The rssi value */
- UINT8 *p_eir; /* received EIR */
+ bool is_limited; /* true, if the limited inquiry bit is set in the CoD */
+ int8_t rssi; /* The rssi value */
+ uint8_t *p_eir; /* received EIR */
#if (BLE_INCLUDED == TRUE)
- UINT8 inq_result_type;
- UINT8 ble_addr_type;
+ uint8_t inq_result_type;
+ uint8_t ble_addr_type;
tBTM_BLE_EVT_TYPE ble_evt_type;
tBT_DEVICE_TYPE device_type;
- UINT8 flag;
+ uint8_t flag;
#endif
} tBTA_DM_INQ_RES;
@@ -1007,14 +1007,14 @@
/* Structure associated with BTA_DM_INQ_CMPL_EVT */
typedef struct
{
- UINT8 num_resps; /* Number of inquiry responses. */
+ uint8_t num_resps; /* Number of inquiry responses. */
} tBTA_DM_INQ_CMPL;
/* Structure associated with BTA_DM_DI_DISC_CMPL_EVT */
typedef struct
{
BD_ADDR bd_addr; /* BD address peer device. */
- UINT8 num_record; /* Number of DI record */
+ uint8_t num_record; /* Number of DI record */
tBTA_STATUS result;
} tBTA_DM_DI_DISC_CMPL;
@@ -1024,11 +1024,11 @@
BD_ADDR bd_addr; /* BD address peer device. */
BD_NAME bd_name; /* Name of peer device. */
tBTA_SERVICE_MASK services; /* Services found on peer device. */
- UINT8 * p_raw_data; /* Raw data for discovery DB */
- UINT32 raw_data_size; /* size of raw data */
+ uint8_t * p_raw_data; /* Raw data for discovery DB */
+ uint32_t raw_data_size; /* size of raw data */
tBT_DEVICE_TYPE device_type; /* device type in case it is BLE device */
- UINT32 num_uuids;
- UINT8 *p_uuid_list;
+ uint32_t num_uuids;
+ uint8_t *p_uuid_list;
tBTA_STATUS result;
} tBTA_DM_DISC_RES;
@@ -1067,7 +1067,7 @@
#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS;
typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS;
typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS;
@@ -1078,20 +1078,20 @@
#define BTA_DM_CONTRL_SCAN 2 /* Scan state - paging/inquiry/trying to connect*/
#define BTA_DM_CONTRL_IDLE 3 /* Idle state - page scan, LE advt, inquiry scan */
-typedef UINT8 tBTA_DM_CONTRL_STATE;
+typedef uint8_t tBTA_DM_CONTRL_STATE;
-typedef UINT8 tBTA_DM_BLE_ADV_STATE;
-typedef UINT8 tBTA_DM_BLE_ADV_INFO_PRESENT;
-typedef UINT8 tBTA_DM_BLE_RSSI_VALUE;
-typedef UINT16 tBTA_DM_BLE_ADV_INFO_TIMESTAMP;
+typedef uint8_t tBTA_DM_BLE_ADV_STATE;
+typedef uint8_t tBTA_DM_BLE_ADV_INFO_PRESENT;
+typedef uint8_t tBTA_DM_BLE_RSSI_VALUE;
+typedef uint16_t tBTA_DM_BLE_ADV_INFO_TIMESTAMP;
typedef tBTM_BLE_TRACK_ADV_DATA tBTA_DM_BLE_TRACK_ADV_DATA;
typedef void (tBTA_BLE_SCAN_THRESHOLD_CBACK)(tBTA_DM_BLE_REF_VALUE ref_value);
-typedef void (tBTA_BLE_SCAN_REP_CBACK) (tBTA_DM_BLE_REF_VALUE ref_value, UINT8 report_format,
- UINT8 num_records, UINT16 data_len,
- UINT8* p_rep_data, tBTA_STATUS status);
+typedef void (tBTA_BLE_SCAN_REP_CBACK) (tBTA_DM_BLE_REF_VALUE ref_value, uint8_t report_format,
+ uint8_t num_records, uint16_t data_len,
+ uint8_t* p_rep_data, tBTA_STATUS status);
typedef void (tBTA_BLE_SCAN_SETUP_CBACK) (tBTA_BLE_BATCH_SCAN_EVT evt,
tBTA_DM_BLE_REF_VALUE ref_value,
@@ -1111,7 +1111,7 @@
tBTA_STATUS status);
#else
-typedef UINT8 tBTA_DM_BLE_SEC_ACT;
+typedef uint8_t tBTA_DM_BLE_SEC_ACT;
#endif
/* Maximum service name length */
@@ -1125,7 +1125,7 @@
#define BTA_DM_LP_HOLD HCI_ENABLE_HOLD_MODE
#define BTA_DM_LP_SNIFF HCI_ENABLE_SNIFF_MODE
#define BTA_DM_LP_PARK HCI_ENABLE_PARK_MODE
-typedef UINT16 tBTA_DM_LP_MASK;
+typedef uint16_t tBTA_DM_LP_MASK;
/* power mode actions */
#define BTA_DM_PM_NO_ACTION 0x00 /* no change to the current pm setting */
@@ -1145,7 +1145,7 @@
#define BTA_DM_PM_SUSPEND 0x04 /* prefers suspend mode */
#define BTA_DM_PM_NO_PREF 0x01 /* service has no prefernce on power mode setting. eg. connection to service got closed */
-typedef UINT8 tBTA_DM_PM_ACTION;
+typedef uint8_t tBTA_DM_PM_ACTION;
/* index to bta_dm_ssr_spec */
#define BTA_DM_PM_SSR0 0
@@ -1263,7 +1263,7 @@
/* Switch callback events */
#define BTA_DM_SWITCH_CMPL_EVT 0 /* Completion of the Switch API */
-typedef UINT8 tBTA_DM_SWITCH_EVT;
+typedef uint8_t tBTA_DM_SWITCH_EVT;
typedef void (tBTA_DM_SWITCH_CBACK)(tBTA_DM_SWITCH_EVT event, tBTA_STATUS status);
/* Audio routing out configuration */
@@ -1277,7 +1277,7 @@
#define BTA_DM_ROUTE_FMRX 0x40 /* routing over FMRX */
#define BTA_DM_ROUTE_BTSNK 0x80 /* routing over BT SNK */
-typedef UINT8 tBTA_DM_ROUTE_PATH;
+typedef uint8_t tBTA_DM_ROUTE_PATH;
/* Device Identification (DI) data structure
@@ -1301,7 +1301,7 @@
#define BTA_DM_LINK_TYPE_BR_EDR 0x01
#define BTA_DM_LINK_TYPE_LE 0x02
#define BTA_DM_LINK_TYPE_ALL 0xFF
-typedef UINT8 tBTA_DM_LINK_TYPE;
+typedef uint8_t tBTA_DM_LINK_TYPE;
#define IMMEDIATE_DELY_MODE 0x00
#define ONFOUND_DELY_MODE 0x01
@@ -1393,7 +1393,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, UINT8 pairable_mode, UINT8 conn_filter);
+extern void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, uint8_t pairable_mode, uint8_t conn_filter);
/*******************************************************************************
**
@@ -1437,7 +1437,7 @@
**
*******************************************************************************/
extern 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);
/*******************************************************************************
**
@@ -1451,7 +1451,7 @@
**
*******************************************************************************/
extern 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);
/*******************************************************************************
**
@@ -1463,7 +1463,7 @@
** BTA_FAILURE if cached name is not available
**
*******************************************************************************/
-tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device, UINT8 **pp_cached_name);
+tBTA_STATUS BTA_DmGetCachedRemoteName(BD_ADDR remote_device, uint8_t **pp_cached_name);
/*******************************************************************************
**
@@ -1520,8 +1520,8 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmPinReply(BD_ADDR bd_addr, BOOLEAN accept, UINT8 pin_len,
- UINT8 *p_pin);
+extern void BTA_DmPinReply(BD_ADDR bd_addr, bool accept, uint8_t pin_len,
+ uint8_t *p_pin);
/*******************************************************************************
**
@@ -1545,7 +1545,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmConfirm(BD_ADDR bd_addr, BOOLEAN accept);
+extern void BTA_DmConfirm(BD_ADDR bd_addr, bool accept);
/*******************************************************************************
**
@@ -1562,8 +1562,8 @@
*******************************************************************************/
extern 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);
+ bool is_trusted, uint8_t key_type,
+ tBTA_IO_CAP io_cap, uint8_t pin_length);
/*******************************************************************************
**
@@ -1592,7 +1592,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GetEirService( UINT8 *p_eir, tBTA_SERVICE_MASK *p_services );
+extern void BTA_GetEirService( uint8_t *p_eir, tBTA_SERVICE_MASK *p_services );
/*******************************************************************************
**
@@ -1603,7 +1603,7 @@
** Returns 0 if the device is NOT connected.
**
*******************************************************************************/
-extern UINT16 BTA_DmGetConnectionState( const BD_ADDR bd_addr );
+extern uint16_t BTA_DmGetConnectionState( const BD_ADDR bd_addr );
/*******************************************************************************
@@ -1616,7 +1616,7 @@
**
*******************************************************************************/
extern tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
- UINT32 *p_handle );
+ uint32_t *p_handle );
/*******************************************************************************
**
@@ -1634,7 +1634,7 @@
** Returns void.
**
*******************************************************************************/
-extern void BTA_DmCloseACL(BD_ADDR bd_addr, BOOLEAN remove_dev, tBTA_TRANSPORT transport);
+extern void BTA_DmCloseACL(BD_ADDR bd_addr, bool remove_dev, tBTA_TRANSPORT transport);
/*******************************************************************************
**
@@ -1664,7 +1664,7 @@
** Returns none
**
*******************************************************************************/
-extern void BTA_DmPcmInitSamples (UINT32 src_sps, UINT32 bits, UINT32 n_channels);
+extern void BTA_DmPcmInitSamples (uint32_t src_sps, uint32_t bits, uint32_t n_channels);
/**************************************************************************************
** Function BTA_DmPcmResample
@@ -1679,13 +1679,13 @@
** the converted PCM samples.
**
**
-** Returns INT32: number of samples converted.
+** Returns int32_t: number of samples converted.
**
**************************************************************************************/
-extern INT32 BTA_DmPcmResample (void *p_src, UINT32 in_bytes, void *p_dst);
+extern int32_t BTA_DmPcmResample (void *p_src, uint32_t in_bytes, void *p_dst);
#endif
-#if ((defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
+#if (BLE_INCLUDED == TRUE)
/* BLE related API functions */
/*******************************************************************************
**
@@ -1733,7 +1733,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, BOOLEAN accept, UINT32 passkey);
+extern void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, bool accept, uint32_t passkey);
/*******************************************************************************
**
@@ -1747,7 +1747,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmBleConfirmReply(BD_ADDR bd_addr, BOOLEAN accept);
+extern void BTA_DmBleConfirmReply(BD_ADDR bd_addr, bool accept);
/*******************************************************************************
**
@@ -1805,8 +1805,8 @@
**
*******************************************************************************/
extern 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 );
/*******************************************************************************
**
@@ -1821,8 +1821,8 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmSetBleConnScanParams(UINT32 scan_interval,
- UINT32 scan_window);
+extern void BTA_DmSetBleConnScanParams(uint32_t scan_interval,
+ uint32_t scan_window);
/*******************************************************************************
**
@@ -1839,8 +1839,8 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmSetBleScanParams(tGATT_IF client_if, UINT32 scan_interval,
- UINT32 scan_window, tBLE_SCAN_MODE scan_mode,
+extern 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_status_cback);
/*******************************************************************************
@@ -1858,7 +1858,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmSetBleAdvParams (UINT16 adv_int_min, UINT16 adv_int_max,
+extern void BTA_DmSetBleAdvParams (uint16_t adv_int_min, uint16_t adv_int_max,
tBLE_BD_ADDR *p_dir_bda);
/*******************************************************************************
**
@@ -1898,7 +1898,7 @@
**
*******************************************************************************/
extern 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);
/*******************************************************************************
**
@@ -1917,7 +1917,7 @@
**
*******************************************************************************/
extern 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);
/*******************************************************************************
@@ -1962,13 +1962,13 @@
** 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);
#endif
-#if BLE_INCLUDED == TRUE
+#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
**
** Function BTA_DmBleConfigLocalPrivacy
@@ -1980,7 +1980,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmBleConfigLocalPrivacy(BOOLEAN privacy_enable);
+extern void BTA_DmBleConfigLocalPrivacy(bool privacy_enable);
/*******************************************************************************
**
@@ -1994,7 +1994,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, BOOLEAN privacy_enable);
+extern void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, bool privacy_enable);
/*******************************************************************************
@@ -2038,7 +2038,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_DmBleBroadcast (BOOLEAN start);
+extern void BTA_DmBleBroadcast (bool start);
/*******************************************************************************
@@ -2069,7 +2069,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_BleUpdateAdvInstParam (UINT8 inst_id,
+extern void BTA_BleUpdateAdvInstParam (uint8_t inst_id,
tBTA_BLE_ADV_PARAMS *p_params);
/*******************************************************************************
@@ -2084,7 +2084,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_BleCfgAdvInstData (UINT8 inst_id, BOOLEAN is_scan_rsp,
+extern void BTA_BleCfgAdvInstData (uint8_t inst_id, bool is_scan_rsp,
tBTA_BLE_AD_MASK data_mask, tBTA_BLE_ADV_DATA *p_data);
/*******************************************************************************
@@ -2098,7 +2098,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_BleDisableAdvInstance(UINT8 inst_id);
+extern void BTA_BleDisableAdvInstance(uint8_t inst_id);
/*******************************************************************************
**
@@ -2115,8 +2115,8 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmBleUpdateConnectionParams(const BD_ADDR bd_addr, UINT16 min_int,
- UINT16 max_int, UINT16 latency, UINT16 timeout);
+extern void BTA_DmBleUpdateConnectionParams(const BD_ADDR bd_addr, uint16_t min_int,
+ uint16_t max_int, uint16_t latency, uint16_t timeout);
/*******************************************************************************
**
@@ -2127,7 +2127,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmBleSetDataLength(BD_ADDR remote_device, UINT16 tx_data_length);
+extern void BTA_DmBleSetDataLength(BD_ADDR remote_device, uint16_t tx_data_length);
/*******************************************************************************
**
@@ -2147,9 +2147,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,
@@ -2172,7 +2172,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);
@@ -2218,7 +2218,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmEnableScanFilter(UINT8 action,
+extern void BTA_DmEnableScanFilter(uint8_t action,
tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
tBTA_DM_BLE_REF_VALUE ref_value);
@@ -2238,7 +2238,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_DmBleScanFilterSetup(UINT8 action,
+extern 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,
diff --git a/bta/include/bta_ar_api.h b/bta/include/bta_ar_api.h
index 302833c..37b060b 100644
--- a/bta/include/bta_ar_api.h
+++ b/bta/include/bta_ar_api.h
@@ -96,7 +96,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_ar_reg_avct(UINT16 mtu, UINT16 mtu_br, UINT8 sec_mask, tBTA_SYS_ID sys_id);
+extern void bta_ar_reg_avct(uint16_t mtu, uint16_t mtu_br, uint8_t sec_mask, tBTA_SYS_ID sys_id);
/*******************************************************************************
**
@@ -118,9 +118,9 @@
** Returns void
**
******************************************************************************/
-extern void bta_ar_reg_avrc(UINT16 service_uuid, char *p_service_name,
- char *p_provider_name, UINT16 categories, tBTA_SYS_ID sys_id,
- BOOLEAN browse_supported, UINT16 profile_version);
+extern void bta_ar_reg_avrc(uint16_t service_uuid, char *p_service_name,
+ char *p_provider_name, uint16_t categories, tBTA_SYS_ID sys_id,
+ bool browse_supported, uint16_t profile_version);
/******************************************************************************
**
@@ -131,7 +131,7 @@
** Returns void
**
******************************************************************************/
-extern void bta_ar_dereg_avrc(UINT16 service_uuid, tBTA_SYS_ID sys_id);
+extern void bta_ar_dereg_avrc(uint16_t service_uuid, tBTA_SYS_ID sys_id);
#ifdef __cplusplus
diff --git a/bta/include/bta_av_api.h b/bta/include/bta_av_api.h
index f878dc0..6e9eff2 100644
--- a/bta/include/bta_av_api.h
+++ b/bta/include/bta_av_api.h
@@ -38,10 +38,10 @@
/*****************************************************************************
** Constants and data types
*****************************************************************************/
-/* Set to TRUE if seperate authorization prompt desired for AVCTP besides A2DP authorization */
-/* Typically FALSE when AVRCP is used in conjunction with A2DP */
+/* Set to true if seperate authorization prompt desired for AVCTP besides A2DP authorization */
+/* Typically false when AVRCP is used in conjunction with A2DP */
#ifndef BTA_AV_WITH_AVCTP_AUTHORIZATION
-#define BTA_AV_WITH_AVCTP_AUTHORIZATION FALSE
+#define BTA_AV_WITH_AVCTP_AUTHORIZATION false
#endif
/* AV status values */
@@ -53,7 +53,7 @@
#define BTA_AV_FAIL_ROLE 5 /* failed due to role management related issues */
#define BTA_AV_FAIL_GET_CAP 6 /* get capability failed due to no SEP availale on the peer */
-typedef UINT8 tBTA_AV_STATUS;
+typedef uint8_t tBTA_AV_STATUS;
/* AV features masks */
#define BTA_AV_FEAT_RCTG 0x0001 /* remote control target */
@@ -73,22 +73,22 @@
/* Internal features */
#define BTA_AV_FEAT_NO_SCO_SSPD 0x8000 /* Do not suspend av streaming as to AG events(SCO or Call) */
-typedef UINT16 tBTA_AV_FEAT;
+typedef uint16_t tBTA_AV_FEAT;
/* AV channel values */
#define BTA_AV_CHNL_MSK 0xC0
#define BTA_AV_CHNL_AUDIO 0x40 /* audio channel */
#define BTA_AV_CHNL_VIDEO 0x80 /* video channel */
-typedef UINT8 tBTA_AV_CHNL;
+typedef uint8_t tBTA_AV_CHNL;
#define BTA_AV_HNDL_MSK 0x3F
-typedef UINT8 tBTA_AV_HNDL;
+typedef uint8_t tBTA_AV_HNDL;
/* handle index to mask */
-#define BTA_AV_HNDL_TO_MSK(h) ((UINT8)(1 << (h)))
+#define BTA_AV_HNDL_TO_MSK(h) ((uint8_t)(1 << (h)))
/* tBTA_AV_HNDL to mask */
-#define BTA_AV_HNDL_TYPE_TO_MSK(h) ((UINT8)(1 << ((h)&BTA_AV_HNDL_MSK)))
+#define BTA_AV_HNDL_TYPE_TO_MSK(h) ((uint8_t)(1 << ((h)&BTA_AV_HNDL_MSK)))
/* offset of codec type in codec info byte array */
#define BTA_AV_CODEC_TYPE_IDX AVDT_CODEC_TYPE_INDEX /* 2 */
@@ -125,7 +125,7 @@
#define BTA_AV_CODEC_H263_P8 VDP_MEDIA_CT_H263_P8 /* H.263 profile 8 */
#define BTA_AV_CODEC_VEND VDP_MEDIA_CT_VEND /* Non-VDP */
-typedef UINT8 tBTA_AV_CODEC;
+typedef uint8_t tBTA_AV_CODEC;
/* Company ID in BT assigned numbers */
#define BTA_AV_BT_VENDOR_ID VDP_BT_VENDOR_ID /* Broadcom Corporation */
@@ -193,13 +193,13 @@
#define BTA_AV_RC_F5 AVRC_ID_F5 /* F5 */
#define BTA_AV_VENDOR AVRC_ID_VENDOR /* vendor unique */
-typedef UINT8 tBTA_AV_RC;
+typedef uint8_t tBTA_AV_RC;
/* state flag for pass through command */
#define BTA_AV_STATE_PRESS AVRC_STATE_PRESS /* key pressed */
#define BTA_AV_STATE_RELEASE AVRC_STATE_RELEASE /* key released */
-typedef UINT8 tBTA_AV_STATE;
+typedef uint8_t tBTA_AV_STATE;
/* command codes for BTA_AvVendorCmd */
#define BTA_AV_CMD_CTRL AVRC_CMD_CTRL
@@ -208,7 +208,7 @@
#define BTA_AV_CMD_NOTIF AVRC_CMD_NOTIF
#define BTA_AV_CMD_GEN_INQ AVRC_CMD_GEN_INQ
-typedef UINT8 tBTA_AV_CMD;
+typedef uint8_t tBTA_AV_CMD;
/* response codes for BTA_AvVendorRsp */
#define BTA_AV_RSP_NOT_IMPL AVRC_RSP_NOT_IMPL
@@ -219,7 +219,7 @@
#define BTA_AV_RSP_CHANGED AVRC_RSP_CHANGED
#define BTA_AV_RSP_INTERIM AVRC_RSP_INTERIM
-typedef UINT8 tBTA_AV_CODE;
+typedef uint8_t tBTA_AV_CODE;
/* error codes for BTA_AvProtectRsp */
#define BTA_AV_ERR_NONE A2D_SUCCESS /* Success, no error */
@@ -228,7 +228,7 @@
#define BTA_AV_ERR_BAD_CP_TYPE A2D_BAD_CP_TYPE /* The requested Content Protection Type is not supported */
#define BTA_AV_ERR_BAD_CP_FORMAT A2D_BAD_CP_FORMAT /* The format of Content Protection Data is not correct */
-typedef UINT8 tBTA_AV_ERR;
+typedef uint8_t tBTA_AV_ERR;
/* AV callback events */
@@ -262,7 +262,7 @@
#define BTA_AV_MAX_EVT 23
-typedef UINT8 tBTA_AV_EVT;
+typedef uint8_t tBTA_AV_EVT;
/* Event associated with BTA_AV_ENABLE_EVT */
typedef struct
@@ -275,14 +275,14 @@
{
tBTA_AV_CHNL chnl; /* audio/video */
tBTA_AV_HNDL hndl; /* Handle associated with the stream. */
- UINT8 app_id; /* ID associated with call to BTA_AvRegister() */
+ uint8_t app_id; /* ID associated with call to BTA_AvRegister() */
tBTA_AV_STATUS status;
} tBTA_AV_REGISTER;
/* data associated with BTA_AV_OPEN_EVT */
#define BTA_AV_EDR_2MBPS 0x01
#define BTA_AV_EDR_3MBPS 0x02
-typedef UINT8 tBTA_AV_EDR;
+typedef uint8_t tBTA_AV_EDR;
typedef struct
{
@@ -290,9 +290,9 @@
tBTA_AV_HNDL hndl;
BD_ADDR bd_addr;
tBTA_AV_STATUS status;
- BOOLEAN starting;
+ bool starting;
tBTA_AV_EDR edr; /* 0, if peer device does not support EDR */
- UINT8 sep; /* sep type of peer device */
+ uint8_t sep; /* sep type of peer device */
} tBTA_AV_OPEN;
/* data associated with BTA_AV_CLOSE_EVT */
@@ -308,8 +308,8 @@
tBTA_AV_CHNL chnl;
tBTA_AV_HNDL hndl;
tBTA_AV_STATUS status;
- BOOLEAN initiator; /* TRUE, if local device initiates the START */
- BOOLEAN suspending;
+ bool initiator; /* true, if local device initiates the START */
+ bool suspending;
} tBTA_AV_START;
/* data associated with BTA_AV_SUSPEND_EVT */
@@ -317,7 +317,7 @@
{
tBTA_AV_CHNL chnl;
tBTA_AV_HNDL hndl;
- BOOLEAN initiator; /* TRUE, if local device initiates the SUSPEND */
+ bool initiator; /* true, if local device initiates the SUSPEND */
tBTA_AV_STATUS status;
} tBTA_AV_SUSPEND;
@@ -334,8 +334,8 @@
{
tBTA_AV_CHNL chnl;
tBTA_AV_HNDL hndl;
- UINT8 *p_data;
- UINT16 len;
+ uint8_t *p_data;
+ uint16_t len;
} tBTA_AV_PROTECT_REQ;
/* data associated with BTA_AV_PROTECT_RSP_EVT */
@@ -343,15 +343,15 @@
{
tBTA_AV_CHNL chnl;
tBTA_AV_HNDL hndl;
- UINT8 *p_data;
- UINT16 len;
+ uint8_t *p_data;
+ uint16_t len;
tBTA_AV_ERR err_code;
} tBTA_AV_PROTECT_RSP;
/* data associated with BTA_AV_RC_OPEN_EVT */
typedef struct
{
- UINT8 rc_handle;
+ uint8_t rc_handle;
tBTA_AV_FEAT peer_features;
BD_ADDR peer_addr;
tBTA_AV_STATUS status;
@@ -360,14 +360,14 @@
/* data associated with BTA_AV_RC_CLOSE_EVT */
typedef struct
{
- UINT8 rc_handle;
+ uint8_t rc_handle;
BD_ADDR peer_addr;
} tBTA_AV_RC_CLOSE;
/* data associated with BTA_AV_RC_FEAT_EVT */
typedef struct
{
- UINT8 rc_handle;
+ uint8_t rc_handle;
tBTA_AV_FEAT peer_features;
BD_ADDR peer_addr;
} tBTA_AV_RC_FEAT;
@@ -375,47 +375,47 @@
/* data associated with BTA_AV_REMOTE_CMD_EVT */
typedef struct
{
- UINT8 rc_handle;
+ uint8_t rc_handle;
tBTA_AV_RC rc_id;
tBTA_AV_STATE key_state;
- UINT8 len;
- UINT8 *p_data;
+ uint8_t len;
+ uint8_t *p_data;
tAVRC_HDR hdr; /* Message header. */
- UINT8 label;
+ uint8_t label;
} tBTA_AV_REMOTE_CMD;
/* data associated with BTA_AV_REMOTE_RSP_EVT */
typedef struct
{
- UINT8 rc_handle;
+ uint8_t rc_handle;
tBTA_AV_RC rc_id;
tBTA_AV_STATE key_state;
- UINT8 len;
- UINT8 *p_data;
+ uint8_t len;
+ uint8_t *p_data;
tBTA_AV_CODE rsp_code;
- UINT8 label;
+ uint8_t label;
} tBTA_AV_REMOTE_RSP;
/* data associated with BTA_AV_VENDOR_CMD_EVT, BTA_AV_VENDOR_RSP_EVT */
typedef struct
{
- UINT8 rc_handle;
- UINT16 len; /* Max vendor dependent message is 512 */
- UINT8 label;
+ uint8_t rc_handle;
+ uint16_t len; /* Max vendor dependent message is 512 */
+ uint8_t label;
tBTA_AV_CODE code;
- UINT32 company_id;
- UINT8 *p_data;
+ uint32_t company_id;
+ uint8_t *p_data;
} tBTA_AV_VENDOR;
/* data associated with BTA_AV_META_MSG_EVT */
typedef struct
{
- UINT8 rc_handle;
- UINT16 len;
- UINT8 label;
+ uint8_t rc_handle;
+ uint16_t len;
+ uint8_t label;
tBTA_AV_CODE code;
- UINT32 company_id;
- UINT8 *p_data;
+ uint32_t company_id;
+ uint8_t *p_data;
tAVRC_MSG *p_msg;
} tBTA_AV_META_MSG;
@@ -461,7 +461,7 @@
typedef struct
{
- UINT8 *codec_info;
+ uint8_t *codec_info;
BD_ADDR bd_addr;;
} tBTA_AVK_CONFIG;
@@ -501,23 +501,23 @@
/* AV configuration structure */
typedef struct
{
- UINT32 company_id; /* AVRCP Company ID */
- UINT16 avrc_mtu; /* AVRCP MTU at L2CAP for control channel */
- UINT16 avrc_br_mtu; /* AVRCP MTU at L2CAP for browsing channel */
- UINT16 avrc_ct_cat; /* AVRCP controller categories */
- UINT16 avrc_tg_cat; /* AVRCP target categories */
- UINT16 sig_mtu; /* AVDTP signaling channel MTU at L2CAP */
- UINT16 audio_mtu; /* AVDTP audio transport channel MTU at L2CAP */
- const UINT16 *p_audio_flush_to;/* AVDTP audio transport channel flush timeout */
- UINT16 audio_mqs; /* AVDTP audio channel max data queue size */
- UINT16 video_mtu; /* AVDTP video transport channel MTU at L2CAP */
- UINT16 video_flush_to; /* AVDTP video transport channel flush timeout */
- BOOLEAN avrc_group; /* TRUE, to accept AVRC 1.3 group nevigation command */
- UINT8 num_co_ids; /* company id count in p_meta_co_ids */
- UINT8 num_evt_ids; /* event id count in p_meta_evt_ids */
+ uint32_t company_id; /* AVRCP Company ID */
+ uint16_t avrc_mtu; /* AVRCP MTU at L2CAP for control channel */
+ uint16_t avrc_br_mtu; /* AVRCP MTU at L2CAP for browsing channel */
+ uint16_t avrc_ct_cat; /* AVRCP controller categories */
+ uint16_t avrc_tg_cat; /* AVRCP target categories */
+ uint16_t sig_mtu; /* AVDTP signaling channel MTU at L2CAP */
+ uint16_t audio_mtu; /* AVDTP audio transport channel MTU at L2CAP */
+ const uint16_t *p_audio_flush_to;/* AVDTP audio transport channel flush timeout */
+ uint16_t audio_mqs; /* AVDTP audio channel max data queue size */
+ uint16_t video_mtu; /* AVDTP video transport channel MTU at L2CAP */
+ uint16_t video_flush_to; /* AVDTP video transport channel flush timeout */
+ bool avrc_group; /* true, to accept AVRC 1.3 group nevigation command */
+ uint8_t num_co_ids; /* company id count in p_meta_co_ids */
+ uint8_t num_evt_ids; /* event id count in p_meta_evt_ids */
tBTA_AV_CODE rc_pass_rsp; /* the default response code for pass through commands */
- const UINT32 *p_meta_co_ids;/* the metadata Get Capabilities response for company id */
- const UINT8 *p_meta_evt_ids;/* the the metadata Get Capabilities response for event id */
+ const uint32_t *p_meta_co_ids;/* the metadata Get Capabilities response for company id */
+ const uint8_t *p_meta_evt_ids;/* the the metadata Get Capabilities response for event id */
const tBTA_AV_ACT *p_act_tbl;/* the action function table for VDP stream */
tBTA_AV_REG *p_reg; /* action function to register VDP */
char avrc_controller_name[BTA_SERVICE_NAME_LEN]; /* Default AVRCP controller name */
@@ -570,7 +570,7 @@
**
*******************************************************************************/
void BTA_AvRegister(tBTA_AV_CHNL chnl, const char *p_service_name,
- UINT8 app_id, tBTA_AV_DATA_CBACK *p_data_cback, UINT16 service_uuid);
+ uint8_t app_id, tBTA_AV_DATA_CBACK *p_data_cback, uint16_t service_uuid);
/*******************************************************************************
**
@@ -595,7 +595,7 @@
**
*******************************************************************************/
void BTA_AvOpen(BD_ADDR bd_addr, tBTA_AV_HNDL handle,
- BOOLEAN use_rc, tBTA_SEC sec_mask, UINT16 uuid);
+ bool use_rc, tBTA_SEC sec_mask, uint16_t uuid);
/*******************************************************************************
**
@@ -646,29 +646,29 @@
** Function BTA_AvStop
**
** Description Stop audio/video stream data transfer.
-** If suspend is TRUE, this function sends AVDT suspend signal
+** If suspend is true, this function sends AVDT suspend signal
** to the connected peer(s).
**
** Returns void
**
*******************************************************************************/
-void BTA_AvStop(BOOLEAN suspend);
+void BTA_AvStop(bool suspend);
/*******************************************************************************
**
** Function BTA_AvReconfig
**
** Description Reconfigure the audio/video stream.
-** If suspend is TRUE, this function tries the suspend/reconfigure
+** If suspend is true, this function tries the suspend/reconfigure
** procedure first.
-** If suspend is FALSE or when suspend/reconfigure fails,
+** If suspend is false or when suspend/reconfigure fails,
** this function closes and re-opens the AVDT connection.
**
** Returns void
**
*******************************************************************************/
-void BTA_AvReconfig(tBTA_AV_HNDL hndl, BOOLEAN suspend, UINT8 sep_info_idx,
- UINT8 *p_codec_info, UINT8 num_protect, UINT8 *p_protect_info);
+void BTA_AvReconfig(tBTA_AV_HNDL hndl, bool suspend, uint8_t sep_info_idx,
+ uint8_t *p_codec_info, uint8_t num_protect, uint8_t *p_protect_info);
/*******************************************************************************
**
@@ -680,7 +680,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvProtectReq(tBTA_AV_HNDL hndl, UINT8 *p_data, UINT16 len);
+void BTA_AvProtectReq(tBTA_AV_HNDL hndl, uint8_t *p_data, uint16_t len);
/*******************************************************************************
**
@@ -694,8 +694,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvProtectRsp(tBTA_AV_HNDL hndl, UINT8 error_code, UINT8 *p_data,
- UINT16 len);
+void BTA_AvProtectRsp(tBTA_AV_HNDL hndl, uint8_t error_code, uint8_t *p_data,
+ uint16_t len);
/*******************************************************************************
**
@@ -707,7 +707,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvRemoteCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_RC rc_id,
+void BTA_AvRemoteCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_RC rc_id,
tBTA_AV_STATE key_state);
/*******************************************************************************
@@ -721,8 +721,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvRemoteVendorUniqueCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_STATE key_state,
- UINT8* p_msg, UINT8 buf_len);
+void BTA_AvRemoteVendorUniqueCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_STATE key_state,
+ uint8_t* p_msg, uint8_t buf_len);
/*******************************************************************************
**
@@ -735,8 +735,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvVendorCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE cmd_code,
- UINT8 *p_data, UINT16 len);
+void BTA_AvVendorCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE cmd_code,
+ uint8_t *p_data, uint16_t len);
/*******************************************************************************
**
@@ -750,8 +750,8 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvVendorRsp(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE rsp_code,
- UINT8 *p_data, UINT16 len, UINT32 company_id);
+void BTA_AvVendorRsp(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code,
+ uint8_t *p_data, uint16_t len, uint32_t company_id);
/*******************************************************************************
@@ -775,7 +775,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvCloseRc(UINT8 rc_handle);
+void BTA_AvCloseRc(uint8_t rc_handle);
/*******************************************************************************
**
@@ -789,7 +789,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvMetaRsp(UINT8 rc_handle, UINT8 label, tBTA_AV_CODE rsp_code,
+void BTA_AvMetaRsp(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code,
BT_HDR *p_pkt);
/*******************************************************************************
@@ -806,7 +806,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_AvMetaCmd(UINT8 rc_handle, UINT8 label, tBTA_AV_CMD cmd_code, BT_HDR *p_pkt);
+void BTA_AvMetaCmd(uint8_t rc_handle, uint8_t label, tBTA_AV_CMD cmd_code, BT_HDR *p_pkt);
/*******************************************************************************
**
diff --git a/bta/include/bta_av_ci.h b/bta/include/bta_av_ci.h
index 9e2c62c..ebfa97a 100644
--- a/bta/include/bta_av_ci.h
+++ b/bta/include/bta_av_ci.h
@@ -61,9 +61,9 @@
** Returns void
**
*******************************************************************************/
-extern void bta_av_ci_setconfig(tBTA_AV_HNDL hndl, UINT8 err_code,
- UINT8 category, UINT8 num_seid, UINT8 *p_seid,
- BOOLEAN recfg_needed, UINT8 avdt_handle);
+extern void bta_av_ci_setconfig(tBTA_AV_HNDL hndl, uint8_t err_code,
+ uint8_t category, uint8_t num_seid, uint8_t *p_seid,
+ bool recfg_needed, uint8_t avdt_handle);
#ifdef __cplusplus
diff --git a/bta/include/bta_av_co.h b/bta/include/bta_av_co.h
index 8cd3c8b..fc306ed 100644
--- a/bta/include/bta_av_co.h
+++ b/bta/include/bta_av_co.h
@@ -35,9 +35,9 @@
** Constants and data types
*****************************************************************************/
-/* TRUE to use SCMS-T content protection */
+/* true to use SCMS-T content protection */
#ifndef BTA_AV_CO_CP_SCMS_T
-#define BTA_AV_CO_CP_SCMS_T FALSE
+#define BTA_AV_CO_CP_SCMS_T false
#endif
/* the content protection IDs assigned by BT SIG */
@@ -67,12 +67,12 @@
/* data type for the Audio Codec Information*/
typedef struct
{
- UINT16 bit_rate; /* SBC encoder bit rate in kbps */
- UINT16 bit_rate_busy; /* SBC encoder bit rate in kbps */
- UINT16 bit_rate_swampd;/* SBC encoder bit rate in kbps */
- UINT8 busy_level; /* Busy level indicating the bit-rate to be used */
- UINT8 codec_info[AVDT_CODEC_SIZE];
- UINT8 codec_type; /* Codec type */
+ uint16_t bit_rate; /* SBC encoder bit rate in kbps */
+ uint16_t bit_rate_busy; /* SBC encoder bit rate in kbps */
+ uint16_t bit_rate_swampd;/* SBC encoder bit rate in kbps */
+ uint8_t busy_level; /* Busy level indicating the bit-rate to be used */
+ uint8_t codec_info[AVDT_CODEC_SIZE];
+ uint8_t codec_type; /* Codec type */
} tBTA_AV_AUDIO_CODEC_INFO;
/*******************************************************************************
@@ -88,8 +88,8 @@
** Returns Stream codec and content protection capabilities info.
**
*******************************************************************************/
-extern BOOLEAN bta_av_co_audio_init(UINT8 *p_codec_type, UINT8 *p_codec_info,
- UINT8 *p_num_protect, UINT8 *p_protect_info, UINT8 index);
+extern bool bta_av_co_audio_init(uint8_t *p_codec_type, uint8_t *p_codec_info,
+ uint8_t *p_num_protect, uint8_t *p_protect_info, uint8_t index);
/*******************************************************************************
**
@@ -103,8 +103,8 @@
** Returns void.
**
*******************************************************************************/
-extern void bta_av_co_audio_disc_res(tBTA_AV_HNDL hndl, UINT8 num_seps,
- UINT8 num_snk, UINT8 num_src, BD_ADDR addr, UINT16 uuid_local);
+extern void bta_av_co_audio_disc_res(tBTA_AV_HNDL hndl, uint8_t num_seps,
+ uint8_t num_snk, uint8_t num_src, BD_ADDR addr, uint16_t uuid_local);
/*******************************************************************************
**
@@ -118,8 +118,8 @@
** Returns void.
**
*******************************************************************************/
-extern void bta_av_co_video_disc_res(tBTA_AV_HNDL hndl, UINT8 num_seps,
- UINT8 num_snk, BD_ADDR addr);
+extern void bta_av_co_video_disc_res(tBTA_AV_HNDL hndl, uint8_t num_seps,
+ uint8_t num_snk, BD_ADDR addr);
/*******************************************************************************
**
@@ -133,9 +133,9 @@
** Returns Stream codec and content protection configuration info.
**
*******************************************************************************/
-extern UINT8 bta_av_co_audio_getconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT8 *p_codec_info, UINT8 *p_sep_info_idx, UINT8 seid,
- UINT8 *p_num_protect, UINT8 *p_protect_info);
+extern uint8_t bta_av_co_audio_getconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
+ uint8_t *p_codec_info, uint8_t *p_sep_info_idx, uint8_t seid,
+ uint8_t *p_num_protect, uint8_t *p_protect_info);
/*******************************************************************************
**
@@ -149,9 +149,9 @@
** Returns Stream codec and content protection configuration info.
**
*******************************************************************************/
-extern UINT8 bta_av_co_video_getconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT8 *p_codec_info, UINT8 *p_sep_info_idx, UINT8 seid,
- UINT8 *p_num_protect, UINT8 *p_protect_info);
+extern uint8_t bta_av_co_video_getconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
+ uint8_t *p_codec_info, uint8_t *p_sep_info_idx, uint8_t seid,
+ uint8_t *p_num_protect, uint8_t *p_protect_info);
/*******************************************************************************
**
@@ -165,8 +165,8 @@
**
*******************************************************************************/
extern void bta_av_co_audio_setconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT8 *p_codec_info, UINT8 seid, BD_ADDR addr,
- UINT8 num_protect, UINT8 *p_protect_info,UINT8 t_local_sep, UINT8 avdt_handle);
+ uint8_t *p_codec_info, uint8_t seid, BD_ADDR addr,
+ uint8_t num_protect, uint8_t *p_protect_info,uint8_t t_local_sep, uint8_t avdt_handle);
/*******************************************************************************
**
@@ -180,8 +180,8 @@
**
*******************************************************************************/
extern void bta_av_co_video_setconfig(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT8 *p_codec_info, UINT8 seid, BD_ADDR addr,
- UINT8 num_protect, UINT8 *p_protect_info);
+ uint8_t *p_codec_info, uint8_t seid, BD_ADDR addr,
+ uint8_t num_protect, uint8_t *p_protect_info);
/*******************************************************************************
**
@@ -197,8 +197,8 @@
**
*******************************************************************************/
extern void bta_av_co_audio_open(tBTA_AV_HNDL hndl,
- tBTA_AV_CODEC codec_type, UINT8 *p_codec_info,
- UINT16 mtu);
+ tBTA_AV_CODEC codec_type, uint8_t *p_codec_info,
+ uint16_t mtu);
/*******************************************************************************
**
@@ -212,8 +212,8 @@
**
*******************************************************************************/
extern void bta_av_co_video_open(tBTA_AV_HNDL hndl,
- tBTA_AV_CODEC codec_type, UINT8 *p_codec_info,
- UINT16 mtu);
+ tBTA_AV_CODEC codec_type, uint8_t *p_codec_info,
+ uint16_t mtu);
/*******************************************************************************
**
@@ -230,7 +230,7 @@
**
*******************************************************************************/
extern void bta_av_co_audio_close(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT16 mtu);
+ uint16_t mtu);
/*******************************************************************************
**
@@ -244,7 +244,7 @@
**
*******************************************************************************/
extern void bta_av_co_video_close(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT16 mtu);
+ uint16_t mtu);
/*******************************************************************************
**
@@ -258,7 +258,7 @@
**
*******************************************************************************/
extern void bta_av_co_audio_start(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT8 *p_codec_info, BOOLEAN *p_no_rtp_hdr);
+ uint8_t *p_codec_info, bool *p_no_rtp_hdr);
/*******************************************************************************
**
@@ -272,7 +272,7 @@
**
*******************************************************************************/
extern void bta_av_co_video_start(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
- UINT8 *p_codec_info, BOOLEAN *p_no_rtp_hdr);
+ uint8_t *p_codec_info, bool *p_no_rtp_hdr);
/*******************************************************************************
**
@@ -312,7 +312,7 @@
**
*******************************************************************************/
extern void * bta_av_co_audio_src_data_path(tBTA_AV_CODEC codec_type,
- UINT32 *p_len, UINT32 *p_timestamp);
+ uint32_t *p_len, uint32_t *p_timestamp);
/*******************************************************************************
**
@@ -322,11 +322,11 @@
** the video codec.
**
** Returns NULL if data is not ready.
-** Otherwise, a video data buffer (UINT8*).
+** Otherwise, a video data buffer (uint8_t*).
**
*******************************************************************************/
extern void * bta_av_co_video_src_data_path(tBTA_AV_CODEC codec_type,
- UINT32 *p_len, UINT32 *p_timestamp);
+ uint32_t *p_len, uint32_t *p_timestamp);
/*******************************************************************************
**
@@ -347,12 +347,12 @@
** Function bta_av_co_video_report_conn
**
** Description This function is called by AV when the reporting channel is
-** opened (open=TRUE) or closed (open=FALSE).
+** opened (open=true) or closed (open=false).
**
** Returns void
**
*******************************************************************************/
-extern void bta_av_co_video_report_conn (BOOLEAN open, UINT8 avdt_handle);
+extern void bta_av_co_video_report_conn (bool open, uint8_t avdt_handle);
/*******************************************************************************
**
@@ -364,7 +364,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_av_co_video_report_rr (UINT32 packet_lost);
+extern void bta_av_co_video_report_rr (uint32_t packet_lost);
/*******************************************************************************
**
@@ -377,7 +377,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_av_co_audio_delay(tBTA_AV_HNDL hndl, UINT16 delay);
+extern void bta_av_co_audio_delay(tBTA_AV_HNDL hndl, uint16_t delay);
/*******************************************************************************
**
@@ -390,7 +390,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_av_co_video_delay(tBTA_AV_HNDL hndl, UINT16 delay);
+extern void bta_av_co_video_delay(tBTA_AV_HNDL hndl, uint16_t delay);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_av_sbc.h b/bta/include/bta_av_sbc.h
index 858f832..57be46e 100644
--- a/bta/include/bta_av_sbc.h
+++ b/bta/include/bta_av_sbc.h
@@ -50,8 +50,8 @@
** Returns none
**
*******************************************************************************/
-extern void bta_av_sbc_init_up_sample (UINT32 src_sps, UINT32 dst_sps,
- UINT16 bits, UINT16 n_channels);
+extern void bta_av_sbc_init_up_sample (uint32_t src_sps, uint32_t dst_sps,
+ uint16_t bits, uint16_t n_channels);
/*******************************************************************************
**
@@ -79,8 +79,8 @@
**
*******************************************************************************/
extern int bta_av_sbc_up_sample (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret);
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret);
/*******************************************************************************
**
@@ -100,8 +100,8 @@
**
*******************************************************************************/
extern int bta_av_sbc_up_sample_16s (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret);
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret);
/*******************************************************************************
**
@@ -121,8 +121,8 @@
**
*******************************************************************************/
extern int bta_av_sbc_up_sample_16m (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret);
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret);
/*******************************************************************************
**
@@ -142,8 +142,8 @@
**
*******************************************************************************/
extern int bta_av_sbc_up_sample_8s (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret);
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret);
/*******************************************************************************
**
@@ -163,8 +163,8 @@
**
*******************************************************************************/
extern int bta_av_sbc_up_sample_8m (void *p_src, void *p_dst,
- UINT32 src_samples, UINT32 dst_samples,
- UINT32 *p_ret);
+ uint32_t src_samples, uint32_t dst_samples,
+ uint32_t *p_ret);
/*******************************************************************************
**
@@ -182,7 +182,7 @@
** Codec configuration in p_cap.
**
*******************************************************************************/
-extern UINT8 bta_av_sbc_cfg_for_cap(UINT8 *p_peer, tA2D_SBC_CIE *p_cap, tA2D_SBC_CIE *p_pref);
+extern uint8_t bta_av_sbc_cfg_for_cap(uint8_t *p_peer, tA2D_SBC_CIE *p_cap, tA2D_SBC_CIE *p_pref);
/*******************************************************************************
**
@@ -194,7 +194,7 @@
** Returns 0 if ok, nonzero if error.
**
*******************************************************************************/
-extern UINT8 bta_av_sbc_cfg_in_cap(UINT8 *p_cfg, tA2D_SBC_CIE *p_cap);
+extern uint8_t bta_av_sbc_cfg_in_cap(uint8_t *p_cfg, tA2D_SBC_CIE *p_cap);
/*******************************************************************************
**
@@ -206,7 +206,7 @@
** Returns 0 if ok, nonzero if error.
**
*******************************************************************************/
-extern UINT8 bta_av_sbc_cfg_matches_cap(UINT8 *p_cfg, tA2D_SBC_CIE *p_cap);
+extern uint8_t bta_av_sbc_cfg_matches_cap(uint8_t *p_cfg, tA2D_SBC_CIE *p_cap);
/*******************************************************************************
**
@@ -217,7 +217,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_av_sbc_bld_hdr(BT_HDR *p_buf, UINT16 fr_per_pkt);
+extern void bta_av_sbc_bld_hdr(BT_HDR *p_buf, uint16_t fr_per_pkt);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_dm_ci.h b/bta/include/bta_dm_ci.h
index 5593b9e..4d4bb81 100644
--- a/bta/include/bta_dm_ci.h
+++ b/bta/include/bta_dm_ci.h
@@ -59,7 +59,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_dm_ci_rmt_oob(BOOLEAN accept, BD_ADDR bd_addr,
+extern void bta_dm_ci_rmt_oob(bool accept, BD_ADDR bd_addr,
BT_OCTET16 c, BT_OCTET16 r);
/*******************************************************************************
**
@@ -71,7 +71,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_dm_sco_ci_data_ready(UINT16 event, UINT16 sco_handle);
+extern void bta_dm_sco_ci_data_ready(uint16_t event, uint16_t sco_handle);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_dm_co.h b/bta/include/bta_dm_co.h
index cfb71fc..47f6abb 100644
--- a/bta/include/bta_dm_co.h
+++ b/bta/include/bta_dm_co.h
@@ -36,7 +36,7 @@
#define BTA_SCO_CODEC_PCM 0 /* used for regular SCO */
#define BTA_SCO_CODEC_SBC 1 /* used for WBS */
-typedef UINT8 tBTA_SCO_CODEC_TYPE;
+typedef uint8_t tBTA_SCO_CODEC_TYPE;
#define BTA_DM_SCO_SAMP_RATE_8K 8000
#define BTA_DM_SCO_SAMP_RATE_16K 16000
@@ -66,15 +66,15 @@
**
** Parameters bd_addr - The peer device
** *p_io_cap - The local Input/Output capabilities
-** *p_oob_data - TRUE, if OOB data is available for the peer device.
-** *p_auth_req - TRUE, if MITM protection is required.
+** *p_oob_data - true, if OOB data is available for the peer device.
+** *p_auth_req - true, if MITM protection is required.
**
** Returns void.
**
*******************************************************************************/
extern void bta_dm_co_io_req(BD_ADDR bd_addr, tBTA_IO_CAP *p_io_cap,
tBTA_OOB_DATA *p_oob_data, tBTA_AUTH_REQ *p_auth_req,
- BOOLEAN is_orig);
+ bool is_orig);
/*******************************************************************************
**
@@ -85,8 +85,8 @@
**
** Parameters bd_addr - The peer device
** io_cap - The remote Input/Output capabilities
-** oob_data - TRUE, if OOB data is available for the peer device.
-** auth_req - TRUE, if MITM protection is required.
+** oob_data - true, if OOB data is available for the peer device.
+** auth_req - true, if MITM protection is required.
**
** Returns void.
**
@@ -102,12 +102,12 @@
** platform wants allow link key upgrade
**
** Parameters bd_addr - The peer device
-** *p_upgrade - TRUE, if link key upgrade is desired.
+** *p_upgrade - true, if link key upgrade is desired.
**
** Returns void.
**
*******************************************************************************/
-extern void bta_dm_co_lk_upgrade(BD_ADDR bd_addr, BOOLEAN *p_upgrade );
+extern void bta_dm_co_lk_upgrade(BD_ADDR bd_addr, bool *p_upgrade );
/*******************************************************************************
**
@@ -116,14 +116,14 @@
** Description This callout function is executed by DM to report the OOB
** data of the local device for the Simple Pairing process
**
-** Parameters valid - TRUE, if the local OOB data is retrieved from LM
+** Parameters valid - true, if the local OOB data is retrieved from LM
** c - Simple Pairing Hash C
** r - Simple Pairing Randomnizer R
**
** Returns void.
**
*******************************************************************************/
-extern void bta_dm_co_loc_oob(BOOLEAN valid, BT_OCTET16 c, BT_OCTET16 r);
+extern void bta_dm_co_loc_oob(bool valid, BT_OCTET16 c, BT_OCTET16 r);
/*******************************************************************************
**
@@ -154,8 +154,8 @@
** Returns Void.
**
*******************************************************************************/
-extern tBTA_DM_SCO_ROUTE_TYPE bta_dm_sco_co_init(UINT32 rx_bw, UINT32 tx_bw,
- tBTA_CODEC_INFO *p_codec_info, UINT8 app_id);
+extern tBTA_DM_SCO_ROUTE_TYPE bta_dm_sco_co_init(uint32_t rx_bw, uint32_t tx_bw,
+ tBTA_CODEC_INFO *p_codec_info, uint8_t app_id);
/*******************************************************************************
@@ -168,7 +168,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_dm_sco_co_open(UINT16 handle, UINT8 pkt_size, UINT16 event);
+extern void bta_dm_sco_co_open(uint16_t handle, uint8_t pkt_size, uint16_t event);
/*******************************************************************************
**
@@ -215,7 +215,7 @@
**
** Parameters bd_addr - The peer device
** *p_io_cap - The local Input/Output capabilities
-** *p_oob_data - TRUE, if OOB data is available for the peer device.
+** *p_oob_data - true, if OOB data is available for the peer device.
** *p_auth_req - Auth request setting (Bonding and MITM required or not)
** *p_max_key_size - max key size local device supported.
** *p_init_key - initiator keys.
@@ -227,7 +227,7 @@
extern void bta_dm_co_ble_io_req(BD_ADDR bd_addr, tBTA_IO_CAP *p_io_cap,
tBTA_OOB_DATA *p_oob_data,
tBTA_LE_AUTH_REQ *p_auth_req,
- UINT8 *p_max_key_size,
+ uint8_t *p_max_key_size,
tBTA_LE_KEY_TYPE *p_init_key,
tBTA_LE_KEY_TYPE *p_resp_key );
@@ -256,7 +256,7 @@
**
** Parameters bd_addr - The peer device
** *p_io_cap - The local Input/Output capabilities
-** *p_oob_data - TRUE, if OOB data is available for the peer device.
+** *p_oob_data - true, if OOB data is available for the peer device.
** *p_auth_req - Auth request setting (Bonding and MITM required or not)
** *p_max_key_size - max key size local device supported.
** *p_init_key - initiator keys.
@@ -268,7 +268,7 @@
extern void bta_dm_co_ble_io_req(BD_ADDR bd_addr, tBTA_IO_CAP *p_io_cap,
tBTA_OOB_DATA *p_oob_data,
tBTA_LE_AUTH_REQ *p_auth_req,
- UINT8 *p_max_key_size,
+ uint8_t *p_max_key_size,
tBTA_LE_KEY_TYPE *p_init_key,
tBTA_LE_KEY_TYPE *p_resp_key );
diff --git a/bta/include/bta_gatt_api.h b/bta/include/bta_gatt_api.h
index 01ae092..e906701 100644
--- a/bta/include/bta_gatt_api.h
+++ b/bta/include/bta_gatt_api.h
@@ -35,17 +35,17 @@
#ifndef BTA_GATT_INCLUDED
#warning BTA_GATT_INCLUDED not defined
-#define BTA_GATT_INCLUDED FALSE
+#define BTA_GATT_INCLUDED false
#endif
-#if ((BLE_INCLUDED == FALSE) && (BTA_GATT_INCLUDED == TRUE))
+#if (BLE_INCLUDED == FALSE && BTA_GATT_INCLUDED == TRUE)
#undef BTA_GATT_INCLUDED
-#define BTA_GATT_INCLUDED FALSE
+#define BTA_GATT_INCLUDED false
#endif
#ifndef BTA_GATT_DEBUG
-#define BTA_GATT_DEBUG FALSE
+#define BTA_GATT_DEBUG false
#endif
/*****************************************************************************
@@ -58,7 +58,7 @@
typedef struct
{
tBT_UUID uuid; /* uuid of the attribute */
- UINT8 inst_id; /* instance ID */
+ uint8_t inst_id; /* instance ID */
} __attribute__((packed)) tBTA_GATT_ID;
/* Success code and error codes */
@@ -109,7 +109,7 @@
#define BTA_GATT_PRC_IN_PROGRESS GATT_PRC_IN_PROGRESS /* 0xFE Procedure Already in progress */
#define BTA_GATT_OUT_OF_RANGE GATT_OUT_OF_RANGE /* 0xFFAttribute value out of range */
-typedef UINT8 tBTA_GATT_STATUS;
+typedef uint8_t tBTA_GATT_STATUS;
#define BTA_GATT_INVALID_CONN_ID GATT_INVALID_CONN_ID
@@ -136,51 +136,51 @@
#define BTA_GATTC_CFG_MTU_EVT 18 /* configure MTU complete event */
#define BTA_GATTC_CONGEST_EVT 24 /* Congestion event */
-typedef UINT8 tBTA_GATTC_EVT;
+typedef uint8_t tBTA_GATTC_EVT;
typedef tGATT_IF tBTA_GATTC_IF;
typedef struct
{
- UINT16 unit; /* as UUIUD defined by SIG */
- UINT16 descr; /* as UUID as defined by SIG */
+ uint16_t unit; /* as UUIUD defined by SIG */
+ uint16_t descr; /* as UUID as defined by SIG */
tGATT_FORMAT format;
- INT8 exp;
- UINT8 name_spc; /* The name space of the description */
+ int8_t exp;
+ uint8_t name_spc; /* The name space of the description */
}tBTA_GATT_CHAR_PRES;
#define BTA_GATT_CLT_CONFIG_NONE GATT_CLT_CONFIG_NONE /* 0x0000 */
#define BTA_GATT_CLT_CONFIG_NOTIFICATION GATT_CLT_CONFIG_NOTIFICATION /* 0x0001 */
#define BTA_GATT_CLT_CONFIG_INDICATION GATT_CLT_CONFIG_INDICATION /* 0x0002 */
-typedef UINT16 tBTA_GATT_CLT_CHAR_CONFIG;
+typedef uint16_t tBTA_GATT_CLT_CHAR_CONFIG;
/* characteristic descriptor: server configuration value
*/
#define BTA_GATT_SVR_CONFIG_NONE GATT_SVR_CONFIG_NONE /* 0x0000 */
#define BTA_GATT_SVR_CONFIG_BROADCAST GATT_SVR_CONFIG_BROADCAST /* 0x0001 */
-typedef UINT16 tBTA_GATT_SVR_CHAR_CONFIG;
+typedef uint16_t tBTA_GATT_SVR_CHAR_CONFIG;
/* Characteristic Aggregate Format attribute value
*/
#define BTA_GATT_AGGR_HANDLE_NUM_MAX 10
typedef struct
{
- UINT8 num_handle;
- UINT16 handle_list[BTA_GATT_AGGR_HANDLE_NUM_MAX];
+ uint8_t num_handle;
+ uint16_t handle_list[BTA_GATT_AGGR_HANDLE_NUM_MAX];
} tBTA_GATT_CHAR_AGGRE;
typedef tGATT_VALID_RANGE tBTA_GATT_VALID_RANGE;
typedef struct
{
- UINT16 len;
- UINT8 *p_value;
+ uint16_t len;
+ uint8_t *p_value;
}tBTA_GATT_UNFMT;
#define BTA_GATT_MAX_ATTR_LEN GATT_MAX_ATTR_LEN
#define BTA_GATTC_TYPE_WRITE GATT_WRITE
#define BTA_GATTC_TYPE_WRITE_NO_RSP GATT_WRITE_NO_RSP
-typedef UINT8 tBTA_GATTC_WRITE_TYPE;
+typedef uint8_t tBTA_GATTC_WRITE_TYPE;
#define BTA_GATT_CONN_UNKNOWN 0
#define BTA_GATT_CONN_L2C_FAILURE GATT_CONN_L2C_FAILURE /* general l2cap resource failure */
@@ -191,14 +191,14 @@
#define BTA_GATT_CONN_LMP_TIMEOUT GATT_CONN_LMP_TIMEOUT /* 0x22 connection fail for LMP response tout */
#define BTA_GATT_CONN_CANCEL GATT_CONN_CANCEL /* 0x0100 L2CAP connection cancelled */
#define BTA_GATT_CONN_NONE 0x0101 /* 0x0101 no connection to cancel */
-typedef UINT16 tBTA_GATT_REASON;
+typedef uint16_t tBTA_GATT_REASON;
#define BTA_GATTC_MULTI_MAX GATT_MAX_READ_MULTI_HANDLES
typedef struct
{
- UINT8 num_attr;
- UINT16 handles[BTA_GATTC_MULTI_MAX];
+ uint8_t num_attr;
+ uint16_t handles[BTA_GATTC_MULTI_MAX];
}tBTA_GATTC_MULTI;
#define BTA_GATT_AUTH_REQ_NONE GATT_AUTH_REQ_NONE
@@ -216,19 +216,19 @@
BTA_GATTC_ATTR_TYPE_CHAR_DESCR,
BTA_GATTC_ATTR_TYPE_SRVC
};
-typedef UINT8 tBTA_GATTC_ATTR_TYPE;
+typedef uint8_t tBTA_GATTC_ATTR_TYPE;
typedef struct
{
tBT_UUID uuid;
- UINT16 s_handle;
- UINT16 e_handle; /* used for service only */
- UINT8 attr_type;
- UINT8 id;
- UINT8 prop; /* used when attribute type is characteristic */
- BOOLEAN is_primary; /* used when attribute type is service */
- UINT16 incl_srvc_handle; /* used when attribute type is included service */
+ uint16_t s_handle;
+ uint16_t e_handle; /* used for service only */
+ uint8_t attr_type;
+ uint8_t id;
+ uint8_t prop; /* used when attribute type is characteristic */
+ bool is_primary; /* used when attribute type is service */
+ uint16_t incl_srvc_handle; /* used when attribute type is included service */
}tBTA_GATTC_NV_ATTR;
/* callback data structure */
@@ -241,58 +241,58 @@
typedef struct
{
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATT_STATUS status;
- UINT16 handle;
+ uint16_t handle;
tBTA_GATT_UNFMT *p_value;
}tBTA_GATTC_READ;
typedef struct
{
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATT_STATUS status;
- UINT16 handle;
+ uint16_t handle;
}tBTA_GATTC_WRITE;
typedef struct
{
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATT_STATUS status;
}tBTA_GATTC_EXEC_CMPL;
typedef struct
{
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATT_STATUS status;
}tBTA_GATTC_SEARCH_CMPL;
typedef struct
{
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATT_ID service_uuid;
}tBTA_GATTC_SRVC_RES;
typedef struct
{
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATT_STATUS status;
- UINT16 mtu;
+ uint16_t mtu;
}tBTA_GATTC_CFG_MTU;
typedef struct
{
tBTA_GATT_STATUS status;
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATTC_IF client_if;
BD_ADDR remote_bda;
tBTA_TRANSPORT transport;
- UINT16 mtu;
+ uint16_t mtu;
}tBTA_GATTC_OPEN;
typedef struct
{
tBTA_GATT_STATUS status;
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATTC_IF client_if;
BD_ADDR remote_bda;
tBTA_GATT_REASON reason; /* disconnect reason code, not useful when connect event is reported */
@@ -300,25 +300,25 @@
typedef struct
{
- UINT16 conn_id;
+ uint16_t conn_id;
BD_ADDR bda;
- UINT16 handle;
- UINT16 len;
- UINT8 value[BTA_GATT_MAX_ATTR_LEN];
- BOOLEAN is_notify;
+ uint16_t handle;
+ uint16_t len;
+ uint8_t value[BTA_GATT_MAX_ATTR_LEN];
+ bool is_notify;
}tBTA_GATTC_NOTIFY;
typedef struct
{
- UINT16 conn_id;
- BOOLEAN congested; /* congestion indicator */
+ uint16_t conn_id;
+ bool congested; /* congestion indicator */
}tBTA_GATTC_CONGEST;
typedef struct
{
tBTA_GATT_STATUS status;
tBTA_GATTC_IF client_if;
- UINT16 conn_id;
+ uint16_t conn_id;
BD_ADDR remote_bda;
}tBTA_GATTC_OPEN_CLOSE;
@@ -378,7 +378,7 @@
#define BTA_GATTS_LISTEN_EVT 19
#define BTA_GATTS_CONGEST_EVT 20
-typedef UINT8 tBTA_GATTS_EVT;
+typedef uint8_t tBTA_GATTS_EVT;
typedef tGATT_IF tBTA_GATTS_IF;
/* Attribute permissions
@@ -391,7 +391,7 @@
#define BTA_GATT_PERM_WRITE_ENC_MITM GATT_PERM_WRITE_ENC_MITM /* bit 6 - 0x0040 */
#define BTA_GATT_PERM_WRITE_SIGNED GATT_PERM_WRITE_SIGNED /* bit 7 - 0x0080 */
#define BTA_GATT_PERM_WRITE_SIGNED_MITM GATT_PERM_WRITE_SIGNED_MITM /* bit 8 - 0x0100 */
-typedef UINT16 tBTA_GATT_PERM;
+typedef uint16_t tBTA_GATT_PERM;
#define BTA_GATTS_INVALID_APP 0xff
@@ -406,7 +406,7 @@
#define BTA_GATT_CHAR_PROP_BIT_INDICATE GATT_CHAR_PROP_BIT_INDICATE /* 0x20 */
#define BTA_GATT_CHAR_PROP_BIT_AUTH GATT_CHAR_PROP_BIT_AUTH /* 0x40 */
#define BTA_GATT_CHAR_PROP_BIT_EXT_PROP GATT_CHAR_PROP_BIT_EXT_PROP /* 0x80 */
-typedef UINT8 tBTA_GATT_CHAR_PROP;
+typedef uint8_t tBTA_GATT_CHAR_PROP;
#ifndef BTA_GATTC_CHAR_DESCR_MAX
#define BTA_GATTC_CHAR_DESCR_MAX 7
@@ -418,10 +418,10 @@
{
tBT_UUID app_uuid128;
tBT_UUID svc_uuid;
- UINT16 svc_inst;
- UINT16 s_handle;
- UINT16 e_handle;
- BOOLEAN is_primary; /* primary service or secondary */
+ uint16_t svc_inst;
+ uint16_t s_handle;
+ uint16_t e_handle;
+ bool is_primary; /* primary service or secondary */
} tBTA_GATTS_HNDL_RANGE;
#define BTA_GATTS_SRV_CHG_CMD_ADD_CLIENT GATTS_SRV_CHG_CMD_ADD_CLIENT
@@ -438,7 +438,7 @@
#define BTA_GATT_TRANSPORT_LE GATT_TRANSPORT_LE
#define BTA_GATT_TRANSPORT_BR_EDR GATT_TRANSPORT_BR_EDR
#define BTA_GATT_TRANSPORT_LE_BR_EDR GATT_TRANSPORT_LE_BR_EDR
-typedef UINT8 tBTA_GATT_TRANSPORT;
+typedef uint8_t tBTA_GATT_TRANSPORT;
/* attribute value */
typedef tGATT_VALUE tBTA_GATT_VALUE;
@@ -464,8 +464,8 @@
{
tBTA_GATT_STATUS status;
BD_ADDR remote_bda;
- UINT32 trans_id;
- UINT16 conn_id;
+ uint32_t trans_id;
+ uint16_t conn_id;
tBTA_GATTS_REQ_DATA *p_data;
}tBTA_GATTS_REQ;
@@ -480,9 +480,9 @@
typedef struct
{
tBTA_GATTS_IF server_if;
- UINT16 service_id;
- UINT16 svc_instance;
- BOOLEAN is_primary;
+ uint16_t service_id;
+ uint16_t svc_instance;
+ bool is_primary;
tBTA_GATT_STATUS status;
tBT_UUID uuid;
}tBTA_GATTS_CREATE;
@@ -490,8 +490,8 @@
typedef struct
{
tBTA_GATTS_IF server_if;
- UINT16 service_id;
- UINT16 attr_id;
+ uint16_t service_id;
+ uint16_t attr_id;
tBTA_GATT_STATUS status;
tBT_UUID char_uuid;
}tBTA_GATTS_ADD_RESULT;
@@ -499,7 +499,7 @@
typedef struct
{
tBTA_GATTS_IF server_if;
- UINT16 service_id;
+ uint16_t service_id;
tBTA_GATT_STATUS status;
}tBTA_GATTS_SRVC_OPER;
@@ -508,20 +508,20 @@
{
tBTA_GATTS_IF server_if;
BD_ADDR remote_bda;
- UINT16 conn_id;
+ uint16_t conn_id;
tBTA_GATT_REASON reason; /* report disconnect reason */
tBTA_GATT_TRANSPORT transport;
}tBTA_GATTS_CONN;
typedef struct
{
- UINT16 conn_id;
- BOOLEAN congested; /* report channel congestion indicator */
+ uint16_t conn_id;
+ bool congested; /* report channel congestion indicator */
}tBTA_GATTS_CONGEST;
typedef struct
{
- UINT16 conn_id; /* connection ID */
+ uint16_t conn_id; /* connection ID */
tBTA_GATT_STATUS status; /* notification/indication status */
}tBTA_GATTS_CONF;
@@ -550,10 +550,10 @@
typedef struct
{
tBT_UUID uuid;
- BOOLEAN is_primary;
- UINT16 handle;
- UINT16 s_handle;
- UINT16 e_handle;
+ bool is_primary;
+ uint16_t handle;
+ uint16_t s_handle;
+ uint16_t e_handle;
list_t *characteristics; /* list of tBTA_GATTC_CHARACTERISTIC */
list_t *included_svc; /* list of tBTA_GATTC_INCLUDED_SVC */
} __attribute__((packed)) tBTA_GATTC_SERVICE;
@@ -561,7 +561,7 @@
typedef struct
{
tBT_UUID uuid;
- UINT16 handle;
+ uint16_t handle;
tBTA_GATT_CHAR_PROP properties;
tBTA_GATTC_SERVICE *service; /* owning service*/
list_t *descriptors; /* list of tBTA_GATTC_DESCRIPTOR */
@@ -570,14 +570,14 @@
typedef struct
{
tBT_UUID uuid;
- UINT16 handle;
+ uint16_t handle;
tBTA_GATTC_CHARACTERISTIC *characteristic; /* owning characteristic */
} __attribute__((packed)) tBTA_GATTC_DESCRIPTOR;
typedef struct
{
tBT_UUID uuid;
- UINT16 handle;
+ uint16_t handle;
tBTA_GATTC_SERVICE *owning_service; /* owning service*/
tBTA_GATTC_SERVICE *included_service;
} __attribute__((packed)) tBTA_GATTC_INCLUDED_SVC;
@@ -647,7 +647,7 @@
**
*******************************************************************************/
extern void BTA_GATTC_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda,
- BOOLEAN is_direct, tBTA_GATT_TRANSPORT transport);
+ bool is_direct, tBTA_GATT_TRANSPORT transport);
/*******************************************************************************
**
@@ -663,7 +663,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_GATTC_CancelOpen(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, BOOLEAN is_direct);
+extern void BTA_GATTC_CancelOpen(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, bool is_direct);
/*******************************************************************************
**
@@ -676,7 +676,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_GATTC_Close(UINT16 conn_id);
+extern void BTA_GATTC_Close(uint16_t conn_id);
/*******************************************************************************
**
@@ -694,7 +694,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GATTC_ServiceSearchRequest(UINT16 conn_id, tBT_UUID *p_srvc_uuid);
+extern void BTA_GATTC_ServiceSearchRequest(uint16_t conn_id, tBT_UUID *p_srvc_uuid);
/*******************************************************************************
**
@@ -707,7 +707,7 @@
** Returns returns list_t of tBTA_GATTC_SERVICE or NULL.
**
*******************************************************************************/
-extern const list_t* BTA_GATTC_GetServices(UINT16 conn_id);
+extern const list_t* BTA_GATTC_GetServices(uint16_t conn_id);
/*******************************************************************************
**
@@ -721,7 +721,7 @@
** Returns returns pointer to tBTA_GATTC_CHARACTERISTIC or NULL.
**
*******************************************************************************/
-extern const tBTA_GATTC_CHARACTERISTIC* BTA_GATTC_GetCharacteristic(UINT16 conn_id, UINT16 handle);
+extern const tBTA_GATTC_CHARACTERISTIC* BTA_GATTC_GetCharacteristic(uint16_t conn_id, uint16_t handle);
/*******************************************************************************
**
@@ -735,7 +735,7 @@
** Returns returns pointer to tBTA_GATTC_DESCRIPTOR or NULL.
**
*******************************************************************************/
-extern const tBTA_GATTC_DESCRIPTOR* BTA_GATTC_GetDescriptor(UINT16 conn_id, UINT16 handle);
+extern const tBTA_GATTC_DESCRIPTOR* BTA_GATTC_GetDescriptor(uint16_t conn_id, uint16_t handle);
/*******************************************************************************
**
@@ -749,7 +749,7 @@
** count: number of elements in db.
**
*******************************************************************************/
-extern void BTA_GATTC_GetGattDb(UINT16 conn_id, UINT16 start_handle, UINT16 end_handle,
+extern void BTA_GATTC_GetGattDb(uint16_t conn_id, uint16_t start_handle, uint16_t end_handle,
btgatt_db_element_t **db, int *count);
/*******************************************************************************
@@ -764,7 +764,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_ReadCharacteristic(UINT16 conn_id, UINT16 handle, tBTA_GATT_AUTH_REQ auth_req);
+void BTA_GATTC_ReadCharacteristic(uint16_t conn_id, uint16_t handle, tBTA_GATT_AUTH_REQ auth_req);
/*******************************************************************************
**
@@ -778,7 +778,7 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_ReadCharDescr (UINT16 conn_id, UINT16 handle, tBTA_GATT_AUTH_REQ auth_req);
+void BTA_GATTC_ReadCharDescr (uint16_t conn_id, uint16_t handle, tBTA_GATT_AUTH_REQ auth_req);
/*******************************************************************************
**
@@ -794,8 +794,8 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_WriteCharValue ( UINT16 conn_id,
- UINT16 handle,
+void BTA_GATTC_WriteCharValue ( uint16_t conn_id,
+ uint16_t handle,
tBTA_GATTC_WRITE_TYPE write_type,
vector<uint8_t> value,
tBTA_GATT_AUTH_REQ auth_req);
@@ -814,8 +814,8 @@
** Returns None
**
*******************************************************************************/
-void BTA_GATTC_WriteCharDescr (UINT16 conn_id,
- UINT16 handle,
+void BTA_GATTC_WriteCharDescr (uint16_t conn_id,
+ uint16_t handle,
tBTA_GATTC_WRITE_TYPE write_type,
vector<uint8_t> value,
tBTA_GATT_AUTH_REQ auth_req);
@@ -832,7 +832,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GATTC_SendIndConfirm (UINT16 conn_id, UINT16 handle);
+extern void BTA_GATTC_SendIndConfirm (uint16_t conn_id, uint16_t handle);
/*******************************************************************************
**
@@ -849,7 +849,7 @@
*******************************************************************************/
extern tBTA_GATT_STATUS BTA_GATTC_RegisterForNotifications (tBTA_GATTC_IF client_if,
const BD_ADDR remote_bda,
- UINT16 handle);
+ uint16_t handle);
/*******************************************************************************
**
@@ -866,7 +866,7 @@
*******************************************************************************/
extern tBTA_GATT_STATUS BTA_GATTC_DeregisterForNotifications (tBTA_GATTC_IF client_if,
const BD_ADDR remote_bda,
- UINT16 handle);
+ uint16_t handle);
/*******************************************************************************
**
@@ -882,9 +882,9 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GATTC_PrepareWrite (UINT16 conn_id,
- UINT16 handle,
- UINT16 offset,
+extern void BTA_GATTC_PrepareWrite (uint16_t conn_id,
+ uint16_t handle,
+ uint16_t offset,
vector<uint8_t> value,
tBTA_GATT_AUTH_REQ auth_req);
@@ -900,7 +900,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GATTC_ExecuteWrite (UINT16 conn_id, BOOLEAN is_execute);
+extern void BTA_GATTC_ExecuteWrite (uint16_t conn_id, bool is_execute);
/*******************************************************************************
**
@@ -915,7 +915,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GATTC_ReadMultiple(UINT16 conn_id, tBTA_GATTC_MULTI *p_read_multi,
+extern void BTA_GATTC_ReadMultiple(uint16_t conn_id, tBTA_GATTC_MULTI *p_read_multi,
tBTA_GATT_AUTH_REQ auth_req);
@@ -947,7 +947,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_GATTC_Listen(tBTA_GATTC_IF client_if, BOOLEAN start, BD_ADDR_PTR target_bda);
+extern void BTA_GATTC_Listen(tBTA_GATTC_IF client_if, bool start, BD_ADDR_PTR target_bda);
/*******************************************************************************
**
@@ -961,7 +961,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_GATTC_Broadcast(tBTA_GATTC_IF client_if, BOOLEAN start);
+extern void BTA_GATTC_Broadcast(tBTA_GATTC_IF client_if, bool start);
/*******************************************************************************
@@ -977,7 +977,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_GATTC_ConfigureMTU (UINT16 conn_id, UINT16 mtu);
+extern void BTA_GATTC_ConfigureMTU (uint16_t conn_id, uint16_t mtu);
/*******************************************************************************
** BTA GATT Server API
@@ -1058,7 +1058,7 @@
**
*******************************************************************************/
extern void BTA_GATTS_CreateService(tBTA_GATTS_IF server_if, tBT_UUID *p_service_uuid,
- UINT8 inst, UINT16 num_handle, BOOLEAN is_primary);
+ uint8_t inst, uint16_t num_handle, bool is_primary);
/*******************************************************************************
**
@@ -1075,7 +1075,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_GATTS_AddIncludeService(UINT16 service_id, UINT16 included_service_id);
+extern void BTA_GATTS_AddIncludeService(uint16_t service_id, uint16_t included_service_id);
/*******************************************************************************
**
@@ -1092,7 +1092,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GATTS_AddCharacteristic (UINT16 service_id, tBT_UUID *p_char_uuid,
+extern void BTA_GATTS_AddCharacteristic (uint16_t service_id, tBT_UUID *p_char_uuid,
tBTA_GATT_PERM perm, tBTA_GATT_CHAR_PROP property);
/*******************************************************************************
@@ -1112,7 +1112,7 @@
** Returns returns status.
**
*******************************************************************************/
-extern void BTA_GATTS_AddCharDescriptor (UINT16 service_id,
+extern void BTA_GATTS_AddCharDescriptor (uint16_t service_id,
tBTA_GATT_PERM perm,
tBT_UUID * p_descr_uuid);
@@ -1128,7 +1128,7 @@
** Returns returns none.
**
*******************************************************************************/
-extern void BTA_GATTS_DeleteService(UINT16 service_id);
+extern void BTA_GATTS_DeleteService(uint16_t service_id);
/*******************************************************************************
**
@@ -1142,7 +1142,7 @@
** Returns None.
**
*******************************************************************************/
-extern void BTA_GATTS_StartService(UINT16 service_id, tBTA_GATT_TRANSPORT sup_transport);
+extern void BTA_GATTS_StartService(uint16_t service_id, tBTA_GATT_TRANSPORT sup_transport);
/*******************************************************************************
**
@@ -1155,7 +1155,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GATTS_StopService(UINT16 service_id);
+extern void BTA_GATTS_StopService(uint16_t service_id);
/*******************************************************************************
**
@@ -1171,9 +1171,9 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GATTS_HandleValueIndication (UINT16 conn_id, UINT16 attr_id,
+extern void BTA_GATTS_HandleValueIndication (uint16_t conn_id, uint16_t attr_id,
vector<uint8_t> value,
- BOOLEAN need_confirm);
+ bool need_confirm);
/*******************************************************************************
**
@@ -1189,7 +1189,7 @@
** Returns None
**
*******************************************************************************/
-extern void BTA_GATTS_SendRsp (UINT16 conn_id, UINT32 trans_id,
+extern void BTA_GATTS_SendRsp (uint16_t conn_id, uint32_t trans_id,
tBTA_GATT_STATUS status, tBTA_GATTS_RSP *p_msg);
@@ -1208,7 +1208,7 @@
**
*******************************************************************************/
extern void BTA_GATTS_Open(tBTA_GATTS_IF server_if, BD_ADDR remote_bda,
- BOOLEAN is_direct, tBTA_GATT_TRANSPORT transport);
+ bool is_direct, tBTA_GATT_TRANSPORT transport);
/*******************************************************************************
@@ -1225,7 +1225,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_GATTS_CancelOpen(tBTA_GATTS_IF server_if, BD_ADDR remote_bda, BOOLEAN is_direct);
+extern void BTA_GATTS_CancelOpen(tBTA_GATTS_IF server_if, BD_ADDR remote_bda, bool is_direct);
/*******************************************************************************
@@ -1239,7 +1239,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_GATTS_Close(UINT16 conn_id);
+extern void BTA_GATTS_Close(uint16_t conn_id);
/*******************************************************************************
**
@@ -1256,7 +1256,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_GATTS_Listen(tBTA_GATTS_IF server_if, BOOLEAN start,
+extern void BTA_GATTS_Listen(tBTA_GATTS_IF server_if, bool start,
BD_ADDR_PTR target_bda);
#endif /* BTA_GATT_API_H */
diff --git a/bta/include/bta_gatts_co.h b/bta/include/bta_gatts_co.h
index c2a048f..c21aa70 100644
--- a/bta/include/bta_gatts_co.h
+++ b/bta/include/bta_gatts_co.h
@@ -43,7 +43,7 @@
** Returns void.
**
*******************************************************************************/
-extern void bta_gatts_co_update_handle_range(BOOLEAN is_add, tBTA_GATTS_HNDL_RANGE *p_hndl_range);
+extern void bta_gatts_co_update_handle_range(bool is_add, tBTA_GATTS_HNDL_RANGE *p_hndl_range);
/*******************************************************************************
**
@@ -57,12 +57,12 @@
** p_req - request paramters
** p_rsp - response data for the request
**
-** Returns TRUE - if the request is processed successfully and
+** Returns true - if the request is processed successfully and
** the response is returned in p_rsp.
** FASLE - if the request can not be processed
**
*******************************************************************************/
-extern BOOLEAN bta_gatts_co_srv_chg(tBTA_GATTS_SRV_CHG_CMD cmd,
+extern bool bta_gatts_co_srv_chg(tBTA_GATTS_SRV_CHG_CMD cmd,
tBTA_GATTS_SRV_CHG_REQ *p_req,
tBTA_GATTS_SRV_CHG_RSP *p_rsp);
@@ -78,7 +78,7 @@
** Returns void.
**
*******************************************************************************/
-extern BOOLEAN bta_gatts_co_load_handle_range(UINT8 index,
+extern bool bta_gatts_co_load_handle_range(uint8_t index,
tBTA_GATTS_HNDL_RANGE *p_handle);
#ifdef __cplusplus
diff --git a/bta/include/bta_hf_client_api.h b/bta/include/bta_hf_client_api.h
index 605550a..3ad6ccd 100644
--- a/bta/include/bta_hf_client_api.h
+++ b/bta/include/bta_hf_client_api.h
@@ -47,7 +47,7 @@
#define BTA_HF_CLIENT_PEER_EXTERR 0x00000100 /* Extended error codes */
#define BTA_HF_CLIENT_PEER_CODEC 0x00000200 /* Codec Negotiation */
-typedef UINT16 tBTA_HF_CLIENT_PEER_FEAT;
+typedef uint16_t tBTA_HF_CLIENT_PEER_FEAT;
/* HFP HF features */
#define BTA_HF_CLIENT_FEAT_ECNR 0x00000001 /* Echo cancellation and/or noise reduction */
@@ -68,7 +68,7 @@
#define BTA_HF_CLIENT_CHLD_MERGE 0x00000020 /* 3 Add held call to multiparty */
#define BTA_HF_CLIENT_CHLD_MERGE_DETACH 0x00000040 /* 4 Add held call to multiparty */
-typedef UINT16 tBTA_HF_CLIENT_CHLD_FEAT;
+typedef uint16_t tBTA_HF_CLIENT_CHLD_FEAT;
/* HFP AG errors ot OK sent to HF Unit */
#define BTA_HF_CLIENT_AT_RESULT_OK 0
@@ -80,7 +80,7 @@
#define BTA_HF_CLIENT_AT_RESULT_BLACKLISTED 6
#define BTA_HF_CLIENT_AT_RESULT_CME 7
-typedef UINT8 tBTA_HF_CLIENT_AT_RESULT_TYPE;
+typedef uint8_t tBTA_HF_CLIENT_AT_RESULT_TYPE;
/* HF Client callback events */
#define BTA_HF_CLIENT_ENABLE_EVT 0 /* HF Client enabled */
@@ -107,7 +107,7 @@
#define BTA_HF_CLIENT_RING_INDICATION 21 /* HF Client ring indication */
#define BTA_HF_CLIENT_DISABLE_EVT 30 /* HF Client disabled */
-typedef UINT8 tBTA_HF_CLIENT_EVT;
+typedef uint8_t tBTA_HF_CLIENT_EVT;
/* HF Client open status */
#define BTA_HF_CLIENT_SUCCESS 0 /* Connection successfully opened */
@@ -115,7 +115,7 @@
#define BTA_HF_CLIENT_FAIL_RFCOMM 2 /* Open failed due to RFCOMM */
#define BTA_HF_CLIENT_FAIL_RESOURCES 3 /* out of resources failure */
-typedef UINT8 tBTA_HF_CLIENT_STATUS;
+typedef uint8_t tBTA_HF_CLIENT_STATUS;
/* indicator type */
#define BTA_HF_CLIENT_IND_BATTCH 0 /* Battery charge indicator */
@@ -126,7 +126,7 @@
#define BTA_HF_CLIENT_IND_CALLSETUP 5 /* Call setup status indicator */
#define BTA_HF_CLIENT_IND_CALLHELD 6 /* Call hold status indicator */
-typedef UINT8 tBTA_HF_CLIENT_IND_TYPE;
+typedef uint8_t tBTA_HF_CLIENT_IND_TYPE;
/* AT commands */
#define BTA_HF_CLIENT_AT_CMD_VTS 0
@@ -146,13 +146,13 @@
#define BTA_HF_CLIENT_AT_CMD_BLDN 14
#define BTA_HF_CLIENT_AT_CMD_NREC 15
-typedef UINT8 tBTA_HF_CLIENT_AT_CMD_TYPE;
+typedef uint8_t tBTA_HF_CLIENT_AT_CMD_TYPE;
/* data associated with BTA_HF_CLIENT_REGISTER_EVT */
typedef struct
{
- UINT16 handle;
+ uint16_t handle;
tBTA_HF_CLIENT_STATUS status;
} tBTA_HF_CLIENT_REGISTER;
@@ -174,7 +174,7 @@
typedef struct
{
tBTA_HF_CLIENT_IND_TYPE type;
- UINT16 value;
+ uint16_t value;
} tBTA_HF_CLIENT_IND;
/* data associated with BTA_HF_CLIENT_OPERATOR_NAME_EVT */
@@ -195,31 +195,31 @@
typedef struct
{
tBTA_HF_CLIENT_AT_RESULT_TYPE type;
- UINT16 cme;
+ uint16_t cme;
} tBTA_HF_CLIENT_AT_RESULT;
/* data associated with BTA_HF_CLIENT_CLCC_EVT event */
typedef struct
{
- UINT32 idx;
- BOOLEAN inc;
- UINT8 status;
- BOOLEAN mpty;
- BOOLEAN number_present;
+ uint32_t idx;
+ bool inc;
+ uint8_t status;
+ bool mpty;
+ bool number_present;
char number[BTA_HF_CLIENT_NUMBER_LEN + 1];
} tBTA_HF_CLIENT_CLCC;
/* data associated with BTA_HF_CLIENT_CNUM_EVT event */
typedef struct
{
- UINT16 service;
+ uint16_t service;
char number[BTA_HF_CLIENT_NUMBER_LEN + 1];
} tBTA_HF_CLIENT_CNUM;
/* data associated with other events */
typedef struct
{
- UINT16 value;
+ uint16_t value;
} tBTA_HF_CLIENT_VAL;
/* union of data associated with AG callback */
@@ -237,7 +237,7 @@
tBTA_HF_CLIENT_CNUM cnum;
} tBTA_HF_CLIENT;
-typedef UINT32 tBTA_HF_CLIENT_FEAT;
+typedef uint32_t tBTA_HF_CLIENT_FEAT;
/* HF Client callback */
typedef void (tBTA_HF_CLIENT_CBACK)(tBTA_HF_CLIENT_EVT event, tBTA_HF_CLIENT *p_data);
@@ -296,7 +296,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientDeregister(UINT16 handle);
+void BTA_HfClientDeregister(uint16_t handle);
/*******************************************************************************
**
@@ -311,7 +311,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientOpen(UINT16 handle, BD_ADDR bd_addr, tBTA_SEC sec_mask);
+void BTA_HfClientOpen(uint16_t handle, BD_ADDR bd_addr, tBTA_SEC sec_mask);
/*******************************************************************************
**
@@ -324,7 +324,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientClose(UINT16 handle);
+void BTA_HfClientClose(uint16_t handle);
/*******************************************************************************
**
@@ -337,7 +337,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientAudioOpen(UINT16 handle);
+void BTA_HfClientAudioOpen(uint16_t handle);
/*******************************************************************************
**
@@ -350,7 +350,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientAudioClose(UINT16 handle);
+void BTA_HfClientAudioClose(uint16_t handle);
/*******************************************************************************
**
@@ -362,7 +362,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_HfClientSendAT(UINT16 handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, UINT32 val1, UINT32 val2, const char *str);
+void BTA_HfClientSendAT(uint16_t handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, uint32_t val1, uint32_t val2, const char *str);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_hh_api.h b/bta/include/bta_hh_api.h
index 9045629..c1f9d79 100644
--- a/bta/include/bta_hh_api.h
+++ b/bta/include/bta_hh_api.h
@@ -21,7 +21,7 @@
#include "bta_api.h"
#include "hidh_api.h"
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
#include "gatt_api.h"
#endif
@@ -33,7 +33,7 @@
** Constants and Type Definitions
*****************************************************************************/
#ifndef BTA_HH_DEBUG
-#define BTA_HH_DEBUG TRUE
+#define BTA_HH_DEBUG true
#endif
#ifndef BTA_HH_SSR_MAX_LATENCY_DEF
@@ -63,7 +63,7 @@
#define BTA_HH_API_ERR_EVT 16 /* API error is caught */
#define BTA_HH_UPDATE_SCPP_EVT 17 /* update scan paramter complete */
-typedef UINT16 tBTA_HH_EVT;
+typedef uint16_t tBTA_HH_EVT;
/* application ID(none-zero) for each type of device */
#define BTA_HH_APP_ID_MI 1
@@ -81,7 +81,7 @@
#define BTA_HH_IDX_INVALID 0xff
#define BTA_HH_MAX_KNOWN HID_HOST_MAX_DEVICES
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
/* GATT_MAX_PHY_CHANNEL can not exceed 14 for the design of BTA HH */
#define BTA_HH_LE_MAX_KNOWN GATT_MAX_PHY_CHANNEL
#define BTA_HH_MAX_DEVICE (HID_HOST_MAX_DEVICES + GATT_MAX_PHY_CHANNEL)
@@ -95,14 +95,14 @@
#define BTA_HH_PROTO_RPT_MODE (0x00)
#define BTA_HH_PROTO_BOOT_MODE (0x01)
#define BTA_HH_PROTO_UNKNOWN (0xff)
-typedef UINT8 tBTA_HH_PROTO_MODE;
+typedef uint8_t tBTA_HH_PROTO_MODE;
enum
{
BTA_HH_KEYBD_RPT_ID = 1,
BTA_HH_MOUSE_RPT_ID
};
-typedef UINT8 tBTA_HH_BOOT_RPT_ID;
+typedef uint8_t tBTA_HH_BOOT_RPT_ID;
/* type of devices, bit mask */
#define BTA_HH_DEVT_UNKNOWN 0x00
@@ -116,7 +116,7 @@
#define BTA_HH_DEVT_MIC 0x20 /* pointing device */
#define BTA_HH_DEVT_COM 0x30 /* Combo keyboard/pointing */
#define BTA_HH_DEVT_OTHER 0x80
-typedef UINT8 tBTA_HH_DEVT;
+typedef uint8_t tBTA_HH_DEVT;
enum
{
@@ -139,7 +139,7 @@
BTA_HH_ERR_HDL,
BTA_HH_ERR_SEC
};
-typedef UINT8 tBTA_HH_STATUS;
+typedef uint8_t tBTA_HH_STATUS;
#define BTA_HH_VIRTUAL_CABLE HID_VIRTUAL_CABLE
@@ -150,21 +150,21 @@
#define BTA_HH_REMOTE_WAKE HID_REMOTE_WAKE
#define BTA_HH_SUP_TOUT_AVLBL HID_SUP_TOUT_AVLBL
#define BTA_HH_SEC_REQUIRED HID_SEC_REQUIRED
-typedef UINT16 tBTA_HH_ATTR_MASK;
+typedef uint16_t tBTA_HH_ATTR_MASK;
/* supported type of device and corresponding application ID */
typedef struct
{
tBTA_HH_DEVT tod; /* type of device */
- UINT8 app_id; /* corresponding application ID */
+ uint8_t app_id; /* corresponding application ID */
}tBTA_HH_SPT_TOD;
/* configuration struct */
typedef struct
{
- UINT8 max_devt_spt; /* max number of types of devices spt */
+ uint8_t max_devt_spt; /* max number of types of devices spt */
tBTA_HH_SPT_TOD *p_devt_list; /* supported types of device list */
- UINT16 sdp_db_size;
+ uint16_t sdp_db_size;
}tBTA_HH_CFG;
enum
@@ -174,7 +174,7 @@
BTA_HH_RPTT_OUTPUT, /* output report */
BTA_HH_RPTT_FEATURE /* feature report */
};
-typedef UINT8 tBTA_HH_RPT_TYPE;
+typedef uint8_t tBTA_HH_RPT_TYPE;
/* HID_CONTROL operation code used in BTA_HhSendCtrl()
*/
@@ -187,7 +187,7 @@
BTA_HH_CTRL_EXIT_SUSPEND, /* exit suspend */
BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG /* virtual unplug */
};
-typedef UINT8 tBTA_HH_TRANS_CTRL_TYPE;
+typedef uint8_t tBTA_HH_TRANS_CTRL_TYPE;
typedef tHID_DEV_DSCP_INFO tBTA_HH_DEV_DESCR;
@@ -200,17 +200,17 @@
/* report descriptor information */
typedef struct
{
- UINT16 vendor_id; /* vendor ID */
- UINT16 product_id; /* product ID */
- UINT16 version; /* version */
- UINT16 ssr_max_latency; /* SSR max latency, BTA_HH_SSR_PARAM_INVALID if unknown */
- UINT16 ssr_min_tout; /* SSR min timeout, BTA_HH_SSR_PARAM_INVALID if unknown */
- UINT8 ctry_code; /*Country Code.*/
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+ uint16_t vendor_id; /* vendor ID */
+ uint16_t product_id; /* product ID */
+ uint16_t version; /* version */
+ uint16_t ssr_max_latency; /* SSR max latency, BTA_HH_SSR_PARAM_INVALID if unknown */
+ uint16_t ssr_min_tout; /* SSR min timeout, BTA_HH_SSR_PARAM_INVALID if unknown */
+ uint8_t ctry_code; /*Country Code.*/
+#if (BTA_HH_LE_INCLUDED == TRUE)
#define BTA_HH_LE_REMOTE_WAKE 0x01
#define BTA_HH_LE_NORMAL_CONN 0x02
- UINT8 flag;
+ uint8_t flag;
#endif
tBTA_HH_DEV_DESCR descriptor;
}tBTA_HH_DEV_DSCP_INFO;
@@ -220,10 +220,10 @@
{
BD_ADDR bda; /* HID device bd address */
tBTA_HH_STATUS status; /* operation status */
- UINT8 handle; /* device handle */
-#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
- BOOLEAN le_hid; /* is LE devices? */
- BOOLEAN scps_supported; /* scan parameter service supported */
+ uint8_t handle; /* device handle */
+#if (BTA_HH_LE_INCLUDED == TRUE)
+ bool le_hid; /* is LE devices? */
+ bool scps_supported; /* scan parameter service supported */
#endif
} tBTA_HH_CONN;
@@ -234,7 +234,7 @@
typedef struct
{
tBTA_HH_STATUS status; /* operation status */
- UINT8 handle; /* device handle */
+ uint8_t handle; /* device handle */
} tBTA_HH_CBDATA;
enum
@@ -249,23 +249,23 @@
/* parsed boot mode keyboard report */
typedef struct
{
- UINT8 this_char[6]; /* virtual key code */
- BOOLEAN mod_key[BTA_HH_MOD_MAX_KEY];
+ uint8_t this_char[6]; /* virtual key code */
+ bool mod_key[BTA_HH_MOD_MAX_KEY];
/* ctrl, shift, Alt, GUI */
/* modifier key: is Shift key pressed */
/* modifier key: is Ctrl key pressed */
/* modifier key: is Alt key pressed */
/* modifier key: GUI up/down */
- BOOLEAN caps_lock; /* is caps locked */
- BOOLEAN num_lock; /* is Num key pressed */
+ bool caps_lock; /* is caps locked */
+ bool num_lock; /* is Num key pressed */
} tBTA_HH_KEYBD_RPT;
/* parsed boot mode mouse report */
typedef struct
{
- UINT8 mouse_button; /* mouse button is clicked */
- INT8 delta_x; /* displacement x */
- INT8 delta_y; /* displacement y */
+ uint8_t mouse_button; /* mouse button is clicked */
+ int8_t delta_x; /* displacement x */
+ int8_t delta_y; /* displacement y */
}tBTA_HH_MICE_RPT;
/* parsed Boot report */
@@ -283,12 +283,12 @@
typedef struct
{
tBTA_HH_STATUS status; /* handshake status */
- UINT8 handle; /* device handle */
+ uint8_t handle; /* device handle */
union
{
tBTA_HH_PROTO_MODE proto_mode; /* GET_PROTO_EVT :protocol mode */
BT_HDR *p_rpt_data; /* GET_RPT_EVT : report data */
- UINT8 idle_rate; /* GET_IDLE_EVT : idle rate */
+ uint8_t idle_rate; /* GET_IDLE_EVT : idle rate */
} rsp_data;
}tBTA_HH_HSDATA;
@@ -366,7 +366,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhClose(UINT8 dev_handle);
+extern void BTA_HhClose(uint8_t dev_handle);
/*******************************************************************************
**
@@ -377,7 +377,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhSetProtoMode(UINT8 handle, tBTA_HH_PROTO_MODE t_type);
+extern void BTA_HhSetProtoMode(uint8_t handle, tBTA_HH_PROTO_MODE t_type);
/*******************************************************************************
**
@@ -388,7 +388,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhGetProtoMode(UINT8 dev_handle);
+extern void BTA_HhGetProtoMode(uint8_t dev_handle);
/*******************************************************************************
**
** Function BTA_HhSetReport
@@ -398,7 +398,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhSetReport(UINT8 dev_handle, tBTA_HH_RPT_TYPE r_type,
+extern void BTA_HhSetReport(uint8_t dev_handle, tBTA_HH_RPT_TYPE r_type,
BT_HDR *p_data);
/*******************************************************************************
@@ -410,8 +410,8 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhGetReport(UINT8 dev_handle, tBTA_HH_RPT_TYPE r_type,
- UINT8 rpt_id, UINT16 buf_size);
+extern void BTA_HhGetReport(uint8_t dev_handle, tBTA_HH_RPT_TYPE r_type,
+ uint8_t rpt_id, uint16_t buf_size);
/*******************************************************************************
**
** Function BTA_HhSetIdle
@@ -421,7 +421,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhSetIdle(UINT8 dev_handle, UINT16 idle_rate);
+extern void BTA_HhSetIdle(uint8_t dev_handle, uint16_t idle_rate);
/*******************************************************************************
**
@@ -432,7 +432,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhGetIdle(UINT8 dev_handle);
+extern void BTA_HhGetIdle(uint8_t dev_handle);
/*******************************************************************************
**
@@ -443,7 +443,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhSendCtrl(UINT8 dev_handle,
+extern void BTA_HhSendCtrl(uint8_t dev_handle,
tBTA_HH_TRANS_CTRL_TYPE c_type);
/*******************************************************************************
@@ -455,7 +455,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhSetIdle(UINT8 dev_handle, UINT16 idle_rate);
+extern void BTA_HhSetIdle(uint8_t dev_handle, uint16_t idle_rate);
/*******************************************************************************
@@ -467,7 +467,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhGetIdle(UINT8 dev_handle);
+extern void BTA_HhGetIdle(uint8_t dev_handle);
/*******************************************************************************
**
@@ -478,7 +478,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhSendData(UINT8 dev_handle, BD_ADDR dev_bda, BT_HDR *p_buf);
+extern void BTA_HhSendData(uint8_t dev_handle, BD_ADDR dev_bda, BT_HDR *p_buf);
/*******************************************************************************
**
@@ -489,7 +489,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhGetDscpInfo(UINT8 dev_handle);
+extern void BTA_HhGetDscpInfo(uint8_t dev_handle);
/*******************************************************************************
** Function BTA_HhAddDev
@@ -503,7 +503,7 @@
**
*******************************************************************************/
extern void BTA_HhAddDev(BD_ADDR bda, tBTA_HH_ATTR_MASK attr_mask,
- UINT8 sub_class, UINT8 app_id,
+ uint8_t sub_class, uint8_t app_id,
tBTA_HH_DEV_DSCP_INFO dscp_info);
/*******************************************************************************
**
@@ -514,7 +514,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhRemoveDev(UINT8 dev_handle );
+extern void BTA_HhRemoveDev(uint8_t dev_handle );
/*******************************************************************************
**
@@ -530,11 +530,11 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HhParseBootRpt(tBTA_HH_BOOT_RPT *p_data, UINT8 *p_report,
- UINT16 report_len);
+extern void BTA_HhParseBootRpt(tBTA_HH_BOOT_RPT *p_data, uint8_t *p_report,
+ uint16_t report_len);
/* test commands */
-extern void bta_hh_le_hid_read_rpt_clt_cfg(BD_ADDR bd_addr, UINT8 rpt_id);
+extern void bta_hh_le_hid_read_rpt_clt_cfg(BD_ADDR bd_addr, uint8_t rpt_id);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_hh_co.h b/bta/include/bta_hh_co.h
index e963412..d9084fe 100755
--- a/bta/include/bta_hh_co.h
+++ b/bta/include/bta_hh_co.h
@@ -32,11 +32,11 @@
typedef struct
{
- UINT16 rpt_uuid;
- UINT8 rpt_id;
+ uint16_t rpt_uuid;
+ uint8_t rpt_id;
tBTA_HH_RPT_TYPE rpt_type;
- UINT8 srvc_inst_id;
- UINT8 char_inst_id;
+ uint8_t srvc_inst_id;
+ uint8_t char_inst_id;
}tBTA_HH_RPT_CACHE_ENTRY;
/*******************************************************************************
@@ -50,9 +50,9 @@
** Returns void.
**
*******************************************************************************/
-extern void bta_hh_co_data(UINT8 dev_handle, UINT8 *p_rpt, UINT16 len,
- tBTA_HH_PROTO_MODE mode, UINT8 sub_class,
- UINT8 ctry_code, BD_ADDR peer_addr, UINT8 app_id);
+extern void bta_hh_co_data(uint8_t dev_handle, uint8_t *p_rpt, uint16_t len,
+ tBTA_HH_PROTO_MODE mode, uint8_t sub_class,
+ uint8_t ctry_code, BD_ADDR peer_addr, uint8_t app_id);
/*******************************************************************************
**
@@ -65,8 +65,8 @@
** Returns void.
**
*******************************************************************************/
-extern void bta_hh_co_open(UINT8 dev_handle, UINT8 sub_class,
- UINT16 attr_mask, UINT8 app_id);
+extern void bta_hh_co_open(uint8_t dev_handle, uint8_t sub_class,
+ uint16_t attr_mask, uint8_t app_id);
/*******************************************************************************
**
@@ -78,7 +78,7 @@
** Returns void.
**
*******************************************************************************/
-extern void bta_hh_co_close(UINT8 dev_handle, UINT8 app_id);
+extern void bta_hh_co_close(uint8_t dev_handle, uint8_t app_id);
#if (BLE_INCLUDED == TRUE && BTA_HH_LE_INCLUDED == TRUE)
/*******************************************************************************
@@ -99,7 +99,7 @@
*******************************************************************************/
extern void bta_hh_le_co_rpt_info(BD_ADDR remote_bda,
tBTA_HH_RPT_CACHE_ENTRY *p_entry,
- UINT8 app_id);
+ uint8_t app_id);
/*******************************************************************************
**
@@ -117,8 +117,8 @@
**
*******************************************************************************/
extern tBTA_HH_RPT_CACHE_ENTRY *bta_hh_le_co_cache_load (BD_ADDR remote_bda,
- UINT8 *p_num_rpt,
- UINT8 app_id);
+ uint8_t *p_num_rpt,
+ uint8_t app_id);
/*******************************************************************************
**
@@ -131,9 +131,9 @@
** Returns none
**
*******************************************************************************/
-extern void bta_hh_le_co_reset_rpt_cache (BD_ADDR remote_bda, UINT8 app_id);
+extern void bta_hh_le_co_reset_rpt_cache (BD_ADDR remote_bda, uint8_t app_id);
-#endif /* #if (BLE_INCLUDED == TRUE && BTA_HH_LE_INCLUDED == TRUE) */
+#endif /* #if (BLE_INCLUDED == true && BTA_HH_LE_INCLUDED == true) */
#ifdef __cplusplus
}
diff --git a/bta/include/bta_hl_api.h b/bta/include/bta_hl_api.h
index 0caa90d..635718f 100644
--- a/bta/include/bta_hl_api.h
+++ b/bta/include/bta_hl_api.h
@@ -39,7 +39,7 @@
*****************************************************************************/
/* Extra Debug Code */
#ifndef BTA_HL_DEBUG
-#define BTA_HL_DEBUG TRUE
+#define BTA_HL_DEBUG true
#endif
#ifndef BTA_HL_NUM_APPS
@@ -142,7 +142,7 @@
#define BTA_HL_STATUS_INVALID_CTRL_PSM 27
#define BTA_HL_STATUS_DUPLICATE_CCH_OPEN 28
-typedef UINT8 tBTA_HL_STATUS;
+typedef uint8_t tBTA_HL_STATUS;
typedef tMCA_HANDLE tBTA_HL_APP_HANDLE;
typedef tMCA_CL tBTA_HL_MCL_HANDLE;
typedef tMCA_DL tBTA_HL_MDL_HANDLE;
@@ -153,7 +153,7 @@
BTA_HL_DEVICE_TYPE_DUAL
};
-typedef UINT8 tBTA_HL_DEVICE_TYPE;
+typedef uint8_t tBTA_HL_DEVICE_TYPE;
@@ -171,11 +171,11 @@
#define BTA_HL_MDEP_ROLE_SOURCE 0x00
#define BTA_HL_MDEP_ROLE_SINK 0x01
-typedef UINT8 tBTA_HL_MDEP_ROLE;
+typedef uint8_t tBTA_HL_MDEP_ROLE;
#define BTA_HL_MDEP_ROLE_MASK_SOURCE 0x01 /* bit mask */
#define BTA_HL_MDEP_ROLE_MASK_SINK 0x02
-typedef UINT8 tBTA_HL_MDEP_ROLE_MASK;
+typedef uint8_t tBTA_HL_MDEP_ROLE_MASK;
#define BTA_HL_ECHO_TEST_MDEP_ID 0
@@ -189,7 +189,7 @@
#define BTA_HL_DELETE_ALL_MDL_IDS 0xFFFF
#define BTA_HL_MAX_MDL_VAL 0xFEFF
-typedef UINT16 tBTA_HL_MDL_ID; /* 0x0000 reserved,
+typedef uint16_t tBTA_HL_MDL_ID; /* 0x0000 reserved,
0x0001-0xFEFF dynamic range,
0xFF00-0xFFFE reserved,
0xFFFF indicates all MDLs*/
@@ -199,14 +199,14 @@
#define BTA_HL_DCH_MODE_RELIABLE 0
#define BTA_HL_DCH_MODE_STREAMING 1
-typedef UINT8 tBTA_HL_DCH_MODE;
+typedef uint8_t tBTA_HL_DCH_MODE;
#define BTA_HL_DCH_CFG_NO_PREF 0
#define BTA_HL_DCH_CFG_RELIABLE 1
#define BTA_HL_DCH_CFG_STREAMING 2
#define BTA_HL_DCH_CFG_UNKNOWN 0xFF
-typedef UINT8 tBTA_HL_DCH_CFG;
+typedef uint8_t tBTA_HL_DCH_CFG;
/* The Default DCH CFG for the echo test when the device is a Source */
#define BTA_HL_DEFAULT_ECHO_TEST_SRC_DCH_CFG BTA_HL_DCH_CFG_RELIABLE
@@ -214,27 +214,27 @@
#define BTA_HL_DCH_CREATE_RSP_SUCCESS 0
#define BTA_HL_DCH_CREATE_RSP_CFG_REJ 1
-typedef UINT8 tBTA_HL_DCH_CREATE_RSP;
+typedef uint8_t tBTA_HL_DCH_CREATE_RSP;
#define BTA_HL_MCAP_SUP_PROC_RECONNECT_INIT 0x02
#define BTA_HL_MCAP_SUP_PROC_RECONNECT_APT 0x04
#define BTA_HL_MCAP_SUP_PROC_CSP_SLAVE 0x08
#define BTA_HL_MCAP_SUP_PROC_CSP_MASTER 0x10
-typedef UINT8 tBTA_HL_SUP_PROC_MASK;
+typedef uint8_t tBTA_HL_SUP_PROC_MASK;
typedef struct
{
- UINT16 max_rx_apdu_size; /* local rcv MTU */
- UINT16 max_tx_apdu_size; /* maximum TX APDU size*/
+ uint16_t max_rx_apdu_size; /* local rcv MTU */
+ uint16_t max_tx_apdu_size; /* maximum TX APDU size*/
} tBTA_HL_ECHO_CFG;
typedef struct
{
- UINT16 data_type;
- UINT16 max_rx_apdu_size; /* local rcv MTU */
- UINT16 max_tx_apdu_size; /* maximum TX APDU size*/
+ uint16_t data_type;
+ uint16_t max_rx_apdu_size; /* local rcv MTU */
+ uint16_t max_tx_apdu_size; /* maximum TX APDU size*/
char desp[BTA_HL_MDEP_DESP_LEN+1];
} tBTA_HL_MDEP_DATA_TYPE_CFG;
@@ -242,7 +242,7 @@
typedef struct
{
tBTA_HL_MDEP_ROLE mdep_role;
- UINT8 num_of_mdep_data_types;
+ uint8_t num_of_mdep_data_types;
tBTA_HL_MDEP_DATA_TYPE_CFG data_cfg[BTA_HL_NUM_DATA_TYPES];
} tBTA_HL_MDEP_CFG;
@@ -250,7 +250,7 @@
{
tBTA_HL_MDEP_ID mdep_id; /* MDEP ID 0x01-0x7F */
tBTA_HL_MDEP_CFG mdep_cfg;
- UINT8 ori_app_id;
+ uint8_t ori_app_id;
} tBTA_HL_MDEP;
typedef struct
@@ -258,27 +258,27 @@
tBTA_HL_MDEP mdep[BTA_HL_NUM_MDEPS];
tBTA_HL_ECHO_CFG echo_cfg;
tBTA_HL_MDEP_ROLE_MASK app_role_mask;
- BOOLEAN advertize_source_sdp;
- UINT8 num_of_mdeps;
+ bool advertize_source_sdp;
+ uint8_t num_of_mdeps;
} tBTA_HL_SUP_FEATURE;
typedef struct
{
- BOOLEAN delete_req_pending;
+ bool delete_req_pending;
tBTA_HL_MDL_ID mdl_id;
tBTA_HL_MCL_HANDLE mcl_handle;
} tBTA_HL_DELETE_MDL;
typedef struct
{
- UINT8 time;
- UINT16 mtu;
+ uint8_t time;
+ uint16_t mtu;
tBTA_HL_MDL_ID mdl_id;
tBTA_HL_MDEP_ID local_mdep_id;
tBTA_HL_MDEP_ROLE local_mdep_role;
- BOOLEAN active; /* true if this item is in use */
+ bool active; /* true if this item is in use */
tBTA_HL_DCH_MODE dch_mode;
- UINT8 fcs;
+ uint8_t fcs;
BD_ADDR peer_bd_addr;
} tBTA_HL_MDL_CFG;
@@ -289,15 +289,15 @@
/* This structure is used to add supported feature lists and find supported feature elements */
typedef struct
{
- UINT8 mdep_id;
- UINT16 data_type;
+ uint8_t mdep_id;
+ uint16_t data_type;
tBTA_HL_MDEP_ROLE mdep_role;
char *p_mdep_desp;
} tBTA_HL_SUP_FEATURE_ELEM;
typedef struct
{
- UINT16 num_elems;
+ uint16_t num_elems;
tBTA_HL_SUP_FEATURE_ELEM list_elem[BTA_HL_NUM_SUP_FEATURE_ELEMS];
} tBTA_HL_SUP_FEATURE_LIST_ELEM;
@@ -313,7 +313,7 @@
typedef struct
{
- UINT16 ctrl_psm;
+ uint16_t ctrl_psm;
BD_ADDR bd_addr; /* Address of peer device */
tBTA_SEC sec_mask; /* security mask for initiating connection*/
} tBTA_HL_CCH_OPEN_PARAM;
@@ -321,7 +321,7 @@
typedef struct
{
- UINT16 ctrl_psm;
+ uint16_t ctrl_psm;
tBTA_HL_MDEP_ID local_mdep_id; /* local MDEP ID */
tBTA_HL_MDEP_ID peer_mdep_id; /* peer mdep id */
tBTA_HL_DCH_CFG local_cfg;
@@ -331,22 +331,22 @@
typedef struct
{
- UINT16 ctrl_psm;
+ uint16_t ctrl_psm;
tBTA_HL_MDL_ID mdl_id;
} tBTA_HL_DCH_RECONNECT_PARAM;
typedef struct
{
- UINT16 ctrl_psm;
- UINT16 pkt_size;
+ uint16_t ctrl_psm;
+ uint16_t pkt_size;
tBTA_HL_DCH_CFG local_cfg;
} tBTA_HL_DCH_ECHO_TEST_PARAM;
typedef struct
{
- UINT16 buf_size;
- UINT8 p_buf; /* buffer pointer */
+ uint16_t buf_size;
+ uint8_t p_buf; /* buffer pointer */
} tBTA_HL_DCH_BUF_INFO;
typedef struct
@@ -359,18 +359,18 @@
typedef struct
{
- UINT16 data_type;
- UINT8 mdep_id;
+ uint16_t data_type;
+ uint8_t mdep_id;
tBTA_HL_MDEP_ROLE mdep_role;
char mdep_desp[BTA_HL_MDEP_DESP_LEN+1];
}tBTA_HL_SDP_MDEP_CFG;
typedef struct
{
- UINT16 ctrl_psm;
- UINT16 data_psm;
- UINT8 mcap_sup_proc;
- UINT8 num_mdeps; /* number of mdep elements from SDP*/
+ uint16_t ctrl_psm;
+ uint16_t data_psm;
+ uint8_t mcap_sup_proc;
+ uint8_t num_mdeps; /* number of mdep elements from SDP*/
char srv_name[BTA_SERVICE_NAME_LEN+1];
char srv_desp[BTA_SERVICE_DESP_LEN+1];
char provider_name[BTA_PROVIDER_NAME_LEN+1];
@@ -379,7 +379,7 @@
typedef struct
{
- UINT8 num_recs;
+ uint8_t num_recs;
tBTA_HL_SDP_REC sdp_rec[BTA_HL_NUM_SDP_RECS];
} tBTA_HL_SDP;
@@ -389,7 +389,7 @@
BTA_HL_CTRL_ENABLE_CFM_EVT = 0,
BTA_HL_CTRL_DISABLE_CFM_EVT
};
-typedef UINT8 tBTA_HL_CTRL_EVT;
+typedef uint8_t tBTA_HL_CTRL_EVT;
/* Structure associated with BTA_HL_ENABLE_EVT
BTA_HL_DISABLE_EVT */
@@ -432,13 +432,13 @@
BTA_HL_SDP_QUERY_CFM_EVT,
BTA_HL_SDP_INFO_IND_EVT
};
-typedef UINT8 tBTA_HL_EVT;
+typedef uint8_t tBTA_HL_EVT;
typedef struct
{
tBTA_HL_STATUS status; /* start status */
- UINT8 app_id;
+ uint8_t app_id;
tBTA_HL_APP_HANDLE app_handle;
} tBTA_HL_REGISTER_CFM;
@@ -446,14 +446,14 @@
typedef struct
{
tBTA_HL_STATUS status; /* start status */
- UINT8 app_id;
+ uint8_t app_id;
tBTA_HL_APP_HANDLE app_handle;
} tBTA_HL_DEREGISTER_CFM;
typedef struct
{
- BOOLEAN intentional;
+ bool intentional;
tBTA_HL_MCL_HANDLE mcl_handle;
tBTA_HL_APP_HANDLE app_handle;
} tBTA_HL_CCH_CLOSE_IND;
@@ -482,7 +482,7 @@
typedef struct
{
tBTA_HL_STATUS status; /* connection status */
- UINT8 app_id;
+ uint8_t app_id;
tBTA_HL_MCL_HANDLE mcl_handle;
tBTA_HL_APP_HANDLE app_handle;
BD_ADDR bd_addr; /* address of peer device */
@@ -510,8 +510,8 @@
data channel conenction */
tBTA_HL_DCH_MODE dch_mode; /* data channel mode - reliable or streaming*/
- BOOLEAN first_reliable; /* whether this is the first reliable data channel */
- UINT16 mtu;
+ bool first_reliable; /* whether this is the first reliable data channel */
+ uint16_t mtu;
} tBTA_HL_DCH_OPEN_IND;
typedef struct
@@ -524,14 +524,14 @@
tBTA_HL_MDL_ID mdl_id; /* MCAP data link ID for this
data channel conenction */
tBTA_HL_DCH_MODE dch_mode; /* data channel mode - reliable or streaming*/
- BOOLEAN first_reliable; /* whether this is the first reliable data channel */
- UINT16 mtu;
+ bool first_reliable; /* whether this is the first reliable data channel */
+ uint16_t mtu;
} tBTA_HL_DCH_OPEN_CFM;
typedef struct
{
- BOOLEAN intentional;
+ bool intentional;
tBTA_HL_MDL_HANDLE mdl_handle;
tBTA_HL_MCL_HANDLE mcl_handle;
tBTA_HL_APP_HANDLE app_handle;
@@ -573,22 +573,22 @@
tBTA_HL_MDL_HANDLE mdl_handle;
tBTA_HL_MCL_HANDLE mcl_handle;
tBTA_HL_APP_HANDLE app_handle;
- BOOLEAN cong;
+ bool cong;
} tBTA_HL_DCH_CONG_IND;
typedef struct
{
tBTA_HL_APP_HANDLE app_handle;
- UINT16 ctrl_psm;
- UINT16 data_psm;
- UINT8 data_x_spec;
- UINT8 mcap_sup_procs;
+ uint16_t ctrl_psm;
+ uint16_t data_psm;
+ uint8_t data_x_spec;
+ uint8_t mcap_sup_procs;
} tBTA_HL_SDP_INFO_IND;
typedef struct
{
tBTA_HL_STATUS status;
- UINT8 app_id;
+ uint8_t app_id;
tBTA_HL_APP_HANDLE app_handle;
BD_ADDR bd_addr;
tBTA_HL_SDP *p_sdp;
@@ -675,8 +675,8 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HlUpdate(UINT8 app_id,
- tBTA_HL_REG_PARAM *p_reg_param, BOOLEAN is_register,
+extern void BTA_HlUpdate(uint8_t app_id,
+ tBTA_HL_REG_PARAM *p_reg_param, bool is_register,
tBTA_HL_CBACK *p_cback);
/*******************************************************************************
@@ -694,7 +694,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HlRegister(UINT8 app_id,
+extern void BTA_HlRegister(uint8_t app_id,
tBTA_HL_REG_PARAM *p_reg_param,
tBTA_HL_CBACK *p_cback);
@@ -709,7 +709,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HlDeregister(UINT8 app_id,tBTA_HL_APP_HANDLE app_handle);
+extern void BTA_HlDeregister(uint8_t app_id,tBTA_HL_APP_HANDLE app_handle);
/*******************************************************************************
**
@@ -729,7 +729,7 @@
** Note: If the control PSM value is zero then the first HDP
** instance is used for the control channel setup
*******************************************************************************/
-extern void BTA_HlCchOpen(UINT8 app_id, tBTA_HL_APP_HANDLE app_handle,
+extern void BTA_HlCchOpen(uint8_t app_id, tBTA_HL_APP_HANDLE app_handle,
tBTA_HL_CCH_OPEN_PARAM *p_open_param);
/*******************************************************************************
@@ -815,7 +815,7 @@
**
*******************************************************************************/
extern void BTA_HlSendData(tBTA_HL_MDL_HANDLE mdl_handle,
- UINT16 pkt_size);
+ uint16_t pkt_size);
/*******************************************************************************
**
@@ -864,7 +864,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_HlSdpQuery(UINT8 app_id,tBTA_HL_APP_HANDLE app_handle,
+extern void BTA_HlSdpQuery(uint8_t app_id,tBTA_HL_APP_HANDLE app_handle,
BD_ADDR bd_addr);
/*******************************************************************************
diff --git a/bta/include/bta_hl_ci.h b/bta/include/bta_hl_ci.h
index 7092fbc..09cde56 100644
--- a/bta/include/bta_hl_ci.h
+++ b/bta/include/bta_hl_ci.h
@@ -62,7 +62,7 @@
*******************************************************************************/
extern void bta_hl_ci_get_tx_data( tBTA_HL_MDL_HANDLE mdl_handle,
tBTA_HL_STATUS status,
- UINT16 evt );
+ uint16_t evt );
/*******************************************************************************
**
@@ -81,7 +81,7 @@
*******************************************************************************/
extern void bta_hl_ci_put_rx_data( tBTA_HL_MDL_HANDLE mdl_handle,
tBTA_HL_STATUS status,
- UINT16 evt );
+ uint16_t evt );
@@ -102,7 +102,7 @@
*******************************************************************************/
extern void bta_hl_ci_get_echo_data( tBTA_HL_MCL_HANDLE mcl_handle,
tBTA_HL_STATUS status,
- UINT16 evt );
+ uint16_t evt );
/*******************************************************************************
@@ -122,7 +122,7 @@
*******************************************************************************/
extern void bta_hl_ci_put_echo_data( tBTA_HL_MCL_HANDLE mcl_handle,
tBTA_HL_STATUS status,
- UINT16 evt );
+ uint16_t evt );
#ifdef __cplusplus
}
diff --git a/bta/include/bta_hl_co.h b/bta/include/bta_hl_co.h
index cf27c80..8e6847f 100644
--- a/bta/include/bta_hl_co.h
+++ b/bta/include/bta_hl_co.h
@@ -51,10 +51,10 @@
** p_num_of_mdep (output) - number of MDEP configurations supported
** by the application
**
-** Returns Bloolean - TRUE success
+** Returns Bloolean - true success
**
*******************************************************************************/
-extern BOOLEAN bta_hl_co_get_num_of_mdep(UINT8 app_id, UINT8 *p_num_of_mdep);
+extern bool bta_hl_co_get_num_of_mdep(uint8_t app_id, uint8_t *p_num_of_mdep);
/*******************************************************************************
**
** Function bta_hl_co_advrtise_source_sdp
@@ -64,11 +64,11 @@
**
** Parameters app_id - application ID
**
-** Returns Bloolean - TRUE advertise the SOURCE MDEP configuration
+** Returns Bloolean - true advertise the SOURCE MDEP configuration
** information
**
*******************************************************************************/
-extern BOOLEAN bta_hl_co_advrtise_source_sdp(UINT8 app_id);
+extern bool bta_hl_co_advrtise_source_sdp(uint8_t app_id);
/*******************************************************************************
**
** Function bta_hl_co_get_mdep_config
@@ -84,11 +84,11 @@
** p_mdl_cfg (output) - pointer to the MDEP configuration
**
**
-** Returns Bloolean - TRUE success
+** Returns Bloolean - true success
*******************************************************************************/
-extern BOOLEAN bta_hl_co_get_mdep_config(UINT8 app_id,
- UINT8 mdep_idx,
- UINT8 mdep_counter,
+extern bool bta_hl_co_get_mdep_config(uint8_t app_id,
+ uint8_t mdep_idx,
+ uint8_t mdep_counter,
tBTA_HL_MDEP_ID mdep_id,
tBTA_HL_MDEP_CFG *p_mdep_cfg);
@@ -104,9 +104,9 @@
** p_echo_cfg (output) - pointer to the Echo test maximum APDU size
** configuration
**
-** Returns Bloolean - TRUE success
+** Returns Bloolean - true success
*******************************************************************************/
-extern BOOLEAN bta_hl_co_get_echo_config(UINT8 app_id,
+extern bool bta_hl_co_get_echo_config(uint8_t app_id,
tBTA_HL_ECHO_CFG *p_echo_cfg);
@@ -124,7 +124,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_hl_co_save_mdl(UINT8 app_id, UINT8 item_idx, tBTA_HL_MDL_CFG *p_mdl_cfg );
+extern void bta_hl_co_save_mdl(uint8_t app_id, uint8_t item_idx, tBTA_HL_MDL_CFG *p_mdl_cfg );
/*******************************************************************************
**
** Function bta_hl_co_delete_mdl
@@ -138,7 +138,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_hl_co_delete_mdl(UINT8 app_id, UINT8 item_idx);
+extern void bta_hl_co_delete_mdl(uint8_t app_id, uint8_t item_idx);
/*******************************************************************************
**
** Function bta_hl_co_get_mdl_config
@@ -151,11 +151,11 @@
** buffer_size - the unit of the buffer size is sizeof(tBTA_HL_MDL_CFG)
** p_mdl_buf - Point to the starting location of the buffer
**
-** Returns BOOLEAN
+** Returns bool
**
**
*******************************************************************************/
-extern BOOLEAN bta_hl_co_load_mdl_config (UINT8 app_id, UINT8 buffer_size,
+extern bool bta_hl_co_load_mdl_config (uint8_t app_id, uint8_t buffer_size,
tBTA_HL_MDL_CFG *p_mdl_buf );
@@ -175,8 +175,8 @@
** Returns Void
**
*******************************************************************************/
-extern void bta_hl_co_get_tx_data (UINT8 app_id, tBTA_HL_MDL_HANDLE mdl_handle,
- UINT16 buf_size, UINT8 *p_buf, UINT16 evt);
+extern void bta_hl_co_get_tx_data (uint8_t app_id, tBTA_HL_MDL_HANDLE mdl_handle,
+ uint16_t buf_size, uint8_t *p_buf, uint16_t evt);
/*******************************************************************************
@@ -195,8 +195,8 @@
** Returns Void
**
*******************************************************************************/
-extern void bta_hl_co_put_rx_data (UINT8 app_id, tBTA_HL_MDL_HANDLE mdl_handle,
- UINT16 data_size, UINT8 *p_data, UINT16 evt);
+extern void bta_hl_co_put_rx_data (uint8_t app_id, tBTA_HL_MDL_HANDLE mdl_handle,
+ uint16_t data_size, uint8_t *p_data, uint16_t evt);
/*******************************************************************************
**
** Function bta_hl_co_get_tx_data
@@ -213,8 +213,8 @@
** Returns Void
**
*******************************************************************************/
-extern void bta_hl_co_get_echo_data (UINT8 app_id, tBTA_HL_MCL_HANDLE mcl_handle,
- UINT16 buf_size, UINT8 *p_buf, UINT16 evt);
+extern void bta_hl_co_get_echo_data (uint8_t app_id, tBTA_HL_MCL_HANDLE mcl_handle,
+ uint16_t buf_size, uint8_t *p_buf, uint16_t evt);
/*******************************************************************************
**
@@ -232,8 +232,8 @@
** Returns Void
**
*******************************************************************************/
-extern void bta_hl_co_put_echo_data (UINT8 app_id, tBTA_HL_MCL_HANDLE mcl_handle,
- UINT16 data_size, UINT8 *p_data, UINT16 evt);
+extern void bta_hl_co_put_echo_data (uint8_t app_id, tBTA_HL_MCL_HANDLE mcl_handle,
+ uint16_t data_size, uint8_t *p_data, uint16_t evt);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_jv_api.h b/bta/include/bta_jv_api.h
index 45245a2..3fc03d9 100644
--- a/bta/include/bta_jv_api.h
+++ b/bta/include/bta_jv_api.h
@@ -44,7 +44,7 @@
#define BTA_JV_NO_DATA 3 /* no data. */
#define BTA_JV_NO_RESOURCE 4 /* No more set pm control block */
-typedef UINT8 tBTA_JV_STATUS;
+typedef uint8_t tBTA_JV_STATUS;
#define BTA_JV_INTERNAL_ERR (-1) /* internal error. */
#define BTA_JV_MAX_UUIDS SDP_MAX_UUID_FILTERS
@@ -79,11 +79,11 @@
BTA_JV_DISC_LIMITED,
BTA_JV_DISC_GENERAL
};
-typedef UINT16 tBTA_JV_DISC;
+typedef uint16_t tBTA_JV_DISC;
#define BTA_JV_ROLE_SLAVE BTM_ROLE_SLAVE
#define BTA_JV_ROLE_MASTER BTM_ROLE_MASTER
-typedef UINT32 tBTA_JV_ROLE;
+typedef uint32_t tBTA_JV_ROLE;
#define BTA_JV_SERVICE_LMTD_DISCOVER BTM_COD_SERVICE_LMTD_DISCOVER /* 0x0020 */
#define BTA_JV_SERVICE_POSITIONING BTM_COD_SERVICE_POSITIONING /* 0x0100 */
@@ -100,7 +100,7 @@
#define BTA_JV_PM_ID_2 2 /* PM example profile 2 */
#define BTA_JV_PM_ID_CLEAR 0 /* Special JV ID used to clear PM profile */
#define BTA_JV_PM_ALL 0xFF /* Generic match all id, see bta_dm_cfg.c */
-typedef UINT8 tBTA_JV_PM_ID;
+typedef uint8_t tBTA_JV_PM_ID;
#define BTA_JV_PM_HANDLE_CLEAR 0xFF /* Special JV ID used to clear PM profile */
@@ -122,7 +122,7 @@
BTA_JV_CONN_BUSY, /* Connection busy state */
BTA_JV_MAX_CONN_STATE /* Max number of connection state */
};
-typedef UINT8 tBTA_JV_CONN_STATE;
+typedef uint8_t tBTA_JV_CONN_STATE;
/* JV Connection types */
#define BTA_JV_CONN_TYPE_RFCOMM 0
@@ -158,7 +158,7 @@
#define BTA_JV_RFCOMM_SRV_OPEN_EVT 34 /* open status of Server RFCOMM connection */
#define BTA_JV_MAX_EVT 35 /* max number of JV events */
-typedef UINT16 tBTA_JV_EVT;
+typedef uint16_t tBTA_JV_EVT;
/* data associated with BTA_JV_SET_DISCOVER_EVT */
typedef struct
@@ -184,18 +184,18 @@
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
+ uint32_t handle; /* The connection handle */
BD_ADDR rem_bda; /* The peer address */
- INT32 tx_mtu; /* The transmit MTU */
+ int32_t tx_mtu; /* The transmit MTU */
} tBTA_JV_L2CAP_OPEN;
/* data associated with BTA_JV_L2CAP_OPEN_EVT for LE sockets */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
+ uint32_t handle; /* The connection handle */
BD_ADDR rem_bda; /* The peer address */
- INT32 tx_mtu; /* The transmit MTU */
+ int32_t tx_mtu; /* The transmit MTU */
void **p_p_cback; /* set them for new socket */
void **p_user_data;/* set them for new socket */
@@ -206,53 +206,53 @@
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- BOOLEAN async; /* FALSE, if local initiates disconnect */
+ uint32_t handle; /* The connection handle */
+ bool async; /* false, if local initiates disconnect */
} tBTA_JV_L2CAP_CLOSE;
/* data associated with BTA_JV_L2CAP_START_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT8 sec_id; /* security ID used by this server */
+ uint32_t handle; /* The connection handle */
+ uint8_t sec_id; /* security ID used by this server */
} tBTA_JV_L2CAP_START;
/* data associated with BTA_JV_L2CAP_CL_INIT_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT8 sec_id; /* security ID used by this client */
+ uint32_t handle; /* The connection handle */
+ uint8_t sec_id; /* security ID used by this client */
} tBTA_JV_L2CAP_CL_INIT;
/* data associated with BTA_JV_L2CAP_CONG_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- BOOLEAN cong; /* TRUE, congested. FALSE, uncongested */
+ uint32_t handle; /* The connection handle */
+ bool cong; /* true, congested. false, uncongested */
} tBTA_JV_L2CAP_CONG;
/* data associated with BTA_JV_L2CAP_READ_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT32 req_id; /* The req_id in the associated BTA_JvL2capRead() */
- UINT8 *p_data; /* This points the same location as the p_data
+ uint32_t handle; /* The connection handle */
+ uint32_t req_id; /* The req_id in the associated BTA_JvL2capRead() */
+ uint8_t *p_data; /* This points the same location as the p_data
* parameter in BTA_JvL2capRead () */
- UINT16 len; /* The length of the data read. */
+ uint16_t len; /* The length of the data read. */
} tBTA_JV_L2CAP_READ;
/* data associated with BTA_JV_L2CAP_WRITE_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT32 req_id; /* The req_id in the associated BTA_JvL2capWrite() */
- UINT16 len; /* The length of the data written. */
- BOOLEAN cong; /* congestion status */
+ uint32_t handle; /* The connection handle */
+ uint32_t req_id; /* The req_id in the associated BTA_JvL2capWrite() */
+ uint16_t len; /* The length of the data written. */
+ bool cong; /* congestion status */
} tBTA_JV_L2CAP_WRITE;
@@ -260,26 +260,26 @@
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT16 channel; /* The connection channel */
+ uint16_t channel; /* The connection channel */
BD_ADDR addr; /* The peer address */
- UINT32 req_id; /* The req_id in the associated BTA_JvL2capWrite() */
- UINT16 len; /* The length of the data written. */
- BOOLEAN cong; /* congestion status */
+ uint32_t req_id; /* The req_id in the associated BTA_JvL2capWrite() */
+ uint16_t len; /* The length of the data written. */
+ bool cong; /* congestion status */
} tBTA_JV_L2CAP_WRITE_FIXED;
/* data associated with BTA_JV_RFCOMM_OPEN_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
+ uint32_t handle; /* The connection handle */
BD_ADDR rem_bda; /* The peer address */
} tBTA_JV_RFCOMM_OPEN;
/* data associated with BTA_JV_RFCOMM_SRV_OPEN_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT32 new_listen_handle; /* The new listen handle */
+ uint32_t handle; /* The connection handle */
+ uint32_t new_listen_handle; /* The new listen handle */
BD_ADDR rem_bda; /* The peer address */
} tBTA_JV_RFCOMM_SRV_OPEN;
@@ -288,38 +288,38 @@
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 port_status; /* PORT status */
- UINT32 handle; /* The connection handle */
- BOOLEAN async; /* FALSE, if local initiates disconnect */
+ uint32_t port_status; /* PORT status */
+ uint32_t handle; /* The connection handle */
+ bool async; /* false, if local initiates disconnect */
} tBTA_JV_RFCOMM_CLOSE;
/* data associated with BTA_JV_RFCOMM_START_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT8 sec_id; /* security ID used by this server */
- BOOLEAN use_co; /* TRUE to use co_rfc_data */
+ uint32_t handle; /* The connection handle */
+ uint8_t sec_id; /* security ID used by this server */
+ bool use_co; /* true to use co_rfc_data */
} tBTA_JV_RFCOMM_START;
/* data associated with BTA_JV_RFCOMM_CL_INIT_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT8 sec_id; /* security ID used by this client */
- BOOLEAN use_co; /* TRUE to use co_rfc_data */
+ uint32_t handle; /* The connection handle */
+ uint8_t sec_id; /* security ID used by this client */
+ bool use_co; /* true to use co_rfc_data */
} tBTA_JV_RFCOMM_CL_INIT;
/*data associated with BTA_JV_L2CAP_DATA_IND_EVT & BTA_JV_RFCOMM_DATA_IND_EVT */
typedef struct
{
- UINT32 handle; /* The connection handle */
+ uint32_t handle; /* The connection handle */
} tBTA_JV_DATA_IND;
/*data associated with BTA_JV_L2CAP_DATA_IND_EVT if used for LE */
typedef struct
{
- UINT32 handle; /* The connection handle */
+ uint32_t handle; /* The connection handle */
BT_HDR *p_buf; /* The incoming data */
} tBTA_JV_LE_DATA_IND;
@@ -328,32 +328,32 @@
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- BOOLEAN cong; /* TRUE, congested. FALSE, uncongested */
+ uint32_t handle; /* The connection handle */
+ bool cong; /* true, congested. false, uncongested */
} tBTA_JV_RFCOMM_CONG;
/* data associated with BTA_JV_RFCOMM_WRITE_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT32 req_id; /* The req_id in the associated BTA_JvRfcommWrite() */
+ uint32_t handle; /* The connection handle */
+ uint32_t req_id; /* The req_id in the associated BTA_JvRfcommWrite() */
int len; /* The length of the data written. */
- BOOLEAN cong; /* congestion status */
+ bool cong; /* congestion status */
} tBTA_JV_RFCOMM_WRITE;
/* data associated with BTA_JV_API_SET_PM_PROFILE_EVT */
typedef struct
{
tBTA_JV_STATUS status; /* Status of the operation */
- UINT32 handle; /* Connection handle */
+ uint32_t handle; /* Connection handle */
tBTA_JV_PM_ID app_id; /* JV app ID */
} tBTA_JV_SET_PM_PROFILE;
/* data associated with BTA_JV_API_NOTIFY_PM_STATE_CHANGE_EVT */
typedef struct
{
- UINT32 handle; /* Connection handle */
+ uint32_t handle; /* Connection handle */
tBTA_JV_CONN_STATE state; /* JV connection stata */
} tBTA_JV_NOTIFY_PM_STATE_CHANGE;
@@ -364,8 +364,8 @@
tBTA_JV_STATUS status; /* BTA_JV_ENABLE_EVT */
tBTA_JV_DISCOVERY_COMP disc_comp; /* BTA_JV_DISCOVERY_COMP_EVT */
tBTA_JV_SET_DISCOVER set_discover; /* BTA_JV_SET_DISCOVER_EVT */
- UINT8 scn; /* BTA_JV_GET_SCN_EVT */
- UINT16 psm; /* BTA_JV_GET_PSM_EVT */
+ uint8_t scn; /* BTA_JV_GET_SCN_EVT */
+ uint16_t psm; /* BTA_JV_GET_PSM_EVT */
tBTA_JV_CREATE_RECORD create_rec; /* BTA_JV_CREATE_RECORD_EVT */
tBTA_JV_L2CAP_OPEN l2c_open; /* BTA_JV_L2CAP_OPEN_EVT */
tBTA_JV_L2CAP_CLOSE l2c_close; /* BTA_JV_L2CAP_CLOSE_EVT */
@@ -400,9 +400,9 @@
/* JV configuration structure */
typedef struct
{
- UINT16 sdp_raw_size; /* The size of p_sdp_raw_data */
- UINT16 sdp_db_size; /* The size of p_sdp_db */
- UINT8 *p_sdp_raw_data; /* The data buffer to keep raw data */
+ uint16_t sdp_raw_size; /* The size of p_sdp_raw_data */
+ uint16_t sdp_db_size; /* The size of p_sdp_db */
+ uint8_t *p_sdp_raw_data; /* The data buffer to keep raw data */
tSDP_DISCOVERY_DB *p_sdp_db; /* The data buffer to keep SDP database */
} tBTA_JV_CFG;
@@ -439,11 +439,11 @@
**
** Description This function checks if the link to peer device is encrypted
**
-** Returns TRUE if encrypted.
-** FALSE if not.
+** Returns true if encrypted.
+** false if not.
**
*******************************************************************************/
-BOOLEAN BTA_JvIsEncrypted(BD_ADDR bd_addr);
+bool BTA_JvIsEncrypted(BD_ADDR bd_addr);
/*******************************************************************************
**
@@ -467,7 +467,7 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvGetChannelId(int conn_type, void* user_data,
- INT32 channel);
+ int32_t channel);
/*******************************************************************************
**
@@ -480,7 +480,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvFreeChannel(UINT16 channel, int conn_type);
+tBTA_JV_STATUS BTA_JvFreeChannel(uint16_t channel, int conn_type);
/*******************************************************************************
**
@@ -495,7 +495,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvStartDiscovery(BD_ADDR bd_addr, UINT16 num_uuid,
+tBTA_JV_STATUS BTA_JvStartDiscovery(BD_ADDR bd_addr, uint16_t num_uuid,
tSDP_UUID *p_uuid_list, void* user_data);
/*******************************************************************************
@@ -521,7 +521,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvDeleteRecord(UINT32 handle);
+tBTA_JV_STATUS BTA_JvDeleteRecord(uint32_t handle);
/*******************************************************************************
**
@@ -539,8 +539,8 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capConnectLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
- const tL2CAP_ERTM_INFO *ertm_info, UINT16 remote_chan,
- UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
+ const tL2CAP_ERTM_INFO *ertm_info, uint16_t remote_chan,
+ uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
BD_ADDR peer_bd_addr, tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
/*******************************************************************************
@@ -559,8 +559,8 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
- const tL2CAP_ERTM_INFO *ertm_info, UINT16 remote_psm,
- UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
+ const tL2CAP_ERTM_INFO *ertm_info, uint16_t remote_psm,
+ uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
BD_ADDR peer_bd_addr, tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
/*******************************************************************************
@@ -573,7 +573,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capClose(UINT32 handle);
+tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle);
/*******************************************************************************
**
@@ -586,7 +586,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capCloseLE(UINT32 handle);
+tBTA_JV_STATUS BTA_JvL2capCloseLE(uint32_t handle);
/*******************************************************************************
**
@@ -604,7 +604,7 @@
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
const tL2CAP_ERTM_INFO *ertm_info,
- UINT16 local_psm, UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
+ uint16_t local_psm, uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
/*******************************************************************************
@@ -624,7 +624,7 @@
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capStartServerLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
const tL2CAP_ERTM_INFO *ertm_info,
- UINT16 local_chan, UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
+ uint16_t local_chan, uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
/*******************************************************************************
@@ -638,7 +638,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capStopServerLE(UINT16 local_chan, void *user_data);
+tBTA_JV_STATUS BTA_JvL2capStopServerLE(uint16_t local_chan, void *user_data);
/*******************************************************************************
**
@@ -651,7 +651,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capStopServer(UINT16 local_psm, void *user_data);
+tBTA_JV_STATUS BTA_JvL2capStopServer(uint16_t local_psm, void *user_data);
/*******************************************************************************
**
@@ -665,8 +665,8 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capRead(UINT32 handle, UINT32 req_id,
- UINT8 *p_data, UINT16 len);
+tBTA_JV_STATUS BTA_JvL2capRead(uint32_t handle, uint32_t req_id,
+ uint8_t *p_data, uint16_t len);
/*******************************************************************************
**
@@ -679,7 +679,7 @@
** BTA_JV_FAILURE, if error.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capReady(UINT32 handle, UINT32 *p_data_size);
+tBTA_JV_STATUS BTA_JvL2capReady(uint32_t handle, uint32_t *p_data_size);
/*******************************************************************************
**
@@ -694,8 +694,8 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capWrite(UINT32 handle, UINT32 req_id,
- UINT8 *p_data, UINT16 len, void *user_data);
+tBTA_JV_STATUS BTA_JvL2capWrite(uint32_t handle, uint32_t req_id,
+ uint8_t *p_data, uint16_t len, void *user_data);
/*******************************************************************************
@@ -711,9 +711,9 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capWriteFixed(UINT16 channel, BD_ADDR *addr, UINT32 req_id,
+tBTA_JV_STATUS BTA_JvL2capWriteFixed(uint16_t channel, BD_ADDR *addr, uint32_t req_id,
tBTA_JV_L2CAP_CBACK *p_cback,
- UINT8 *p_data, UINT16 len, void *user_data);
+ uint8_t *p_data, uint16_t len, void *user_data);
/*******************************************************************************
**
@@ -731,7 +731,7 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
- tBTA_JV_ROLE role, UINT8 remote_scn, BD_ADDR peer_bd_addr,
+ tBTA_JV_ROLE role, uint8_t remote_scn, BD_ADDR peer_bd_addr,
tBTA_JV_RFCOMM_CBACK *p_cback, void *user_data);
/*******************************************************************************
@@ -744,7 +744,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, void* user_data);
+tBTA_JV_STATUS BTA_JvRfcommClose(uint32_t handle, void* user_data);
/*******************************************************************************
**
@@ -762,7 +762,7 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask,
- tBTA_JV_ROLE role, UINT8 local_scn, UINT8 max_session,
+ tBTA_JV_ROLE role, uint8_t local_scn, uint8_t max_session,
tBTA_JV_RFCOMM_CBACK *p_cback, void *user_data);
/*******************************************************************************
@@ -776,7 +776,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle, void* user_data);
+tBTA_JV_STATUS BTA_JvRfcommStopServer(uint32_t handle, void* user_data);
/*******************************************************************************
**
@@ -790,7 +790,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvRfcommWrite(UINT32 handle, UINT32 req_id);
+tBTA_JV_STATUS BTA_JvRfcommWrite(uint32_t handle, uint32_t req_id);
/*******************************************************************************
**
@@ -811,7 +811,7 @@
** BTA_JV_CONN_CLOSE to remove in case of connection close!
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvSetPmProfile(UINT32 handle, tBTA_JV_PM_ID app_id,
+tBTA_JV_STATUS BTA_JvSetPmProfile(uint32_t handle, tBTA_JV_PM_ID app_id,
tBTA_JV_CONN_STATE init_st);
/*******************************************************************************
@@ -824,7 +824,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-UINT16 BTA_JvRfcommGetPortHdl(UINT32 handle);
+uint16_t BTA_JvRfcommGetPortHdl(uint32_t handle);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_jv_co.h b/bta/include/bta_jv_co.h
index 226d4f7..f8c7cf3 100644
--- a/bta/include/bta_jv_co.h
+++ b/bta/include/bta_jv_co.h
@@ -48,11 +48,11 @@
extern int bta_co_rfc_data_incoming(void *user_data, BT_HDR *p_buf);
extern int bta_co_rfc_data_outgoing_size(void *user_data, int *size);
-extern int bta_co_rfc_data_outgoing(void *user_data, UINT8* buf, UINT16 size);
+extern int bta_co_rfc_data_outgoing(void *user_data, uint8_t* buf, uint16_t size);
extern int bta_co_l2cap_data_incoming(void *user_data, BT_HDR *p_buf);
extern int bta_co_l2cap_data_outgoing_size(void *user_data, int *size);
-extern int bta_co_l2cap_data_outgoing(void *user_data, UINT8* buf, UINT16 size);
+extern int bta_co_l2cap_data_outgoing(void *user_data, uint8_t* buf, uint16_t size);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_mce_api.h b/bta/include/bta_mce_api.h
index c350390..eedf1d2 100644
--- a/bta/include/bta_mce_api.h
+++ b/bta/include/bta_mce_api.h
@@ -42,7 +42,7 @@
#define BTA_MCE_FAILURE 1 /* Generic failure. */
#define BTA_MCE_BUSY 2 /* Temporarily can not handle this request. */
-typedef UINT8 tBTA_MCE_STATUS;
+typedef uint8_t tBTA_MCE_STATUS;
/* MCE I/F callback events */
/* events received by tBTA_MCE_DM_CBACK */
@@ -52,15 +52,15 @@
#define BTA_MCE_MAX_MAS_INSTANCES 12
-typedef UINT16 tBTA_MCE_EVT;
+typedef uint16_t tBTA_MCE_EVT;
typedef struct
{
- UINT8 scn;
+ uint8_t scn;
char *p_srv_name;
- UINT16 srv_name_len;
- UINT8 instance_id;
- UINT8 msg_type;
+ uint16_t srv_name_len;
+ uint8_t instance_id;
+ uint8_t msg_type;
} tBTA_MCE_MAS_INFO;
/* data associated with BTA_MCE_MAS_DISCOVERY_COMP_EVT */
@@ -85,7 +85,7 @@
/* MCE configuration structure */
typedef struct
{
- UINT16 sdp_db_size; /* The size of p_sdp_db */
+ uint16_t sdp_db_size; /* The size of p_sdp_db */
tSDP_DISCOVERY_DB *p_sdp_db; /* The data buffer to keep SDP database */
} tBTA_MCE_CFG;
diff --git a/bta/include/bta_op_api.h b/bta/include/bta_op_api.h
index c26ea35..f8371bf 100644
--- a/bta/include/bta_op_api.h
+++ b/bta/include/bta_op_api.h
@@ -33,11 +33,11 @@
*****************************************************************************/
/* Extra Debug Code */
#ifndef BTA_OPS_DEBUG
-#define BTA_OPS_DEBUG FALSE
+#define BTA_OPS_DEBUG false
#endif
#ifndef BTA_OPC_DEBUG
-#define BTA_OPC_DEBUG FALSE
+#define BTA_OPC_DEBUG false
#endif
@@ -50,7 +50,7 @@
#define BTA_OP_VMSG_FMT 6 /* vMessage */
#define BTA_OP_OTHER_FMT 0xFF /* other format */
-typedef UINT8 tBTA_OP_FMT;
+typedef uint8_t tBTA_OP_FMT;
/* Object format mask */
#define BTA_OP_VCARD21_MASK 0x01 /* vCard 2.1 */
@@ -61,7 +61,7 @@
#define BTA_OP_VMSG_MASK 0x20 /* vMessage */
#define BTA_OP_ANY_MASK 0x40 /* Any type of object. */
-typedef UINT8 tBTA_OP_FMT_MASK;
+typedef uint8_t tBTA_OP_FMT_MASK;
#endif /* BTA_OP_API_H */
diff --git a/bta/include/bta_pan_api.h b/bta/include/bta_pan_api.h
index b595f8c..739c64e 100644
--- a/bta/include/bta_pan_api.h
+++ b/bta/include/bta_pan_api.h
@@ -39,7 +39,7 @@
#define BTA_PAN_SUCCESS 0
#define BTA_PAN_FAIL 1
-typedef UINT8 tBTA_PAN_STATUS;
+typedef uint8_t tBTA_PAN_STATUS;
/* PAN Callback events */
@@ -49,7 +49,7 @@
#define BTA_PAN_OPEN_EVT 3 /* Connection has been opened. */
#define BTA_PAN_CLOSE_EVT 4 /* Connection has been closed. */
-typedef UINT8 tBTA_PAN_EVT;
+typedef uint8_t tBTA_PAN_EVT;
/* pan roles */
@@ -58,13 +58,13 @@
#define BTA_PAN_ROLE_NAP PAN_ROLE_NAP_SERVER
-typedef UINT8 tBTA_PAN_ROLE;
+typedef uint8_t tBTA_PAN_ROLE;
/* information regarding PAN roles */
typedef struct
{
const char *p_srv_name; /* service name for the PAN role */
- UINT8 app_id; /* application id */
+ uint8_t app_id; /* application id */
tBTA_SEC sec_mask; /* security setting for the role */
} tBTA_PAN_ROLE_INFO;
@@ -81,7 +81,7 @@
typedef struct
{
BD_ADDR bd_addr; /* BD address of peer device. */
- UINT16 handle; /* Handle associated with this connection. */
+ uint16_t handle; /* Handle associated with this connection. */
} tBTA_PAN_OPENING;
@@ -90,7 +90,7 @@
typedef struct
{
BD_ADDR bd_addr; /* BD address of peer device. */
- UINT16 handle; /* Handle associated with this connection. */
+ uint16_t handle; /* Handle associated with this connection. */
tBTA_PAN_STATUS status; /* status of open event */
tBTA_PAN_ROLE local_role; /* Local device PAN role for the connection */
tBTA_PAN_ROLE peer_role; /* Peer device PAN role for the connection */
@@ -100,7 +100,7 @@
/* Event associated with BTA_PAN_CLOSE_EVT */
typedef struct
{
- UINT16 handle; /* Handle associated with the connection. */
+ uint16_t handle; /* Handle associated with the connection. */
} tBTA_PAN_CLOSE;
/* Union of all PAN callback structures */
@@ -190,7 +190,7 @@
** Returns void
**
*******************************************************************************/
-extern void BTA_PanClose(UINT16 handle);
+extern void BTA_PanClose(uint16_t handle);
#ifdef __cplusplus
diff --git a/bta/include/bta_pan_ci.h b/bta/include/bta_pan_ci.h
index df6bcbb..66b7241 100644
--- a/bta/include/bta_pan_ci.h
+++ b/bta/include/bta_pan_ci.h
@@ -47,7 +47,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_ci_tx_ready(UINT16 handle);
+extern void bta_pan_ci_tx_ready(uint16_t handle);
/*******************************************************************************
**
@@ -62,7 +62,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_ci_rx_ready(UINT16 handle);
+extern void bta_pan_ci_rx_ready(uint16_t handle);
/*******************************************************************************
**
@@ -79,7 +79,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_ci_tx_flow(UINT16 handle, BOOLEAN enable);
+extern void bta_pan_ci_tx_flow(uint16_t handle, bool enable);
/*******************************************************************************
**
@@ -92,10 +92,10 @@
** phone must not free the buffer.
**
**
-** Returns TRUE if flow enabled
+** Returns true if flow enabled
**
*******************************************************************************/
-extern void bta_pan_ci_rx_writebuf(UINT16 handle, BD_ADDR src, BD_ADDR dst, UINT16 protocol, BT_HDR *p_buf, BOOLEAN ext);
+extern void bta_pan_ci_rx_writebuf(uint16_t handle, BD_ADDR src, BD_ADDR dst, uint16_t protocol, BT_HDR *p_buf, bool ext);
/*******************************************************************************
**
@@ -110,8 +110,8 @@
** Returns void
**
*******************************************************************************/
-extern BT_HDR * bta_pan_ci_readbuf(UINT16 handle, BD_ADDR src, BD_ADDR dst, UINT16 *p_protocol,
- BOOLEAN* p_ext, BOOLEAN* p_forward);
+extern BT_HDR * bta_pan_ci_readbuf(uint16_t handle, BD_ADDR src, BD_ADDR dst, uint16_t *p_protocol,
+ bool* p_ext, bool* p_forward);
/*******************************************************************************
**
@@ -123,7 +123,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_ci_set_pfilters(UINT16 handle, UINT16 num_filters, UINT16 *p_start_array, UINT16 *p_end_array);
+extern void bta_pan_ci_set_pfilters(uint16_t handle, uint16_t num_filters, uint16_t *p_start_array, uint16_t *p_end_array);
/*******************************************************************************
@@ -136,8 +136,8 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_ci_set_mfilters(UINT16 handle, UINT16 num_mcast_filters, UINT8 *p_start_array,
- UINT8 *p_end_array);
+extern void bta_pan_ci_set_mfilters(uint16_t handle, uint16_t num_mcast_filters, uint8_t *p_start_array,
+ uint8_t *p_end_array);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_pan_co.h b/bta/include/bta_pan_co.h
index e9d7e6c..cf28eef 100644
--- a/bta/include/bta_pan_co.h
+++ b/bta/include/bta_pan_co.h
@@ -68,7 +68,7 @@
** Returns Data flow mask.
**
*******************************************************************************/
-extern UINT8 bta_pan_co_init(UINT8 *q_level);
+extern uint8_t bta_pan_co_init(uint8_t *q_level);
/*******************************************************************************
**
@@ -82,7 +82,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_co_open(UINT16 handle, UINT8 app_id, tBTA_PAN_ROLE local_role, tBTA_PAN_ROLE peer_role, BD_ADDR peer_addr);
+extern void bta_pan_co_open(uint16_t handle, uint8_t app_id, tBTA_PAN_ROLE local_role, tBTA_PAN_ROLE peer_role, BD_ADDR peer_addr);
/*******************************************************************************
**
@@ -95,7 +95,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_co_close(UINT16 handle, UINT8 app_id);
+extern void bta_pan_co_close(uint16_t handle, uint8_t app_id);
/*******************************************************************************
**
@@ -110,7 +110,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_co_tx_path(UINT16 handle, UINT8 app_id);
+extern void bta_pan_co_tx_path(uint16_t handle, uint8_t app_id);
/*******************************************************************************
**
@@ -125,7 +125,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_co_rx_path(UINT16 handle, UINT8 app_id);
+extern void bta_pan_co_rx_path(uint16_t handle, uint8_t app_id);
/*******************************************************************************
**
@@ -140,8 +140,8 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_co_tx_write(UINT16 handle, UINT8 app_id, BD_ADDR src, BD_ADDR dst, UINT16 protocol, UINT8 *p_data,
- UINT16 len, BOOLEAN ext, BOOLEAN forward);
+extern void bta_pan_co_tx_write(uint16_t handle, uint8_t app_id, BD_ADDR src, BD_ADDR dst, uint16_t protocol, uint8_t *p_data,
+ uint16_t len, bool ext, bool forward);
/*******************************************************************************
**
@@ -156,8 +156,8 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_co_tx_writebuf(UINT16 handle, UINT8 app_id, BD_ADDR src, BD_ADDR dst, UINT16 protocol, BT_HDR *p_buf,
- BOOLEAN ext, BOOLEAN forward);
+extern void bta_pan_co_tx_writebuf(uint16_t handle, uint8_t app_id, BD_ADDR src, BD_ADDR dst, uint16_t protocol, BT_HDR *p_buf,
+ bool ext, bool forward);
/*******************************************************************************
@@ -174,7 +174,7 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_co_rx_flow(UINT16 handle, UINT8 app_id, BOOLEAN enable);
+extern void bta_pan_co_rx_flow(uint16_t handle, uint8_t app_id, bool enable);
/*******************************************************************************
@@ -186,8 +186,8 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_co_pfilt_ind(UINT16 handle, BOOLEAN indication, tBTA_PAN_STATUS result,
- UINT16 len, UINT8 *p_filters);
+extern void bta_pan_co_pfilt_ind(uint16_t handle, bool indication, tBTA_PAN_STATUS result,
+ uint16_t len, uint8_t *p_filters);
/*******************************************************************************
**
@@ -198,8 +198,8 @@
** Returns void
**
*******************************************************************************/
-extern void bta_pan_co_mfilt_ind(UINT16 handle, BOOLEAN indication, tBTA_PAN_STATUS result,
- UINT16 len, UINT8 *p_filters);
+extern void bta_pan_co_mfilt_ind(uint16_t handle, bool indication, tBTA_PAN_STATUS result,
+ uint16_t len, uint8_t *p_filters);
#ifdef __cplusplus
}
diff --git a/bta/include/bta_sdp_api.h b/bta/include/bta_sdp_api.h
index 5beb8f6..2344bc1 100644
--- a/bta/include/bta_sdp_api.h
+++ b/bta/include/bta_sdp_api.h
@@ -39,7 +39,7 @@
#define BTA_SDP_FAILURE 1 /* Generic failure. */
#define BTA_SDP_BUSY 2 /* Temporarily can not handle this request. */
-typedef UINT8 tBTA_SDP_STATUS;
+typedef uint8_t tBTA_SDP_STATUS;
/* SDP I/F callback events */
/* events received by tBTA_SDP_DM_CBACK */
@@ -52,7 +52,7 @@
#define BTA_SDP_MAX_RECORDS 15
-typedef UINT16 tBTA_SDP_EVT;
+typedef uint16_t tBTA_SDP_EVT;
/* data associated with BTA_SDP_DISCOVERY_COMP_EVT */
typedef struct
@@ -76,7 +76,7 @@
/* MCE configuration structure */
typedef struct
{
- UINT16 sdp_db_size; /* The size of p_sdp_db */
+ uint16_t sdp_db_size; /* The size of p_sdp_db */
tSDP_DISCOVERY_DB *p_sdp_db; /* The data buffer to keep SDP database */
} tBTA_SDP_CFG;
diff --git a/bta/include/utl.h b/bta/include/utl.h
index 16d4a80..2b988ab 100644
--- a/bta/include/utl.h
+++ b/bta/include/utl.h
@@ -48,9 +48,9 @@
/** for utl_set_device_class() **/
typedef struct
{
- UINT8 minor;
- UINT8 major;
- UINT16 service;
+ uint8_t minor;
+ uint8_t major;
+ uint16_t service;
} tBTA_UTL_COD;
@@ -70,7 +70,7 @@
** Returns Integer value or -1 on error.
**
*******************************************************************************/
-extern INT16 utl_str2int(const char *p_s);
+extern int16_t utl_str2int(const char *p_s);
/*******************************************************************************
**
@@ -91,7 +91,7 @@
**
** Function utl_itoa
**
-** Description This utility function converts a UINT16 to a string. The
+** Description This utility function converts a uint16_t to a string. The
** string is NULL-terminated. The length of the string is
** returned.
**
@@ -99,7 +99,7 @@
** Returns Length of string.
**
*******************************************************************************/
-extern UINT8 utl_itoa(UINT16 i, char *p_s);
+extern uint8_t utl_itoa(uint16_t i, char *p_s);
/*******************************************************************************
**
@@ -117,10 +117,10 @@
** BTA_UTL_SET_COD_ALL - overwrite major, minor, set the bits in service class
** BTA_UTL_INIT_COD - overwrite major, minor, and service class
**
-** Returns TRUE if successful, Otherwise FALSE
+** Returns true if successful, Otherwise false
**
*******************************************************************************/
-extern BOOLEAN utl_set_device_class(tBTA_UTL_COD *p_cod, UINT8 cmd);
+extern bool utl_set_device_class(tBTA_UTL_COD *p_cod, uint8_t cmd);
/*******************************************************************************
**
@@ -130,10 +130,10 @@
** integer string or not
**
**
-** Returns TRUE if successful, Otherwise FALSE
+** Returns true if successful, Otherwise false
**
*******************************************************************************/
-extern BOOLEAN utl_isintstr(const char *p_s);
+extern bool utl_isintstr(const char *p_s);
/*******************************************************************************
**
@@ -143,10 +143,10 @@
** only dial digits or not
**
**
-** Returns TRUE if successful, Otherwise FALSE
+** Returns true if successful, Otherwise false
**
*******************************************************************************/
-extern BOOLEAN utl_isdialstr(const char *p_s);
+extern bool utl_isdialstr(const char *p_s);
#ifdef __cplusplus
}
diff --git a/bta/jv/bta_jv_act.c b/bta/jv/bta_jv_act.c
index 3918fdf..5927c21 100644
--- a/bta/jv/bta_jv_act.c
+++ b/bta/jv/bta_jv_act.c
@@ -79,9 +79,9 @@
static uint32_t fc_next_id;
-static void fcchan_conn_chng_cbk(UINT16 chan, BD_ADDR bd_addr, BOOLEAN connected,
- UINT16 reason, tBT_TRANSPORT );
-static void fcchan_data_cbk(UINT16 chan, BD_ADDR bd_addr, BT_HDR *p_buf);
+static void fcchan_conn_chng_cbk(uint16_t chan, BD_ADDR bd_addr, bool connected,
+ uint16_t reason, tBT_TRANSPORT );
+static void fcchan_data_cbk(uint16_t chan, BD_ADDR bd_addr, BT_HDR *p_buf);
extern void uuid_to_string_legacy(bt_uuid_t *p_uuid, char *str);
@@ -94,7 +94,7 @@
static tBTA_JV_PCB * bta_jv_add_rfc_port(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pcb_open);
-static tBTA_JV_STATUS bta_jv_free_set_pm_profile_cb(UINT32 jv_handle);
+static tBTA_JV_STATUS bta_jv_free_set_pm_profile_cb(uint32_t jv_handle);
static void bta_jv_pm_conn_busy(tBTA_JV_PM_CB *p_cb);
static void bta_jv_pm_conn_idle(tBTA_JV_PM_CB *p_cb);
static void bta_jv_pm_state_change(tBTA_JV_PM_CB *p_cb, const tBTA_JV_CONN_STATE state);
@@ -110,9 +110,9 @@
** Returns
**
*******************************************************************************/
-UINT8 bta_jv_alloc_sec_id(void)
+uint8_t bta_jv_alloc_sec_id(void)
{
- UINT8 ret = 0;
+ uint8_t ret = 0;
int i;
for(i=0; i<BTA_JV_NUM_SERVICE_ID; i++)
{
@@ -164,9 +164,9 @@
** Returns
**
*******************************************************************************/
-static void bta_jv_free_sec_id(UINT8 *p_sec_id)
+static void bta_jv_free_sec_id(uint8_t *p_sec_id)
{
- UINT8 sec_id = *p_sec_id;
+ uint8_t sec_id = *p_sec_id;
*p_sec_id = 0;
if(sec_id >= BTA_JV_FIRST_SERVICE_ID && sec_id <= BTA_JV_LAST_SERVICE_ID)
{
@@ -184,7 +184,7 @@
** Returns
**
*******************************************************************************/
-tBTA_JV_RFC_CB * bta_jv_alloc_rfc_cb(UINT16 port_handle, tBTA_JV_PCB **pp_pcb)
+tBTA_JV_RFC_CB * bta_jv_alloc_rfc_cb(uint16_t port_handle, tBTA_JV_PCB **pp_pcb)
{
tBTA_JV_RFC_CB *p_cb = NULL;
tBTA_JV_PCB *p_pcb;
@@ -230,7 +230,7 @@
** Returns
**
*******************************************************************************/
-tBTA_JV_PCB * bta_jv_rfc_port_to_pcb(UINT16 port_handle)
+tBTA_JV_PCB * bta_jv_rfc_port_to_pcb(uint16_t port_handle)
{
tBTA_JV_PCB *p_pcb = NULL;
@@ -252,10 +252,10 @@
** Returns
**
*******************************************************************************/
-tBTA_JV_RFC_CB * bta_jv_rfc_port_to_cb(UINT16 port_handle)
+tBTA_JV_RFC_CB * bta_jv_rfc_port_to_cb(uint16_t port_handle)
{
tBTA_JV_RFC_CB *p_cb = NULL;
- UINT32 handle;
+ uint32_t handle;
if ((port_handle > 0) && (port_handle <= MAX_RFC_PORTS)
&& bta_jv_cb.port_cb[port_handle - 1].handle)
@@ -277,7 +277,7 @@
static tBTA_JV_STATUS bta_jv_free_rfc_cb(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pcb)
{
tBTA_JV_STATUS status = BTA_JV_SUCCESS;
- BOOLEAN remove_server = FALSE;
+ bool remove_server = false;
int close_pending = 0;
if (!p_cb || !p_pcb)
@@ -309,7 +309,7 @@
break;
case BTA_JV_ST_SR_LISTEN:
p_pcb->state = BTA_JV_ST_SR_CLOSING;
- remove_server = TRUE;
+ remove_server = true;
APPL_TRACE_DEBUG("bta_jv_free_sr_rfc_cb: state: BTA_JV_ST_SR_LISTEN, scn:%d,"
" user_data:%p", p_cb->scn, p_pcb->user_data);
break;
@@ -350,7 +350,7 @@
bta_jv_free_set_pm_profile_cb(p_pcb->handle);
//Initialize congestion flags
- p_pcb->cong = FALSE;
+ p_pcb->cong = false;
p_pcb->user_data = 0;
int si = BTA_JV_RFC_HDL_TO_SIDX(p_pcb->handle);
if (0 <= si && si < BTA_JV_MAX_RFC_SR_SESSION)
@@ -387,13 +387,13 @@
if(BTA_JV_ST_NONE != p_cb->state)
{
- bta_jv_free_set_pm_profile_cb((UINT32)p_cb->handle);
+ bta_jv_free_set_pm_profile_cb((uint32_t)p_cb->handle);
if (GAP_ConnClose(p_cb->handle) != BT_PASS)
status = BTA_JV_FAILURE;
}
p_cb->psm = 0;
p_cb->state = BTA_JV_ST_NONE;
- p_cb->cong = FALSE;
+ p_cb->cong = false;
bta_jv_free_sec_id(&p_cb->sec_id);
p_cb->p_cback = NULL;
return status;
@@ -405,13 +405,13 @@
** Function bta_jv_clear_pm_cb
**
** Description clears jv pm control block and optionally calls bta_sys_conn_close()
-** In general close_conn should be set to TRUE to remove registering with
+** In general close_conn should be set to true to remove registering with
** dm pm!
**
** WARNING: Make sure to clear pointer form port or l2c to this control block too!
**
*******************************************************************************/
-static void bta_jv_clear_pm_cb(tBTA_JV_PM_CB *p_pm_cb, BOOLEAN close_conn)
+static void bta_jv_clear_pm_cb(tBTA_JV_PM_CB *p_pm_cb, bool close_conn)
{
/* needs to be called if registered with bta pm, otherwise we may run out of dm pm slots! */
if (close_conn)
@@ -432,7 +432,7 @@
** BTA_JV_FAILURE in case of no profile has been registered or already freed
**
*******************************************************************************/
-static tBTA_JV_STATUS bta_jv_free_set_pm_profile_cb(UINT32 jv_handle)
+static tBTA_JV_STATUS bta_jv_free_set_pm_profile_cb(uint32_t jv_handle)
{
tBTA_JV_STATUS status = BTA_JV_FAILURE;
tBTA_JV_PM_CB **p_cb;
@@ -463,17 +463,17 @@
if (bd_counter <= 1 || (appid_counter <= 1))
{
- bta_jv_clear_pm_cb(&bta_jv_cb.pm_cb[i], TRUE);
+ bta_jv_clear_pm_cb(&bta_jv_cb.pm_cb[i], true);
}
else
{
- bta_jv_clear_pm_cb(&bta_jv_cb.pm_cb[i], FALSE);
+ bta_jv_clear_pm_cb(&bta_jv_cb.pm_cb[i], false);
}
if (BTA_JV_RFCOMM_MASK & jv_handle)
{
- UINT32 hi = ((jv_handle & BTA_JV_RFC_HDL_MASK) & ~BTA_JV_RFCOMM_MASK) - 1;
- UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(jv_handle);
+ uint32_t hi = ((jv_handle & BTA_JV_RFC_HDL_MASK) & ~BTA_JV_RFCOMM_MASK) - 1;
+ uint32_t si = BTA_JV_RFC_HDL_TO_SIDX(jv_handle);
if (hi < BTA_JV_MAX_RFC_CONN && bta_jv_cb.rfc_cb[hi].p_cback && si
< BTA_JV_MAX_RFC_SR_SESSION && bta_jv_cb.rfc_cb[hi].rfc_hdl[si])
{
@@ -518,9 +518,9 @@
** Returns pointer to allocated cb or NULL in case of failure
**
*******************************************************************************/
-static tBTA_JV_PM_CB *bta_jv_alloc_set_pm_profile_cb(UINT32 jv_handle, tBTA_JV_PM_ID app_id)
+static tBTA_JV_PM_CB *bta_jv_alloc_set_pm_profile_cb(uint32_t jv_handle, tBTA_JV_PM_ID app_id)
{
- BOOLEAN bRfcHandle = (jv_handle & BTA_JV_RFCOMM_MASK) != 0;
+ bool bRfcHandle = (jv_handle & BTA_JV_RFCOMM_MASK) != 0;
BD_ADDR peer_bd_addr;
int i, j;
tBTA_JV_PM_CB **pp_cb;
@@ -553,7 +553,7 @@
if (jv_handle == bta_jv_cb.l2c_cb[j].handle)
{
pp_cb = &bta_jv_cb.l2c_cb[j].p_pm_cb;
- UINT8 *p_bd_addr = GAP_ConnGetRemoteAddr((UINT16)jv_handle);
+ uint8_t *p_bd_addr = GAP_ConnGetRemoteAddr((uint16_t)jv_handle);
if (NULL != p_bd_addr)
bdcpy(peer_bd_addr, p_bd_addr);
else
@@ -589,12 +589,12 @@
**
** Description for now use only the legal PSM per JSR82 spec
**
-** Returns TRUE, if allowed
+** Returns true, if allowed
**
*******************************************************************************/
-BOOLEAN bta_jv_check_psm(UINT16 psm)
+bool bta_jv_check_psm(uint16_t psm)
{
- BOOLEAN ret = FALSE;
+ bool ret = false;
if (L2C_IS_VALID_PSM(psm))
{
@@ -610,39 +610,39 @@
case TCS_PSM_INTERCOM: /* 5 */
case TCS_PSM_CORDLESS: /* 7 */
- if( FALSE == bta_sys_is_register(BTA_ID_CT) &&
- FALSE == bta_sys_is_register(BTA_ID_CG) )
- ret = TRUE;
+ if( false == bta_sys_is_register(BTA_ID_CT) &&
+ false == bta_sys_is_register(BTA_ID_CG) )
+ ret = true;
break;
case BT_PSM_BNEP: /* F */
- if(FALSE == bta_sys_is_register(BTA_ID_PAN))
- ret = TRUE;
+ if(false == bta_sys_is_register(BTA_ID_PAN))
+ ret = true;
break;
case HID_PSM_CONTROL: /* 0x11 */
case HID_PSM_INTERRUPT: /* 0x13 */
//FIX: allow HID Device and HID Host to coexist
- if( FALSE == bta_sys_is_register(BTA_ID_HD) ||
- FALSE == bta_sys_is_register(BTA_ID_HH) )
- ret = TRUE;
+ if( false == bta_sys_is_register(BTA_ID_HD) ||
+ false == bta_sys_is_register(BTA_ID_HH) )
+ ret = true;
break;
case AVCT_PSM: /* 0x17 */
case AVDT_PSM: /* 0x19 */
- if ((FALSE == bta_sys_is_register(BTA_ID_AV)) &&
- (FALSE == bta_sys_is_register(BTA_ID_AVK)))
- ret = TRUE;
+ if ((false == bta_sys_is_register(BTA_ID_AV)) &&
+ (false == bta_sys_is_register(BTA_ID_AVK)))
+ ret = true;
break;
default:
- ret = TRUE;
+ ret = true;
break;
}
}
else
{
- ret = TRUE;
+ ret = true;
}
}
return ret;
@@ -690,10 +690,10 @@
* list.
* If no free PSMs exist, 0 will be returned.
*/
-static UINT16 bta_jv_get_free_psm() {
+static uint16_t bta_jv_get_free_psm() {
const int cnt = sizeof(bta_jv_cb.free_psm_list)/sizeof(bta_jv_cb.free_psm_list[0]);
for (int i = 0; i < cnt; i++) {
- UINT16 psm = bta_jv_cb.free_psm_list[i];
+ uint16_t psm = bta_jv_cb.free_psm_list[i];
if (psm != 0) {
APPL_TRACE_DEBUG("%s(): Reusing PSM: 0x%04d", __func__, psm)
bta_jv_cb.free_psm_list[i] = 0;
@@ -703,7 +703,7 @@
return 0;
}
-static void bta_jv_set_free_psm(UINT16 psm) {
+static void bta_jv_set_free_psm(uint16_t psm) {
int free_index = -1;
const int cnt = sizeof(bta_jv_cb.free_psm_list)/sizeof(bta_jv_cb.free_psm_list[0]);
for (int i = 0; i < cnt; i++) {
@@ -733,15 +733,15 @@
*******************************************************************************/
void bta_jv_get_channel_id(tBTA_JV_MSG *p_data)
{
- UINT16 psm = 0;
+ uint16_t psm = 0;
switch (p_data->alloc_channel.type) {
case BTA_JV_CONN_TYPE_RFCOMM: {
- INT32 channel = p_data->alloc_channel.channel;
- UINT8 scn = 0;
+ int32_t channel = p_data->alloc_channel.channel;
+ uint8_t scn = 0;
if (channel > 0)
{
- if (BTM_TryAllocateSCN(channel) == FALSE)
+ if (BTM_TryAllocateSCN(channel) == false)
{
APPL_TRACE_ERROR("rfc channel:%d already in use or invalid", channel);
channel = 0;
@@ -751,8 +751,8 @@
channel = 0;
}
if (channel != 0) {
- bta_jv_cb.scn[channel-1] = TRUE;
- scn = (UINT8) channel;
+ bta_jv_cb.scn[channel-1] = true;
+ scn = (uint8_t) channel;
}
if (bta_jv_cb.p_dm_cback)
bta_jv_cb.p_dm_cback(BTA_JV_GET_SCN_EVT, (tBTA_JV *)&scn,
@@ -787,14 +787,14 @@
*******************************************************************************/
void bta_jv_free_scn(tBTA_JV_MSG *p_data)
{
- UINT16 scn = p_data->free_channel.scn;
+ uint16_t scn = p_data->free_channel.scn;
switch (p_data->free_channel.type) {
case BTA_JV_CONN_TYPE_RFCOMM: {
if (scn > 0 && scn <= BTA_JV_MAX_SCN && bta_jv_cb.scn[scn-1])
{
/* this scn is used by JV */
- bta_jv_cb.scn[scn-1] = FALSE;
+ bta_jv_cb.scn[scn-1] = false;
BTM_FreeSCN(scn);
}
break;
@@ -854,7 +854,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_jv_start_discovery_cback(UINT16 result, void * user_data)
+static void bta_jv_start_discovery_cback(uint16_t result, void * user_data)
{
tBTA_JV_STATUS status;
@@ -877,7 +877,7 @@
APPL_TRACE_DEBUG("p_sdp_rec:%p", p_sdp_rec);
if (p_sdp_rec && SDP_FindProtocolListElemInRec(p_sdp_rec, UUID_PROTOCOL_RFCOMM, &pe))
{
- dcomp.scn = (UINT8) pe.params[0];
+ dcomp.scn = (uint8_t) pe.params[0];
status = BTA_JV_SUCCESS;
}
}
@@ -985,7 +985,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_jv_l2cap_client_cback(UINT16 gap_handle, UINT16 event)
+static void bta_jv_l2cap_client_cback(uint16_t gap_handle, uint16_t event)
{
tBTA_JV_L2C_CB *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
tBTA_JV evt_data;
@@ -1009,7 +1009,7 @@
case GAP_EVT_CONN_CLOSED:
p_cb->state = BTA_JV_ST_NONE;
bta_jv_free_sec_id(&p_cb->sec_id);
- evt_data.l2c_close.async = TRUE;
+ evt_data.l2c_close.async = true;
p_cb->p_cback(BTA_JV_L2CAP_CLOSE_EVT, &evt_data, p_cb->user_data);
p_cb->p_cback = NULL;
break;
@@ -1028,7 +1028,7 @@
case GAP_EVT_CONN_CONGESTED:
case GAP_EVT_CONN_UNCONGESTED:
- p_cb->cong = (event == GAP_EVT_CONN_CONGESTED) ? TRUE : FALSE;
+ p_cb->cong = (event == GAP_EVT_CONN_CONGESTED) ? true : false;
evt_data.l2c_cong.cong = p_cb->cong;
p_cb->p_cback(BTA_JV_L2CAP_CONG_EVT, &evt_data, p_cb->user_data);
break;
@@ -1051,16 +1051,16 @@
{
tBTA_JV_L2C_CB *p_cb;
tBTA_JV_L2CAP_CL_INIT evt_data;
- UINT16 handle=GAP_INVALID_HANDLE;
- UINT8 sec_id;
+ uint16_t handle=GAP_INVALID_HANDLE;
+ uint8_t sec_id;
tL2CAP_CFG_INFO cfg;
tBTA_JV_API_L2CAP_CONNECT *cc = &(p_data->l2cap_connect);
- UINT8 chan_mode_mask = GAP_FCR_CHAN_OPT_BASIC;
+ uint8_t chan_mode_mask = GAP_FCR_CHAN_OPT_BASIC;
tL2CAP_ERTM_INFO *ertm_info = NULL;
memset(&cfg, 0, sizeof(tL2CAP_CFG_INFO));
- if (cc->has_cfg == TRUE)
+ if (cc->has_cfg == true)
{
cfg = cc->cfg;
if (cfg.fcr_present && cfg.fcr.mode == L2CAP_FCR_ERTM_MODE) {
@@ -1068,13 +1068,13 @@
}
}
- if (cc->has_ertm_info == TRUE)
+ if (cc->has_ertm_info == true)
{
ertm_info = &(cc->ertm_info);
}
/* We need to use this value for MTU to be able to handle cases where cfg is not set in req. */
- cfg.mtu_present = TRUE;
+ cfg.mtu_present = true;
cfg.mtu = cc->rx_mtu;
/* TODO: DM role manager
@@ -1137,7 +1137,7 @@
evt_data.handle = cc->handle;
evt_data.status = bta_jv_free_l2c_cb(cc->p_cb);
- evt_data.async = FALSE;
+ evt_data.async = false;
if (p_cback)
p_cback(BTA_JV_L2CAP_CLOSE_EVT, (tBTA_JV *)&evt_data, user_data);
@@ -1152,7 +1152,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_jv_l2cap_server_cback(UINT16 gap_handle, UINT16 event)
+static void bta_jv_l2cap_server_cback(uint16_t gap_handle, uint16_t event)
{
tBTA_JV_L2C_CB *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
tBTA_JV evt_data;
@@ -1176,7 +1176,7 @@
break;
case GAP_EVT_CONN_CLOSED:
- evt_data.l2c_close.async = TRUE;
+ evt_data.l2c_close.async = true;
evt_data.l2c_close.handle = p_cb->handle;
p_cback = p_cb->p_cback;
user_data = p_cb->user_data;
@@ -1198,7 +1198,7 @@
case GAP_EVT_CONN_CONGESTED:
case GAP_EVT_CONN_UNCONGESTED:
- p_cb->cong = (event == GAP_EVT_CONN_CONGESTED) ? TRUE : FALSE;
+ p_cb->cong = (event == GAP_EVT_CONN_CONGESTED) ? true : false;
evt_data.l2c_cong.cong = p_cb->cong;
p_cb->p_cback(BTA_JV_L2CAP_CONG_EVT, &evt_data, p_cb->user_data);
break;
@@ -1220,36 +1220,36 @@
void bta_jv_l2cap_start_server(tBTA_JV_MSG *p_data)
{
tBTA_JV_L2C_CB *p_cb;
- UINT8 sec_id;
- UINT16 handle;
+ uint8_t sec_id;
+ uint16_t handle;
tL2CAP_CFG_INFO cfg;
tBTA_JV_L2CAP_START evt_data;
tBTA_JV_API_L2CAP_SERVER *ls = &(p_data->l2cap_server);
- UINT8 chan_mode_mask = GAP_FCR_CHAN_OPT_BASIC;
+ uint8_t chan_mode_mask = GAP_FCR_CHAN_OPT_BASIC;
tL2CAP_ERTM_INFO *ertm_info = NULL;
memset(&cfg, 0, sizeof(tL2CAP_CFG_INFO));
- if (ls->has_cfg == TRUE) {
+ if (ls->has_cfg == true) {
cfg = ls->cfg;
if (cfg.fcr_present && cfg.fcr.mode == L2CAP_FCR_ERTM_MODE) {
chan_mode_mask = GAP_FCR_CHAN_OPT_ERTM;
}
}
- if (ls->has_ertm_info == TRUE) {
+ if (ls->has_ertm_info == true) {
ertm_info = &(ls->ertm_info);
}
//FIX: MTU=0 means not present
if (ls->rx_mtu >0)
{
- cfg.mtu_present = TRUE;
+ cfg.mtu_present = true;
cfg.mtu = ls->rx_mtu;
}
else
{
- cfg.mtu_present = FALSE;
+ cfg.mtu_present = false;
cfg.mtu = 0;
}
@@ -1259,7 +1259,7 @@
sec_id = bta_jv_alloc_sec_id();
/* PSM checking is not required for LE COC */
- if (0 == sec_id || ((ls->type == BTA_JV_CONN_TYPE_L2CAP) && (FALSE == bta_jv_check_psm(ls->local_psm))) ||
+ if (0 == sec_id || ((ls->type == BTA_JV_CONN_TYPE_L2CAP) && (false == bta_jv_check_psm(ls->local_psm))) ||
(handle = GAP_ConnOpen("JV L2CAP", sec_id, 1, 0, ls->local_psm, &cfg, ertm_info,
ls->sec_mask, chan_mode_mask, bta_jv_l2cap_server_cback, ls->type)) == GAP_INVALID_HANDLE)
{
@@ -1308,7 +1308,7 @@
user_data = p_cb->user_data;
evt_data.handle = p_cb->handle;
evt_data.status = bta_jv_free_l2c_cb(p_cb);
- evt_data.async = FALSE;
+ evt_data.async = false;
p_cback(BTA_JV_L2CAP_CLOSE_EVT, (tBTA_JV *)&evt_data, user_data);
break;
}
@@ -1434,7 +1434,7 @@
** Returns void
**
*******************************************************************************/
-static int bta_jv_port_data_co_cback(UINT16 port_handle, UINT8 *buf, UINT16 len, int type)
+static int bta_jv_port_data_co_cback(uint16_t port_handle, uint8_t *buf, uint16_t len, int type)
{
tBTA_JV_RFC_CB *p_cb = bta_jv_rfc_port_to_cb(port_handle);
tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
@@ -1467,13 +1467,13 @@
** Returns void
**
*******************************************************************************/
-static void bta_jv_port_mgmt_cl_cback(UINT32 code, UINT16 port_handle)
+static void bta_jv_port_mgmt_cl_cback(uint32_t code, uint16_t port_handle)
{
tBTA_JV_RFC_CB *p_cb = bta_jv_rfc_port_to_cb(port_handle);
tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
tBTA_JV evt_data;
BD_ADDR rem_bda;
- UINT16 lcid;
+ uint16_t lcid;
tBTA_JV_RFCOMM_CBACK *p_cback; /* the callback function */
APPL_TRACE_DEBUG( "bta_jv_port_mgmt_cl_cback:code:%d, port_handle%d", code, port_handle);
@@ -1498,13 +1498,13 @@
evt_data.rfc_close.handle = p_cb->handle;
evt_data.rfc_close.status = BTA_JV_FAILURE;
evt_data.rfc_close.port_status = code;
- evt_data.rfc_close.async = TRUE;
+ evt_data.rfc_close.async = true;
if (p_pcb->state == BTA_JV_ST_CL_CLOSING)
{
- evt_data.rfc_close.async = FALSE;
+ evt_data.rfc_close.async = false;
}
//p_pcb->state = BTA_JV_ST_NONE;
- //p_pcb->cong = FALSE;
+ //p_pcb->cong = false;
p_cback = p_cb->p_cback;
p_cback(BTA_JV_RFCOMM_CLOSE_EVT, &evt_data, p_pcb->user_data);
//bta_jv_free_rfc_cb(p_cb, p_pcb);
@@ -1521,7 +1521,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_jv_port_event_cl_cback(UINT32 code, UINT16 port_handle)
+static void bta_jv_port_event_cl_cback(uint32_t code, uint16_t port_handle)
{
tBTA_JV_RFC_CB *p_cb = bta_jv_rfc_port_to_cb(port_handle);
tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
@@ -1541,7 +1541,7 @@
if (code & PORT_EV_FC)
{
- p_pcb->cong = (code & PORT_EV_FCS) ? FALSE : TRUE;
+ p_pcb->cong = (code & PORT_EV_FCS) ? false : true;
evt_data.rfc_cong.cong = p_pcb->cong;
evt_data.rfc_cong.handle = p_cb->handle;
evt_data.rfc_cong.status = BTA_JV_SUCCESS;
@@ -1565,10 +1565,10 @@
*******************************************************************************/
void bta_jv_rfcomm_connect(tBTA_JV_MSG *p_data)
{
- UINT16 handle = 0;
- UINT32 event_mask = BTA_JV_RFC_EV_MASK;
+ uint16_t handle = 0;
+ uint32_t event_mask = BTA_JV_RFC_EV_MASK;
tPORT_STATE port_state;
- UINT8 sec_id = 0;
+ uint8_t sec_id = 0;
tBTA_JV_RFC_CB *p_cb = NULL;
tBTA_JV_PCB *p_pcb;
tBTA_JV_API_RFCOMM_CONNECT *cc = &(p_data->rfcomm_connect);
@@ -1583,15 +1583,15 @@
evt_data.sec_id = sec_id;
evt_data.status = BTA_JV_SUCCESS;
if (0 == sec_id ||
- BTM_SetSecurityLevel(TRUE, "", sec_id, cc->sec_mask, BT_PSM_RFCOMM,
- BTM_SEC_PROTO_RFCOMM, cc->remote_scn) == FALSE)
+ BTM_SetSecurityLevel(true, "", sec_id, cc->sec_mask, BT_PSM_RFCOMM,
+ BTM_SEC_PROTO_RFCOMM, cc->remote_scn) == false)
{
evt_data.status = BTA_JV_FAILURE;
APPL_TRACE_ERROR("sec_id:%d is zero or BTM_SetSecurityLevel failed, remote_scn:%d", sec_id, cc->remote_scn);
}
if (evt_data.status == BTA_JV_SUCCESS &&
- RFCOMM_CreateConnection(UUID_SERVCLASS_SERIAL_PORT, cc->remote_scn, FALSE,
+ RFCOMM_CreateConnection(UUID_SERVCLASS_SERIAL_PORT, cc->remote_scn, false,
BTA_JV_DEF_RFC_MTU, cc->peer_bd_addr, &handle, bta_jv_port_mgmt_cl_cback) != PORT_SUCCESS)
{
APPL_TRACE_ERROR("bta_jv_rfcomm_connect, RFCOMM_CreateConnection failed");
@@ -1607,7 +1607,7 @@
p_cb->scn = 0;
p_pcb->state = BTA_JV_ST_CL_OPENING;
p_pcb->user_data = cc->user_data;
- evt_data.use_co = TRUE;
+ evt_data.use_co = true;
PORT_SetEventCallback(handle, bta_jv_port_event_cl_cback);
PORT_SetEventMask(handle, event_mask);
@@ -1618,7 +1618,7 @@
port_state.fc_type = (PORT_FC_CTS_ON_INPUT | PORT_FC_CTS_ON_OUTPUT);
/* coverity[uninit_use_in_call]
- FALSE-POSITIVE: port_state is initialized at PORT_GetState() */
+ false-POSITIVE: port_state is initialized at PORT_GetState() */
PORT_SetState(handle, &port_state);
evt_data.handle = p_cb->handle;
@@ -1646,7 +1646,7 @@
int i;
for (i = 0; i < MAX_RFC_PORTS; i++)
{
- UINT32 rfc_handle = bta_jv_cb.port_cb[i].handle & BTA_JV_RFC_HDL_MASK;
+ uint32_t rfc_handle = bta_jv_cb.port_cb[i].handle & BTA_JV_RFC_HDL_MASK;
rfc_handle &= ~BTA_JV_RFCOMM_MASK;
if (rfc_handle && bta_jv_cb.port_cb[i].user_data == user_data)
{
@@ -1701,13 +1701,13 @@
** Returns void
**
*******************************************************************************/
-static void bta_jv_port_mgmt_sr_cback(UINT32 code, UINT16 port_handle)
+static void bta_jv_port_mgmt_sr_cback(uint32_t code, uint16_t port_handle)
{
tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
tBTA_JV_RFC_CB *p_cb = bta_jv_rfc_port_to_cb(port_handle);
tBTA_JV evt_data;
BD_ADDR rem_bda;
- UINT16 lcid;
+ uint16_t lcid;
APPL_TRACE_DEBUG("bta_jv_port_mgmt_sr_cback, code:%d, port_handle:%d", code, port_handle);
if (NULL == p_cb || NULL == p_cb->p_cback)
{
@@ -1720,7 +1720,7 @@
code, port_handle, p_cb->handle, p_pcb, p_pcb->user_data);
PORT_CheckConnection(port_handle, rem_bda, &lcid);
- int failed = TRUE;
+ int failed = true;
if (code == PORT_SUCCESS)
{
evt_data.rfc_srv_open.handle = p_pcb->handle;
@@ -1732,7 +1732,7 @@
evt_data.rfc_srv_open.new_listen_handle = p_pcb_new_listen->handle;
p_pcb_new_listen->user_data = p_cb->p_cback(BTA_JV_RFCOMM_SRV_OPEN_EVT, &evt_data, user_data);
APPL_TRACE_DEBUG("PORT_SUCCESS: curr_sess:%d, max_sess:%d", p_cb->curr_sess, p_cb->max_sess);
- failed = FALSE;
+ failed = false;
}
else
APPL_TRACE_ERROR("bta_jv_add_rfc_port failed to create new listen port");
@@ -1741,16 +1741,16 @@
{
evt_data.rfc_close.handle = p_cb->handle;
evt_data.rfc_close.status = BTA_JV_FAILURE;
- evt_data.rfc_close.async = TRUE;
+ evt_data.rfc_close.async = true;
evt_data.rfc_close.port_status = code;
- p_pcb->cong = FALSE;
+ p_pcb->cong = false;
tBTA_JV_RFCOMM_CBACK *p_cback = p_cb->p_cback;
APPL_TRACE_DEBUG("PORT_CLOSED before BTA_JV_RFCOMM_CLOSE_EVT: curr_sess:%d, max_sess:%d",
p_cb->curr_sess, p_cb->max_sess);
if (BTA_JV_ST_SR_CLOSING == p_pcb->state)
{
- evt_data.rfc_close.async = FALSE;
+ evt_data.rfc_close.async = false;
evt_data.rfc_close.status = BTA_JV_SUCCESS;
}
//p_pcb->state = BTA_JV_ST_NONE;
@@ -1771,7 +1771,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_jv_port_event_sr_cback(UINT32 code, UINT16 port_handle)
+static void bta_jv_port_event_sr_cback(uint32_t code, uint16_t port_handle)
{
tBTA_JV_PCB *p_pcb = bta_jv_rfc_port_to_pcb(port_handle);
tBTA_JV_RFC_CB *p_cb = bta_jv_rfc_port_to_cb(port_handle);
@@ -1792,7 +1792,7 @@
if (code & PORT_EV_FC)
{
- p_pcb->cong = (code & PORT_EV_FCS) ? FALSE : TRUE;
+ p_pcb->cong = (code & PORT_EV_FCS) ? false : true;
evt_data.rfc_cong.cong = p_pcb->cong;
evt_data.rfc_cong.handle = p_cb->handle;
evt_data.rfc_cong.status = BTA_JV_SUCCESS;
@@ -1816,10 +1816,10 @@
*******************************************************************************/
static tBTA_JV_PCB * bta_jv_add_rfc_port(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pcb_open)
{
- UINT8 used = 0, i, listen=0;
- UINT32 si = 0;
+ uint8_t used = 0, i, listen=0;
+ uint32_t si = 0;
tPORT_STATE port_state;
- UINT32 event_mask = BTA_JV_RFC_EV_MASK;
+ uint32_t event_mask = BTA_JV_RFC_EV_MASK;
tBTA_JV_PCB *p_pcb = NULL;
if (p_cb->max_sess > 1)
{
@@ -1859,8 +1859,8 @@
if (used < p_cb->max_sess && listen == 1 && si)
{
si--;
- if (RFCOMM_CreateConnection(p_cb->sec_id, p_cb->scn, TRUE,
- BTA_JV_DEF_RFC_MTU, (UINT8 *) bd_addr_any, &(p_cb->rfc_hdl[si]), bta_jv_port_mgmt_sr_cback) == PORT_SUCCESS)
+ if (RFCOMM_CreateConnection(p_cb->sec_id, p_cb->scn, true,
+ BTA_JV_DEF_RFC_MTU, (uint8_t *) bd_addr_any, &(p_cb->rfc_hdl[si]), bta_jv_port_mgmt_sr_cback) == PORT_SUCCESS)
{
p_cb->curr_sess++;
p_pcb = &bta_jv_cb.port_cb[p_cb->rfc_hdl[si] - 1];
@@ -1902,10 +1902,10 @@
*******************************************************************************/
void bta_jv_rfcomm_start_server(tBTA_JV_MSG *p_data)
{
- UINT16 handle = 0;
- UINT32 event_mask = BTA_JV_RFC_EV_MASK;
+ uint16_t handle = 0;
+ uint32_t event_mask = BTA_JV_RFC_EV_MASK;
tPORT_STATE port_state;
- UINT8 sec_id = 0;
+ uint8_t sec_id = 0;
tBTA_JV_RFC_CB *p_cb = NULL;
tBTA_JV_PCB *p_pcb;
tBTA_JV_API_RFCOMM_SERVER *rs = &(p_data->rfcomm_server);
@@ -1924,15 +1924,15 @@
sec_id = bta_jv_alloc_sec_id();
if (0 == sec_id ||
- BTM_SetSecurityLevel(FALSE, "JV PORT", sec_id, rs->sec_mask,
- BT_PSM_RFCOMM, BTM_SEC_PROTO_RFCOMM, rs->local_scn) == FALSE)
+ BTM_SetSecurityLevel(false, "JV PORT", sec_id, rs->sec_mask,
+ BT_PSM_RFCOMM, BTM_SEC_PROTO_RFCOMM, rs->local_scn) == false)
{
APPL_TRACE_ERROR("bta_jv_rfcomm_start_server, run out of sec_id");
break;
}
- if (RFCOMM_CreateConnection(sec_id, rs->local_scn, TRUE,
- BTA_JV_DEF_RFC_MTU, (UINT8 *) bd_addr_any, &handle, bta_jv_port_mgmt_sr_cback) != PORT_SUCCESS)
+ if (RFCOMM_CreateConnection(sec_id, rs->local_scn, true,
+ BTA_JV_DEF_RFC_MTU, (uint8_t *) bd_addr_any, &handle, bta_jv_port_mgmt_sr_cback) != PORT_SUCCESS)
{
APPL_TRACE_ERROR("bta_jv_rfcomm_start_server, RFCOMM_CreateConnection failed");
break;
@@ -1955,7 +1955,7 @@
evt_data.status = BTA_JV_SUCCESS;
evt_data.handle = p_cb->handle;
evt_data.sec_id = sec_id;
- evt_data.use_co = TRUE;
+ evt_data.use_co = true;
PORT_ClearKeepHandleFlag(handle);
PORT_SetEventCallback(handle, bta_jv_port_event_sr_cback);
@@ -2311,7 +2311,7 @@
static struct fc_client *fcclient_alloc(uint16_t chan, char server, const uint8_t *sec_id_to_use)
{
- struct fc_channel *fc = fcchan_get(chan, TRUE);
+ struct fc_channel *fc = fcchan_get(chan, true);
struct fc_client *t;
uint8_t sec_id;
@@ -2349,7 +2349,7 @@
// Update channel if needed
if (server)
- fc->has_server = TRUE;
+ fc->has_server = true;
return t;
}
@@ -2357,7 +2357,7 @@
static void fcclient_free(struct fc_client *fc)
{
struct fc_client *t = fc_clients;
- struct fc_channel *tc = fcchan_get(fc->chan, FALSE);
+ struct fc_channel *tc = fcchan_get(fc->chan, false);
//remove from global list
while (t && t->next_all_list != fc)
@@ -2385,7 +2385,7 @@
//if was server then channel no longer has a server
if (fc->server)
- tc->has_server = FALSE;
+ tc->has_server = false;
}
//free security id
@@ -2394,18 +2394,18 @@
osi_free(fc);
}
-static void fcchan_conn_chng_cbk(UINT16 chan, BD_ADDR bd_addr, BOOLEAN connected, UINT16 reason, tBT_TRANSPORT transport)
+static void fcchan_conn_chng_cbk(uint16_t chan, BD_ADDR bd_addr, bool connected, uint16_t reason, tBT_TRANSPORT transport)
{
tBTA_JV init_evt;
tBTA_JV open_evt;
struct fc_channel *tc;
struct fc_client *t = NULL, *new_conn;
tBTA_JV_L2CAP_CBACK *p_cback = NULL;
- char call_init = FALSE;
+ char call_init = false;
void *user_data = NULL;
- tc = fcchan_get(chan, FALSE);
+ tc = fcchan_get(chan, false);
if (tc) {
t = fcclient_find_by_addr(tc->clients, bd_addr); // try to find an open socked for that addr
if (t) {
@@ -2415,12 +2415,12 @@
t = fcclient_find_by_addr(tc->clients, NULL); // try to find a listening socked for that channel
if (t) {
//found: create a normal connection socket and assign the connection to it
- new_conn = fcclient_alloc(chan, FALSE, &t->sec_id);
+ new_conn = fcclient_alloc(chan, false, &t->sec_id);
if (new_conn){
memcpy(&new_conn->remote_addr, bd_addr, sizeof(new_conn->remote_addr));
new_conn->p_cback = NULL; //for now
- new_conn->init_called = TRUE; /*nop need to do it again */
+ new_conn->init_called = true; /*nop need to do it again */
p_cback = t->p_cback;
user_data = t->user_data;
@@ -2438,8 +2438,8 @@
if (!t->init_called) {
- call_init = TRUE;
- t->init_called = TRUE;
+ call_init = true;
+ t->init_called = true;
init_evt.l2c_cl_init.handle = t->id;
init_evt.l2c_cl_init.status = BTA_JV_SUCCESS;
@@ -2472,7 +2472,7 @@
}
}
-static void fcchan_data_cbk(UINT16 chan, BD_ADDR bd_addr, BT_HDR *p_buf)
+static void fcchan_data_cbk(uint16_t chan, BD_ADDR bd_addr, BT_HDR *p_buf)
{
tBTA_JV evt_data;
struct fc_channel *tc;
@@ -2480,7 +2480,7 @@
tBTA_JV_L2CAP_CBACK *sock_cback = NULL;
void *sock_user_data;
- tc = fcchan_get(chan, FALSE);
+ tc = fcchan_get(chan, false);
if (tc) {
t = fcclient_find_by_addr(tc->clients, bd_addr); // try to find an open socked for that addr and channel
if (!t) {
@@ -2513,13 +2513,13 @@
tBTA_JV_API_L2CAP_CONNECT *cc = &(p_data->l2cap_connect);
tBTA_JV evt;
uint32_t id;
- char call_init_f = TRUE;
+ char call_init_f = true;
struct fc_client *t;
evt.l2c_cl_init.handle = GAP_INVALID_HANDLE;
evt.l2c_cl_init.status = BTA_JV_FAILURE;
- t = fcclient_alloc(cc->remote_chan, FALSE, NULL);
+ t = fcclient_alloc(cc->remote_chan, false, NULL);
if (!t) {
cc->p_cback(BTA_JV_L2CAP_CL_INIT_EVT, &evt, cc->user_data);
return;
@@ -2529,7 +2529,7 @@
t->user_data = cc->user_data;
memcpy(&t->remote_addr, &cc->peer_bd_addr, sizeof(t->remote_addr));
id = t->id;
- t->init_called = FALSE;
+ t->init_called = false;
if (L2CA_ConnectFixedChnl(t->chan, t->remote_addr)) {
@@ -2547,7 +2547,7 @@
}
if (call_init_f)
cc->p_cback(BTA_JV_L2CAP_CL_INIT_EVT, &evt, cc->user_data);
- t->init_called = TRUE;
+ t->init_called = true;
}
@@ -2570,10 +2570,10 @@
void *user_data;
evt.l2c_close.status = BTA_JV_FAILURE;
- evt.l2c_close.async = FALSE;
+ evt.l2c_close.async = false;
evt.l2c_close.handle = GAP_INVALID_HANDLE;
- fcchan = fcchan_get(ls->local_chan, FALSE);
+ fcchan = fcchan_get(ls->local_chan, false);
if (fcchan) {
while((fcclient = fcchan->clients)) {
p_cback = fcclient->p_cback;
@@ -2581,7 +2581,7 @@
evt.l2c_close.handle = fcclient->id;
evt.l2c_close.status = BTA_JV_SUCCESS;
- evt.l2c_close.async = FALSE;
+ evt.l2c_close.async = false;
fcclient_free(fcclient);
@@ -2610,7 +2610,7 @@
evt_data.status = BTA_JV_FAILURE;
- t = fcclient_alloc(ss->local_chan, TRUE, NULL);
+ t = fcclient_alloc(ss->local_chan, true, NULL);
if (!t)
goto out;
diff --git a/bta/jv/bta_jv_api.c b/bta/jv/bta_jv_api.c
index 674a510..32f8597 100644
--- a/bta/jv/bta_jv_api.c
+++ b/bta/jv/bta_jv_api.c
@@ -63,7 +63,7 @@
int i;
APPL_TRACE_API( "BTA_JvEnable");
- if(p_cback && FALSE == bta_sys_is_register(BTA_ID_JV))
+ if(p_cback && false == bta_sys_is_register(BTA_ID_JV))
{
memset(&bta_jv_cb, 0, sizeof(tBTA_JV_CB));
/* set handle to invalid value by default */
@@ -118,21 +118,21 @@
**
** Description This function checks if the link to peer device is encrypted
**
-** Returns TRUE if encrypted.
-** FALSE if not.
+** Returns true if encrypted.
+** false if not.
**
*******************************************************************************/
-BOOLEAN BTA_JvIsEncrypted(BD_ADDR bd_addr)
+bool BTA_JvIsEncrypted(BD_ADDR bd_addr)
{
- BOOLEAN is_encrypted = FALSE;
- UINT8 sec_flags, le_flags;
+ bool is_encrypted = false;
+ uint8_t sec_flags, le_flags;
if (BTM_GetSecurityFlags(bd_addr, &sec_flags) &&
BTM_GetSecurityFlagsByTransport(bd_addr, &le_flags, BT_TRANSPORT_LE))
{
if(sec_flags & BTM_SEC_FLAG_ENCRYPTED ||
le_flags & BTM_SEC_FLAG_ENCRYPTED)
- is_encrypted = TRUE;
+ is_encrypted = true;
}
return is_encrypted;
}
@@ -158,7 +158,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvGetChannelId(int conn_type, void* user_data, INT32 channel)
+tBTA_JV_STATUS BTA_JvGetChannelId(int conn_type, void* user_data, int32_t channel)
{
tBTA_JV_API_ALLOC_CHANNEL *p_msg =
(tBTA_JV_API_ALLOC_CHANNEL *)osi_malloc(sizeof(tBTA_JV_API_ALLOC_CHANNEL));
@@ -190,7 +190,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvFreeChannel(UINT16 channel, int conn_type)
+tBTA_JV_STATUS BTA_JvFreeChannel(uint16_t channel, int conn_type)
{
tBTA_JV_API_FREE_CHANNEL *p_msg =
(tBTA_JV_API_FREE_CHANNEL *)osi_malloc(sizeof(tBTA_JV_API_FREE_CHANNEL));
@@ -219,7 +219,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvStartDiscovery(BD_ADDR bd_addr, UINT16 num_uuid,
+tBTA_JV_STATUS BTA_JvStartDiscovery(BD_ADDR bd_addr, uint16_t num_uuid,
tSDP_UUID *p_uuid_list, void * user_data)
{
tBTA_JV_API_START_DISCOVERY *p_msg =
@@ -276,7 +276,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvDeleteRecord(UINT32 handle)
+tBTA_JV_STATUS BTA_JvDeleteRecord(uint32_t handle)
{
tBTA_JV_API_ADD_ATTRIBUTE *p_msg =
(tBTA_JV_API_ADD_ATTRIBUTE *)osi_malloc(sizeof(tBTA_JV_API_ADD_ATTRIBUTE));
@@ -307,8 +307,8 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capConnectLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
- const tL2CAP_ERTM_INFO *ertm_info, UINT16 remote_chan,
- UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
+ const tL2CAP_ERTM_INFO *ertm_info, uint16_t remote_chan,
+ uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
BD_ADDR peer_bd_addr, tBTA_JV_L2CAP_CBACK *p_cback, void *user_data)
{
APPL_TRACE_API("%s", __func__);
@@ -324,16 +324,16 @@
p_msg->remote_chan = remote_chan;
p_msg->rx_mtu = rx_mtu;
if (cfg != NULL) {
- p_msg->has_cfg = TRUE;
+ p_msg->has_cfg = true;
p_msg->cfg = *cfg;
} else {
- p_msg->has_cfg = FALSE;
+ p_msg->has_cfg = false;
}
if (ertm_info != NULL) {
- p_msg->has_ertm_info = TRUE;
+ p_msg->has_ertm_info = true;
p_msg->ertm_info = *ertm_info;
} else {
- p_msg->has_ertm_info = FALSE;
+ p_msg->has_ertm_info = false;
}
memcpy(p_msg->peer_bd_addr, peer_bd_addr, sizeof(BD_ADDR));
p_msg->p_cback = p_cback;
@@ -360,8 +360,8 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
- const tL2CAP_ERTM_INFO *ertm_info, UINT16 remote_psm,
- UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
+ const tL2CAP_ERTM_INFO *ertm_info, uint16_t remote_psm,
+ uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
BD_ADDR peer_bd_addr, tBTA_JV_L2CAP_CBACK *p_cback, void *user_data)
{
APPL_TRACE_API("%s", __func__);
@@ -378,16 +378,16 @@
p_msg->remote_psm = remote_psm;
p_msg->rx_mtu = rx_mtu;
if (cfg != NULL) {
- p_msg->has_cfg = TRUE;
+ p_msg->has_cfg = true;
p_msg->cfg = *cfg;
} else {
- p_msg->has_cfg = FALSE;
+ p_msg->has_cfg = false;
}
if (ertm_info != NULL) {
- p_msg->has_ertm_info = TRUE;
+ p_msg->has_ertm_info = true;
p_msg->ertm_info = *ertm_info;
} else {
- p_msg->has_ertm_info = FALSE;
+ p_msg->has_ertm_info = false;
}
memcpy(p_msg->peer_bd_addr, peer_bd_addr, sizeof(BD_ADDR));
p_msg->p_cback = p_cback;
@@ -408,7 +408,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capClose(UINT32 handle)
+tBTA_JV_STATUS BTA_JvL2capClose(uint32_t handle)
{
tBTA_JV_STATUS status = BTA_JV_FAILURE;
@@ -439,7 +439,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capCloseLE(UINT32 handle)
+tBTA_JV_STATUS BTA_JvL2capCloseLE(uint32_t handle)
{
tBTA_JV_API_L2CAP_CLOSE *p_msg =
(tBTA_JV_API_L2CAP_CLOSE *)osi_malloc(sizeof(tBTA_JV_API_L2CAP_CLOSE));
@@ -469,7 +469,7 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
- const tL2CAP_ERTM_INFO *ertm_info,UINT16 local_psm, UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
+ const tL2CAP_ERTM_INFO *ertm_info,uint16_t local_psm, uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
tBTA_JV_L2CAP_CBACK *p_cback, void *user_data)
{
APPL_TRACE_API("%s", __func__);
@@ -486,16 +486,16 @@
p_msg->local_psm = local_psm;
p_msg->rx_mtu = rx_mtu;
if (cfg != NULL) {
- p_msg->has_cfg = TRUE;
+ p_msg->has_cfg = true;
p_msg->cfg = *cfg;
} else {
- p_msg->has_cfg = FALSE;
+ p_msg->has_cfg = false;
}
if (ertm_info != NULL) {
- p_msg->has_ertm_info = TRUE;
+ p_msg->has_ertm_info = true;
p_msg->ertm_info = *ertm_info;
} else {
- p_msg->has_ertm_info = FALSE;
+ p_msg->has_ertm_info = false;
}
p_msg->p_cback = p_cback;
p_msg->user_data = user_data;
@@ -520,7 +520,7 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capStartServerLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
- const tL2CAP_ERTM_INFO *ertm_info,UINT16 local_chan, UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
+ const tL2CAP_ERTM_INFO *ertm_info,uint16_t local_chan, uint16_t rx_mtu, tL2CAP_CFG_INFO *cfg,
tBTA_JV_L2CAP_CBACK *p_cback, void *user_data)
{
APPL_TRACE_API("%s", __func__);
@@ -536,16 +536,16 @@
p_msg->local_chan = local_chan;
p_msg->rx_mtu = rx_mtu;
if (cfg != NULL) {
- p_msg->has_cfg = TRUE;
+ p_msg->has_cfg = true;
p_msg->cfg = *cfg;
} else {
- p_msg->has_cfg = FALSE;
+ p_msg->has_cfg = false;
}
if (ertm_info != NULL) {
- p_msg->has_ertm_info = TRUE;
+ p_msg->has_ertm_info = true;
p_msg->ertm_info = *ertm_info;
} else {
- p_msg->has_ertm_info = FALSE;
+ p_msg->has_ertm_info = false;
}
p_msg->p_cback = p_cback;
p_msg->user_data = user_data;
@@ -566,7 +566,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capStopServer(UINT16 local_psm, void *user_data)
+tBTA_JV_STATUS BTA_JvL2capStopServer(uint16_t local_psm, void *user_data)
{
APPL_TRACE_API("%s", __func__);
@@ -592,7 +592,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capStopServerLE(UINT16 local_chan, void *user_data)
+tBTA_JV_STATUS BTA_JvL2capStopServerLE(uint16_t local_chan, void *user_data)
{
APPL_TRACE_API("%s", __func__);
@@ -621,7 +621,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capRead(UINT32 handle, UINT32 req_id, UINT8 *p_data, UINT16 len)
+tBTA_JV_STATUS BTA_JvL2capRead(uint32_t handle, uint32_t req_id, uint8_t *p_data, uint16_t len)
{
tBTA_JV_STATUS status = BTA_JV_FAILURE;
tBTA_JV_L2CAP_READ evt_data;
@@ -638,7 +638,7 @@
evt_data.p_data = p_data;
evt_data.len = 0;
- if (BT_PASS == GAP_ConnReadData((UINT16)handle, p_data, len, &evt_data.len))
+ if (BT_PASS == GAP_ConnReadData((uint16_t)handle, p_data, len, &evt_data.len))
{
evt_data.status = BTA_JV_SUCCESS;
}
@@ -660,7 +660,7 @@
** BTA_JV_FAILURE, if error.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capReady(UINT32 handle, UINT32 *p_data_size)
+tBTA_JV_STATUS BTA_JvL2capReady(uint32_t handle, uint32_t *p_data_size)
{
tBTA_JV_STATUS status = BTA_JV_FAILURE;
@@ -668,7 +668,7 @@
if (p_data_size && handle < BTA_JV_MAX_L2C_CONN && bta_jv_cb.l2c_cb[handle].p_cback)
{
*p_data_size = 0;
- if(BT_PASS == GAP_GetRxQueueCnt((UINT16)handle, p_data_size) )
+ if(BT_PASS == GAP_GetRxQueueCnt((uint16_t)handle, p_data_size) )
{
status = BTA_JV_SUCCESS;
}
@@ -691,8 +691,8 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capWrite(UINT32 handle, UINT32 req_id, UINT8 *p_data,
- UINT16 len, void *user_data)
+tBTA_JV_STATUS BTA_JvL2capWrite(uint32_t handle, uint32_t req_id, uint8_t *p_data,
+ uint16_t len, void *user_data)
{
tBTA_JV_STATUS status = BTA_JV_FAILURE;
@@ -730,8 +730,8 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capWriteFixed(UINT16 channel, BD_ADDR *addr, UINT32 req_id,
- tBTA_JV_L2CAP_CBACK *p_cback, UINT8 *p_data, UINT16 len, void *user_data)
+tBTA_JV_STATUS BTA_JvL2capWriteFixed(uint16_t channel, BD_ADDR *addr, uint32_t req_id,
+ tBTA_JV_L2CAP_CBACK *p_cback, uint8_t *p_data, uint16_t len, void *user_data)
{
tBTA_JV_API_L2CAP_WRITE_FIXED *p_msg =
(tBTA_JV_API_L2CAP_WRITE_FIXED *)osi_malloc(sizeof(tBTA_JV_API_L2CAP_WRITE_FIXED));
@@ -768,7 +768,7 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
- tBTA_JV_ROLE role, UINT8 remote_scn, BD_ADDR peer_bd_addr,
+ tBTA_JV_ROLE role, uint8_t remote_scn, BD_ADDR peer_bd_addr,
tBTA_JV_RFCOMM_CBACK *p_cback, void* user_data)
{
APPL_TRACE_API("%s", __func__);
@@ -801,11 +801,11 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, void *user_data)
+tBTA_JV_STATUS BTA_JvRfcommClose(uint32_t handle, void *user_data)
{
tBTA_JV_STATUS status = BTA_JV_FAILURE;
- UINT32 hi = ((handle & BTA_JV_RFC_HDL_MASK)&~BTA_JV_RFCOMM_MASK) - 1;
- UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(handle);
+ uint32_t hi = ((handle & BTA_JV_RFC_HDL_MASK)&~BTA_JV_RFCOMM_MASK) - 1;
+ uint32_t si = BTA_JV_RFC_HDL_TO_SIDX(handle);
APPL_TRACE_API("%s", __func__);
@@ -843,7 +843,7 @@
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask,
- tBTA_JV_ROLE role, UINT8 local_scn, UINT8 max_session,
+ tBTA_JV_ROLE role, uint8_t local_scn, uint8_t max_session,
tBTA_JV_RFCOMM_CBACK *p_cback, void* user_data)
{
APPL_TRACE_API("%s", __func__);
@@ -883,7 +883,7 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle, void * user_data)
+tBTA_JV_STATUS BTA_JvRfcommStopServer(uint32_t handle, void * user_data)
{
tBTA_JV_API_RFCOMM_SERVER *p_msg =
(tBTA_JV_API_RFCOMM_SERVER *)osi_malloc(sizeof(tBTA_JV_API_RFCOMM_SERVER));
@@ -909,10 +909,10 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-UINT16 BTA_JvRfcommGetPortHdl(UINT32 handle)
+uint16_t BTA_JvRfcommGetPortHdl(uint32_t handle)
{
- UINT32 hi = ((handle & BTA_JV_RFC_HDL_MASK) & ~BTA_JV_RFCOMM_MASK) - 1;
- UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(handle);
+ uint32_t hi = ((handle & BTA_JV_RFC_HDL_MASK) & ~BTA_JV_RFCOMM_MASK) - 1;
+ uint32_t si = BTA_JV_RFC_HDL_TO_SIDX(handle);
if (hi < BTA_JV_MAX_RFC_CONN &&
si < BTA_JV_MAX_RFC_SR_SESSION && bta_jv_cb.rfc_cb[hi].rfc_hdl[si])
@@ -931,11 +931,11 @@
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvRfcommWrite(UINT32 handle, UINT32 req_id)
+tBTA_JV_STATUS BTA_JvRfcommWrite(uint32_t handle, uint32_t req_id)
{
tBTA_JV_STATUS status = BTA_JV_FAILURE;
- UINT32 hi = ((handle & BTA_JV_RFC_HDL_MASK)&~BTA_JV_RFCOMM_MASK) - 1;
- UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(handle);
+ uint32_t hi = ((handle & BTA_JV_RFC_HDL_MASK)&~BTA_JV_RFCOMM_MASK) - 1;
+ uint32_t si = BTA_JV_RFC_HDL_TO_SIDX(handle);
APPL_TRACE_API("%s", __func__);
@@ -978,7 +978,7 @@
** BTA_JV_CONN_CLOSE to remove in case of connection close!
**
*******************************************************************************/
-tBTA_JV_STATUS BTA_JvSetPmProfile(UINT32 handle, tBTA_JV_PM_ID app_id, tBTA_JV_CONN_STATE init_st)
+tBTA_JV_STATUS BTA_JvSetPmProfile(uint32_t handle, tBTA_JV_PM_ID app_id, tBTA_JV_CONN_STATE init_st)
{
tBTA_JV_API_SET_PM_PROFILE *p_msg =
(tBTA_JV_API_SET_PM_PROFILE *)osi_malloc(sizeof(tBTA_JV_API_SET_PM_PROFILE));
diff --git a/bta/jv/bta_jv_cfg.c b/bta/jv/bta_jv_cfg.c
index 3f328f0..0acc844 100644
--- a/bta/jv/bta_jv_cfg.c
+++ b/bta/jv/bta_jv_cfg.c
@@ -41,8 +41,8 @@
* between BTA_JvEnable and BTA_JvDisable
* p_bta_jv_cfg->p_sdp_raw_data can be allocated before calling BTA_JvStartDiscovery
* it can be de-allocated after the last call to access the database */
-static UINT8 bta_jv_sdp_raw_data[BTA_JV_SDP_RAW_DATA_SIZE];
-static UINT8 __attribute__ ((aligned(4))) bta_jv_sdp_db_data[BTA_JV_SDP_DB_SIZE];
+static uint8_t bta_jv_sdp_raw_data[BTA_JV_SDP_RAW_DATA_SIZE];
+static uint8_t __attribute__ ((aligned(4))) bta_jv_sdp_db_data[BTA_JV_SDP_DB_SIZE];
/* JV configuration structure */
const tBTA_JV_CFG bta_jv_cfg =
diff --git a/bta/jv/bta_jv_int.h b/bta/jv/bta_jv_int.h
index e098894..4e91fc5 100644
--- a/bta/jv/bta_jv_int.h
+++ b/bta/jv/bta_jv_int.h
@@ -81,10 +81,10 @@
{
BT_HDR hdr;
BD_ADDR bd_addr;
- UINT16 num_uuid;
+ uint16_t num_uuid;
tSDP_UUID uuid_list[BTA_JV_MAX_UUIDS];
- UINT16 num_attr;
- UINT16 attr_list[BTA_JV_MAX_ATTRS];
+ uint16_t num_attr;
+ uint16_t attr_list[BTA_JV_MAX_ATTRS];
void *user_data; /* piggyback caller's private data*/
} tBTA_JV_API_START_DISCOVERY;
@@ -98,8 +98,8 @@
/* BTA JV PM control block */
typedef struct
{
- UINT32 handle; /* The connection handle */
- UINT8 state; /* state: see above enum */
+ uint32_t handle; /* The connection handle */
+ uint8_t state; /* state: see above enum */
tBTA_JV_PM_ID app_id; /* JV app specific id indicating power table to use */
BD_ADDR peer_bd_addr; /* Peer BD address */
} tBTA_JV_PM_CB;
@@ -114,17 +114,17 @@
BTA_JV_ST_SR_OPEN,
BTA_JV_ST_SR_CLOSING
} ;
-typedef UINT8 tBTA_JV_STATE;
+typedef uint8_t tBTA_JV_STATE;
#define BTA_JV_ST_CL_MAX BTA_JV_ST_CL_CLOSING
/* JV L2CAP control block */
typedef struct
{
tBTA_JV_L2CAP_CBACK *p_cback; /* the callback function */
- UINT16 psm; /* the psm used for this server connection */
+ uint16_t psm; /* the psm used for this server connection */
tBTA_JV_STATE state; /* the state of this control block */
tBTA_SERVICE_ID sec_id; /* service id */
- UINT32 handle; /* the handle reported to java app (same as gap handle) */
- BOOLEAN cong; /* TRUE, if congested */
+ uint32_t handle; /* the handle reported to java app (same as gap handle) */
+ bool cong; /* true, if congested */
tBTA_JV_PM_CB *p_pm_cb; /* ptr to pm control block, NULL: unused */
void *user_data; /* user data for callback from higher layers */
} tBTA_JV_L2C_CB;
@@ -138,12 +138,12 @@
/* port control block */
typedef struct
{
- UINT32 handle; /* the rfcomm session handle at jv */
- UINT16 port_handle;/* port handle */
+ uint32_t handle; /* the rfcomm session handle at jv */
+ uint16_t port_handle;/* port handle */
tBTA_JV_STATE state; /* the state of this control block */
- UINT8 max_sess; /* max sessions */
+ uint8_t max_sess; /* max sessions */
void *user_data; /* piggyback caller's private data*/
- BOOLEAN cong; /* TRUE, if congested */
+ bool cong; /* true, if congested */
tBTA_JV_PM_CB *p_pm_cb; /* ptr to pm control block, NULL: unused */
} tBTA_JV_PCB;
@@ -151,11 +151,11 @@
typedef struct
{
tBTA_JV_RFCOMM_CBACK *p_cback; /* the callback function */
- UINT16 rfc_hdl[BTA_JV_MAX_RFC_SR_SESSION];
+ uint16_t rfc_hdl[BTA_JV_MAX_RFC_SR_SESSION];
tBTA_SERVICE_ID sec_id; /* service id */
- UINT8 handle; /* index: the handle reported to java app */
- UINT8 scn; /* the scn of the server */
- UINT8 max_sess; /* max sessions */
+ uint8_t handle; /* index: the handle reported to java app */
+ uint8_t scn; /* the scn of the server */
+ uint8_t max_sess; /* max sessions */
int curr_sess; /* current sessions count*/
} tBTA_JV_RFC_CB;
@@ -163,18 +163,18 @@
typedef struct
{
BT_HDR hdr;
- INT32 type; /* One of BTA_JV_CONN_TYPE_ */
+ int32_t type; /* One of BTA_JV_CONN_TYPE_ */
tBTA_SEC sec_mask;
tBTA_JV_ROLE role;
union {
- UINT16 remote_psm;
- UINT16 remote_chan;
+ uint16_t remote_psm;
+ uint16_t remote_chan;
};
- UINT16 rx_mtu;
+ uint16_t rx_mtu;
BD_ADDR peer_bd_addr;
- INT32 has_cfg;
+ int32_t has_cfg;
tL2CAP_CFG_INFO cfg;
- INT32 has_ertm_info;
+ int32_t has_ertm_info;
tL2CAP_ERTM_INFO ertm_info;
tBTA_JV_L2CAP_CBACK *p_cback;
void *user_data;
@@ -184,17 +184,17 @@
typedef struct
{
BT_HDR hdr;
- INT32 type; /* One of BTA_JV_CONN_TYPE_ */
+ int32_t type; /* One of BTA_JV_CONN_TYPE_ */
tBTA_SEC sec_mask;
tBTA_JV_ROLE role;
union {
- UINT16 local_psm;
- UINT16 local_chan;
+ uint16_t local_psm;
+ uint16_t local_chan;
};
- UINT16 rx_mtu;
- INT32 has_cfg;
+ uint16_t rx_mtu;
+ int32_t has_cfg;
tL2CAP_CFG_INFO cfg;
- INT32 has_ertm_info;
+ int32_t has_ertm_info;
tL2CAP_ERTM_INFO ertm_info;
tBTA_JV_L2CAP_CBACK *p_cback;
void *user_data;
@@ -204,7 +204,7 @@
typedef struct
{
BT_HDR hdr;
- UINT32 handle;
+ uint32_t handle;
tBTA_JV_L2C_CB *p_cb;
} tBTA_JV_API_L2CAP_CLOSE;
@@ -212,11 +212,11 @@
typedef struct
{
BT_HDR hdr;
- UINT32 handle;
- UINT32 req_id;
+ uint32_t handle;
+ uint32_t req_id;
tBTA_JV_L2CAP_CBACK *p_cback;
- UINT8* p_data;
- UINT16 len;
+ uint8_t* p_data;
+ uint16_t len;
void *user_data;
} tBTA_JV_API_L2CAP_READ;
@@ -224,11 +224,11 @@
typedef struct
{
BT_HDR hdr;
- UINT32 handle;
- UINT32 req_id;
+ uint32_t handle;
+ uint32_t req_id;
tBTA_JV_L2C_CB *p_cb;
- UINT8 *p_data;
- UINT16 len;
+ uint8_t *p_data;
+ uint16_t len;
void *user_data;
} tBTA_JV_API_L2CAP_WRITE;
@@ -236,12 +236,12 @@
typedef struct
{
BT_HDR hdr;
- UINT16 channel;
+ uint16_t channel;
BD_ADDR addr;
- UINT32 req_id;
+ uint32_t req_id;
tBTA_JV_L2CAP_CBACK *p_cback;
- UINT8 *p_data;
- UINT16 len;
+ uint8_t *p_data;
+ uint16_t len;
void *user_data;
} tBTA_JV_API_L2CAP_WRITE_FIXED;
@@ -251,7 +251,7 @@
BT_HDR hdr;
tBTA_SEC sec_mask;
tBTA_JV_ROLE role;
- UINT8 remote_scn;
+ uint8_t remote_scn;
BD_ADDR peer_bd_addr;
tBTA_JV_RFCOMM_CBACK *p_cback;
void *user_data;
@@ -263,9 +263,9 @@
BT_HDR hdr;
tBTA_SEC sec_mask;
tBTA_JV_ROLE role;
- UINT8 local_scn;
- UINT8 max_session;
- UINT32 handle;
+ uint8_t local_scn;
+ uint8_t max_session;
+ uint32_t handle;
tBTA_JV_RFCOMM_CBACK *p_cback;
void *user_data;
} tBTA_JV_API_RFCOMM_SERVER;
@@ -274,7 +274,7 @@
typedef struct
{
BT_HDR hdr;
- UINT32 handle;
+ uint32_t handle;
tBTA_JV_PM_ID app_id;
tBTA_JV_CONN_STATE init_st;
} tBTA_JV_API_SET_PM_PROFILE;
@@ -291,9 +291,9 @@
typedef struct
{
BT_HDR hdr;
- UINT32 handle;
- UINT32 req_id;
- UINT8 *p_data;
+ uint32_t handle;
+ uint32_t req_id;
+ uint8_t *p_data;
int len;
tBTA_JV_RFC_CB *p_cb;
tBTA_JV_PCB *p_pcb;
@@ -303,7 +303,7 @@
typedef struct
{
BT_HDR hdr;
- UINT32 handle;
+ uint32_t handle;
tBTA_JV_RFC_CB *p_cb;
tBTA_JV_PCB *p_pcb;
void *user_data;
@@ -320,26 +320,26 @@
typedef struct
{
BT_HDR hdr;
- UINT32 handle;
- UINT16 attr_id;
- UINT8 *p_value;
- INT32 value_size;
+ uint32_t handle;
+ uint16_t attr_id;
+ uint8_t *p_value;
+ int32_t value_size;
} tBTA_JV_API_ADD_ATTRIBUTE;
/* data type for BTA_JV_API_FREE_SCN_EVT */
typedef struct
{
BT_HDR hdr;
- INT32 type; /* One of BTA_JV_CONN_TYPE_ */
- UINT16 scn;
+ int32_t type; /* One of BTA_JV_CONN_TYPE_ */
+ uint16_t scn;
} tBTA_JV_API_FREE_CHANNEL;
/* data type for BTA_JV_API_ALLOC_CHANNEL_EVT */
typedef struct
{
BT_HDR hdr;
- INT32 type; /* One of BTA_JV_CONN_TYPE_ */
- INT32 channel; /* optionally request a specific channel */
+ int32_t type; /* One of BTA_JV_CONN_TYPE_ */
+ int32_t channel; /* optionally request a specific channel */
void *user_data;
} tBTA_JV_API_ALLOC_CHANNEL;
/* union of all data types */
@@ -373,18 +373,18 @@
/* the SDP handle reported to JV user is the (index + 1) to sdp_handle[].
* if sdp_handle[i]==0, it's not used.
* otherwise sdp_handle[i] is the stack SDP handle. */
- UINT32 sdp_handle[BTA_JV_MAX_SDP_REC]; /* SDP records created */
- UINT8 *p_sel_raw_data;/* the raw data of last service select */
+ uint32_t sdp_handle[BTA_JV_MAX_SDP_REC]; /* SDP records created */
+ uint8_t *p_sel_raw_data;/* the raw data of last service select */
tBTA_JV_DM_CBACK *p_dm_cback;
tBTA_JV_L2C_CB l2c_cb[BTA_JV_MAX_L2C_CONN]; /* index is GAP handle (index) */
tBTA_JV_RFC_CB rfc_cb[BTA_JV_MAX_RFC_CONN];
tBTA_JV_PCB port_cb[MAX_RFC_PORTS]; /* index of this array is
the port_handle, */
- UINT8 sec_id[BTA_JV_NUM_SERVICE_ID]; /* service ID */
- BOOLEAN scn[BTA_JV_MAX_SCN]; /* SCN allocated by java */
- UINT16 free_psm_list[BTA_JV_MAX_L2C_CONN]; /* PSMs freed by java
+ uint8_t sec_id[BTA_JV_NUM_SERVICE_ID]; /* service ID */
+ bool scn[BTA_JV_MAX_SCN]; /* SCN allocated by java */
+ uint16_t free_psm_list[BTA_JV_MAX_L2C_CONN]; /* PSMs freed by java
(can be reused) */
- UINT8 sdp_active; /* see BTA_JV_SDP_ACT_* */
+ uint8_t sdp_active; /* see BTA_JV_SDP_ACT_* */
tSDP_UUID uuid; /* current uuid of sdp discovery*/
tBTA_JV_PM_CB pm_cb[BTA_JV_PM_MAX_NUM]; /* PM on a per JV handle bases */
} tBTA_JV_CB;
@@ -397,7 +397,7 @@
};
/* JV control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_JV_CB bta_jv_cb;
#else
extern tBTA_JV_CB *bta_jv_cb_ptr;
@@ -407,7 +407,7 @@
/* config struct */
extern tBTA_JV_CFG *p_bta_jv_cfg;
-extern BOOLEAN bta_jv_sm_execute(BT_HDR *p_msg);
+extern bool bta_jv_sm_execute(BT_HDR *p_msg);
extern void bta_jv_enable (tBTA_JV_MSG *p_data);
extern void bta_jv_disable (tBTA_JV_MSG *p_data);
diff --git a/bta/jv/bta_jv_main.c b/bta/jv/bta_jv_main.c
index 8b69774..d474a53 100644
--- a/bta/jv/bta_jv_main.c
+++ b/bta/jv/bta_jv_main.c
@@ -31,7 +31,7 @@
** Constants and types
*****************************************************************************/
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_JV_CB bta_jv_cb;
#endif
@@ -81,16 +81,16 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_jv_sm_execute(BT_HDR *p_msg)
+bool bta_jv_sm_execute(BT_HDR *p_msg)
{
- BOOLEAN ret = FALSE;
- UINT16 action = (p_msg->event & 0x00ff);
+ bool ret = false;
+ uint16_t action = (p_msg->event & 0x00ff);
/* execute action functions */
if(action < BTA_JV_NUM_ACTIONS)
{
(*bta_jv_action[action])((tBTA_JV_MSG*)p_msg);
- ret = TRUE;
+ ret = true;
}
return(ret);
diff --git a/bta/mce/bta_mce_act.c b/bta/mce/bta_mce_act.c
index 9d3d5fd..827ca4c 100644
--- a/bta/mce/bta_mce_act.c
+++ b/bta/mce/bta_mce_act.c
@@ -57,7 +57,7 @@
**
*******************************************************************************/
-static void bta_mce_search_cback(UINT16 result, void * user_data)
+static void bta_mce_search_cback(uint16_t result, void * user_data)
{
tSDP_DISC_REC *p_rec = NULL;
tBTA_MCE_MAS_DISCOVERY_COMP evt_data;
@@ -152,7 +152,7 @@
}
tBTA_MCE_STATUS status = BTA_MCE_FAILURE;
- APPL_TRACE_DEBUG("%s in, sdp_active:%d", __FUNCTION__, bta_mce_cb.sdp_active);
+ APPL_TRACE_DEBUG("%s in, sdp_active:%d", __func__, bta_mce_cb.sdp_active);
if (bta_mce_cb.sdp_active != BTA_MCE_SDP_ACT_NONE)
{
diff --git a/bta/mce/bta_mce_api.c b/bta/mce/bta_mce_api.c
index 8967605..b0a590d 100644
--- a/bta/mce/bta_mce_api.c
+++ b/bta/mce/bta_mce_api.c
@@ -63,7 +63,7 @@
APPL_TRACE_API("%", __func__);
- if (p_cback && FALSE == bta_sys_is_register(BTA_ID_MCE)) {
+ if (p_cback && false == bta_sys_is_register(BTA_ID_MCE)) {
memset(&bta_mce_cb, 0, sizeof(tBTA_MCE_CB));
/* register with BTA system manager */
diff --git a/bta/mce/bta_mce_cfg.c b/bta/mce/bta_mce_cfg.c
index 45deeed..0f9761e 100644
--- a/bta/mce/bta_mce_cfg.c
+++ b/bta/mce/bta_mce_cfg.c
@@ -32,7 +32,7 @@
#define BTA_MCE_SDP_DB_SIZE 4500
#endif
-static UINT8 __attribute__ ((aligned(4))) bta_mce_sdp_db_data[BTA_MCE_SDP_DB_SIZE];
+static uint8_t __attribute__ ((aligned(4))) bta_mce_sdp_db_data[BTA_MCE_SDP_DB_SIZE];
/* MCE configuration structure */
const tBTA_MCE_CFG bta_mce_cfg =
diff --git a/bta/mce/bta_mce_int.h b/bta/mce/bta_mce_int.h
index 9032f6a..925906e 100644
--- a/bta/mce/bta_mce_int.h
+++ b/bta/mce/bta_mce_int.h
@@ -67,7 +67,7 @@
/* MCE control block */
typedef struct
{
- UINT8 sdp_active; /* see BTA_MCE_SDP_ACT_* */
+ uint8_t sdp_active; /* see BTA_MCE_SDP_ACT_* */
BD_ADDR remote_addr;
tBTA_MCE_DM_CBACK *p_dm_cback;
} tBTA_MCE_CB;
@@ -79,7 +79,7 @@
};
/* MCE control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_MCE_CB bta_mce_cb;
#else
extern tBTA_MCE_CB *bta_mce_cb_ptr;
@@ -89,7 +89,7 @@
/* config struct */
extern tBTA_MCE_CFG *p_bta_mce_cfg;
-extern BOOLEAN bta_mce_sm_execute(BT_HDR *p_msg);
+extern bool bta_mce_sm_execute(BT_HDR *p_msg);
extern void bta_mce_enable (tBTA_MCE_MSG *p_data);
extern void bta_mce_get_remote_mas_instances (tBTA_MCE_MSG *p_data);
diff --git a/bta/mce/bta_mce_main.c b/bta/mce/bta_mce_main.c
index a0536ff..632ee68 100644
--- a/bta/mce/bta_mce_main.c
+++ b/bta/mce/bta_mce_main.c
@@ -33,7 +33,7 @@
** Constants and types
*****************************************************************************/
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_MCE_CB bta_mce_cb;
#endif
@@ -60,18 +60,18 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_mce_sm_execute(BT_HDR *p_msg)
+bool bta_mce_sm_execute(BT_HDR *p_msg)
{
- if(p_msg == NULL) return FALSE;
+ if(p_msg == NULL) return false;
- BOOLEAN ret = FALSE;
- UINT16 action = (p_msg->event & 0x00ff);
+ bool ret = false;
+ uint16_t action = (p_msg->event & 0x00ff);
/* execute action functions */
if(action < BTA_MCE_NUM_ACTIONS)
{
(*bta_mce_action[action])((tBTA_MCE_MSG*)p_msg);
- ret = TRUE;
+ ret = true;
}
return(ret);
diff --git a/bta/pan/bta_pan_act.c b/bta/pan/bta_pan_act.c
index 1995478..c4d92fe 100644
--- a/bta/pan/bta_pan_act.c
+++ b/bta/pan/bta_pan_act.c
@@ -24,7 +24,7 @@
#include "bt_target.h"
-#if defined(PAN_INCLUDED) && (PAN_INCLUDED == TRUE)
+#if (PAN_INCLUDED == TRUE)
#include "bta_api.h"
#include "bta_sys.h"
@@ -85,8 +85,8 @@
** Returns void
**
*******************************************************************************/
-static void bta_pan_conn_state_cback(UINT16 handle, BD_ADDR bd_addr, tPAN_RESULT state,
- BOOLEAN is_role_change, UINT8 src_role, UINT8 dst_role)
+static void bta_pan_conn_state_cback(uint16_t handle, BD_ADDR bd_addr, tPAN_RESULT state,
+ bool is_role_change, uint8_t src_role, uint8_t dst_role)
{
tBTA_PAN_SCB *p_scb;
tBTA_PAN_CONN *p_buf = (tBTA_PAN_CONN *)osi_malloc(sizeof(tBTA_PAN_CONN));
@@ -106,7 +106,7 @@
p_scb->handle = handle;
p_scb->local_role = src_role;
p_scb->peer_role = dst_role;
- p_scb->pan_flow_enable = TRUE;
+ p_scb->pan_flow_enable = true;
bdcpy(p_scb->bd_addr, bd_addr);
p_scb->data_queue = fixed_queue_new(SIZE_MAX);
@@ -139,7 +139,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_pan_data_flow_cb(UINT16 handle, tPAN_RESULT result)
+static void bta_pan_data_flow_cb(uint16_t handle, tPAN_RESULT result)
{
tBTA_PAN_SCB *p_scb;
@@ -151,10 +151,10 @@
p_buf->layer_specific = handle;
p_buf->event = BTA_PAN_BNEP_FLOW_ENABLE_EVT;
bta_sys_sendmsg(p_buf);
- bta_pan_co_rx_flow(handle, p_scb->app_id, TRUE);
+ bta_pan_co_rx_flow(handle, p_scb->app_id, true);
} else if (result == PAN_TX_FLOW_OFF) {
- p_scb->pan_flow_enable = FALSE;
- bta_pan_co_rx_flow(handle, p_scb->app_id, FALSE);
+ p_scb->pan_flow_enable = false;
+ bta_pan_co_rx_flow(handle, p_scb->app_id, false);
}
}
@@ -168,8 +168,8 @@
** Returns void
**
*******************************************************************************/
-static void bta_pan_data_buf_ind_cback(UINT16 handle, BD_ADDR src, BD_ADDR dst, UINT16 protocol, BT_HDR *p_buf,
- BOOLEAN ext, BOOLEAN forward)
+static void bta_pan_data_buf_ind_cback(uint16_t handle, BD_ADDR src, BD_ADDR dst, uint16_t protocol, BT_HDR *p_buf,
+ bool ext, bool forward)
{
tBTA_PAN_SCB *p_scb;
BT_HDR *p_new_buf;
@@ -177,8 +177,8 @@
if (sizeof(tBTA_PAN_DATA_PARAMS) > p_buf->offset) {
/* offset smaller than data structure in front of actual data */
p_new_buf = (BT_HDR *)osi_malloc(PAN_BUF_SIZE);
- memcpy((UINT8 *)(p_new_buf + 1) + sizeof(tBTA_PAN_DATA_PARAMS),
- (UINT8 *)(p_buf + 1) + p_buf->offset, p_buf->len);
+ memcpy((uint8_t *)(p_new_buf + 1) + sizeof(tBTA_PAN_DATA_PARAMS),
+ (uint8_t *)(p_buf + 1) + p_buf->offset, p_buf->len);
p_new_buf->len = p_buf->len;
p_new_buf->offset = sizeof(tBTA_PAN_DATA_PARAMS);
osi_free(p_buf);
@@ -214,8 +214,8 @@
** Returns void
**
*******************************************************************************/
-static void bta_pan_pfilt_ind_cback(UINT16 handle, BOOLEAN indication,tBNEP_RESULT result,
- UINT16 num_filters, UINT8 *p_filters)
+static void bta_pan_pfilt_ind_cback(uint16_t handle, bool indication,tBNEP_RESULT result,
+ uint16_t num_filters, uint8_t *p_filters)
{
bta_pan_co_pfilt_ind(handle, indication, (tBTA_PAN_STATUS)((result == BNEP_SUCCESS) ? BTA_PAN_SUCCESS : BTA_PAN_FAIL),
@@ -235,8 +235,8 @@
** Returns void
**
*******************************************************************************/
-static void bta_pan_mfilt_ind_cback(UINT16 handle, BOOLEAN indication,tBNEP_RESULT result,
- UINT16 num_mfilters, UINT8 *p_mfilters)
+static void bta_pan_mfilt_ind_cback(uint16_t handle, bool indication,tBNEP_RESULT result,
+ uint16_t num_mfilters, uint8_t *p_mfilters)
{
bta_pan_co_mfilt_ind(handle, indication, (tBTA_PAN_STATUS)((result == BNEP_SUCCESS) ? BTA_PAN_SUCCESS : BTA_PAN_FAIL),
@@ -253,43 +253,43 @@
** different devices
**
**
-** Returns BOOLEAN
+** Returns bool
**
*******************************************************************************/
-static BOOLEAN bta_pan_has_multiple_connections(UINT8 app_id)
+static bool bta_pan_has_multiple_connections(uint8_t app_id)
{
tBTA_PAN_SCB *p_scb = NULL;
- BOOLEAN found = FALSE;
+ bool found = false;
BD_ADDR bd_addr;
- for (UINT8 index = 0; index < BTA_PAN_NUM_CONN; index++)
+ for (uint8_t index = 0; index < BTA_PAN_NUM_CONN; index++)
{
p_scb = &bta_pan_cb.scb[index];
- if (p_scb->in_use == TRUE && app_id == p_scb->app_id)
+ if (p_scb->in_use == true && app_id == p_scb->app_id)
{
/* save temp bd_addr */
bdcpy(bd_addr, p_scb->bd_addr);
- found = TRUE;
+ found = true;
break;
}
}
/* If cannot find a match then there is no connection at all */
- if (found == FALSE)
- return FALSE;
+ if (found == false)
+ return false;
/* Find whether there is another connection with different device other than PANU.
Could be same service or different service */
- for (UINT8 index = 0; index < BTA_PAN_NUM_CONN; index++)
+ for (uint8_t index = 0; index < BTA_PAN_NUM_CONN; index++)
{
p_scb = &bta_pan_cb.scb[index];
- if (p_scb->in_use == TRUE && p_scb->app_id != bta_pan_cb.app_id[0] &&
+ if (p_scb->in_use == true && p_scb->app_id != bta_pan_cb.app_id[0] &&
bdcmp(bd_addr, p_scb->bd_addr))
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
/*******************************************************************************
@@ -306,12 +306,12 @@
void bta_pan_enable(tBTA_PAN_DATA *p_data)
{
tPAN_REGISTER reg_data;
- UINT16 initial_discoverability;
- UINT16 initial_connectability;
- UINT16 d_window;
- UINT16 d_interval;
- UINT16 c_window;
- UINT16 c_interval;
+ uint16_t initial_discoverability;
+ uint16_t initial_connectability;
+ uint16_t d_window;
+ uint16_t d_interval;
+ uint16_t c_window;
+ uint16_t c_interval;
bta_pan_cb.p_cback = p_data->api_enable.p_cback;
@@ -355,7 +355,7 @@
{
tPAN_RESULT status;
tBTA_PAN_SET_ROLE set_role;
- UINT8 sec[3];
+ uint8_t sec[3];
bta_pan_cb.app_id[0] = p_data->api_set_role.user_app_id;
@@ -422,7 +422,7 @@
BT_HDR *p_buf;
tBTA_PAN_SCB *p_scb = &bta_pan_cb.scb[0];
- UINT8 i;
+ uint8_t i;
/* close all connections */
@@ -550,8 +550,8 @@
if(p_data->conn.result == PAN_SUCCESS)
{
data.status = BTA_PAN_SUCCESS;
- p_scb->pan_flow_enable = TRUE;
- p_scb->app_flow_enable = TRUE;
+ p_scb->pan_flow_enable = true;
+ p_scb->app_flow_enable = true;
bta_sys_conn_open(BTA_ID_PAN ,p_scb->app_id, p_scb->bd_addr);
}
else
@@ -560,8 +560,8 @@
data.status = BTA_PAN_FAIL;
}
- p_scb->pan_flow_enable = TRUE;
- p_scb->app_flow_enable = TRUE;
+ p_scb->pan_flow_enable = true;
+ p_scb->app_flow_enable = true;
/* If app_id is NAP/GN, check whether there are multiple connections.
If there are, provide a special app_id to dm to enforce master role only. */
@@ -630,7 +630,7 @@
if ((bta_pan_cb.flow_mask & BTA_PAN_RX_MASK) == BTA_PAN_RX_PULL)
{
/* if we can accept data */
- if (p_scb->pan_flow_enable == TRUE)
+ if (p_scb->pan_flow_enable == true)
{
/* call application callout function for rx path */
bta_pan_co_rx_path(p_scb->handle, p_scb->app_id);
@@ -673,7 +673,7 @@
else if ((bta_pan_cb.flow_mask & BTA_PAN_TX_MASK) == BTA_PAN_TX_PUSH_BUF)
{
/* if app can accept data */
- if (p_scb->app_flow_enable == TRUE)
+ if (p_scb->app_flow_enable == true)
{
BT_HDR *p_buf;
diff --git a/bta/pan/bta_pan_api.c b/bta/pan/bta_pan_api.c
index 8968c15..3cf56a4 100644
--- a/bta/pan/bta_pan_api.c
+++ b/bta/pan/bta_pan_api.c
@@ -34,7 +34,7 @@
#include <string.h>
#include "bt_utils.h"
-#if defined(BTA_PAN_INCLUDED) && (BTA_PAN_INCLUDED == TRUE)
+#if (BTA_PAN_INCLUDED == TRUE)
static const tBTA_SYS_REG bta_pan_reg =
{
@@ -172,7 +172,7 @@
** Returns void
**
*******************************************************************************/
-void BTA_PanClose(UINT16 handle)
+void BTA_PanClose(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -208,7 +208,7 @@
UNUSED(peer_role);
}
-void BTA_PanClose(UINT16 handle)
+void BTA_PanClose(uint16_t handle)
{
UNUSED(handle);
}
diff --git a/bta/pan/bta_pan_ci.c b/bta/pan/bta_pan_ci.c
index ec77e60..bd3f348 100644
--- a/bta/pan/bta_pan_ci.c
+++ b/bta/pan/bta_pan_ci.c
@@ -34,7 +34,7 @@
#include "bta_pan_int.h"
#include "bt_utils.h"
-#if defined(BTA_PAN_INCLUDED) && (BTA_PAN_INCLUDED == TRUE)
+#if (BTA_PAN_INCLUDED == TRUE)
/*******************************************************************************
**
@@ -49,7 +49,7 @@
** Returns void
**
*******************************************************************************/
-void bta_pan_ci_tx_ready(UINT16 handle)
+void bta_pan_ci_tx_ready(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -72,7 +72,7 @@
** Returns void
**
*******************************************************************************/
-void bta_pan_ci_rx_ready(UINT16 handle)
+void bta_pan_ci_rx_ready(uint16_t handle)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
@@ -97,7 +97,7 @@
** Returns void
**
*******************************************************************************/
-void bta_pan_ci_tx_flow(UINT16 handle, BOOLEAN enable)
+void bta_pan_ci_tx_flow(uint16_t handle, bool enable)
{
tBTA_PAN_CI_TX_FLOW *p_buf =
(tBTA_PAN_CI_TX_FLOW *)osi_malloc(sizeof(tBTA_PAN_CI_TX_FLOW));
@@ -121,8 +121,8 @@
** Returns void
**
*******************************************************************************/
-void bta_pan_ci_rx_write(UINT16 handle, BD_ADDR dst, BD_ADDR src, UINT16 protocol,
- UINT8 *p_data, UINT16 len, BOOLEAN ext)
+void bta_pan_ci_rx_write(uint16_t handle, BD_ADDR dst, BD_ADDR src, uint16_t protocol,
+ uint8_t *p_data, uint16_t len, bool ext)
{
BT_HDR *p_buf = (BT_HDR *)osi_malloc(PAN_BUF_SIZE);
@@ -136,7 +136,7 @@
p_buf->len=len;
/* copy data */
- memcpy((UINT8 *)(p_buf + 1) + p_buf->offset, p_data, len);
+ memcpy((uint8_t *)(p_buf + 1) + p_buf->offset, p_data, len);
p_buf->layer_specific = handle;
p_buf->event = BTA_PAN_CI_RX_WRITEBUF_EVT;
@@ -158,8 +158,8 @@
** Returns void
**
*******************************************************************************/
-void bta_pan_ci_rx_writebuf(UINT16 handle, BD_ADDR dst, BD_ADDR src, UINT16 protocol,
- BT_HDR *p_buf, BOOLEAN ext)
+void bta_pan_ci_rx_writebuf(uint16_t handle, BD_ADDR dst, BD_ADDR src, uint16_t protocol,
+ BT_HDR *p_buf, bool ext)
{
/* copy all other params before the data */
@@ -186,8 +186,8 @@
** Returns void
**
*******************************************************************************/
-BT_HDR * bta_pan_ci_readbuf(UINT16 handle, BD_ADDR src, BD_ADDR dst, UINT16* p_protocol,
- BOOLEAN* p_ext, BOOLEAN* p_forward)
+BT_HDR * bta_pan_ci_readbuf(uint16_t handle, BD_ADDR src, BD_ADDR dst, uint16_t* p_protocol,
+ bool* p_ext, bool* p_forward)
{
tBTA_PAN_SCB * p_scb;
BT_HDR * p_buf;
@@ -218,8 +218,8 @@
** Returns void
**
*******************************************************************************/
-void bta_pan_ci_set_mfilters(UINT16 handle, UINT16 num_mcast_filters, UINT8 *p_start_array,
- UINT8 *p_end_array)
+void bta_pan_ci_set_mfilters(uint16_t handle, uint16_t num_mcast_filters, uint8_t *p_start_array,
+ uint8_t *p_end_array)
{
PAN_SetMulticastFilters(handle, num_mcast_filters, p_start_array, p_end_array);
@@ -237,7 +237,7 @@
** Returns void
**
*******************************************************************************/
-void bta_pan_ci_set_pfilters(UINT16 handle, UINT16 num_filters, UINT16 *p_start_array, UINT16 *p_end_array)
+void bta_pan_ci_set_pfilters(uint16_t handle, uint16_t num_filters, uint16_t *p_start_array, uint16_t *p_end_array)
{
PAN_SetProtocolFilters(handle, num_filters, p_start_array, p_end_array );
@@ -245,23 +245,23 @@
}
#else
-void bta_pan_ci_tx_ready(UINT16 handle)
+void bta_pan_ci_tx_ready(uint16_t handle)
{
UNUSED(handle);
}
-void bta_pan_ci_rx_ready(UINT16 handle)
+void bta_pan_ci_rx_ready(uint16_t handle)
{
UNUSED(handle);
}
-void bta_pan_ci_tx_flow(UINT16 handle, BOOLEAN enable)
+void bta_pan_ci_tx_flow(uint16_t handle, bool enable)
{
UNUSED(handle);
UNUSED(enable);
}
-void bta_pan_ci_rx_writebuf(UINT16 handle, BD_ADDR src, BD_ADDR dst, UINT16 protocol, BT_HDR *p_buf, BOOLEAN ext)
+void bta_pan_ci_rx_writebuf(uint16_t handle, BD_ADDR src, BD_ADDR dst, uint16_t protocol, BT_HDR *p_buf, bool ext)
{
UNUSED(handle);
UNUSED(src);
@@ -271,8 +271,8 @@
UNUSED(ext);
}
-BT_HDR * bta_pan_ci_readbuf(UINT16 handle, BD_ADDR src, BD_ADDR dst, UINT16 *p_protocol,
- BOOLEAN* p_ext, BOOLEAN* p_forward)
+BT_HDR * bta_pan_ci_readbuf(uint16_t handle, BD_ADDR src, BD_ADDR dst, uint16_t *p_protocol,
+ bool* p_ext, bool* p_forward)
{
UNUSED(handle);
UNUSED(src);
@@ -283,7 +283,7 @@
return NULL;
}
-void bta_pan_ci_set_pfilters(UINT16 handle, UINT16 num_filters, UINT16 *p_start_array, UINT16 *p_end_array)
+void bta_pan_ci_set_pfilters(uint16_t handle, uint16_t num_filters, uint16_t *p_start_array, uint16_t *p_end_array)
{
UNUSED(handle);
UNUSED(num_filters);
@@ -291,8 +291,8 @@
UNUSED(p_end_array);
}
-void bta_pan_ci_set_mfilters(UINT16 handle, UINT16 num_mcast_filters, UINT8 *p_start_array,
- UINT8 *p_end_array)
+void bta_pan_ci_set_mfilters(uint16_t handle, uint16_t num_mcast_filters, uint8_t *p_start_array,
+ uint8_t *p_end_array)
{
UNUSED(handle);
UNUSED(num_mcast_filters);
diff --git a/bta/pan/bta_pan_int.h b/bta/pan/bta_pan_int.h
index cd36ef2..cc619bc 100644
--- a/bta/pan/bta_pan_int.h
+++ b/bta/pan/bta_pan_int.h
@@ -87,9 +87,9 @@
char gn_name[BTA_SERVICE_NAME_LEN+1]; /* Service name */
char nap_name[BTA_SERVICE_NAME_LEN+1]; /* Service name */
tBTA_PAN_ROLE role;
- UINT8 user_app_id;
- UINT8 gn_app_id;
- UINT8 nap_app_id;
+ uint8_t user_app_id;
+ uint8_t gn_app_id;
+ uint8_t nap_app_id;
tBTA_SEC user_sec_mask; /* Security mask */
tBTA_SEC gn_sec_mask; /* Security mask */
tBTA_SEC nap_sec_mask; /* Security mask */
@@ -110,7 +110,7 @@
typedef struct
{
BT_HDR hdr; /* Event header */
- BOOLEAN enable; /* Flow control setting */
+ bool enable; /* Flow control setting */
} tBTA_PAN_CI_TX_FLOW;
/* data type for BTA_PAN_CONN_OPEN_EVT */
@@ -140,15 +140,15 @@
{
BD_ADDR bd_addr; /* peer bdaddr */
fixed_queue_t *data_queue; /* Queue of buffers waiting to be passed to application */
- UINT16 handle; /* BTA PAN/BNEP handle */
- BOOLEAN in_use; /* scb in use */
+ uint16_t handle; /* BTA PAN/BNEP handle */
+ bool in_use; /* scb in use */
tBTA_SEC sec_mask; /* Security mask */
- BOOLEAN pan_flow_enable;/* BNEP flow control state */
- BOOLEAN app_flow_enable;/* Application flow control state */
- UINT8 state; /* State machine state */
+ bool pan_flow_enable;/* BNEP flow control state */
+ bool app_flow_enable;/* Application flow control state */
+ uint8_t state; /* State machine state */
tBTA_PAN_ROLE local_role; /* local role */
tBTA_PAN_ROLE peer_role; /* peer role */
- UINT8 app_id; /* application id for the connection */
+ uint8_t app_id; /* application id for the connection */
} tBTA_PAN_SCB;
@@ -159,9 +159,9 @@
{
tBTA_PAN_SCB scb[BTA_PAN_NUM_CONN]; /* state machine control blocks */
tBTA_PAN_CBACK *p_cback; /* PAN callback function */
- UINT8 app_id[3]; /* application id for PAN roles */
- UINT8 flow_mask; /* Data flow mask */
- UINT8 q_level; /* queue level set by application for TX data */
+ uint8_t app_id[3]; /* application id for PAN roles */
+ uint8_t flow_mask; /* Data flow mask */
+ uint8_t q_level; /* queue level set by application for TX data */
} tBTA_PAN_CB;
@@ -172,9 +172,9 @@
BT_HDR hdr;
BD_ADDR src;
BD_ADDR dst;
- UINT16 protocol;
- BOOLEAN ext;
- BOOLEAN forward;
+ uint16_t protocol;
+ bool ext;
+ bool forward;
} tBTA_PAN_DATA_PARAMS;
@@ -185,7 +185,7 @@
/* PAN control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_PAN_CB bta_pan_cb;
#else
extern tBTA_PAN_CB *bta_pan_cb_ptr;
@@ -197,9 +197,9 @@
*****************************************************************************/
extern tBTA_PAN_SCB *bta_pan_scb_alloc(void);
extern void bta_pan_scb_dealloc(tBTA_PAN_SCB *p_scb);
-extern UINT8 bta_pan_scb_to_idx(tBTA_PAN_SCB *p_scb);
-extern tBTA_PAN_SCB *bta_pan_scb_by_handle(UINT16 handle);
-extern BOOLEAN bta_pan_hdl_event(BT_HDR *p_msg);
+extern uint8_t bta_pan_scb_to_idx(tBTA_PAN_SCB *p_scb);
+extern tBTA_PAN_SCB *bta_pan_scb_by_handle(uint16_t handle);
+extern bool bta_pan_hdl_event(BT_HDR *p_msg);
/* action functions */
extern void bta_pan_enable(tBTA_PAN_DATA *p_data);
diff --git a/bta/pan/bta_pan_main.c b/bta/pan/bta_pan_main.c
index a766f2e..2d35c42 100644
--- a/bta/pan/bta_pan_main.c
+++ b/bta/pan/bta_pan_main.c
@@ -24,7 +24,7 @@
#include "bt_target.h"
-#if defined(BTA_PAN_INCLUDED) && (BTA_PAN_INCLUDED == TRUE)
+#if (BTA_PAN_INCLUDED == TRUE)
#include <string.h>
#include "bta_api.h"
@@ -85,7 +85,7 @@
/* state table for listen state */
-const UINT8 bta_pan_st_idle[][BTA_PAN_NUM_COLS] =
+const uint8_t bta_pan_st_idle[][BTA_PAN_NUM_COLS] =
{
/* API_CLOSE */ {BTA_PAN_API_CLOSE, BTA_PAN_IDLE_ST},
/* CI_TX_READY */ {BTA_PAN_IGNORE, BTA_PAN_IDLE_ST},
@@ -103,7 +103,7 @@
/* state table for open state */
-const UINT8 bta_pan_st_open[][BTA_PAN_NUM_COLS] =
+const uint8_t bta_pan_st_open[][BTA_PAN_NUM_COLS] =
{
/* API_CLOSE */ {BTA_PAN_API_CLOSE, BTA_PAN_OPEN_ST},
/* CI_TX_READY */ {BTA_PAN_TX_PATH, BTA_PAN_OPEN_ST},
@@ -118,7 +118,7 @@
};
/* state table for closing state */
-const UINT8 bta_pan_st_closing[][BTA_PAN_NUM_COLS] =
+const uint8_t bta_pan_st_closing[][BTA_PAN_NUM_COLS] =
{
/* API_CLOSE */ {BTA_PAN_IGNORE, BTA_PAN_CLOSING_ST},
/* CI_TX_READY */ {BTA_PAN_TX_PATH, BTA_PAN_CLOSING_ST},
@@ -133,7 +133,7 @@
};
/* type for state table */
-typedef const UINT8 (*tBTA_PAN_ST_TBL)[BTA_PAN_NUM_COLS];
+typedef const uint8_t (*tBTA_PAN_ST_TBL)[BTA_PAN_NUM_COLS];
/* state table */
const tBTA_PAN_ST_TBL bta_pan_st_tbl[] = {
@@ -147,7 +147,7 @@
*****************************************************************************/
/* PAN control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_PAN_CB bta_pan_cb;
#endif
@@ -170,7 +170,7 @@
{
if (!p_scb->in_use)
{
- p_scb->in_use = TRUE;
+ p_scb->in_use = true;
APPL_TRACE_DEBUG("bta_pan_scb_alloc %d", i);
break;
}
@@ -195,10 +195,10 @@
** Returns void
**
*******************************************************************************/
-static void bta_pan_sm_execute(tBTA_PAN_SCB *p_scb, UINT16 event, tBTA_PAN_DATA *p_data)
+static void bta_pan_sm_execute(tBTA_PAN_SCB *p_scb, uint16_t event, tBTA_PAN_DATA *p_data)
{
tBTA_PAN_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
int i;
APPL_TRACE_EVENT("PAN scb=%d event=0x%x state=%d", bta_pan_scb_to_idx(p_scb), event, p_scb->state);
@@ -318,10 +318,10 @@
** Returns Index of scb.
**
*******************************************************************************/
-UINT8 bta_pan_scb_to_idx(tBTA_PAN_SCB *p_scb)
+uint8_t bta_pan_scb_to_idx(tBTA_PAN_SCB *p_scb)
{
- return ((UINT8) (p_scb - bta_pan_cb.scb)) + 1;
+ return ((uint8_t) (p_scb - bta_pan_cb.scb)) + 1;
}
@@ -336,10 +336,10 @@
** Returns Pointer to scb or NULL if not found.
**
*******************************************************************************/
-tBTA_PAN_SCB *bta_pan_scb_by_handle(UINT16 handle)
+tBTA_PAN_SCB *bta_pan_scb_by_handle(uint16_t handle)
{
tBTA_PAN_SCB *p_scb = &bta_pan_cb.scb[0];
- UINT8 i;
+ uint8_t i;
for (i = 0; i < BTA_PAN_NUM_CONN; i++, p_scb++)
{
@@ -365,10 +365,10 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_pan_hdl_event(BT_HDR *p_msg)
+bool bta_pan_hdl_event(BT_HDR *p_msg)
{
tBTA_PAN_SCB *p_scb;
- BOOLEAN freebuf = TRUE;
+ bool freebuf = true;
switch (p_msg->event)
{
@@ -395,7 +395,7 @@
/* events that require buffer not be released */
case BTA_PAN_CI_RX_WRITEBUF_EVT:
- freebuf = FALSE;
+ freebuf = false;
if ((p_scb = bta_pan_scb_by_handle(p_msg->layer_specific)) != NULL)
{
bta_pan_sm_execute(p_scb, p_msg->event, (tBTA_PAN_DATA *) p_msg);
diff --git a/bta/pb/bta_pbs_int.h b/bta/pb/bta_pbs_int.h
index fb78842..3488986 100644
--- a/bta/pb/bta_pbs_int.h
+++ b/bta/pb/bta_pbs_int.h
@@ -49,10 +49,10 @@
/* Configuration structure */
typedef struct
{
- UINT8 realm_charset; /* Server only */
- BOOLEAN userid_req; /* TRUE if user id is required during obex authentication (Server only) */
- UINT8 supported_features; /* Server supported features */
- UINT8 supported_repositories; /* Server supported repositories */
+ uint8_t realm_charset; /* Server only */
+ bool userid_req; /* true if user id is required during obex authentication (Server only) */
+ uint8_t supported_features; /* Server supported features */
+ uint8_t supported_repositories; /* Server supported repositories */
} tBTA_PBS_CFG;
diff --git a/bta/sdp/bta_sdp.c b/bta/sdp/bta_sdp.c
index 88a68a5..613159a 100644
--- a/bta/sdp/bta_sdp.c
+++ b/bta/sdp/bta_sdp.c
@@ -33,7 +33,7 @@
** Constants and types
*****************************************************************************/
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_SDP_CB bta_sdp_cb;
#endif
@@ -59,18 +59,18 @@
**
** Returns void
*******************************************************************************/
-BOOLEAN bta_sdp_sm_execute(BT_HDR *p_msg)
+bool bta_sdp_sm_execute(BT_HDR *p_msg)
{
- if(p_msg == NULL) return FALSE;
+ if(p_msg == NULL) return false;
- BOOLEAN ret = FALSE;
- UINT16 action = (p_msg->event & 0x00ff);
+ bool ret = false;
+ uint16_t action = (p_msg->event & 0x00ff);
/* execute action functions */
if(action < BTA_SDP_NUM_ACTIONS)
{
(*bta_sdp_action[action])((tBTA_SDP_MSG*)p_msg);
- ret = TRUE;
+ ret = true;
}
return(ret);
diff --git a/bta/sdp/bta_sdp_act.c b/bta/sdp/bta_sdp_act.c
index 0168b9c..10b50c7 100644
--- a/bta/sdp/bta_sdp_act.c
+++ b/bta/sdp/bta_sdp_act.c
@@ -94,7 +94,7 @@
{
tSDP_DISC_ATTR *p_attr;
tSDP_PROTOCOL_ELEM pe;
- UINT16 pversion = 0;
+ uint16_t pversion = 0;
record->mns.hdr.type = SDP_TYPE_MAP_MNS;
record->mns.hdr.service_name_length = 0;
record->mns.hdr.service_name = NULL;
@@ -134,7 +134,7 @@
{
tSDP_DISC_ATTR *p_attr;
tSDP_PROTOCOL_ELEM pe;
- UINT16 pversion = -1;
+ uint16_t pversion = -1;
record->mas.hdr.type = SDP_TYPE_MAP_MAS;
record->mas.hdr.service_name_length = 0;
@@ -186,7 +186,7 @@
static void bta_create_pse_sdp_record(bluetooth_sdp_record *record, tSDP_DISC_REC *p_rec)
{
tSDP_DISC_ATTR *p_attr;
- UINT16 pversion;
+ uint16_t pversion;
tSDP_PROTOCOL_ELEM pe;
record->pse.hdr.type = SDP_TYPE_PBAP_PSE;
@@ -233,7 +233,7 @@
{
tSDP_DISC_ATTR *p_attr, *p_sattr;
tSDP_PROTOCOL_ELEM pe;
- UINT16 pversion = -1;
+ uint16_t pversion = -1;
record->ops.hdr.type = SDP_TYPE_OPP_SERVER;
record->ops.hdr.service_name_length = 0;
@@ -314,7 +314,7 @@
{
tSDP_DISC_ATTR *p_attr;
tSDP_PROTOCOL_ELEM pe;
- UINT16 pversion = -1;
+ uint16_t pversion = -1;
record->sap.hdr.type = SDP_TYPE_MAP_MAS;
record->sap.hdr.service_name_length = 0;
@@ -378,7 +378,7 @@
** Returns void
**
*******************************************************************************/
-static void bta_sdp_search_cback(UINT16 result, void * user_data)
+static void bta_sdp_search_cback(uint16_t result, void * user_data)
{
tSDP_DISC_REC *p_rec = NULL;
tBTA_SDP_SEARCH_COMP evt_data;
diff --git a/bta/sdp/bta_sdp_api.c b/bta/sdp/bta_sdp_api.c
index 50d74d4..e10c31e 100644
--- a/bta/sdp/bta_sdp_api.c
+++ b/bta/sdp/bta_sdp_api.c
@@ -59,8 +59,8 @@
{
tBTA_SDP_STATUS status = BTA_SDP_FAILURE;
- APPL_TRACE_API(__FUNCTION__);
- if(p_cback && FALSE == bta_sys_is_register(BTA_ID_SDP))
+ APPL_TRACE_API(__func__);
+ if(p_cback && false == bta_sys_is_register(BTA_ID_SDP))
{
memset(&bta_sdp_cb, 0, sizeof(tBTA_SDP_CB));
diff --git a/bta/sdp/bta_sdp_cfg.c b/bta/sdp/bta_sdp_cfg.c
index 477318c..9bc0aa3 100644
--- a/bta/sdp/bta_sdp_cfg.c
+++ b/bta/sdp/bta_sdp_cfg.c
@@ -28,7 +28,7 @@
#define BTA_SDP_DB_SIZE 4500
#endif
-static UINT8 __attribute__ ((aligned(4))) bta_sdp_db_data[BTA_SDP_DB_SIZE];
+static uint8_t __attribute__ ((aligned(4))) bta_sdp_db_data[BTA_SDP_DB_SIZE];
/* SDP configuration structure */
const tBTA_SDP_CFG bta_sdp_cfg =
diff --git a/bta/sdp/bta_sdp_int.h b/bta/sdp/bta_sdp_int.h
index 4f3f6a5..536e8e6 100644
--- a/bta/sdp/bta_sdp_int.h
+++ b/bta/sdp/bta_sdp_int.h
@@ -88,14 +88,14 @@
/* SDP control block */
typedef struct
{
- UINT8 sdp_active; /* see BTA_SDP_SDP_ACT_* */
+ uint8_t sdp_active; /* see BTA_SDP_SDP_ACT_* */
BD_ADDR remote_addr;
tBTA_SDP_DM_CBACK *p_dm_cback;
} tBTA_SDP_CB;
/* SDP control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_SDP_CB bta_sdp_cb;
#else
extern tBTA_SDP_CB *bta_sdp_cb_ptr;
@@ -105,7 +105,7 @@
/* config struct */
extern tBTA_SDP_CFG *p_bta_sdp_cfg;
-extern BOOLEAN bta_sdp_sm_execute(BT_HDR *p_msg);
+extern bool bta_sdp_sm_execute(BT_HDR *p_msg);
extern void bta_sdp_enable (tBTA_SDP_MSG *p_data);
extern void bta_sdp_search (tBTA_SDP_MSG *p_data);
diff --git a/bta/sys/bta_sys.h b/bta/sys/bta_sys.h
index b89898e..30faa77 100644
--- a/bta/sys/bta_sys.h
+++ b/bta/sys/bta_sys.h
@@ -37,10 +37,10 @@
*****************************************************************************/
/* vendor specific event handler function type */
-typedef BOOLEAN (tBTA_SYS_VS_EVT_HDLR)(UINT16 evt, void *p);
+typedef bool (tBTA_SYS_VS_EVT_HDLR)(uint16_t evt, void *p);
/* event handler function type */
-typedef BOOLEAN (tBTA_SYS_EVT_HDLR)(BT_HDR *p_msg);
+typedef bool (tBTA_SYS_EVT_HDLR)(BT_HDR *p_msg);
/* disable function type */
typedef void (tBTA_SYS_DISABLE)(void);
@@ -55,7 +55,7 @@
BTA_SYS_MAX_HW_MODULES
};
-typedef UINT16 tBTA_SYS_HW_MODULE;
+typedef uint16_t tBTA_SYS_HW_MODULE;
#ifndef BTA_DM_NUM_JV_ID
#define BTA_DM_NUM_JV_ID 2
@@ -113,7 +113,7 @@
#define BTA_ID_MAX (44 + BTA_DM_NUM_JV_ID)
-typedef UINT8 tBTA_SYS_ID;
+typedef uint8_t tBTA_SYS_ID;
#define BTA_SYS_CONN_OPEN 0x00
@@ -132,24 +132,24 @@
#define BTA_SYS_PLCY_DEF_CLR 0x13 /* clear the default link policy */
#define BTA_SYS_ROLE_CHANGE 0x14 /* role change */
-typedef UINT8 tBTA_SYS_CONN_STATUS;
+typedef uint8_t tBTA_SYS_CONN_STATUS;
/* Bitmask of sys features */
#define BTA_SYS_FEAT_PCM2 0x0001
#define BTA_SYS_FEAT_PCM2_MASTER 0x0002
/* tBTA_PREF_ROLES */
-typedef UINT8 tBTA_SYS_PREF_ROLES;
+typedef uint8_t tBTA_SYS_PREF_ROLES;
/* conn callback for role / low power manager*/
-typedef void (tBTA_SYS_CONN_CBACK)(tBTA_SYS_CONN_STATUS status,UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
+typedef void (tBTA_SYS_CONN_CBACK)(tBTA_SYS_CONN_STATUS status,uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
/* conn callback for role / low power manager*/
-typedef void (tBTA_SYS_SSR_CFG_CBACK)(UINT8 id, UINT8 app_id, UINT16 latency, UINT16 tout);
+typedef void (tBTA_SYS_SSR_CFG_CBACK)(uint8_t id, uint8_t app_id, uint16_t latency, uint16_t tout);
#if (BTA_EIR_CANNED_UUID_LIST != TRUE)
/* eir callback for adding/removeing UUID */
-typedef void (tBTA_SYS_EIR_CBACK)(UINT16 uuid16, BOOLEAN adding);
+typedef void (tBTA_SYS_EIR_CBACK)(uint16_t uuid16, bool adding);
#endif
/* registration structure */
@@ -171,7 +171,7 @@
*****************************************************************************/
/* trace level */
-extern UINT8 appl_trace_level;
+extern uint8_t appl_trace_level;
/*****************************************************************************
** Macros
@@ -210,7 +210,7 @@
BTA_SYS_HW_ERROR_EVT
};
-typedef UINT8 tBTA_SYS_HW_EVT;
+typedef uint8_t tBTA_SYS_HW_EVT;
/* HW enable callback type */
typedef void (tBTA_SYS_HW_CBACK)(tBTA_SYS_HW_EVT status);
@@ -222,11 +222,11 @@
extern void bta_sys_init(void);
extern void bta_sys_free(void);
extern void bta_sys_event(BT_HDR *p_msg);
-extern void bta_sys_set_trace_level(UINT8 level);
-extern void bta_sys_register(UINT8 id, const tBTA_SYS_REG *p_reg);
-extern void bta_sys_deregister(UINT8 id);
-extern BOOLEAN bta_sys_is_register(UINT8 id);
-extern UINT16 bta_sys_get_sys_features(void);
+extern void bta_sys_set_trace_level(uint8_t level);
+extern void bta_sys_register(uint8_t id, const tBTA_SYS_REG *p_reg);
+extern void bta_sys_deregister(uint8_t id);
+extern bool bta_sys_is_register(uint8_t id);
+extern uint16_t bta_sys_get_sys_features(void);
extern void bta_sys_sendmsg(void *p_msg);
extern void bta_sys_start_timer(alarm_t *alarm, period_ms_t interval,
uint16_t event, uint16_t layer_specific);
@@ -243,41 +243,41 @@
extern void bta_sys_sco_register(tBTA_SYS_CONN_CBACK * p_cback);
-extern void bta_sys_conn_open(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-extern void bta_sys_conn_close(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-extern void bta_sys_app_open(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-extern void bta_sys_app_close(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-extern void bta_sys_sco_open(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-extern void bta_sys_sco_close(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-extern void bta_sys_sco_use(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-extern void bta_sys_sco_unuse(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-extern void bta_sys_idle(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
-extern void bta_sys_busy(UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
+extern void bta_sys_conn_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_conn_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_app_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_app_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_sco_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_sco_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_sco_use(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_sco_unuse(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_idle(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
+extern void bta_sys_busy(uint8_t id, uint8_t app_id, BD_ADDR peer_addr);
#if (BTM_SSR_INCLUDED == TRUE)
extern void bta_sys_ssr_cfg_register(tBTA_SYS_SSR_CFG_CBACK * p_cback);
-extern void bta_sys_chg_ssr_config (UINT8 id, UINT8 app_id, UINT16 max_latency, UINT16 min_tout);
+extern void bta_sys_chg_ssr_config (uint8_t id, uint8_t app_id, uint16_t max_latency, uint16_t min_tout);
#endif
extern void bta_sys_role_chg_register(tBTA_SYS_CONN_CBACK * p_cback);
-extern void bta_sys_notify_role_chg(BD_ADDR_PTR p_bda, UINT8 new_role, UINT8 hci_status);
-extern void bta_sys_collision_register(UINT8 bta_id, tBTA_SYS_CONN_CBACK *p_cback);
+extern void bta_sys_notify_role_chg(BD_ADDR_PTR p_bda, uint8_t new_role, uint8_t hci_status);
+extern void bta_sys_collision_register(uint8_t bta_id, tBTA_SYS_CONN_CBACK *p_cback);
extern void bta_sys_notify_collision (BD_ADDR_PTR p_bda);
#if (BTA_EIR_CANNED_UUID_LIST != TRUE)
extern void bta_sys_eir_register(tBTA_SYS_EIR_CBACK * p_cback);
-extern void bta_sys_add_uuid(UINT16 uuid16);
-extern void bta_sys_remove_uuid(UINT16 uuid16);
+extern void bta_sys_add_uuid(uint16_t uuid16);
+extern void bta_sys_remove_uuid(uint16_t uuid16);
#else
#define bta_sys_eir_register(ut)
#define bta_sys_add_uuid(ut)
#define bta_sys_remove_uuid(ut)
#endif
-extern void bta_sys_set_policy (UINT8 id, UINT8 policy, BD_ADDR peer_addr);
-extern void bta_sys_clear_policy (UINT8 id, UINT8 policy, BD_ADDR peer_addr);
-extern void bta_sys_set_default_policy (UINT8 id, UINT8 policy);
-extern void bta_sys_clear_default_policy (UINT8 id, UINT8 policy);
+extern void bta_sys_set_policy (uint8_t id, uint8_t policy, BD_ADDR peer_addr);
+extern void bta_sys_clear_policy (uint8_t id, uint8_t policy, BD_ADDR peer_addr);
+extern void bta_sys_set_default_policy (uint8_t id, uint8_t policy);
+extern void bta_sys_clear_default_policy (uint8_t id, uint8_t policy);
#ifdef __cplusplus
}
diff --git a/bta/sys/bta_sys_conn.c b/bta/sys/bta_sys_conn.c
index ec2b177..1fae9e7 100644
--- a/bta/sys/bta_sys_conn.c
+++ b/bta/sys/bta_sys_conn.c
@@ -100,7 +100,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_notify_role_chg(BD_ADDR_PTR p_bda, UINT8 new_role, UINT8 hci_status)
+void bta_sys_notify_role_chg(BD_ADDR_PTR p_bda, uint8_t new_role, uint8_t hci_status)
{
if (bta_sys_cb.p_role_cb)
{
@@ -118,9 +118,9 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_collision_register(UINT8 bta_id, tBTA_SYS_CONN_CBACK *p_cback)
+void bta_sys_collision_register(uint8_t bta_id, tBTA_SYS_CONN_CBACK *p_cback)
{
- UINT8 index;
+ uint8_t index;
for (index = 0; index < MAX_COLLISION_REG; index++)
{
@@ -146,7 +146,7 @@
*******************************************************************************/
void bta_sys_notify_collision (BD_ADDR_PTR p_bda)
{
- UINT8 index;
+ uint8_t index;
for (index = 0; index < MAX_COLLISION_REG; index++)
{
@@ -199,7 +199,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_conn_open(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_conn_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
if(bta_sys_cb.prm_cb)
{
@@ -229,7 +229,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_conn_close(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_conn_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
if(bta_sys_cb.prm_cb)
{
@@ -258,7 +258,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_app_open(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_app_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
if(bta_sys_cb.ppm_cb)
{
@@ -278,7 +278,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_app_close(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_app_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
if(bta_sys_cb.ppm_cb)
{
@@ -297,7 +297,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_sco_open(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_sco_open(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
/* AG triggers p_sco_cb by bta_sys_sco_use. */
if((id != BTA_ID_AG) && (bta_sys_cb.p_sco_cb))
@@ -322,9 +322,9 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_sco_close(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_sco_close(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
- UINT8 num_sco_links;
+ uint8_t num_sco_links;
if((id != BTA_ID_AG) && (bta_sys_cb.p_sco_cb))
{
@@ -348,7 +348,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_sco_use(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_sco_use(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
UNUSED(id);
@@ -370,9 +370,9 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_sco_unuse(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_sco_unuse(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
- UINT8 num_sco_links;
+ uint8_t num_sco_links;
UNUSED(id);
if((bta_sys_cb.p_sco_cb))
@@ -392,7 +392,7 @@
**
*******************************************************************************/
#if (BTM_SSR_INCLUDED == TRUE)
-void bta_sys_chg_ssr_config (UINT8 id, UINT8 app_id, UINT16 max_latency, UINT16 min_tout)
+void bta_sys_chg_ssr_config (uint8_t id, uint8_t app_id, uint16_t max_latency, uint16_t min_tout)
{
if(bta_sys_cb.p_ssr_cb)
{
@@ -410,7 +410,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_set_policy (UINT8 id, UINT8 policy, BD_ADDR peer_addr)
+void bta_sys_set_policy (uint8_t id, uint8_t policy, BD_ADDR peer_addr)
{
if(bta_sys_cb.p_policy_cb)
{
@@ -428,7 +428,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_clear_policy (UINT8 id, UINT8 policy, BD_ADDR peer_addr)
+void bta_sys_clear_policy (uint8_t id, uint8_t policy, BD_ADDR peer_addr)
{
if(bta_sys_cb.p_policy_cb)
{
@@ -446,7 +446,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_set_default_policy (UINT8 id, UINT8 policy)
+void bta_sys_set_default_policy (uint8_t id, uint8_t policy)
{
if(bta_sys_cb.p_policy_cb)
{
@@ -464,7 +464,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_clear_default_policy (UINT8 id, UINT8 policy)
+void bta_sys_clear_default_policy (uint8_t id, uint8_t policy)
{
if(bta_sys_cb.p_policy_cb)
{
@@ -482,7 +482,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_idle(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_idle(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
if(bta_sys_cb.prm_cb)
@@ -509,7 +509,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_busy(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
+void bta_sys_busy(uint8_t id, uint8_t app_id, BD_ADDR peer_addr)
{
if(bta_sys_cb.prm_cb)
{
@@ -552,11 +552,11 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_add_uuid(UINT16 uuid16)
+void bta_sys_add_uuid(uint16_t uuid16)
{
if(bta_sys_cb.eir_cb)
{
- bta_sys_cb.eir_cb(uuid16, TRUE );
+ bta_sys_cb.eir_cb(uuid16, true );
}
}
@@ -570,11 +570,11 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_remove_uuid(UINT16 uuid16)
+void bta_sys_remove_uuid(uint16_t uuid16)
{
if(bta_sys_cb.eir_cb)
{
- bta_sys_cb.eir_cb(uuid16, FALSE);
+ bta_sys_cb.eir_cb(uuid16, false);
}
}
#endif
diff --git a/bta/sys/bta_sys_int.h b/bta/sys/bta_sys_int.h
index e9c1929..b81886e 100644
--- a/bta/sys/bta_sys_int.h
+++ b/bta/sys/bta_sys_int.h
@@ -40,14 +40,14 @@
BTA_SYS_HW_ON,
BTA_SYS_HW_STOPPING
};
-typedef UINT8 tBTA_SYS_HW_STATE;
+typedef uint8_t tBTA_SYS_HW_STATE;
/* Collision callback */
#define MAX_COLLISION_REG 5
typedef struct
{
- UINT8 id[MAX_COLLISION_REG];
+ uint8_t id[MAX_COLLISION_REG];
tBTA_SYS_CONN_CBACK *p_coll_cback[MAX_COLLISION_REG];
} tBTA_SYS_COLLISION;
@@ -55,11 +55,11 @@
typedef struct
{
tBTA_SYS_REG *reg[BTA_ID_MAX]; /* registration structures */
- BOOLEAN is_reg[BTA_ID_MAX]; /* registration structures */
+ bool is_reg[BTA_ID_MAX]; /* registration structures */
tBTA_SYS_HW_STATE state;
tBTA_SYS_HW_CBACK *sys_hw_cback[BTA_SYS_MAX_HW_MODULES]; /* enable callback for each HW modules */
- UINT32 sys_hw_module_active; /* bitmask of all active modules */
- UINT16 sys_features; /* Bitmask of sys features */
+ uint32_t sys_hw_module_active; /* bitmask of all active modules */
+ uint16_t sys_features; /* Bitmask of sys features */
tBTA_SYS_CONN_CBACK *prm_cb; /* role management callback registered by DM */
tBTA_SYS_CONN_CBACK *ppm_cb; /* low power management callback registered by DM */
@@ -83,7 +83,7 @@
*****************************************************************************/
/* system manager control block */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
extern tBTA_SYS_CB bta_sys_cb;
#else
extern tBTA_SYS_CB *bta_sys_cb_ptr;
@@ -99,6 +99,6 @@
void bta_sys_hw_evt_disabled(tBTA_SYS_HW_MSG *p_sys_hw_msg);
void bta_sys_hw_evt_stack_enabled(tBTA_SYS_HW_MSG *p_sys_hw_msg);
-BOOLEAN bta_sys_sm_execute(BT_HDR *p_msg);
+bool bta_sys_sm_execute(BT_HDR *p_msg);
#endif /* BTA_SYS_INT_H */
diff --git a/bta/sys/bta_sys_main.c b/bta/sys/bta_sys_main.c
index 320703e..1938519 100644
--- a/bta/sys/bta_sys_main.c
+++ b/bta/sys/bta_sys_main.c
@@ -40,12 +40,12 @@
#include "osi/include/thread.h"
#include "utl.h"
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == true)
#include "bta_ar_api.h"
#endif
/* system manager control block definition */
-#if BTA_DYNAMIC_MEMORY == FALSE
+#if (BTA_DYNAMIC_MEMORY == FALSE)
tBTA_SYS_CB bta_sys_cb;
#endif
@@ -54,8 +54,8 @@
/* trace level */
/* TODO Hard-coded trace levels - Needs to be configurable */
-UINT8 appl_trace_level = BT_TRACE_LEVEL_WARNING; //APPL_INITIAL_TRACE_LEVEL;
-UINT8 btif_trace_level = BT_TRACE_LEVEL_WARNING;
+uint8_t appl_trace_level = BT_TRACE_LEVEL_WARNING; //APPL_INITIAL_TRACE_LEVEL;
+uint8_t btif_trace_level = BT_TRACE_LEVEL_WARNING;
// Communication queue between btu_task and bta.
extern fixed_queue_t *btu_bta_msg_queue;
@@ -104,7 +104,7 @@
/* state table for OFF state */
-const UINT8 bta_sys_hw_off[][BTA_SYS_NUM_COLS] =
+const uint8_t bta_sys_hw_off[][BTA_SYS_NUM_COLS] =
{
/* Event Action 1 Action 2 Next State */
/* API_ENABLE */ {BTA_SYS_HW_API_ENABLE, BTA_SYS_IGNORE, BTA_SYS_HW_STARTING},
@@ -115,7 +115,7 @@
/* EVT_ERROR */ {BTA_SYS_IGNORE, BTA_SYS_IGNORE, BTA_SYS_HW_OFF}
};
-const UINT8 bta_sys_hw_starting[][BTA_SYS_NUM_COLS] =
+const uint8_t bta_sys_hw_starting[][BTA_SYS_NUM_COLS] =
{
/* Event Action 1 Action 2 Next State */
/* API_ENABLE */ {BTA_SYS_IGNORE, BTA_SYS_IGNORE, BTA_SYS_HW_STARTING}, /* wait for completion event */
@@ -126,7 +126,7 @@
/* EVT_ERROR */ {BTA_SYS_HW_ERROR, BTA_SYS_IGNORE, BTA_SYS_HW_ON}
};
-const UINT8 bta_sys_hw_on[][BTA_SYS_NUM_COLS] =
+const uint8_t bta_sys_hw_on[][BTA_SYS_NUM_COLS] =
{
/* Event Action 1 Action 2 Next State */
/* API_ENABLE */ {BTA_SYS_HW_API_ENABLE, BTA_SYS_IGNORE, BTA_SYS_HW_ON},
@@ -137,7 +137,7 @@
/* EVT_ERROR */ {BTA_SYS_HW_ERROR, BTA_SYS_IGNORE, BTA_SYS_HW_ON}
};
-const UINT8 bta_sys_hw_stopping[][BTA_SYS_NUM_COLS] =
+const uint8_t bta_sys_hw_stopping[][BTA_SYS_NUM_COLS] =
{
/* Event Action 1 Action 2 Next State */
/* API_ENABLE */ {BTA_SYS_IGNORE, BTA_SYS_IGNORE, BTA_SYS_HW_STARTING}, /* change state, and wait for completion event to enable */
@@ -148,7 +148,7 @@
/* EVT_ERROR */ {BTA_SYS_HW_API_DISABLE, BTA_SYS_IGNORE, BTA_SYS_HW_STOPPING}
};
-typedef const UINT8 (*tBTA_SYS_ST_TBL)[BTA_SYS_NUM_COLS];
+typedef const uint8_t (*tBTA_SYS_ST_TBL)[BTA_SYS_NUM_COLS];
/* state table */
const tBTA_SYS_ST_TBL bta_sys_st_tbl[] = {
@@ -184,7 +184,7 @@
/* register for BTM notifications */
BTM_RegisterForDeviceStatusNotif ((tBTM_DEV_STATUS_CB*)&bta_sys_hw_btm_cback );
-#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
+#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == true)
bta_ar_init();
#endif
@@ -206,11 +206,11 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_sys_sm_execute(BT_HDR *p_msg)
+bool bta_sys_sm_execute(BT_HDR *p_msg)
{
- BOOLEAN freebuf = TRUE;
+ bool freebuf = true;
tBTA_SYS_ST_TBL state_table;
- UINT8 action;
+ uint8_t action;
int i;
APPL_TRACE_EVENT("bta_sys_sm_execute state:%d, event:0x%x", bta_sys_cb.state, p_msg->event);
@@ -292,14 +292,14 @@
*******************************************************************************/
void bta_sys_hw_error(tBTA_SYS_HW_MSG *p_sys_hw_msg)
{
- UINT8 module_index;
+ uint8_t module_index;
UNUSED(p_sys_hw_msg);
- APPL_TRACE_DEBUG("%s", __FUNCTION__);
+ APPL_TRACE_DEBUG("%s", __func__);
for (module_index = 0; module_index < BTA_SYS_MAX_HW_MODULES; module_index++)
{
- if( bta_sys_cb.sys_hw_module_active & ((UINT32)1 << module_index )) {
+ if( bta_sys_cb.sys_hw_module_active & ((uint32_t)1 << module_index )) {
switch( module_index)
{
case BTA_SYS_HW_BLUETOOTH:
@@ -333,7 +333,7 @@
if ((!bta_sys_cb.sys_hw_module_active) && (bta_sys_cb.state != BTA_SYS_HW_ON))
{
/* register which HW module was turned on */
- bta_sys_cb.sys_hw_module_active |= ((UINT32)1 << p_sys_hw_msg->hw_module );
+ bta_sys_cb.sys_hw_module_active |= ((uint32_t)1 << p_sys_hw_msg->hw_module );
tBTA_SYS_HW_MSG *p_msg =
(tBTA_SYS_HW_MSG *)osi_malloc(sizeof(tBTA_SYS_HW_MSG));
@@ -345,7 +345,7 @@
else
{
/* register which HW module was turned on */
- bta_sys_cb.sys_hw_module_active |= ((UINT32)1 << p_sys_hw_msg->hw_module );
+ bta_sys_cb.sys_hw_module_active |= ((uint32_t)1 << p_sys_hw_msg->hw_module );
/* HW already in use, so directly notify the caller */
if (bta_sys_cb.sys_hw_cback[p_sys_hw_msg->hw_module ]!= NULL )
@@ -377,7 +377,7 @@
/* register which module we turn off */
- bta_sys_cb.sys_hw_module_active &= ~((UINT32)1 << p_sys_hw_msg->hw_module );
+ bta_sys_cb.sys_hw_module_active &= ~((uint32_t)1 << p_sys_hw_msg->hw_module );
/* if there are still some SW modules using the HW, just provide an answer to the calling */
@@ -430,7 +430,7 @@
*******************************************************************************/
void bta_sys_hw_evt_disabled(tBTA_SYS_HW_MSG *p_sys_hw_msg)
{
- UINT8 hw_module_index;
+ uint8_t hw_module_index;
APPL_TRACE_DEBUG("bta_sys_hw_evt_disabled - module 0x%X", p_sys_hw_msg->hw_module);
@@ -453,7 +453,7 @@
*******************************************************************************/
void bta_sys_hw_evt_stack_enabled(tBTA_SYS_HW_MSG *p_sys_hw_msg)
{
- UINT8 hw_module_index;
+ uint8_t hw_module_index;
UNUSED(p_sys_hw_msg);
APPL_TRACE_DEBUG(" bta_sys_hw_evt_stack_enabled!notify the callers");
@@ -480,13 +480,13 @@
*******************************************************************************/
void bta_sys_event(BT_HDR *p_msg)
{
- UINT8 id;
- BOOLEAN freebuf = TRUE;
+ uint8_t id;
+ bool freebuf = true;
APPL_TRACE_EVENT("BTA got event 0x%x", p_msg->event);
/* get subsystem id from event */
- id = (UINT8) (p_msg->event >> 8);
+ id = (uint8_t) (p_msg->event >> 8);
/* verify id and call subsystem event handler */
if ((id < BTA_ID_MAX) && (bta_sys_cb.reg[id] != NULL))
@@ -516,10 +516,10 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_register(UINT8 id, const tBTA_SYS_REG *p_reg)
+void bta_sys_register(uint8_t id, const tBTA_SYS_REG *p_reg)
{
bta_sys_cb.reg[id] = (tBTA_SYS_REG *) p_reg;
- bta_sys_cb.is_reg[id] = TRUE;
+ bta_sys_cb.is_reg[id] = true;
}
/*******************************************************************************
@@ -533,9 +533,9 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_deregister(UINT8 id)
+void bta_sys_deregister(uint8_t id)
{
- bta_sys_cb.is_reg[id] = FALSE;
+ bta_sys_cb.is_reg[id] = false;
}
/*******************************************************************************
@@ -549,7 +549,7 @@
** Returns void
**
*******************************************************************************/
-BOOLEAN bta_sys_is_register(UINT8 id)
+bool bta_sys_is_register(uint8_t id)
{
return bta_sys_cb.is_reg[id];
}
@@ -628,7 +628,7 @@
{
if (bta_sys_cb.reg[bta_id] != NULL)
{
- if (bta_sys_cb.is_reg[bta_id] == TRUE && bta_sys_cb.reg[bta_id]->disable != NULL)
+ if (bta_sys_cb.is_reg[bta_id] == true && bta_sys_cb.reg[bta_id]->disable != NULL)
{
(*bta_sys_cb.reg[bta_id]->disable)();
}
@@ -645,7 +645,7 @@
** Returns void
**
*******************************************************************************/
-void bta_sys_set_trace_level(UINT8 level)
+void bta_sys_set_trace_level(uint8_t level)
{
appl_trace_level = level;
}
@@ -659,7 +659,7 @@
** Returns sys_features
**
*******************************************************************************/
-UINT16 bta_sys_get_sys_features (void)
+uint16_t bta_sys_get_sys_features (void)
{
return bta_sys_cb.sys_features;
}
diff --git a/bta/sys/utl.c b/bta/sys/utl.c
index fc3d7eb..61b8d43 100644
--- a/bta/sys/utl.c
+++ b/bta/sys/utl.c
@@ -39,9 +39,9 @@
** Returns Integer value or -1 on error.
**
*******************************************************************************/
-INT16 utl_str2int(const char *p_s)
+int16_t utl_str2int(const char *p_s)
{
- INT32 val = 0;
+ int32_t val = 0;
for (;*p_s == ' ' && *p_s != 0; p_s++);
@@ -51,13 +51,13 @@
{
if ((*p_s < '0') || (*p_s > '9')) return -1;
- val += (INT32) (*p_s++ - '0');
+ val += (int32_t) (*p_s++ - '0');
if (val > 32767) return -1;
if (*p_s == 0)
{
- return (INT16) val;
+ return (int16_t) val;
}
else
{
@@ -111,7 +111,7 @@
**
** Function utl_itoa
**
-** Description This utility function converts a UINT16 to a string. The
+** Description This utility function converts a uint16_t to a string. The
** string is NULL-terminated. The length of the string is
** returned;
**
@@ -119,11 +119,11 @@
** Returns Length of string.
**
*******************************************************************************/
-UINT8 utl_itoa(UINT16 i, char *p_s)
+uint8_t utl_itoa(uint16_t i, char *p_s)
{
- UINT16 j, k;
+ uint16_t j, k;
char *p = p_s;
- BOOLEAN fill = FALSE;
+ bool fill = false;
if (i == 0)
{
@@ -139,12 +139,12 @@
if (k > 0 || fill)
{
*p++ = k + '0';
- fill = TRUE;
+ fill = true;
}
}
}
*p = 0;
- return (UINT8) (p - p_s);
+ return (uint8_t) (p - p_s);
}
/*******************************************************************************
@@ -163,14 +163,14 @@
** BTA_UTL_SET_COD_ALL - overwrite major, minor, set the bits in service class
** BTA_UTL_INIT_COD - overwrite major, minor, and service class
**
-** Returns TRUE if successful, Otherwise FALSE
+** Returns true if successful, Otherwise false
**
*******************************************************************************/
-BOOLEAN utl_set_device_class(tBTA_UTL_COD *p_cod, UINT8 cmd)
+bool utl_set_device_class(tBTA_UTL_COD *p_cod, uint8_t cmd)
{
- UINT8 *dev;
- UINT16 service;
- UINT8 minor, major;
+ uint8_t *dev;
+ uint16_t service;
+ uint8_t minor, major;
DEV_CLASS dev_class;
dev = BTM_ReadDeviceClass();
@@ -210,16 +210,16 @@
break;
default:
- return FALSE;
+ return false;
}
/* convert the fields into the device class type */
FIELDS_TO_COD(dev_class, minor, major, service);
if (BTM_SetDeviceClass(dev_class) == BTM_SUCCESS)
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
/*******************************************************************************
@@ -230,20 +230,20 @@
** integer string or not
**
**
-** Returns TRUE if successful, Otherwise FALSE
+** Returns true if successful, Otherwise false
**
*******************************************************************************/
-BOOLEAN utl_isintstr(const char *p_s)
+bool utl_isintstr(const char *p_s)
{
- UINT16 i = 0;
+ uint16_t i = 0;
for(i=0; p_s[i] != 0; i++)
{
if(((p_s[i] < '0') || (p_s[i] > '9')) && (p_s[i] != ';'))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/*******************************************************************************
@@ -254,12 +254,12 @@
** only dial digits or not
**
**
-** Returns TRUE if successful, Otherwise FALSE
+** Returns true if successful, Otherwise false
**
*******************************************************************************/
-BOOLEAN utl_isdialstr(const char *p_s)
+bool utl_isdialstr(const char *p_s)
{
- UINT16 i = 0;
+ uint16_t i = 0;
for(i=0; p_s[i] != 0; i++)
{
@@ -268,10 +268,10 @@
|| ((p_s[i] >= 'A') && (p_s[i] <= 'C'))
|| ((p_s[i] == 'p') || (p_s[i] == 'P')
|| (p_s[i] == 'w') || (p_s[i] == 'W'))))
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}