char clip[BTA_AG_AT_MAX_LEN+1]; /* number string used for CLIP */
UINT16 serv_handle[BTA_AG_NUM_IDX]; /* RFCOMM server handles */
tBTA_AG_AT_CB at_cb; /* AT command interpreter */
- TIMER_LIST_ENT act_timer; /* ring timer */
+ timer_entry_t act_timer; /* ring timer */
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 */
BOOLEAN codec_updated; /* set to TRUE whenever the app updates codec type */
BOOLEAN 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 */
- TIMER_LIST_ENT cn_timer; /* codec negotiation timer */
+ timer_entry_t cn_timer; /* codec negotiation timer */
#endif
UINT16 sco_idx; /* SCO handle */
BOOLEAN in_use; /* scb in use */
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 */
- TIMER_LIST_ENT colli_timer; /* Collision timer */
+ timer_entry_t colli_timer; /* Collision timer */
BOOLEAN colli_tmr_on; /* TRUE if collision timer is active */
UINT8 state; /* state machine state */
UINT8 conn_service; /* connected service */
static void bta_ag_timer_cback(void *p)
{
BT_HDR *p_buf;
- TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *) p;
+ timer_entry_t *p_te = (timer_entry_t *) p;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
{
- p_buf->event = p_tle->event;
- p_buf->layer_specific = bta_ag_scb_to_idx((tBTA_AG_SCB *) p_tle->param);
+ p_buf->event = p_te->event;
+ p_buf->layer_specific = bta_ag_scb_to_idx((tBTA_AG_SCB *) p_te->param);
bta_sys_sendmsg(p_buf);
}
}
** Returns void
**
*******************************************************************************/
-static void bta_ag_colli_timer_cback (TIMER_LIST_ENT *p_tle)
+static void bta_ag_colli_timer_cback (timer_entry_t *p_te)
{
tBTA_AG_SCB *p_scb;
APPL_TRACE_DEBUG ("bta_ag_colli_timer_cback");
- if (p_tle)
+ if (p_te)
{
- p_scb = (tBTA_AG_SCB *)p_tle->param;
+ p_scb = (tBTA_AG_SCB *)p_te->param;
if (p_scb)
{
bta_ag_start_servers(p_scb, p_scb->reg_services);
/* Start timer to han */
- p_scb->colli_timer.p_cback = (TIMER_CBACK*)&bta_ag_colli_timer_cback;
+ p_scb->colli_timer.p_cback =
+ (timer_callback_t *)&bta_ag_colli_timer_cback;
p_scb->colli_timer.param = p_scb;
bta_sys_start_timer(&p_scb->colli_timer, 0, BTA_AG_COLLISION_TIMER);
p_scb->colli_tmr_on = TRUE;
** Returns void
**
*******************************************************************************/
-static void bta_ag_cn_timer_cback (TIMER_LIST_ENT *p_tle)
+static void bta_ag_cn_timer_cback (timer_entry_t *p_te)
{
tBTA_AG_SCB *p_scb;
- if (p_tle)
+ if (p_te)
{
- p_scb = (tBTA_AG_SCB *)p_tle->param;
+ p_scb = (tBTA_AG_SCB *)p_te->param;
if (p_scb)
{
bta_ag_send_bcs(p_scb, NULL);
/* Start timer to handle timeout */
- p_scb->cn_timer.p_cback = (TIMER_CBACK*)&bta_ag_cn_timer_cback;
+ p_scb->cn_timer.p_cback = (timer_callback_t *)&bta_ag_cn_timer_cback;
p_scb->cn_timer.param = p_scb;
bta_sys_start_timer(&p_scb->cn_timer, 0, BTA_AG_CODEC_NEGO_TIMEOUT);
}
#define BTA_AV_ACP_SIG_TIME_VAL 2000
#endif
-static void bta_av_acp_sig_timer_cback (TIMER_LIST_ENT *p_tle);
+static void bta_av_acp_sig_timer_cback(timer_entry_t *p_te);
/*******************************************************************************
**
// it as a UINT8 and then reassigns it as param that
// way, so should this be unsigned?
p_cb->acp_sig_tmr.param = INT_TO_PTR(xx);
- p_cb->acp_sig_tmr.p_cback = (TIMER_CBACK*)&bta_av_acp_sig_timer_cback;
+ p_cb->acp_sig_tmr.p_cback =
+ (timer_callback_t *)&bta_av_acp_sig_timer_cback;
bta_sys_start_timer(&p_cb->acp_sig_tmr, 0, BTA_AV_ACP_SIG_TIME_VAL);
}
break;
** Returns void
**
*******************************************************************************/
-static void bta_av_acp_sig_timer_cback (TIMER_LIST_ENT *p_tle)
+static void bta_av_acp_sig_timer_cback(timer_entry_t *p_te)
{
- UINT8 inx = PTR_TO_UINT(p_tle->param);
+ UINT8 inx = PTR_TO_UINT(p_te->param);
tBTA_AV_CB *p_cb = &bta_av_cb;
tBTA_AV_SCB *p_scb = NULL;
tBTA_AV_API_OPEN *p_buf;
p_scb->coll_mask |= BTA_AV_COLL_INC_TMR;
p_cb->acp_sig_tmr.param = UINT_TO_PTR(inx);
- p_cb->acp_sig_tmr.p_cback = (TIMER_CBACK *)&bta_av_acp_sig_timer_cback;
+ p_cb->acp_sig_tmr.p_cback =
+ (timer_callback_t *)&bta_av_acp_sig_timer_cback;
bta_sys_start_timer(&p_cb->acp_sig_tmr, 0, BTA_AV_ACP_SIG_TIME_VAL);
}
else
tBTA_AV_Q_INFO q_info;
tAVDT_SEP_INFO sep_info[BTA_AV_NUM_SEPS]; /* stream discovery results */
tAVDT_CFG cfg; /* local SEP configuration */
- TIMER_LIST_ENT timer; /* delay timer for AVRC CT */
+ timer_entry_t 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 */
tBTA_AV_CBACK *p_cback; /* application callback function */
tBTA_AV_RCB rcb[BTA_AV_NUM_RCB]; /* RCB control block */
tBTA_AV_LCB lcb[BTA_AV_NUM_LINKS+1]; /* link control block */
- TIMER_LIST_ENT sig_tmr; /* link timer */
- TIMER_LIST_ENT acp_sig_tmr; /* timer to monitor signalling when accepting */
+ timer_entry_t sig_tmr; /* link timer */
+ timer_entry_t acp_sig_tmr; /* timer to monitor signalling when accepting */
UINT32 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 */
** Returns void
**
*******************************************************************************/
-static void bta_av_timer_cback(void *p_tle)
+static void bta_av_timer_cback(void *p_te)
{
BT_HDR *p_buf;
- TIMER_LIST_ENT *p = (TIMER_LIST_ENT *)p_tle;
+ timer_entry_t *p = (timer_entry_t *)p_te;
int xx;
tBTA_AV_SCB *p_scb = NULL;
p_scb->app_id = registr.app_id;
/* initialize the stream control block */
- p_scb->timer.p_cback = (TIMER_CBACK*)&bta_av_timer_cback;
+ p_scb->timer.p_cback = (timer_callback_t *)&bta_av_timer_cback;
registr.status = BTA_AV_SUCCESS;
if((bta_av_cb.reg_audio + bta_av_cb.reg_video) == 0)
tBTA_SERVICE_MASK *p_services_to_search,
tBTA_SERVICE_MASK *p_services_found);
-static void bta_dm_search_timer_cback (TIMER_LIST_ENT *p_tle);
-static void bta_dm_disable_conn_down_timer_cback (TIMER_LIST_ENT *p_tle);
+static void bta_dm_search_timer_cback(timer_entry_t *p_te);
+static void bta_dm_disable_conn_down_timer_cback(timer_entry_t *p_te);
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 char *bta_dm_get_remname(void);
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_cmpl_cb(void * p_result);
-static void bta_dm_delay_role_switch_cback(TIMER_LIST_ENT *p_tle);
+static void bta_dm_delay_role_switch_cback(timer_entry_t *p_te);
extern void sdpu_uuid16_to_uuid128(UINT16 uuid16, UINT8* p_uuid128);
-static void bta_dm_disable_timer_cback(TIMER_LIST_ENT *p_tle);
+static void bta_dm_disable_timer_cback(timer_entry_t *p_te);
const UINT16 bta_service_id_to_uuid_lkup_tbl [BTA_MAX_SERVICE_ID] =
APPL_TRACE_WARNING("%s BTA_DISABLE_DELAY set to %d ms",
__FUNCTION__, BTA_DISABLE_DELAY);
bta_sys_stop_timer(&bta_dm_cb.disable_timer);
- bta_dm_cb.disable_timer.p_cback = (TIMER_CBACK*)&bta_dm_disable_conn_down_timer_cback;
+ bta_dm_cb.disable_timer.p_cback =
+ (timer_callback_t *)&bta_dm_disable_conn_down_timer_cback;
bta_sys_start_timer(&bta_dm_cb.disable_timer, 0, BTA_DISABLE_DELAY);
#else
bta_dm_disable_conn_down_timer_cback(NULL);
}
else
{
- bta_dm_cb.disable_timer.p_cback = (TIMER_CBACK*)&bta_dm_disable_timer_cback;
+ bta_dm_cb.disable_timer.p_cback =
+ (timer_callback_t *)&bta_dm_disable_timer_cback;
bta_dm_cb.disable_timer.param = INT_TO_PTR(0);
bta_sys_start_timer(&bta_dm_cb.disable_timer, 0, 5000);
}
** Returns void
**
*******************************************************************************/
-static void bta_dm_disable_timer_cback (TIMER_LIST_ENT *p_tle)
+static void bta_dm_disable_timer_cback(timer_entry_t *p_te)
{
- UNUSED(p_tle);
UINT8 i;
tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;
BOOLEAN trigger_disc = FALSE;
- APPL_TRACE_EVENT(" bta_dm_disable_timer_cback trial %d ", p_tle->param);
+ APPL_TRACE_EVENT(" bta_dm_disable_timer_cback trial %d ", p_te->param);
- if(BTM_GetNumAclLinks() && PTR_TO_INT(p_tle->param) == 0)
+ if(BTM_GetNumAclLinks() && PTR_TO_INT(p_te->param) == 0)
{
for(i=0; i<bta_dm_cb.device_list.count; i++)
{
to be sent out to avoid jave layer disable timeout */
if (trigger_disc)
{
- bta_dm_cb.disable_timer.p_cback = (TIMER_CBACK*)&bta_dm_disable_timer_cback;
+ bta_dm_cb.disable_timer.p_cback =
+ (timer_callback_t *)&bta_dm_disable_timer_cback;
bta_dm_cb.disable_timer.param = INT_TO_PTR(1);
bta_sys_start_timer(&bta_dm_cb.disable_timer, 0, 1500);
}
{
/* wait until link is disconnected or timeout */
bta_dm_search_cb.sdp_results = TRUE;
- bta_dm_search_cb.search_timer.p_cback = (TIMER_CBACK*)&bta_dm_search_timer_cback;
+ bta_dm_search_cb.search_timer.p_cback =
+ (timer_callback_t *)&bta_dm_search_timer_cback;
bta_sys_start_timer(&bta_dm_search_cb.search_timer, 0, 1000*(L2CAP_LINK_INACTIVITY_TOUT+1) );
}
** Returns void
**
*******************************************************************************/
-static void bta_dm_search_timer_cback (TIMER_LIST_ENT *p_tle)
+static void bta_dm_search_timer_cback(timer_entry_t *p_te)
{
- UNUSED(p_tle);
-
APPL_TRACE_EVENT("%s", __func__);
bta_dm_search_cb.wait_disc = FALSE;
if(!BTM_GetNumAclLinks())
{
bta_sys_stop_timer(&bta_dm_cb.disable_timer);
- bta_dm_cb.disable_timer.p_cback = (TIMER_CBACK*)&bta_dm_disable_conn_down_timer_cback;
+ bta_dm_cb.disable_timer.p_cback =
+ (timer_callback_t *)&bta_dm_disable_conn_down_timer_cback;
/*
* Start a timer to make sure that the profiles
* get the disconnect event.
** Returns void
**
*******************************************************************************/
-static void bta_dm_disable_conn_down_timer_cback (TIMER_LIST_ENT *p_tle)
+static void bta_dm_disable_conn_down_timer_cback(timer_entry_t *p_te)
{
- UNUSED(p_tle);
tBTA_SYS_HW_MSG *sys_enable_event;
/* disable the power managment module */
** Returns void
**
*******************************************************************************/
-static void bta_dm_delay_role_switch_cback(TIMER_LIST_ENT *p_tle)
+static void bta_dm_delay_role_switch_cback(timer_entry_t *p_te)
{
- UNUSED(p_tle);
APPL_TRACE_EVENT("bta_dm_delay_role_switch_cback: initiating Delayed RS");
bta_dm_adjust_roles (FALSE);
}
else
{
bta_dm_cb.switch_delay_timer.p_cback =
- (TIMER_CBACK*)&bta_dm_delay_role_switch_cback;
+ (timer_callback_t *)&bta_dm_delay_role_switch_cback;
bta_sys_start_timer(&bta_dm_cb.switch_delay_timer, 0, 500);
}
}
* Keep three different timers for PARK, SNIFF and SUSPEND if TBFC is
* supported.
*/
- TIMER_LIST_ENT timer[BTA_DM_PM_MODE_TIMER_MAX];
+ timer_entry_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];
#endif
UINT16 state;
BOOLEAN disabling;
- TIMER_LIST_ENT disable_timer;
+ timer_entry_t disable_timer;
UINT32 wbt_sdp_handle; /* WIDCOMM Extensions SDP record handle */
UINT8 wbt_scn; /* WIDCOMM Extensions SCN */
UINT8 num_master_only;
BOOLEAN just_works; /* TRUE, if "Just Works" association model */
#if ( BTA_EIR_CANNED_UUID_LIST != TRUE )
/* store UUID list for EIR */
- TIMER_LIST_ENT app_ready_timer;
+ timer_entry_t app_ready_timer;
UINT32 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];
tBTA_DM_ENCRYPT_CBACK *p_encrypt_cback;
- TIMER_LIST_ENT switch_delay_timer;
+ timer_entry_t switch_delay_timer;
} tBTA_DM_CB;
BD_ADDR peer_bdaddr;
BOOLEAN name_discover_done;
BD_NAME peer_name;
- TIMER_LIST_ENT search_timer;
+ timer_entry_t search_timer;
UINT8 service_index;
tBTA_DM_MSG * p_search_queue; /* search or discover commands during search cancel stored here */
BOOLEAN wait_disc;
UINT8 * p_ble_rawdata;
UINT32 ble_raw_size;
UINT32 ble_raw_used;
- TIMER_LIST_ENT gatt_close_timer; /* GATT channel close delay timer */
+ timer_entry_t gatt_close_timer; /* GATT channel close delay timer */
BD_ADDR pending_close_bda; /* pending GATT channel remote device address */
#endif
#endif
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_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 *p_tle);
+static void bta_dm_pm_timer_cback(void *p_te);
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);
p_timer->in_use = FALSE;
}
-UINT32 bta_dm_pm_get_remaining_ticks (TIMER_LIST_ENT *p_target_tle)
+UINT32 bta_dm_pm_get_remaining_ticks (timer_entry_t *p_target_te)
{
- return bta_sys_get_remaining_ticks(p_target_tle);
+ return bta_sys_get_remaining_ticks(p_target_te);
}
/*******************************************************************************
** Returns void
**
*******************************************************************************/
-static void bta_dm_pm_timer_cback(void *p_tle)
+static void bta_dm_pm_timer_cback(void *p_te)
{
UINT8 i, j;
{
for (j = 0; j < BTA_DM_PM_MODE_TIMER_MAX; j++)
{
- if(&bta_dm_cb.pm_timer[i].timer[j] == (TIMER_LIST_ENT*) p_tle)
+ if(&bta_dm_cb.pm_timer[i].timer[j] == (timer_entry_t *)p_te)
{
bta_dm_cb.pm_timer[i].active --;
bta_dm_cb.pm_timer[i].srvc_id[j] = BTA_ID_MAX;
}
}
-static void bta_hf_client_at_resp_timer_cback (TIMER_LIST_ENT *p_tle)
+static void bta_hf_client_at_resp_timer_cback(timer_entry_t *p_te)
{
- if (p_tle)
+ if (p_te)
{
bta_hf_client_cb.scb.at_cb.resp_timer_on = FALSE;
bta_sys_stop_timer (&bta_hf_client_cb.scb.at_cb.resp_timer);
}
- bta_hf_client_cb.scb.at_cb.resp_timer.p_cback = (TIMER_CBACK*)&bta_hf_client_at_resp_timer_cback;
+ bta_hf_client_cb.scb.at_cb.resp_timer.p_cback =
+ (timer_callback_t *)&bta_hf_client_at_resp_timer_cback;
bta_sys_start_timer(&bta_hf_client_cb.scb.at_cb.resp_timer, 0, BTA_HF_CLIENT_AT_TIMEOUT);
bta_hf_client_cb.scb.at_cb.resp_timer_on = TRUE;
}
}
}
-static void bta_hf_client_at_hold_timer_cback(TIMER_LIST_ENT *p_tle)
+static void bta_hf_client_at_hold_timer_cback(timer_entry_t *p_te)
{
APPL_TRACE_DEBUG("%s", __FUNCTION__);
- if (p_tle)
+ if (p_te)
{
bta_hf_client_cb.scb.at_cb.hold_timer_on = FALSE;
bta_hf_client_send_queued_at();
static void bta_hf_client_start_at_hold_timer(void)
{
- TIMER_LIST_ENT *timer = &bta_hf_client_cb.scb.at_cb.hold_timer;
+ timer_entry_t *p_te = &bta_hf_client_cb.scb.at_cb.hold_timer;
APPL_TRACE_DEBUG("%s", __FUNCTION__);
if (bta_hf_client_cb.scb.at_cb.hold_timer_on)
{
- bta_sys_stop_timer (timer);
+ bta_sys_stop_timer(p_te);
}
- timer->p_cback = (TIMER_CBACK*)&bta_hf_client_at_hold_timer_cback;
- bta_sys_start_timer(timer, 0, BTA_HF_CLIENT_AT_HOLD_TIMEOUT);
+ p_te->p_cback = (timer_callback_t *)&bta_hf_client_at_hold_timer_cback;
+ bta_sys_start_timer(p_te, 0, BTA_HF_CLIENT_AT_HOLD_TIMEOUT);
bta_hf_client_cb.scb.at_cb.hold_timer_on = TRUE;
}
tBTA_HF_CLIENT_AT_CMD current_cmd;
tBTA_HF_CLIENT_AT_QCMD *queued_cmd;
- TIMER_LIST_ENT resp_timer; /* AT response timer */
+ timer_entry_t resp_timer; /* AT response timer */
BOOLEAN resp_timer_on; /* TRUE if AT response timer is active */
- TIMER_LIST_ENT hold_timer; /* AT hold timer */
+ timer_entry_t hold_timer; /* AT hold timer */
BOOLEAN hold_timer_on; /* TRUE if AT hold timer is active */
/* CIND: lookup table to store the sequence of incoming indicators and their values
tBTA_HF_CLIENT_AT_CB at_cb; /* AT Parser control block */
UINT8 state; /* state machine state */
tBTM_SCO_CODEC_TYPE negotiated_codec; /* negotiated codec */
- TIMER_LIST_ENT colli_timer; /* Collision timer */
+ timer_entry_t colli_timer; /* Collision timer */
BOOLEAN colli_tmr_on; /* TRUE if collision timer is active */
} tBTA_HF_CLIENT_SCB;
** Returns void
**
*******************************************************************************/
-static void bta_hf_client_colli_timer_cback (TIMER_LIST_ENT *p_tle)
+static void bta_hf_client_colli_timer_cback (timer_entry_t *p_te)
{
APPL_TRACE_DEBUG("%s", __FUNCTION__);
- if (p_tle)
+ if (p_te)
{
bta_hf_client_cb.scb.colli_tmr_on = FALSE;
bta_hf_client_start_server();
/* Start timer to handle connection opening restart */
- bta_hf_client_cb.scb.colli_timer.p_cback = (TIMER_CBACK*)&bta_hf_client_colli_timer_cback;
+ bta_hf_client_cb.scb.colli_timer.p_cback =
+ (timer_callback_t *)&bta_hf_client_colli_timer_cback;
bta_sys_start_timer(&bta_hf_client_cb.scb.colli_timer, 0, BTA_HF_CLIENT_COLLISION_TIMER);
bta_hf_client_cb.scb.colli_tmr_on = TRUE;
}
#define BTA_SYS_H
#include "bt_target.h"
+#include "osi/include/non_repeating_timer.h"
#include "gki.h"
/*****************************************************************************
extern BOOLEAN bta_sys_is_register(UINT8 id);
extern UINT16 bta_sys_get_sys_features(void);
extern void bta_sys_sendmsg(void *p_msg);
-extern void bta_sys_start_timer(TIMER_LIST_ENT *p_tle, UINT16 type, INT32 timeout_ms);
-extern void bta_sys_stop_timer(TIMER_LIST_ENT *p_tle);
+extern void bta_sys_start_timer(timer_entry_t *p_te, UINT16 type, INT32 timeout_ms);
+extern void bta_sys_stop_timer(timer_entry_t *p_te);
extern void bta_sys_disable(tBTA_SYS_HW_MODULE module);
-extern UINT32 bta_sys_get_remaining_ticks(TIMER_LIST_ENT *p_target_tle);
+extern UINT32 bta_sys_get_remaining_ticks(timer_entry_t *p_target_te);
extern void bta_sys_hw_register( tBTA_SYS_HW_MODULE module, tBTA_SYS_HW_CBACK *cback);
extern void bta_sys_hw_unregister( tBTA_SYS_HW_MODULE module );
*******************************************************************************/
void bta_alarm_cb(void *data) {
assert(data != NULL);
- TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)data;
+ timer_entry_t *p_te = (timer_entry_t *)data;
- fixed_queue_enqueue(btu_bta_alarm_queue, p_tle);
+ fixed_queue_enqueue(btu_bta_alarm_queue, p_te);
}
-void bta_sys_start_timer(TIMER_LIST_ENT *p_tle, UINT16 type, INT32 timeout_ms) {
- assert(p_tle != NULL);
+void bta_sys_start_timer(timer_entry_t *p_te, UINT16 type, INT32 timeout_ms) {
+ assert(p_te != NULL);
- // Get the alarm for this p_tle.
+ // Get the alarm for this p_te.
pthread_mutex_lock(&bta_alarm_lock);
- if (!hash_map_has_key(bta_alarm_hash_map, p_tle)) {
- hash_map_set(bta_alarm_hash_map, p_tle, alarm_new());
+ if (!hash_map_has_key(bta_alarm_hash_map, p_te)) {
+ hash_map_set(bta_alarm_hash_map, p_te, alarm_new());
}
pthread_mutex_unlock(&bta_alarm_lock);
- alarm_t *alarm = hash_map_get(bta_alarm_hash_map, p_tle);
+ alarm_t *alarm = hash_map_get(bta_alarm_hash_map, p_te);
if (alarm == NULL) {
LOG_ERROR(LOG_TAG, "%s unable to create alarm.", __func__);
return;
}
- p_tle->event = type;
- p_tle->ticks = timeout_ms;
- alarm_set(alarm, (period_ms_t)timeout_ms, bta_alarm_cb, p_tle);
+ p_te->event = type;
+ p_te->ticks = timeout_ms;
+ alarm_set(alarm, (period_ms_t)timeout_ms, bta_alarm_cb, p_te);
}
bool hash_iter_ro_cb(hash_map_entry_t *hash_map_entry, void *context)
return true;
}
-UINT32 bta_sys_get_remaining_ticks(TIMER_LIST_ENT *p_target_tle)
+UINT32 bta_sys_get_remaining_ticks(timer_entry_t *p_target_te)
{
period_ms_t remaining_ms = 0;
pthread_mutex_lock(&bta_alarm_lock);
- // Get the alarm for this p_tle
+ // Get the alarm for this p_te
hash_map_foreach(bta_alarm_hash_map, hash_iter_ro_cb, &remaining_ms);
pthread_mutex_unlock(&bta_alarm_lock);
return remaining_ms;
** Returns void
**
*******************************************************************************/
-void bta_sys_stop_timer(TIMER_LIST_ENT *p_tle) {
- assert(p_tle != NULL);
+void bta_sys_stop_timer(timer_entry_t *p_te) {
+ assert(p_te != NULL);
- alarm_t *alarm = hash_map_get(bta_alarm_hash_map, p_tle);
+ alarm_t *alarm = hash_map_get(bta_alarm_hash_map, p_te);
if (alarm == NULL) {
LOG_DEBUG(LOG_TAG, "%s expected alarm was not in bta alarm hash map.", __func__);
return;
tBTA_BLE_AD_MASK mask;
tBTA_BLE_ADV_DATA data;
tBTA_BLE_ADV_PARAMS param;
- TIMER_LIST_ENT tle_limited_timer;
+ timer_entry_t timer_entry;
int timeout_s;
} btgatt_multi_adv_inst_cb;
int service_data_len, char* service_data, int service_uuid_len,
char* service_uuid, btif_adv_data_t *p_multi_adv_inst);
extern void btif_gattc_adv_data_cleanup(const btif_adv_data_t* adv);
-void btif_multi_adv_timer_ctrl(int client_if, TIMER_CBACK cb);
+void btif_multi_adv_timer_ctrl(int client_if, timer_callback_t cb);
pthread_t hh_poll_thread_id;
UINT8 hh_keep_polling;
BOOLEAN vup_timer_active;
- TIMER_LIST_ENT vup_timer;
+ timer_entry_t vup_timer;
BOOLEAN local_vup; // Indicated locally initiated VUP
} btif_hh_device_t;
tBTA_HL_SDP sdp;
btif_hl_cch_op_t cch_oper;
BOOLEAN cch_timer_active;
- TIMER_LIST_ENT cch_timer;
+ timer_entry_t cch_timer;
} btif_hl_mcl_cb_t;
typedef struct
static btav_callbacks_t *bt_av_src_callbacks = NULL;
static btav_callbacks_t *bt_av_sink_callbacks = NULL;
static btif_av_cb_t btif_av_cb = {0};
-static TIMER_LIST_ENT tle_av_open_on_rc;
+static timer_entry_t te_av_open_on_rc;
/* both interface and media task needs to be ready to alloc incoming request */
#define CHECK_BTAV_INIT() if (((bt_av_src_callbacks == NULL) &&(bt_av_sink_callbacks == NULL)) \
** Returns void
**
*******************************************************************************/
-static void btif_initiate_av_open_tmr_hdlr(TIMER_LIST_ENT *tle)
+static void btif_initiate_av_open_tmr_hdlr(timer_entry_t *p_te)
{
BD_ADDR peer_addr;
- UNUSED(tle);
btif_av_connect_req_t connect_req;
- UNUSED(tle);
+ UNUSED(p_te);
/* is there at least one RC connection - There should be */
if (btif_rc_get_connected_peer(peer_addr)) {
BTIF_TRACE_DEBUG("%s Issuing connect to the remote RC peer", __FUNCTION__);
*/
BTIF_TRACE_DEBUG("BTA_AV_RC_OPEN_EVT received w/o AV");
- memset(&tle_av_open_on_rc, 0, sizeof(tle_av_open_on_rc));
- tle_av_open_on_rc.param = btif_initiate_av_open_tmr_hdlr;
- btu_start_timer(&tle_av_open_on_rc, BTU_TTYPE_USER_FUNC,
+ memset(&te_av_open_on_rc, 0, sizeof(te_av_open_on_rc));
+ te_av_open_on_rc.param = btif_initiate_av_open_tmr_hdlr;
+ btu_start_timer(&te_av_open_on_rc, BTU_TTYPE_USER_FUNC,
BTIF_TIMEOUT_AV_OPEN_ON_RC_SECS);
btif_rc_handler(event, p_data);
break;
break;
case BTA_AV_RC_CLOSE_EVT:
- if (tle_av_open_on_rc.in_use) {
+ if (te_av_open_on_rc.in_use) {
BTIF_TRACE_DEBUG("BTA_AV_RC_CLOSE_EVT: Stopping AV timer.");
- btu_stop_timer(&tle_av_open_on_rc);
+ btu_stop_timer(&te_av_open_on_rc);
}
btif_rc_handler(event, p_data);
break;
********************************************************************************/
static bt_status_t btif_gattc_multi_adv_disable(int client_if);
-static void btif_multi_adv_stop_cb(void *p_tle)
+static void btif_multi_adv_stop_cb(void *p_te)
{
- int client_if = PTR_TO_INT(((TIMER_LIST_ENT*)p_tle)->data);
+ int client_if = PTR_TO_INT(((timer_entry_t*)p_te)->data);
btif_gattc_multi_adv_disable(client_if); // Does context switch
}
// Discoverability timer cleanup
if (stop_timer)
{
- if (p_multi_inst_cb->tle_limited_timer.in_use)
- btu_stop_timer_oneshot(&p_multi_inst_cb->tle_limited_timer);
- p_multi_inst_cb->tle_limited_timer.in_use = 0;
+ if (p_multi_inst_cb->timer_entry.in_use)
+ btu_stop_timer_oneshot(&p_multi_inst_cb->timer_entry);
+ p_multi_inst_cb->timer_entry.in_use = 0;
}
memset(&p_multi_inst_cb->data, 0, sizeof(p_multi_inst_cb->data));
*buf = NULL;
}
-void btif_multi_adv_timer_ctrl(int client_if, TIMER_CBACK cb)
+void btif_multi_adv_timer_ctrl(int client_if, timer_callback_t cb)
{
int inst_id = btif_multi_adv_instid_for_clientif(client_if);
if (inst_id == INVALID_ADV_INST)
if (cb == NULL)
{
- if (p_multi_adv_data_cb->inst_cb[cbindex].tle_limited_timer.in_use)
- btu_stop_timer_oneshot(&p_multi_adv_data_cb->inst_cb[cbindex].tle_limited_timer);
+ if (p_multi_adv_data_cb->inst_cb[cbindex].timer_entry.in_use)
+ btu_stop_timer_oneshot(&p_multi_adv_data_cb->inst_cb[cbindex].timer_entry);
} else {
if (p_multi_adv_data_cb->inst_cb[cbindex].timeout_s != 0)
{
- if (p_multi_adv_data_cb->inst_cb[cbindex].tle_limited_timer.in_use)
- btu_stop_timer_oneshot(&p_multi_adv_data_cb->inst_cb[cbindex].tle_limited_timer);
+ if (p_multi_adv_data_cb->inst_cb[cbindex].timer_entry.in_use)
+ btu_stop_timer_oneshot(&p_multi_adv_data_cb->inst_cb[cbindex].timer_entry);
- memset(&p_multi_adv_data_cb->inst_cb[cbindex].tle_limited_timer, 0, sizeof(TIMER_LIST_ENT));
- p_multi_adv_data_cb->inst_cb[cbindex].tle_limited_timer.param = cb;
- p_multi_adv_data_cb->inst_cb[cbindex].tle_limited_timer.data = INT_TO_PTR(client_if);
- btu_start_timer_oneshot(&p_multi_adv_data_cb->inst_cb[cbindex].tle_limited_timer,
+ memset(&p_multi_adv_data_cb->inst_cb[cbindex].timer_entry, 0, sizeof(timer_entry_t));
+ p_multi_adv_data_cb->inst_cb[cbindex].timer_entry.param = cb;
+ p_multi_adv_data_cb->inst_cb[cbindex].timer_entry.data = INT_TO_PTR(client_if);
+ btu_start_timer_oneshot(&p_multi_adv_data_cb->inst_cb[cbindex].timer_entry,
BTU_TTYPE_USER_FUNC, p_multi_adv_data_cb->inst_cb[cbindex].timeout_s);
}
}
static void toggle_os_keylockstates(int fd, int changedkeystates);
static void sync_lockstate_on_connect(btif_hh_device_t *p_dev);
//static void hh_update_keyboard_lockstates(btif_hh_device_t *p_dev);
-void btif_hh_tmr_hdlr(TIMER_LIST_ENT *tle);
+void btif_hh_tmr_hdlr(timer_entry_t *p_te);
/************************************************************************************
** Functions
if (p_dev->vup_timer_active == FALSE)
{
BTIF_TRACE_DEBUG("Start VUP timer ");
- memset(&p_dev->vup_timer, 0, sizeof(TIMER_LIST_ENT));
+ memset(&p_dev->vup_timer, 0, sizeof(timer_entry_t));
p_dev->vup_timer.param = btif_hh_tmr_hdlr;
btu_start_timer(&p_dev->vup_timer, BTU_TTYPE_USER_FUNC,
BTIF_TIMEOUT_VUP_SECS);
**
** Returns void
*******************************************************************************/
-void btif_hh_tmr_hdlr(TIMER_LIST_ENT *tle)
+void btif_hh_tmr_hdlr(timer_entry_t *p_te)
{
btif_hh_device_t *p_dev;
UINT8 i;
int param_len = 0;
memset(&p_data, 0, sizeof(tBTA_HH));
- BTIF_TRACE_DEBUG("%s timer_in_use=%d", __FUNCTION__, tle->in_use );
+ BTIF_TRACE_DEBUG("%s timer_in_use=%d", __FUNCTION__, p_te->in_use);
for (i = 0; i < BTIF_HH_MAX_HID; i++) {
if (btif_hh_cb.devices[i].dev_status == BTHH_CONN_STATE_CONNECTED)
**
** Returns void
*******************************************************************************/
-void btif_hl_tmr_hdlr(TIMER_LIST_ENT *tle)
+void btif_hl_tmr_hdlr(timer_entry_t *p_te)
{
btif_hl_mcl_cb_t *p_mcb;
UINT8 i,j;
- BTIF_TRACE_DEBUG("%s timer_in_use=%d", __FUNCTION__, tle->in_use );
+ BTIF_TRACE_DEBUG("%s timer_in_use=%d", __FUNCTION__, p_te->in_use);
for (i=0; i < BTA_HL_NUM_APPS ; i ++)
{
if (!p_mcb->cch_timer.in_use)
{
BTIF_TRACE_DEBUG("Start CCH timer ");
- memset(&p_mcb->cch_timer, 0, sizeof(TIMER_LIST_ENT));
+ memset(&p_mcb->cch_timer, 0, sizeof(timer_entry_t));
p_mcb->cch_timer.param = btif_hl_tmr_hdlr;
btu_start_timer(&p_mcb->cch_timer, BTU_TTYPE_USER_FUNC,
BTIF_TIMEOUT_CCH_NO_DCH_SECS);
#include "bt_target.h"
#include "bt_types.h"
-static const char GKI_MODULE[] = "gki_module";
-
-/* Timer list entry callback type
-*/
-typedef void (TIMER_CBACK)(void *p_tle);
-#ifndef TIMER_PARAM_TYPE
-#define TIMER_PARAM_TYPE void*
-#endif
-/* Define a timer list entry
-*/
-typedef struct _tle
-{
- TIMER_CBACK *p_cback;
- INT32 ticks;
- INT32 ticks_initial;
- TIMER_PARAM_TYPE param;
- TIMER_PARAM_TYPE data;
- UINT16 event;
- UINT8 in_use;
-} TIMER_LIST_ENT;
-
/***********************************************************************
** Function prototypes
*/
#endif
-#ifndef TIMER_PARAM_TYPE
-#define TIMER_PARAM_TYPE void*
-#endif
-
/******************************************************************************
**
** BLE
// Cancels the non repeating timer if it is currently running. All the semantics of
// |alarm_cancel| apply here. |timer| may not be NULL.
void non_repeating_timer_cancel(non_repeating_timer_t *timer);
+
+//
+// TODO: timer_entry_t below should be removed, and its usage everywhere
+// should be replaced by |non_repeating_timer_t| .
+//
+
+// Timer entry callback type
+typedef void (timer_callback_t)(void *p_te);
+typedef void* timer_param_t;
+
+//
+// Define a timer entry
+//
+typedef struct _timer_entry
+{
+ timer_callback_t *p_cback;
+ int32_t ticks;
+ int32_t ticks_initial;
+ timer_param_t param;
+ timer_param_t data;
+ uint16_t event;
+ uint8_t in_use;
+} timer_entry_t;
** Returns void
**
*******************************************************************************/
-void avdt_process_timeout(TIMER_LIST_ENT *p_tle)
+void avdt_process_timeout(timer_entry_t *p_te)
{
UINT8 event = 0;
UINT8 err_code = AVDT_ERR_TIMEOUT;
- switch (p_tle->event)
+ switch (p_te->event)
{
case BTU_TTYPE_AVDT_CCB_RET:
event = AVDT_CCB_RET_TOUT_EVT + AVDT_CCB_MKR;
if (event & AVDT_CCB_MKR)
{
- avdt_ccb_event((tAVDT_CCB *) p_tle->param, (UINT8) (event & ~AVDT_CCB_MKR),
+ avdt_ccb_event((tAVDT_CCB *) p_te->param, (UINT8) (event & ~AVDT_CCB_MKR),
(tAVDT_CCB_EVT *) &err_code);
}
else
{
- avdt_scb_event((tAVDT_SCB *) p_tle->param, event, NULL);
+ avdt_scb_event((tAVDT_SCB *) p_te->param, event, NULL);
}
}
#define AVDT_INT_H
#include "osi/include/fixed_queue.h"
+#include "osi/include/non_repeating_timer.h"
#include "gki.h"
#include "avdt_api.h"
#include "avdtc_api.h"
/* channel control block type */
typedef struct {
BD_ADDR peer_addr; /* BD address of peer */
- TIMER_LIST_ENT timer_entry; /* CCB timer list entry */
+ timer_entry_t timer_entry; /* CCB timer entry */
fixed_queue_t *cmd_q; /* Queue for outgoing command messages */
fixed_queue_t *rsp_q; /* Queue for outgoing response and reject messages */
tAVDT_CTRL_CBACK *proc_cback; /* Procedure callback function */
tAVDT_CS cs; /* stream creation struct */
tAVDT_CFG curr_cfg; /* current configuration */
tAVDT_CFG req_cfg; /* requested configuration */
- TIMER_LIST_ENT timer_entry; /* timer entry */
+ timer_entry_t timer_entry; /* timer entry */
BT_HDR *p_pkt; /* packet waiting to be sent */
tAVDT_CCB *p_ccb; /* ccb associated with this scb */
UINT16 media_seq; /* media packet sequence number */
extern void avdt_ad_open_req(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb, UINT8 role);
extern void avdt_ad_close_req(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb);
-extern void avdt_process_timeout(TIMER_LIST_ENT *p_tle);
+extern void avdt_process_timeout(timer_entry_t *p_te);
/*****************************************************************************
** macros
#endif
/* Start a timer to read our BD address */
- btu_start_timer (&bnep_cb.bnep_tle, BTU_TTYPE_BNEP, 2);
+ btu_start_timer(&bnep_cb.bnep_te, BTU_TTYPE_BNEP, 2);
}
}
/* Start timer waiting for connect */
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
+ btu_start_timer(&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
}
*p_handle = p_bcb->handle;
UINT16 l2cap_cid;
BD_ADDR rem_bda;
UINT16 rem_mtu_size;
- TIMER_LIST_ENT conn_tle;
+ timer_entry_t conn_te;
fixed_queue_t *xmit_q;
UINT16 sent_num_filters;
tL2CAP_APPL_INFO reg_info;
- TIMER_LIST_ENT bnep_tle;
+ timer_entry_t bnep_te;
BOOLEAN profile_registered; /* TRUE when we got our BD addr */
UINT8 trace_level;
extern tBNEP_RESULT bnep_register_with_l2cap (void);
extern void bnep_disconnect (tBNEP_CONN *p_bcb, UINT16 reason);
extern tBNEP_CONN *bnep_conn_originate (UINT8 *p_bd_addr);
-extern void bnep_process_timeout (TIMER_LIST_ENT *p_tle);
+extern void bnep_process_timeout(timer_entry_t *p_te);
extern void bnep_connected (tBNEP_CONN *p_bcb);
L2CA_ConfigReq (l2cap_cid, &bnep_cb.l2cap_my_cfg);
/* Start timer waiting for config setup */
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
+ btu_start_timer(&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
BNEP_TRACE_EVENT("BNEP - Rcvd L2CAP conn ind, CID: 0x%x", p_bcb->l2cap_cid);
L2CA_ConfigReq (l2cap_cid, &bnep_cb.l2cap_my_cfg);
/* Start timer waiting for config results */
- btu_start_timer (&bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
+ btu_start_timer (&bcb->conn_te, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
BNEP_TRACE_EVENT ("BNEP - got conn cnf, sent cfg req, CID: 0x%x", bcb->l2cap_cid);
}
p_bcb->con_state = BNEP_STATE_SEC_CHECKING;
/* Start timer waiting for setup or response */
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_HOST_TIMEOUT);
+ btu_start_timer (&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_HOST_TIMEOUT);
if (p_bcb->con_flags & BNEP_FLAGS_IS_ORIG)
{
p_bcb->con_state = BNEP_STATE_SEC_CHECKING;
/* Start timer waiting for setup or response */
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_HOST_TIMEOUT);
+ btu_start_timer (&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_HOST_TIMEOUT);
if (p_bcb->con_flags & BNEP_FLAGS_IS_ORIG)
{
** Returns void
**
*******************************************************************************/
-void bnep_process_timeout (TIMER_LIST_ENT *p_tle)
+void bnep_process_timeout(timer_entry_t *p_te)
{
tBNEP_CONN *p_bcb;
- if (!p_tle->param)
+ if (!p_te->param)
{
return;
}
- p_bcb = (tBNEP_CONN *)p_tle->param;
+ p_bcb = (tBNEP_CONN *)p_te->param;
BNEP_TRACE_EVENT ("BNEP - CCB timeout in state: %d CID: 0x%x flags %x, re_transmit %d",
p_bcb->con_state, p_bcb->l2cap_cid, p_bcb->con_flags, p_bcb->re_transmits);
if (p_bcb->re_transmits++ != BNEP_MAX_RETRANSMITS)
{
bnep_send_conn_req (p_bcb);
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
+ btu_start_timer (&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
}
else
{
if (p_bcb->re_transmits++ != BNEP_MAX_RETRANSMITS)
{
bnepu_send_peer_our_filters (p_bcb);
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_FILTER_SET_TIMEOUT);
+ btu_start_timer (&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_FILTER_SET_TIMEOUT);
}
else
{
if (p_bcb->re_transmits++ != BNEP_MAX_RETRANSMITS)
{
bnepu_send_peer_our_multi_filters (p_bcb);
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_FILTER_SET_TIMEOUT);
+ btu_start_timer (&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_FILTER_SET_TIMEOUT);
}
else
{
p_bcb->con_flags &= (~BNEP_FLAGS_SETUP_RCVD);
/* Ensure timer is stopped */
- btu_stop_timer (&p_bcb->conn_tle);
+ btu_stop_timer(&p_bcb->conn_te);
p_bcb->re_transmits = 0;
/* Tell the upper layer, if he has a callback */
{
memset ((UINT8 *)p_bcb, 0, sizeof (tBNEP_CONN));
- p_bcb->conn_tle.param = p_bcb;
+ p_bcb->conn_te.param = p_bcb;
memcpy ((UINT8 *)(p_bcb->rem_bda), (UINT8 *)p_rem_bda, BD_ADDR_LEN);
p_bcb->handle = xx + 1;
void bnepu_release_bcb (tBNEP_CONN *p_bcb)
{
/* Ensure timer is stopped */
- btu_stop_timer (&p_bcb->conn_tle);
+ btu_stop_timer(&p_bcb->conn_te);
/* Drop any response pointer we may be holding */
p_bcb->con_state = BNEP_STATE_IDLE;
p_bcb->con_flags |= BNEP_FLAGS_FILTER_RESP_PEND;
/* Start timer waiting for setup response */
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_FILTER_SET_TIMEOUT);
+ btu_start_timer(&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_FILTER_SET_TIMEOUT);
}
p_bcb->con_flags |= BNEP_FLAGS_MULTI_RESP_PEND;
/* Start timer waiting for setup response */
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_FILTER_SET_TIMEOUT);
+ btu_start_timer(&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_FILTER_SET_TIMEOUT);
}
memcpy ((UINT8 *)&(p_bcb->dst_uuid), (UINT8 *)&(p_bcb->prv_dst_uuid), sizeof (tBT_UUID));
/* Ensure timer is stopped */
- btu_stop_timer (&p_bcb->conn_tle);
+ btu_stop_timer(&p_bcb->conn_te);
p_bcb->re_transmits = 0;
/* Tell the user if he has a callback */
}
/* Ensure timer is stopped */
- btu_stop_timer (&p_bcb->conn_tle);
+ btu_stop_timer(&p_bcb->conn_te);
p_bcb->con_flags &= ~BNEP_FLAGS_FILTER_RESP_PEND;
p_bcb->re_transmits = 0;
}
/* Ensure timer is stopped */
- btu_stop_timer (&p_bcb->conn_tle);
+ btu_stop_timer(&p_bcb->conn_te);
p_bcb->con_flags &= ~BNEP_FLAGS_MULTI_RESP_PEND;
p_bcb->re_transmits = 0;
p_bcb->con_state = BNEP_STATE_CONN_SETUP;
bnep_send_conn_req (p_bcb);
- btu_start_timer (&p_bcb->conn_tle, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
+ btu_start_timer(&p_bcb->conn_te, BTU_TTYPE_BNEP, BNEP_CONN_TIMEOUT);
return;
}
** Returns void
**
*******************************************************************************/
-void btm_ble_timeout(TIMER_LIST_ENT *p_tle)
+void btm_ble_timeout(timer_entry_t *p_te)
{
BTM_TRACE_EVENT ("btm_ble_timeout");
- switch (p_tle->event)
+ switch (p_te->event)
{
case BTU_TTYPE_BLE_OBSERVE:
btm_ble_stop_observe();
case BTU_TTYPE_BLE_RANDOM_ADDR:
if (btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type == BLE_ADDR_RANDOM)
{
- if (NULL == (void *)(p_tle->param))
+ if (NULL == (void *)(p_te->param))
{
/* refresh the random addr */
btm_gen_resolvable_private_addr((void *)btm_gen_resolve_paddr_low);
else
{
if (BTM_BleMaxMultiAdvInstanceCount() > 0)
- btm_ble_multi_adv_configure_rpa((tBTM_BLE_MULTI_ADV_INST*)p_tle->param);
+ btm_ble_multi_adv_configure_rpa((tBTM_BLE_MULTI_ADV_INST*)p_te->param);
}
}
break;
tBLE_BD_ADDR direct_bda;
tBTM_BLE_EVT directed_conn;
BOOLEAN fast_adv_on;
- TIMER_LIST_ENT fast_adv_timer;
+ timer_entry_t fast_adv_timer;
UINT8 adv_len;
UINT8 adv_data_cache[BTM_BLE_CACHE_ADV_DATA_MAX];
tBTM_BLE_LOCAL_ADV_DATA adv_data;
tBTM_BLE_ADV_CHNL_MAP adv_chnl_map;
- TIMER_LIST_ENT inq_timer_ent;
+ timer_entry_t inq_timer_ent;
BOOLEAN scan_rsp;
UINT8 state; /* Current state that the inquiry process is in */
INT8 tx_power;
tBTM_BLE_RESOLVE_CBACK *p_resolve_cback;
tBTM_BLE_ADDR_CBACK *p_generate_cback;
void *p;
- TIMER_LIST_ENT raddr_timer_ent;
+ timer_entry_t raddr_timer_ent;
} tBTM_LE_RANDOM_CB;
#define BTM_BLE_MAX_BG_CONN_DEV_NUM 10
/* observer callback and timer */
tBTM_INQ_RESULTS_CB *p_obs_results_cb;
tBTM_CMPL_CB *p_obs_cmpl_cb;
- TIMER_LIST_ENT obs_timer_ent;
+ timer_entry_t obs_timer_ent;
/* background connection procedure cb value */
tBTM_BLE_CONN_TYPE bg_conn_type;
extern "C" {
#endif
-extern void btm_ble_timeout(TIMER_LIST_ENT *p_tle);
+extern void btm_ble_timeout(timer_entry_t *p_te);
extern void btm_ble_process_adv_pkt (UINT8 *p);
extern void btm_ble_proc_scan_rsp_rpt (UINT8 *p);
extern tBTM_STATUS btm_ble_read_remote_name(BD_ADDR remote_bda, tBTM_INQ_INFO *p_cur, tBTM_CMPL_CB *p_cb);
if (btm_cb.ble_ctr_cb.privacy_mode != BTM_PRIVACY_NONE)
{
/* start timer */
- p_inst->raddr_timer_ent.param = (TIMER_PARAM_TYPE) p_inst;
+ p_inst->raddr_timer_ent.param = (timer_param_t)p_inst;
btu_start_timer_oneshot(&p_inst->raddr_timer_ent, BTU_TTYPE_BLE_RANDOM_ADDR,
BTM_BLE_PRIVATE_ADDR_INT);
}
{
/* start a periodical timer to refresh random addr */
btu_stop_timer_oneshot(&p_inst->raddr_timer_ent);
- p_inst->raddr_timer_ent.param = (TIMER_PARAM_TYPE) p_inst;
+ p_inst->raddr_timer_ent.param = (timer_param_t)p_inst;
btu_start_timer_oneshot(&p_inst->raddr_timer_ent, BTU_TTYPE_BLE_RANDOM_ADDR,
BTM_BLE_PRIVATE_ADDR_INT);
memset(btm_cb.cfg.bd_name, 0, sizeof(tBTM_LOC_BD_NAME));
#endif
- btm_cb.devcb.reset_timer.param = (TIMER_PARAM_TYPE)TT_DEV_RESET;
- btm_cb.devcb.rln_timer.param = (TIMER_PARAM_TYPE)TT_DEV_RLN;
+ btm_cb.devcb.reset_timer.param = (timer_param_t)TT_DEV_RESET;
+ btm_cb.devcb.rln_timer.param = (timer_param_t)TT_DEV_RLN;
btm_cb.btm_acl_pkt_types_supported = BTM_ACL_PKT_TYPES_MASK_DH1 + BTM_ACL_PKT_TYPES_MASK_DM1 +
BTM_ACL_PKT_TYPES_MASK_DH3 + BTM_ACL_PKT_TYPES_MASK_DM3 +
**
** Function btm_dev_timeout
**
-** Description This function is called when a timer list entry expires.
+** Description This function is called when a timer entry expires.
**
** Returns void
**
*******************************************************************************/
-void btm_dev_timeout (TIMER_LIST_ENT *p_tle)
+void btm_dev_timeout (timer_entry_t *p_te)
{
- TIMER_PARAM_TYPE timer_type = (TIMER_PARAM_TYPE)p_tle->param;
+ timer_param_t timer_type = (timer_param_t)p_te->param;
- if (timer_type == (TIMER_PARAM_TYPE)TT_DEV_RLN)
+ if (timer_type == (timer_param_t)TT_DEV_RLN)
{
tBTM_CMPL_CB *p_cb = btm_cb.devcb.p_rln_cmpl_cb;
tBTM_CMPL_CB *p_stored_link_key_cmpl_cb; /* Read/Write/Delete stored link key */
- TIMER_LIST_ENT reset_timer;
+ timer_entry_t reset_timer;
- TIMER_LIST_ENT rln_timer;
+ timer_entry_t rln_timer;
tBTM_CMPL_CB *p_rln_cmpl_cb; /* Callback function to be called when */
/* read local name function complete */
- TIMER_LIST_ENT rssi_timer;
+ timer_entry_t rssi_timer;
tBTM_CMPL_CB *p_rssi_cmpl_cb; /* Callback function to be called when */
/* read rssi function completes */
- TIMER_LIST_ENT lnk_quality_timer;
+ timer_entry_t lnk_quality_timer;
tBTM_CMPL_CB *p_lnk_qual_cmpl_cb;/* Callback function to be called when */
/* read link quality function completes */
- TIMER_LIST_ENT txpwer_timer;
+ timer_entry_t txpwer_timer;
tBTM_CMPL_CB *p_txpwer_cmpl_cb; /* Callback function to be called when */
/* read inq tx power function completes */
- TIMER_LIST_ENT qossu_timer;
+ timer_entry_t qossu_timer;
tBTM_CMPL_CB *p_qossu_cmpl_cb; /* Callback function to be called when */
/* qos setup function completes */
tBTM_CMPL_CB *p_switch_role_cb; /* Callback function to be called when */
/* requested switch role is completed */
- TIMER_LIST_ENT tx_power_timer;
+ timer_entry_t tx_power_timer;
tBTM_CMPL_CB *p_tx_power_cmpl_cb;/* Callback function to be called */
DEV_CLASS dev_class; /* Local device class */
#define BTM_EXT_RMT_NAME_TIMEOUT 40
- TIMER_LIST_ENT rmt_name_timer_ent;
+ timer_entry_t rmt_name_timer_ent;
UINT16 discoverable_mode;
UINT16 connectable_mode;
UINT32 inq_counter; /* Counter incremented each time an inquiry completes */
/* Used for determining whether or not duplicate devices */
/* have responded to the same inquiry */
- TIMER_LIST_ENT inq_timer_ent;
+ timer_entry_t inq_timer_ent;
tINQ_BDADDR *p_bd_db; /* Pointer to memory that holds bdaddrs */
UINT16 num_bd_entries; /* Number of entries in database */
UINT16 max_bd_entries; /* Maximum number of entries that can be stored */
tBTM_RMT_NAME_CALLBACK *p_rmt_name_callback[BTM_SEC_MAX_RMT_NAME_CALLBACKS];
tBTM_SEC_DEV_REC *p_collided_dev_rec;
- TIMER_LIST_ENT sec_collision_tle;
+ timer_entry_t sec_collision_te;
UINT32 collision_start_time;
UINT32 max_collision_delay;
UINT32 dev_rec_count; /* Counter used for device record timestamp */
tBTM_PAIRING_STATE pairing_state; /* The current pairing state */
UINT8 pairing_flags; /* The current pairing flags */
BD_ADDR pairing_bda; /* The device currently pairing */
- TIMER_LIST_ENT pairing_tle; /* Timer for pairing process */
+ timer_entry_t pairing_te; /* Timer for pairing process */
UINT16 disc_handle; /* for legacy devices */
UINT8 disc_reason; /* for legacy devices */
tBTM_SEC_SERV_REC sec_serv_rec[BTM_SEC_MAX_SERVICE_RECORDS];
**********************************************
*/
extern void btm_dev_init (void);
-extern void btm_dev_timeout (TIMER_LIST_ENT *p_tle);
+extern void btm_dev_timeout(timer_entry_t *p_te);
extern void btm_read_local_name_complete (UINT8 *p, UINT16 evt_len);
#if (BLE_INCLUDED == TRUE)
static BOOLEAN btm_sec_start_get_name (tBTM_SEC_DEV_REC *p_dev_rec);
static BOOLEAN btm_sec_start_authentication (tBTM_SEC_DEV_REC *p_dev_rec);
static BOOLEAN btm_sec_start_encryption (tBTM_SEC_DEV_REC *p_dev_rec);
-static void btm_sec_collision_timeout (TIMER_LIST_ENT *p_tle);
+static void btm_sec_collision_timeout(timer_entry_t *p_te);
static void btm_restore_mode(void);
-static void btm_sec_pairing_timeout (TIMER_LIST_ENT *p_tle);
+static void btm_sec_pairing_timeout(timer_entry_t *p_te);
static tBTM_STATUS btm_sec_dd_create_conn (tBTM_SEC_DEV_REC *p_dev_rec);
static void btm_sec_change_pairing_state (tBTM_PAIRING_STATE new_state);
btm_sec_change_pairing_state (BTM_PAIR_STATE_WAIT_DISCONNECT);
/* Change the timer to 1 second */
- btu_start_timer (&btm_cb.pairing_tle, BTU_TTYPE_USER_FUNC, BT_1SEC_TIMEOUT);
+ btu_start_timer (&btm_cb.pairing_te, BTU_TTYPE_USER_FUNC, BT_1SEC_TIMEOUT);
}
else if (memcmp (btm_cb.pairing_bda, evt_data.bd_addr, BD_ADDR_LEN) == 0)
{
/* stop the timer */
- btu_stop_timer (&btm_cb.pairing_tle);
+ btu_stop_timer(&btm_cb.pairing_te);
if (p_dev_rec->sec_state != BTM_SEC_STATE_AUTHENTICATING)
{
p_dev_rec->sec_state = 0;
btm_cb.p_collided_dev_rec = p_dev_rec;
- btm_cb.sec_collision_tle.param = UINT_TO_PTR(btm_sec_collision_timeout);
- btu_start_timer (&btm_cb.sec_collision_tle, BTU_TTYPE_USER_FUNC, BT_1SEC_TIMEOUT);
+ btm_cb.sec_collision_te.param = UINT_TO_PTR(btm_sec_collision_timeout);
+ btu_start_timer (&btm_cb.sec_collision_te, BTU_TTYPE_USER_FUNC, BT_1SEC_TIMEOUT);
}
}
}
** Returns Pointer to the TLE struct
**
*******************************************************************************/
-static void btm_sec_connect_after_reject_timeout (TIMER_LIST_ENT *p_tle)
+static void btm_sec_connect_after_reject_timeout(timer_entry_t *p_te)
{
tBTM_SEC_DEV_REC *p_dev_rec = btm_cb.p_collided_dev_rec;
- UNUSED(p_tle);
+ UNUSED(p_te);
BTM_TRACE_EVENT ("btm_sec_connect_after_reject_timeout()");
- btm_cb.sec_collision_tle.param = 0;
+ btm_cb.sec_collision_te.param = 0;
btm_cb.p_collided_dev_rec = 0;
if (btm_sec_dd_create_conn(p_dev_rec) != BTM_CMD_STARTED)
/* Start timer with 0 to initiate connection with new LCB */
/* because L2CAP will delete current LCB with this event */
btm_cb.p_collided_dev_rec = p_dev_rec;
- btm_cb.sec_collision_tle.param = UINT_TO_PTR(btm_sec_connect_after_reject_timeout);
- btu_start_timer (&btm_cb.sec_collision_tle, BTU_TTYPE_USER_FUNC, 0);
+ btm_cb.sec_collision_te.param = UINT_TO_PTR(btm_sec_connect_after_reject_timeout);
+ btu_start_timer (&btm_cb.sec_collision_te, BTU_TTYPE_USER_FUNC, 0);
}
else
{
/* Start timer with 0 to initiate connection with new LCB */
/* because L2CAP will delete current LCB with this event */
btm_cb.p_collided_dev_rec = p_dev_rec;
- btm_cb.sec_collision_tle.param = UINT_TO_PTR(btm_sec_connect_after_reject_timeout);
- btu_start_timer (&btm_cb.sec_collision_tle, BTU_TTYPE_USER_FUNC, 0);
+ btm_cb.sec_collision_te.param = UINT_TO_PTR(btm_sec_connect_after_reject_timeout);
+ btu_start_timer(&btm_cb.sec_collision_te, BTU_TTYPE_USER_FUNC, 0);
}
return;
** Returns Pointer to the TLE struct
**
*******************************************************************************/
-static void btm_sec_pairing_timeout (TIMER_LIST_ENT *p_tle)
+static void btm_sec_pairing_timeout (timer_entry_t *p_te)
{
tBTM_CB *p_cb = &btm_cb;
tBTM_SEC_DEV_REC *p_dev_rec;
#endif
#endif
UINT8 name[2];
- UNUSED(p_tle);
+ UNUSED(p_te);
- p_cb->pairing_tle.param = 0;
+ p_cb->pairing_te.param = 0;
/* Coverity: FALSE-POSITIVE error from Coverity tool. Please do NOT remove following comment. */
/* coverity[UNUSED_VALUE] pointer p_dev_rec is actually used several times... This is a Coverity false-positive, i.e. a fake issue.
*/
** Returns Pointer to the TLE struct
**
*******************************************************************************/
-static void btm_sec_collision_timeout (TIMER_LIST_ENT *p_tle)
+static void btm_sec_collision_timeout (timer_entry_t *p_te)
{
- UNUSED(p_tle);
+ UNUSED(p_te);
BTM_TRACE_EVENT ("%s()", __func__);
- btm_cb.sec_collision_tle.param = 0;
+ btm_cb.sec_collision_te.param = 0;
tBTM_STATUS status = btm_sec_execute_procedure (btm_cb.p_collided_dev_rec);
if (new_state == BTM_PAIR_STATE_IDLE)
{
- btu_stop_timer (&btm_cb.pairing_tle);
+ btu_stop_timer(&btm_cb.pairing_te);
btm_cb.pairing_flags = 0;
btm_cb.pin_code_len = 0;
if (old_state == BTM_PAIR_STATE_IDLE)
l2cu_update_lcb_4_bonding (btm_cb.pairing_bda, TRUE);
- btm_cb.pairing_tle.param = (TIMER_PARAM_TYPE)btm_sec_pairing_timeout;
+ btm_cb.pairing_te.param = (timer_param_t)btm_sec_pairing_timeout;
- btu_start_timer (&btm_cb.pairing_tle, BTU_TTYPE_USER_FUNC, BTM_SEC_TIMEOUT_VALUE);
+ btu_start_timer(&btm_cb.pairing_te, BTU_TTYPE_USER_FUNC, BTM_SEC_TIMEOUT_VALUE);
}
}
extern thread_t *bt_workqueue_thread;
/* Define a function prototype to allow a generic timeout handler */
-typedef void (tUSER_TIMEOUT_FUNC) (TIMER_LIST_ENT *p_tle);
+typedef void (tUSER_TIMEOUT_FUNC) (timer_entry_t *p_te);
-static void btu_l2cap_alarm_process(TIMER_LIST_ENT *p_tle);
-static void btu_general_alarm_process(TIMER_LIST_ENT *p_tle);
-static void btu_bta_alarm_process(TIMER_LIST_ENT *p_tle);
+static void btu_l2cap_alarm_process(timer_entry_t *p_te);
+static void btu_general_alarm_process(timer_entry_t *p_te);
+static void btu_bta_alarm_process(timer_entry_t *p_te);
static void btu_hci_msg_process(BT_HDR *p_msg);
void btu_hci_msg_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) {
}
void btu_general_alarm_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) {
- TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)fixed_queue_dequeue(queue);
- btu_general_alarm_process(p_tle);
+ timer_entry_t *p_te = (timer_entry_t *)fixed_queue_dequeue(queue);
+ btu_general_alarm_process(p_te);
}
void btu_oneshot_alarm_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) {
- TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)fixed_queue_dequeue(queue);
- btu_general_alarm_process(p_tle);
+ timer_entry_t *p_te = (timer_entry_t *)fixed_queue_dequeue(queue);
+ btu_general_alarm_process(p_te);
- switch (p_tle->event) {
+ switch (p_te->event) {
#if (defined(BLE_INCLUDED) && BLE_INCLUDED == TRUE)
case BTU_TTYPE_BLE_RANDOM_ADDR:
- btm_ble_timeout(p_tle);
+ btm_ble_timeout(p_te);
break;
#endif
case BTU_TTYPE_USER_FUNC:
{
- tUSER_TIMEOUT_FUNC *p_uf = (tUSER_TIMEOUT_FUNC *)p_tle->param;
- (*p_uf)(p_tle);
+ tUSER_TIMEOUT_FUNC *p_uf = (tUSER_TIMEOUT_FUNC *)p_te->param;
+ (*p_uf)(p_te);
}
break;
default:
// FAIL
BTM_TRACE_WARNING("Received unexpected oneshot timer event:0x%x\n",
- p_tle->event);
+ p_te->event);
break;
}
}
void btu_l2cap_alarm_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) {
- TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)fixed_queue_dequeue(queue);
- btu_l2cap_alarm_process(p_tle);
+ timer_entry_t *p_te = (timer_entry_t *)fixed_queue_dequeue(queue);
+ btu_l2cap_alarm_process(p_te);
}
void btu_bta_msg_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) {
}
void btu_bta_alarm_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) {
- TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)fixed_queue_dequeue(queue);
- btu_bta_alarm_process(p_tle);
+ timer_entry_t *p_te = (timer_entry_t *)fixed_queue_dequeue(queue);
+ btu_bta_alarm_process(p_te);
}
static void btu_hci_msg_process(BT_HDR *p_msg) {
}
-static void btu_bta_alarm_process(TIMER_LIST_ENT *p_tle) {
+static void btu_bta_alarm_process(timer_entry_t *p_te) {
/* call timer callback */
- if (p_tle->p_cback) {
- (*p_tle->p_cback)(p_tle);
- } else if (p_tle->event) {
+ if (p_te->p_cback) {
+ (*p_te->p_cback)(p_te);
+ } else if (p_te->event) {
BT_HDR *p_msg;
if ((p_msg = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL) {
- p_msg->event = p_tle->event;
+ p_msg->event = p_te->event;
p_msg->layer_specific = 0;
bta_sys_sendmsg(p_msg);
}
** Returns void
**
*******************************************************************************/
-static void btu_general_alarm_process(TIMER_LIST_ENT *p_tle) {
- assert(p_tle != NULL);
+static void btu_general_alarm_process(timer_entry_t *p_te) {
+ assert(p_te != NULL);
- switch (p_tle->event) {
+ switch (p_te->event) {
case BTU_TTYPE_BTM_DEV_CTL:
- btm_dev_timeout(p_tle);
+ btm_dev_timeout(p_te);
break;
case BTU_TTYPE_L2CAP_LINK:
case BTU_TTYPE_L2CAP_HOLD:
case BTU_TTYPE_L2CAP_INFO:
case BTU_TTYPE_L2CAP_FCR_ACK:
- l2c_process_timeout (p_tle);
+ l2c_process_timeout (p_te);
break;
case BTU_TTYPE_SDP:
- sdp_conn_timeout ((tCONN_CB *)p_tle->param);
+ sdp_conn_timeout ((tCONN_CB *)p_te->param);
break;
case BTU_TTYPE_BTM_RMT_NAME:
case BTU_TTYPE_RFCOMM_MFC:
case BTU_TTYPE_RFCOMM_PORT:
- rfcomm_process_timeout (p_tle);
+ rfcomm_process_timeout (p_te);
break;
#if ((defined(BNEP_INCLUDED) && BNEP_INCLUDED == TRUE))
case BTU_TTYPE_BNEP:
- bnep_process_timeout(p_tle);
+ bnep_process_timeout(p_te);
break;
#endif
case BTU_TTYPE_AVDT_CCB_RSP:
case BTU_TTYPE_AVDT_CCB_IDLE:
case BTU_TTYPE_AVDT_SCB_TC:
- avdt_process_timeout(p_tle);
+ avdt_process_timeout(p_te);
break;
#endif
#if (defined(HID_HOST_INCLUDED) && HID_HOST_INCLUDED == TRUE)
case BTU_TTYPE_HID_HOST_REPAGE_TO :
- hidh_proc_repage_timeout(p_tle);
+ hidh_proc_repage_timeout(p_te);
break;
#endif
case BTU_TTYPE_BLE_RANDOM_ADDR:
case BTU_TTYPE_BLE_GAP_FAST_ADV:
case BTU_TTYPE_BLE_OBSERVE:
- btm_ble_timeout(p_tle);
+ btm_ble_timeout(p_te);
break;
case BTU_TTYPE_ATT_WAIT_FOR_RSP:
- gatt_rsp_timeout(p_tle);
+ gatt_rsp_timeout(p_te);
break;
case BTU_TTYPE_ATT_WAIT_FOR_IND_ACK:
- gatt_ind_ack_timeout(p_tle);
+ gatt_ind_ack_timeout(p_te);
break;
#if (defined(SMP_INCLUDED) && SMP_INCLUDED == TRUE)
case BTU_TTYPE_SMP_PAIRING_CMD:
- smp_rsp_timeout(p_tle);
+ smp_rsp_timeout(p_te);
break;
#endif
#if (MCA_INCLUDED == TRUE)
case BTU_TTYPE_MCA_CCB_RSP:
- mca_process_timeout(p_tle);
+ mca_process_timeout(p_te);
break;
#endif
case BTU_TTYPE_USER_FUNC:
{
- tUSER_TIMEOUT_FUNC *p_uf = (tUSER_TIMEOUT_FUNC *)p_tle->param;
- (*p_uf)(p_tle);
+ tUSER_TIMEOUT_FUNC *p_uf = (tUSER_TIMEOUT_FUNC *)p_te->param;
+ (*p_uf)(p_te);
}
break;
{
if (btu_cb.timer_reg[i].timer_cb == NULL)
continue;
- if (btu_cb.timer_reg[i].p_tle == p_tle)
+ if (btu_cb.timer_reg[i].p_te == p_te)
{
- btu_cb.timer_reg[i].timer_cb(p_tle);
+ btu_cb.timer_reg[i].timer_cb(p_te);
handled = TRUE;
}
}
void btu_general_alarm_cb(void *data) {
assert(data != NULL);
- TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)data;
+ timer_entry_t *p_te = (timer_entry_t *)data;
- fixed_queue_enqueue(btu_general_alarm_queue, p_tle);
+ fixed_queue_enqueue(btu_general_alarm_queue, p_te);
}
-void btu_start_timer(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_sec) {
- assert(p_tle != NULL);
+void btu_start_timer(timer_entry_t *p_te, UINT16 type, UINT32 timeout_sec) {
+ assert(p_te != NULL);
- // Get the alarm for the timer list entry.
+ // Get the alarm for the timer entry.
pthread_mutex_lock(&btu_general_alarm_lock);
- if (!hash_map_has_key(btu_general_alarm_hash_map, p_tle)) {
- hash_map_set(btu_general_alarm_hash_map, p_tle, alarm_new());
+ if (!hash_map_has_key(btu_general_alarm_hash_map, p_te)) {
+ hash_map_set(btu_general_alarm_hash_map, p_te, alarm_new());
}
pthread_mutex_unlock(&btu_general_alarm_lock);
- alarm_t *alarm = hash_map_get(btu_general_alarm_hash_map, p_tle);
+ alarm_t *alarm = hash_map_get(btu_general_alarm_hash_map, p_te);
if (alarm == NULL) {
LOG_ERROR(LOG_TAG, "%s Unable to create alarm", __func__);
return;
}
alarm_cancel(alarm);
- p_tle->event = type;
+ p_te->event = type;
// NOTE: This value is in seconds but stored in a ticks field.
- p_tle->ticks = timeout_sec;
- p_tle->in_use = TRUE;
- alarm_set(alarm, (period_ms_t)(timeout_sec * 1000), btu_general_alarm_cb, (void *)p_tle);
+ p_te->ticks = timeout_sec;
+ p_te->in_use = TRUE;
+ alarm_set(alarm, (period_ms_t)(timeout_sec * 1000), btu_general_alarm_cb, (void *)p_te);
}
/*******************************************************************************
** Returns void
**
*******************************************************************************/
-void btu_stop_timer(TIMER_LIST_ENT *p_tle) {
- assert(p_tle != NULL);
+void btu_stop_timer(timer_entry_t *p_te) {
+ assert(p_te != NULL);
- if (p_tle->in_use == FALSE)
+ if (p_te->in_use == FALSE)
return;
- p_tle->in_use = FALSE;
+ p_te->in_use = FALSE;
- // Get the alarm for the timer list entry.
- alarm_t *alarm = hash_map_get(btu_general_alarm_hash_map, p_tle);
+ // Get the alarm for the timer entry.
+ alarm_t *alarm = hash_map_get(btu_general_alarm_hash_map, p_te);
if (alarm == NULL) {
LOG_WARN(LOG_TAG, "%s Unable to find expected alarm in hashmap", __func__);
return;
** Returns void
**
*******************************************************************************/
-static void btu_l2cap_alarm_process(TIMER_LIST_ENT *p_tle) {
- assert(p_tle != NULL);
+static void btu_l2cap_alarm_process(timer_entry_t *p_te) {
+ assert(p_te != NULL);
- switch (p_tle->event) {
+ switch (p_te->event) {
case BTU_TTYPE_L2CAP_CHNL: /* monitor or retransmission timer */
case BTU_TTYPE_L2CAP_FCR_ACK: /* ack timer */
- l2c_process_timeout (p_tle);
+ l2c_process_timeout(p_te);
break;
default:
static void btu_l2cap_alarm_cb(void *data) {
assert(data != NULL);
- TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)data;
+ timer_entry_t *p_te = (timer_entry_t *)data;
- fixed_queue_enqueue(btu_l2cap_alarm_queue, p_tle);
+ fixed_queue_enqueue(btu_l2cap_alarm_queue, p_te);
}
-void btu_start_quick_timer(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_ticks) {
- assert(p_tle != NULL);
+void btu_start_quick_timer(timer_entry_t *p_te, UINT16 type, UINT32 timeout_ticks) {
+ assert(p_te != NULL);
- // Get the alarm for the timer list entry.
+ // Get the alarm for the timer entry.
pthread_mutex_lock(&btu_l2cap_alarm_lock);
- if (!hash_map_has_key(btu_l2cap_alarm_hash_map, p_tle)) {
- hash_map_set(btu_l2cap_alarm_hash_map, p_tle, alarm_new());
+ if (!hash_map_has_key(btu_l2cap_alarm_hash_map, p_te)) {
+ hash_map_set(btu_l2cap_alarm_hash_map, p_te, alarm_new());
}
pthread_mutex_unlock(&btu_l2cap_alarm_lock);
- alarm_t *alarm = hash_map_get(btu_l2cap_alarm_hash_map, p_tle);
+ alarm_t *alarm = hash_map_get(btu_l2cap_alarm_hash_map, p_te);
if (alarm == NULL) {
LOG_ERROR(LOG_TAG, "%s Unable to create alarm", __func__);
return;
}
alarm_cancel(alarm);
- p_tle->event = type;
- p_tle->ticks = timeout_ticks;
- p_tle->in_use = TRUE;
+ p_te->event = type;
+ p_te->ticks = timeout_ticks;
+ p_te->in_use = TRUE;
// The quick timer ticks are 100ms long.
- alarm_set(alarm, (period_ms_t)(timeout_ticks * 100), btu_l2cap_alarm_cb, (void *)p_tle);
+ alarm_set(alarm, (period_ms_t)(timeout_ticks * 100), btu_l2cap_alarm_cb, (void *)p_te);
}
/*******************************************************************************
** Returns void
**
*******************************************************************************/
-void btu_stop_quick_timer(TIMER_LIST_ENT *p_tle) {
- assert(p_tle != NULL);
+void btu_stop_quick_timer(timer_entry_t *p_te) {
+ assert(p_te != NULL);
- if (p_tle->in_use == FALSE)
+ if (p_te->in_use == FALSE)
return;
- p_tle->in_use = FALSE;
+ p_te->in_use = FALSE;
- // Get the alarm for the timer list entry.
- alarm_t *alarm = hash_map_get(btu_l2cap_alarm_hash_map, p_tle);
+ // Get the alarm for the timer entry.
+ alarm_t *alarm = hash_map_get(btu_l2cap_alarm_hash_map, p_te);
if (alarm == NULL) {
LOG_WARN(LOG_TAG, "%s Unable to find expected alarm in hashmap", __func__);
return;
void btu_oneshot_alarm_cb(void *data) {
assert(data != NULL);
- TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)data;
+ timer_entry_t *p_te = (timer_entry_t *)data;
- btu_stop_timer_oneshot(p_tle);
+ btu_stop_timer_oneshot(p_te);
- fixed_queue_enqueue(btu_oneshot_alarm_queue, p_tle);
+ fixed_queue_enqueue(btu_oneshot_alarm_queue, p_te);
}
/*
* Starts a oneshot timer with a timeout in seconds.
*/
-void btu_start_timer_oneshot(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout_sec) {
- assert(p_tle != NULL);
+void btu_start_timer_oneshot(timer_entry_t *p_te, UINT16 type, UINT32 timeout_sec) {
+ assert(p_te != NULL);
- // Get the alarm for the timer list entry.
+ // Get the alarm for the timer entry.
pthread_mutex_lock(&btu_oneshot_alarm_lock);
- if (!hash_map_has_key(btu_oneshot_alarm_hash_map, p_tle)) {
- hash_map_set(btu_oneshot_alarm_hash_map, p_tle, alarm_new());
+ if (!hash_map_has_key(btu_oneshot_alarm_hash_map, p_te)) {
+ hash_map_set(btu_oneshot_alarm_hash_map, p_te, alarm_new());
}
pthread_mutex_unlock(&btu_oneshot_alarm_lock);
- alarm_t *alarm = hash_map_get(btu_oneshot_alarm_hash_map, p_tle);
+ alarm_t *alarm = hash_map_get(btu_oneshot_alarm_hash_map, p_te);
if (alarm == NULL) {
LOG_ERROR(LOG_TAG, "%s Unable to create alarm", __func__);
return;
}
alarm_cancel(alarm);
- p_tle->event = type;
- p_tle->in_use = TRUE;
+ p_te->event = type;
+ p_te->in_use = TRUE;
// NOTE: This value is in seconds but stored in a ticks field.
- p_tle->ticks = timeout_sec;
- alarm_set(alarm, (period_ms_t)(timeout_sec * 1000), btu_oneshot_alarm_cb, (void *)p_tle);
+ p_te->ticks = timeout_sec;
+ alarm_set(alarm, (period_ms_t)(timeout_sec * 1000), btu_oneshot_alarm_cb, (void *)p_te);
}
-void btu_stop_timer_oneshot(TIMER_LIST_ENT *p_tle) {
- assert(p_tle != NULL);
+void btu_stop_timer_oneshot(timer_entry_t *p_te) {
+ assert(p_te != NULL);
- if (p_tle->in_use == FALSE)
+ if (p_te->in_use == FALSE)
return;
- p_tle->in_use = FALSE;
+ p_te->in_use = FALSE;
- // Get the alarm for the timer list entry.
- alarm_t *alarm = hash_map_get(btu_oneshot_alarm_hash_map, p_tle);
+ // Get the alarm for the timer entry.
+ alarm_t *alarm = hash_map_get(btu_oneshot_alarm_hash_map, p_te);
if (alarm == NULL) {
LOG_WARN(LOG_TAG, "%s Unable to find expected alarm in hashmap", __func__);
return;
UINT16 indicate_handle;
fixed_queue_t *pending_ind_q;
- TIMER_LIST_ENT conf_timer_ent; /* peer confirm to indication timer */
+ timer_entry_t conf_timer_ent; /* peer confirm to indication timer */
UINT8 prep_cnt[GATT_MAX_APPS];
UINT8 ind_count;
tGATT_CMD_Q cl_cmd_q[GATT_CL_MAX_LCB];
- TIMER_LIST_ENT ind_ack_timer_ent; /* local app confirm to indication timer */
+ timer_entry_t ind_ack_timer_ent; /* local app confirm to indication timer */
UINT8 pending_cl_req;
UINT8 next_slot_inq; /* index of next available slot in queue */
BOOLEAN first_read_blob_after_read;
tGATT_READ_INC_UUID128 read_uuid128;
BOOLEAN in_use;
- TIMER_LIST_ENT rsp_timer_ent; /* peer response timer */
+ timer_entry_t rsp_timer_ent; /* peer response timer */
UINT8 retry_count;
} tGATT_CLCB;
extern void gatt_sr_get_sec_info(BD_ADDR rem_bda, tBT_TRANSPORT transport, UINT8 *p_sec_flag, UINT8 *p_key_size);
extern void gatt_start_rsp_timer(UINT16 clcb_idx);
extern void gatt_start_conf_timer(tGATT_TCB *p_tcb);
-extern void gatt_rsp_timeout(TIMER_LIST_ENT *p_tle);
-extern void gatt_ind_ack_timeout(TIMER_LIST_ENT *p_tle);
+extern void gatt_rsp_timeout(timer_entry_t *p_te);
+extern void gatt_ind_ack_timeout(timer_entry_t *p_te);
extern void gatt_start_ind_ack_timer(tGATT_TCB *p_tcb);
extern tGATT_STATUS gatt_send_error_rsp(tGATT_TCB *p_tcb, UINT8 err_code, UINT8 op_code, UINT16 handle, BOOLEAN deq);
extern void gatt_dbg_display_uuid(tBT_UUID bt_uuid);
{
tGATT_CLCB *p_clcb = &gatt_cb.clcb[clcb_idx];
UINT32 timeout = GATT_WAIT_FOR_RSP_TOUT;
- p_clcb->rsp_timer_ent.param = (TIMER_PARAM_TYPE)p_clcb;
+ p_clcb->rsp_timer_ent.param = (timer_param_t)p_clcb;
if (p_clcb->operation == GATTC_OPTYPE_DISCOVERY &&
p_clcb->op_subtype == GATT_DISC_SRVC_ALL)
{
*******************************************************************************/
void gatt_start_conf_timer(tGATT_TCB *p_tcb)
{
- p_tcb->conf_timer_ent.param = (TIMER_PARAM_TYPE)p_tcb;
+ p_tcb->conf_timer_ent.param = (timer_param_t)p_tcb;
btu_start_timer (&p_tcb->conf_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_RSP,
GATT_WAIT_FOR_RSP_TOUT);
}
*******************************************************************************/
void gatt_start_ind_ack_timer(tGATT_TCB *p_tcb)
{
- p_tcb->ind_ack_timer_ent.param = (TIMER_PARAM_TYPE)p_tcb;
+ p_tcb->ind_ack_timer_ent.param = (timer_param_t)p_tcb;
/* start notification cache timer */
btu_start_timer (&p_tcb->ind_ack_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_IND_ACK,
GATT_WAIT_FOR_RSP_TOUT);
** Returns void
**
*******************************************************************************/
-void gatt_rsp_timeout(TIMER_LIST_ENT *p_tle)
+void gatt_rsp_timeout(timer_entry_t *p_te)
{
- tGATT_CLCB *p_clcb = (tGATT_CLCB *)p_tle->param;
+ tGATT_CLCB *p_clcb = (tGATT_CLCB *)p_te->param;
if (p_clcb == NULL || p_clcb->p_tcb == NULL)
{
GATT_TRACE_WARNING("gatt_rsp_timeout clcb is already deleted");
** Returns void
**
*******************************************************************************/
-void gatt_ind_ack_timeout(TIMER_LIST_ENT *p_tle)
+void gatt_ind_ack_timeout(timer_entry_t *p_te)
{
- tGATT_TCB * p_tcb = (tGATT_TCB *)p_tle->param;
+ tGATT_TCB * p_tcb = (tGATT_TCB *)p_te->param;
GATT_TRACE_WARNING("gatt_ind_ack_timeout send ack now");
if (p_tcb != NULL)
p_tcb->ind_count = 0;
- attp_send_cl_msg(((tGATT_TCB *)p_tle->param), 0, GATT_HANDLE_VALUE_CONF, NULL);
+ attp_send_cl_msg(((tGATT_TCB *)p_te->param), 0, GATT_HANDLE_VALUE_CONF, NULL);
}
/*******************************************************************************
**
#ifndef HID_CONN_H
#define HID_CONN_H
+#include "osi/include/non_repeating_timer.h"
/* Define the HID Connection Block
*/
UINT16 intr_cid;
UINT16 rem_mtu_size;
UINT16 disc_reason; /* Reason for disconnecting (for HID_HDEV_EVT_CLOSE) */
- TIMER_LIST_ENT timer_entry;
+ timer_entry_t timer_entry;
} tHID_CONN;
** Returns void
**
*******************************************************************************/
-void hidh_proc_repage_timeout (TIMER_LIST_ENT *p_tle)
+void hidh_proc_repage_timeout(timer_entry_t *p_te)
{
tHID_HOST_DEV_CTB *device;
- UINT8 dhandle = PTR_TO_UINT(p_tle->param);
+ UINT8 dhandle = PTR_TO_UINT(p_te->param);
hidh_conn_initiate(dhandle);
extern void hidh_conn_dereg( void );
extern tHID_STATUS hidh_conn_disconnect (UINT8 dhandle);
extern tHID_STATUS hidh_conn_initiate (UINT8 dhandle);
-extern void hidh_proc_repage_timeout (TIMER_LIST_ENT *p_tle);
+extern void hidh_proc_repage_timeout(timer_entry_t *p_te);
#ifdef __cplusplus
extern "C"
#include "btm_api.h"
#include "gki.h"
+#include "osi/include/non_repeating_timer.h"
#include <hardware/bt_common_types.h>
#define CHNL_MAP_LEN 5
BOOLEAN in_use;
UINT8 adv_evt;
BD_ADDR rpa;
- TIMER_LIST_ENT raddr_timer_ent;
+ timer_entry_t raddr_timer_ent;
tBTM_BLE_MULTI_ADV_CBACK *p_cback;
void *p_ref;
UINT8 index;
#include "bt_target.h"
#include "gki.h"
+#include "osi/include/non_repeating_timer.h"
// HACK(zachoverflow): temporary dark magic
#define BTU_POST_TO_TASK_NO_GOOD_HORRIBLE_HACK 0x1700 // didn't look used in bt_types...here goes nothing
/* callbacks
*/
-typedef void (*tBTU_TIMER_CALLBACK)(TIMER_LIST_ENT *p_tle);
+typedef void (*tBTU_TIMER_CALLBACK)(timer_entry_t *p_te);
typedef void (*tBTU_EVENT_CALLBACK)(BT_HDR *p_hdr);
/* structure to hold registered timers */
typedef struct
{
- TIMER_LIST_ENT *p_tle; /* timer entry */
+ timer_entry_t *p_te; /* timer entry */
tBTU_TIMER_CALLBACK timer_cb; /* callback triggered when timer expires */
} tBTU_TIMER_REG;
/* Functions provided by btu_task.c
************************************
*/
-extern void btu_start_timer (TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout);
-extern void btu_stop_timer (TIMER_LIST_ENT *p_tle);
-extern void btu_start_timer_oneshot(TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout);
-extern void btu_stop_timer_oneshot(TIMER_LIST_ENT *p_tle);
+extern void btu_start_timer (timer_entry_t *p_te, UINT16 type, UINT32 timeout);
+extern void btu_stop_timer (timer_entry_t *p_te);
+extern void btu_start_timer_oneshot(timer_entry_t *p_te, UINT16 type, UINT32 timeout);
+extern void btu_stop_timer_oneshot(timer_entry_t *p_te);
extern void btu_uipc_rx_cback(BT_HDR *p_msg);
** Quick Timer
*/
#if defined(QUICK_TIMER_TICKS_PER_SEC) && (QUICK_TIMER_TICKS_PER_SEC > 0)
-extern void btu_start_quick_timer (TIMER_LIST_ENT *p_tle, UINT16 type, UINT32 timeout);
-extern void btu_stop_quick_timer (TIMER_LIST_ENT *p_tle);
+extern void btu_start_quick_timer (timer_entry_t *p_te, UINT16 type, UINT32 timeout);
+extern void btu_stop_quick_timer (timer_entry_t *p_te);
extern void btu_process_quick_timer_evt (void);
#endif
#include "gki.h"
/* Port emulation entity Entry Points */
-extern void rfcomm_process_timeout (TIMER_LIST_ENT *p_tle);
+extern void rfcomm_process_timeout (timer_entry_t *p_te);
#endif
#include "osi/include/fixed_queue.h"
#include "osi/include/list.h"
+#include "osi/include/non_repeating_timer.h"
#include "btm_api.h"
#include "gki.h"
#include "l2c_api.h"
fixed_queue_t *srej_rcv_hold_q; /* Buffers rcvd but held pending SREJ rsp */
fixed_queue_t *retrans_q; /* Buffers being retransmitted */
- TIMER_LIST_ENT ack_timer; /* Timer delaying RR */
- TIMER_LIST_ENT mon_retrans_timer; /* Timer Monitor or Retransmission */
+ timer_entry_t ack_timer; /* Timer delaying RR */
+ timer_entry_t mon_retrans_timer; /* Timer Monitor or Retransmission */
#if (L2CAP_ERTM_STATS == TRUE)
UINT32 connect_tick_count; /* Time channel was established */
UINT16 local_cid; /* Local CID */
UINT16 remote_cid; /* Remote CID */
- TIMER_LIST_ENT timer_entry; /* CCB Timer List Entry */
+ timer_entry_t timer_entry; /* CCB Timer Entry */
tL2C_RCB *p_rcb; /* Registration CB for this Channel */
bool should_free_rcb; /* True if RCB was allocated on the heap */
BOOLEAN in_use; /* TRUE when in use, FALSE when not */
tL2C_LINK_STATE link_state;
- TIMER_LIST_ENT timer_entry; /* Timer list entry for timeout evt */
+ timer_entry_t timer_entry; /* Timer entry for timeout evt */
UINT16 handle; /* The handle used with LM */
tL2C_CCB_Q ccb_queue; /* Queue of CCBs on this LCB */
tL2C_CCB *p_pending_ccb; /* ccb of waiting channel during link disconnect */
- TIMER_LIST_ENT info_timer_entry; /* Timer entry for info resp timeout evt */
+ timer_entry_t info_timer_entry; /* Timer entry for info resp timeout evt */
BD_ADDR remote_bd_addr; /* The BD address of the remote */
UINT8 link_role; /* Master or slave */
UINT16 idle_timeout; /* Idle timeout */
list_t *rcv_pending_q; /* Recv pending queue */
- TIMER_LIST_ENT rcv_hold_tle; /* Timer list entry for rcv hold */
+ timer_entry_t rcv_hold_te; /* Timer entry for rcv hold */
tL2C_LCB *p_cur_hcit_lcb; /* Current HCI Transport buffer */
UINT16 num_links_active; /* Number of links active */
void l2c_init(void);
void l2c_free(void);
-extern void l2c_process_timeout (TIMER_LIST_ENT *p_tle);
+extern void l2c_process_timeout(timer_entry_t *p_te);
extern UINT8 l2c_data_write (UINT16 cid, BT_HDR *p_data, UINT16 flag);
extern void l2c_rcv_acl_data (BT_HDR *p_msg);
extern void l2c_process_held_packets (BOOLEAN timed_out);
list_append(l2cb.rcv_pending_q, p_msg);
if (list_length(l2cb.rcv_pending_q) == 1)
- btu_start_timer (&l2cb.rcv_hold_tle, BTU_TTYPE_L2CAP_HOLD, BT_1SEC_TIMEOUT);
+ btu_start_timer (&l2cb.rcv_hold_te, BTU_TTYPE_L2CAP_HOLD, BT_1SEC_TIMEOUT);
return;
} else {
return;
if (!timed_out) {
- btu_stop_timer(&l2cb.rcv_hold_tle);
+ btu_stop_timer(&l2cb.rcv_hold_te);
L2CAP_TRACE_WARNING("L2CAP HOLD CONTINUE");
} else {
L2CAP_TRACE_WARNING("L2CAP HOLD TIMEOUT");
/* If anyone still in the queue, restart the timeout */
if (!list_is_empty(l2cb.rcv_pending_q))
- btu_start_timer (&l2cb.rcv_hold_tle, BTU_TTYPE_L2CAP_HOLD, BT_1SEC_TIMEOUT);
+ btu_start_timer (&l2cb.rcv_hold_te, BTU_TTYPE_L2CAP_HOLD, BT_1SEC_TIMEOUT);
}
/*******************************************************************************
** Returns void
**
*******************************************************************************/
-void l2c_process_timeout (TIMER_LIST_ENT *p_tle)
+void l2c_process_timeout (timer_entry_t *p_te)
{
/* What type of timeout ? */
- switch (p_tle->event)
+ switch (p_te->event)
{
case BTU_TTYPE_L2CAP_LINK:
- l2c_link_timeout ((tL2C_LCB *)p_tle->param);
+ l2c_link_timeout ((tL2C_LCB *)p_te->param);
break;
case BTU_TTYPE_L2CAP_CHNL:
- l2c_csm_execute (((tL2C_CCB *)p_tle->param), L2CEVT_TIMEOUT, NULL);
+ l2c_csm_execute (((tL2C_CCB *)p_te->param), L2CEVT_TIMEOUT, NULL);
break;
case BTU_TTYPE_L2CAP_FCR_ACK:
- l2c_csm_execute (((tL2C_CCB *)p_tle->param), L2CEVT_ACK_TIMEOUT, NULL);
+ l2c_csm_execute (((tL2C_CCB *)p_te->param), L2CEVT_ACK_TIMEOUT, NULL);
break;
case BTU_TTYPE_L2CAP_HOLD:
break;
case BTU_TTYPE_L2CAP_INFO:
- l2c_info_timeout((tL2C_LCB *)p_tle->param);
+ l2c_info_timeout((tL2C_LCB *)p_te->param);
break;
}
}
p_lcb->link_state = LST_DISCONNECTED;
p_lcb->handle = HCI_INVALID_HANDLE;
p_lcb->link_flush_tout = 0xFFFF;
- p_lcb->timer_entry.param = (TIMER_PARAM_TYPE)p_lcb;
- p_lcb->info_timer_entry.param = (TIMER_PARAM_TYPE)p_lcb;
+ p_lcb->timer_entry.param = (timer_param_t)p_lcb;
+ p_lcb->info_timer_entry.param = (timer_param_t)p_lcb;
p_lcb->idle_timeout = l2cb.idle_timeout;
p_lcb->id = 1; /* spec does not allow '0' */
p_lcb->is_bonding = is_bonding;
memset (&p_ccb->ertm_info, 0, sizeof(tL2CAP_ERTM_INFO));
p_ccb->peer_cfg_already_rejected = FALSE;
p_ccb->fcr_cfg_tries = L2CAP_MAX_FCR_CFG_TRIES;
- p_ccb->fcrb.ack_timer.param = (TIMER_PARAM_TYPE)p_ccb;
+ p_ccb->fcrb.ack_timer.param = (timer_param_t)p_ccb;
- /* if timer is running, remove it from timer list */
+ /* if timer is running, stop it */
if (p_ccb->fcrb.ack_timer.in_use)
btu_stop_quick_timer (&p_ccb->fcrb.ack_timer);
- p_ccb->fcrb.mon_retrans_timer.param = (TIMER_PARAM_TYPE)p_ccb;
+ p_ccb->fcrb.mon_retrans_timer.param = (timer_param_t)p_ccb;
// btla-specific ++
/* CSP408639 Fix: When L2CAP send amp move channel request or receive
p_ccb->is_flushable = FALSE;
#endif
- p_ccb->timer_entry.param = (TIMER_PARAM_TYPE)p_ccb;
+ p_ccb->timer_entry.param = (timer_param_t)p_ccb;
p_ccb->timer_entry.in_use = 0;
l2c_link_adjust_chnl_allocation ();
p_ccb->is_flushable = FALSE;
- p_ccb->timer_entry.param = (TIMER_PARAM_TYPE)p_ccb;
+ p_ccb->timer_entry.param = (timer_param_t)p_ccb;
if (p_fcr)
** Returns void
**
*******************************************************************************/
-void mca_process_timeout(TIMER_LIST_ENT *p_tle)
+void mca_process_timeout(timer_entry_t *p_te)
{
- if(p_tle->event == BTU_TTYPE_MCA_CCB_RSP)
+ if (p_te->event == BTU_TTYPE_MCA_CCB_RSP)
{
- p_tle->event = 0;
- mca_ccb_event ((tMCA_CCB *) p_tle->param, MCA_CCB_RSP_TOUT_EVT, NULL);
+ p_te->event = 0;
+ mca_ccb_event((tMCA_CCB *) p_te->param, MCA_CCB_RSP_TOUT_EVT, NULL);
}
}
p_msg->hdr.layer_specific = TRUE; /* mark this message as sent */
p_pkt->len = p - p_start;
L2CA_DataWrite (p_ccb->lcid, p_pkt);
- p_ccb->timer_entry.param = (TIMER_PARAM_TYPE) p_ccb;
+ p_ccb->timer_entry.param = (timer_param_t)p_ccb;
btu_start_timer(&p_ccb->timer_entry, BTU_TTYPE_MCA_CCB_RSP, p_ccb->p_rcb->reg.rsp_tout);
}
}
#ifndef MCA_INT_H
#define MCA_INT_H
#include "gki.h"
+#include "osi/include/non_repeating_timer.h"
#include "mca_api.h"
/*****************************************************************************
*/
typedef struct {
tMCA_RCB *p_rcb; /* the associated registration control block */
- TIMER_LIST_ENT timer_entry; /* CCB timer list entry */
+ timer_entry_t timer_entry; /* CCB timer entry */
tMCA_CCB_MSG *p_tx_req; /* Current request being sent/awaiting response */
tMCA_CCB_MSG *p_rx_msg; /* Current message received/being processed */
BD_ADDR peer_addr; /* BD address of peer */
extern tMCA_RCB *mca_rcb_by_handle(tMCA_HANDLE handle);
extern BOOLEAN mca_is_valid_dep_id(tMCA_RCB *p_rcb, tMCA_DEP dep);
extern void mca_free_buf(void **p_buf);
-extern void mca_process_timeout(TIMER_LIST_ENT *p_tle);
+extern void mca_process_timeout(timer_entry_t *p_te);
extern void mca_stop_timer(tMCA_CCB *p_ccb);
/* l2c functions */
#include "bt_target.h"
#include "osi/include/fixed_queue.h"
+#include "osi/include/non_repeating_timer.h"
#include "gki.h"
#include "rfcdefs.h"
#include "port_api.h"
*/
typedef struct
{
- TIMER_LIST_ENT tle; /* Timer list entry */
+ timer_entry_t timer_entry; /* Timer entry */
fixed_queue_t *cmd_q; /* Queue for command messages on this mux */
UINT8 port_inx[RFCOMM_MAX_DLCI + 1]; /* Array for quick access to */
/* tPORT based on dlci */
tRFC_MCB *p_mcb;
- TIMER_LIST_ENT tle; /* Timer list entry */
+ timer_entry_t timer_entry; /* Timer entry */
};
typedef struct t_rfc_port tRFC_PORT;
*******************************************************************************/
void rfc_timer_start (tRFC_MCB *p_mcb, UINT16 timeout)
{
- TIMER_LIST_ENT *p_tle = &p_mcb->tle;
+ timer_entry_t *p_te = &p_mcb->timer_entry;
RFCOMM_TRACE_EVENT ("rfc_timer_start - timeout:%d", timeout);
- p_tle->param = p_mcb;
+ p_te->param = p_mcb;
- btu_start_timer (p_tle, BTU_TTYPE_RFCOMM_MFC, timeout);
+ btu_start_timer (p_te, BTU_TTYPE_RFCOMM_MFC, timeout);
}
{
RFCOMM_TRACE_EVENT ("rfc_timer_stop");
- btu_stop_timer (&p_mcb->tle);
+ btu_stop_timer (&p_mcb->timer_entry);
}
*******************************************************************************/
void rfc_port_timer_start (tPORT *p_port, UINT16 timeout)
{
- TIMER_LIST_ENT *p_tle = &p_port->rfc.tle;
+ timer_entry_t *p_te = &p_port->rfc.timer_entry;
RFCOMM_TRACE_EVENT ("rfc_port_timer_start - timeout:%d", timeout);
- p_tle->param = p_port;
+ p_te->param = p_port;
- btu_start_timer (p_tle, BTU_TTYPE_RFCOMM_PORT, timeout);
+ btu_start_timer (p_te, BTU_TTYPE_RFCOMM_PORT, timeout);
}
{
RFCOMM_TRACE_EVENT ("rfc_port_timer_stop");
- btu_stop_timer (&p_port->rfc.tle);
+ btu_stop_timer (&p_port->rfc.timer_entry);
}
** Returns void
**
*******************************************************************************/
-void rfcomm_process_timeout (TIMER_LIST_ENT *p_tle)
+void rfcomm_process_timeout (timer_entry_t *p_te)
{
- switch (p_tle->event)
+ switch (p_te->event)
{
case BTU_TTYPE_RFCOMM_MFC:
- rfc_mx_sm_execute ((tRFC_MCB *)p_tle->param, RFC_EVENT_TIMEOUT, NULL);
+ rfc_mx_sm_execute ((tRFC_MCB *)p_te->param, RFC_EVENT_TIMEOUT, NULL);
break;
case BTU_TTYPE_RFCOMM_PORT:
- rfc_port_sm_execute ((tPORT *)p_tle->param, RFC_EVENT_TIMEOUT, NULL);
+ rfc_port_sm_execute ((tPORT *)p_te->param, RFC_EVENT_TIMEOUT, NULL);
break;
default:
#define SDP_INT_H
#include "bt_target.h"
+#include "osi/include/non_repeating_timer.h"
#include "sdp_api.h"
#include "l2c_api.h"
UINT8 con_flags;
BD_ADDR device_address;
- TIMER_LIST_ENT timer_entry;
+ timer_entry_t timer_entry;
UINT16 rem_mtu_size;
UINT16 connection_id;
UINT16 list_len; /* length of the response in the GKI buffer */
typedef struct
{
tSMP_CALLBACK *p_callback;
- TIMER_LIST_ENT rsp_timer_ent;
+ timer_entry_t rsp_timer_ent;
UINT8 trace_level;
BD_ADDR pairing_bda;
tSMP_STATE state;
extern void smp_proc_pairing_cmpl(tSMP_CB *p_cb);
extern void smp_convert_string_to_tk(BT_OCTET16 tk, UINT32 passkey);
extern void smp_mask_enc_key(UINT8 loc_enc_size, UINT8 * p_data);
-extern void smp_rsp_timeout(TIMER_LIST_ENT *p_tle);
+extern void smp_rsp_timeout(timer_entry_t *p_te);
extern void smp_xor_128(BT_OCTET16 a, BT_OCTET16 b);
extern BOOLEAN smp_encrypt_data (UINT8 *key, UINT8 key_len,
UINT8 *plain_text, UINT8 pt_len,
** Returns void
**
*******************************************************************************/
-void smp_rsp_timeout(TIMER_LIST_ENT *p_tle)
+void smp_rsp_timeout(timer_entry_t *p_te)
{
tSMP_CB *p_cb = &smp_cb;
UINT8 failure = SMP_RSP_TIMEOUT;
- UNUSED(p_tle);
+ UNUSED(p_te);
SMP_TRACE_EVENT("%s state:%d br_state:%d", __FUNCTION__, p_cb->state, p_cb->br_state);