本文整理汇总了C++中bta_sys_sendmsg函数的典型用法代码示例。如果您正苦于以下问题:C++ bta_sys_sendmsg函数的具体用法?C++ bta_sys_sendmsg怎么用?C++ bta_sys_sendmsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bta_sys_sendmsg函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BTA_HfClientSendAT
/*******************************************************************************
**
** Function BTA_HfClientSendAT
**
** Description send AT command
**
**
** Returns void
**
*******************************************************************************/
BTA_API void BTA_HfClientSendAT(UINT16 handle, tBTA_HF_CLIENT_AT_CMD_TYPE at, UINT32 val1, UINT32 val2, const char *str)
{
tBTA_HF_CLIENT_DATA_VAL *p_buf;
if ((p_buf = (tBTA_HF_CLIENT_DATA_VAL *) GKI_getbuf(sizeof(tBTA_HF_CLIENT_DATA_VAL))) != NULL)
{
p_buf->hdr.event = BTA_HF_CLIENT_SEND_AT_CMD_EVT;
p_buf->uint8_val = at;
p_buf->uint32_val1 = val1;
p_buf->uint32_val2 = val2;
if (str)
{
strlcpy(p_buf->str, str, BTA_HF_CLIENT_NUMBER_LEN + 1);
p_buf->str[BTA_HF_CLIENT_NUMBER_LEN] = '\0';
}
else
{
p_buf->str[0] = '\0';
}
p_buf->hdr.layer_specific = handle;
bta_sys_sendmsg(p_buf);
}
}
示例2: BTA_HfClientEnable
/*******************************************************************************
**
** Function BTA_HfClientEnable
**
** Description Enable the HF CLient service. When the enable
** operation is complete the callback function will be
** called with a BTA_HF_CLIENT_ENABLE_EVT. This function must
** be called before other function in the HF CLient API are
** called.
**
** Returns BTA_SUCCESS if OK, BTA_FAILURE otherwise.
**
*******************************************************************************/
BTA_API tBTA_STATUS BTA_HfClientEnable(tBTA_HF_CLIENT_CBACK *p_cback)
{
tBTA_HF_CLIENT_API_ENABLE *p_buf;
UINT8 idx;
if (bta_sys_is_register (BTA_ID_HS))
{
APPL_TRACE_ERROR0("BTA HF Client is already enabled, ignoring ...");
return BTA_FAILURE;
}
/* register with BTA system manager */
GKI_sched_lock();
bta_sys_register(BTA_ID_HS, &bta_hf_client_reg);
GKI_sched_unlock();
if ((p_buf = (tBTA_HF_CLIENT_API_ENABLE *) GKI_getbuf(sizeof(tBTA_HF_CLIENT_API_ENABLE))) != NULL)
{
p_buf->hdr.event = BTA_HF_CLIENT_API_ENABLE_EVT;
p_buf->p_cback = p_cback;
bta_sys_sendmsg(p_buf);
}
return BTA_SUCCESS;
}
示例3: bta_pan_conn_state_cback
/*******************************************************************************
**
** Function bta_pan_conn_state_cback
**
** Description Connection state callback from Pan profile
**
**
** 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)
{
tBTA_PAN_CONN * p_buf;
tBTA_PAN_SCB *p_scb;
if ((p_buf = (tBTA_PAN_CONN *) GKI_getbuf(sizeof(tBTA_PAN_CONN))) != NULL)
{
if((state == PAN_SUCCESS) && !is_role_change)
{
p_buf->hdr.event = BTA_PAN_CONN_OPEN_EVT;
if((p_scb = bta_pan_scb_by_handle(handle)) == NULL)
{
/* allocate an scb */
p_scb = bta_pan_scb_alloc();
}
/* we have exceeded maximum number of connections */
if(!p_scb)
{
PAN_Disconnect (handle);
return;
}
p_scb->handle = handle;
p_scb->local_role = src_role;
p_scb->peer_role = dst_role;
p_scb->pan_flow_enable = TRUE;
bdcpy(p_scb->bd_addr, bd_addr);
GKI_init_q(&p_scb->data_queue);
if(src_role == PAN_ROLE_CLIENT)
p_scb->app_id = bta_pan_cb.app_id[0];
else if (src_role == PAN_ROLE_GN_SERVER)
p_scb->app_id = bta_pan_cb.app_id[1];
else if (src_role == PAN_ROLE_NAP_SERVER)
p_scb->app_id = bta_pan_cb.app_id[2];
}
else if((state != PAN_SUCCESS) && !is_role_change)
{
p_buf->hdr.event = BTA_PAN_CONN_CLOSE_EVT;
}
else
{
return;
}
p_buf->result = state;
p_buf->hdr.layer_specific = handle;
bta_sys_sendmsg(p_buf);
}
}
示例4: BTA_AgRegister
/*******************************************************************************
**
** Function BTA_AgRegister
**
** Description Register an Audio Gateway service.
**
**
** Returns void
**
*******************************************************************************/
void BTA_AgRegister(tBTA_SERVICE_MASK services, tBTA_SEC sec_mask,tBTA_AG_FEAT features,
char * p_service_names[], UINT8 app_id)
{
tBTA_AG_API_REGISTER *p_buf;
int i;
if ((p_buf = (tBTA_AG_API_REGISTER *) GKI_getbuf(sizeof(tBTA_AG_API_REGISTER))) != NULL)
{
p_buf->hdr.event = BTA_AG_API_REGISTER_EVT;
p_buf->features = features;
p_buf->sec_mask = sec_mask;
p_buf->services = services;
p_buf->app_id = app_id;
for (i = 0; i < BTA_AG_NUM_IDX; i++)
{
if(p_service_names[i])
{
BCM_STRNCPY_S(p_buf->p_name[i], BTA_SERVICE_NAME_LEN+1, p_service_names[i], BTA_SERVICE_NAME_LEN);
p_buf->p_name[i][BTA_SERVICE_NAME_LEN] = 0;
}
else
{
p_buf->p_name[i][0] = 0;
}
}
bta_sys_sendmsg(p_buf);
}
}
示例5: BTA_AgEnable
/*******************************************************************************
**
** Function BTA_AgEnable
**
** Description Enable the audio gateway service. When the enable
** operation is complete the callback function will be
** called with a BTA_AG_ENABLE_EVT. This function must
** be called before other function in the AG API are
** called.
**
** Returns BTA_SUCCESS if OK, BTA_FAILURE otherwise.
**
*******************************************************************************/
tBTA_STATUS BTA_AgEnable(tBTA_AG_PARSE_MODE parse_mode, tBTA_AG_CBACK *p_cback)
{
tBTA_AG_API_ENABLE *p_buf;
UINT8 idx;
/* Error if AG is already enabled, or AG is in the middle of disabling. */
for (idx = 0; idx < BTA_AG_NUM_SCB; idx++)
{
if (bta_ag_cb.scb[idx].in_use)
{
APPL_TRACE_ERROR0 ("BTA_AgEnable: FAILED, AG already enabled.");
return BTA_FAILURE;
}
}
/* register with BTA system manager */
GKI_sched_lock();
bta_sys_register(BTA_ID_AG, &bta_ag_reg);
GKI_sched_unlock();
if ((p_buf = (tBTA_AG_API_ENABLE *) GKI_getbuf(sizeof(tBTA_AG_API_ENABLE))) != NULL)
{
p_buf->hdr.event = BTA_AG_API_ENABLE_EVT;
p_buf->parse_mode = parse_mode;
p_buf->p_cback = p_cback;
bta_sys_sendmsg(p_buf);
}
return BTA_SUCCESS;
}
示例6: bta_pan_data_flow_cb
/*******************************************************************************
**
** Function bta_pan_data_flow_cb
**
** Description Data flow status callback from PAN
**
**
** Returns void
**
*******************************************************************************/
static void bta_pan_data_flow_cb(UINT16 handle, tPAN_RESULT result)
{
BT_HDR *p_buf;
tBTA_PAN_SCB *p_scb;
if((p_scb = bta_pan_scb_by_handle(handle)) == NULL)
return;
if(result == PAN_TX_FLOW_ON)
{
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
{
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);
}
else if(result == PAN_TX_FLOW_OFF)
{
p_scb->pan_flow_enable = FALSE;
bta_pan_co_rx_flow(handle, p_scb->app_id, FALSE);
}
}
示例7: bta_ag_sdp_cback
/*******************************************************************************
**
** Function bta_ag_sdp_cback
**
** Description SDP callback function.
**
**
** Returns void
**
*******************************************************************************/
static void bta_ag_sdp_cback(UINT16 status, UINT8 idx)
{
tBTA_AG_DISC_RESULT *p_buf;
UINT16 event;
tBTA_AG_SCB *p_scb;
APPL_TRACE_DEBUG("bta_ag_sdp_cback status:0x%x", status);
if ((p_scb = bta_ag_scb_by_idx(idx)) != NULL)
{
/* set event according to int/acp */
if (p_scb->role == BTA_AG_ACP)
{
event = BTA_AG_DISC_ACP_RES_EVT;
}
else
{
event = BTA_AG_DISC_INT_RES_EVT;
}
if ((p_buf = (tBTA_AG_DISC_RESULT *) GKI_getbuf(sizeof(tBTA_AG_DISC_RESULT))) != NULL)
{
p_buf->hdr.event = event;
p_buf->hdr.layer_specific = idx;
p_buf->status = status;
bta_sys_sendmsg(p_buf);
}
}
}
示例8: BTA_GpsDisable
/*******************************************************************************
**
** Function BTA_GpsDisable
**
** Description
**
**
** Returns void
**
*******************************************************************************/
void BTA_GpsDisable()
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->event = 9473;
bta_sys_sendmsg(p_buf);
}
}
示例9: ptim_timer_update
/*******************************************************************************
**
** Function ptim_timer_update
**
** Description Update the protocol timer list and handle expired timers.
** This function is called from the task running the protocol
** timers when the periodic GKI timer expires.
**
** Returns void
**
*******************************************************************************/
void ptim_timer_update(tPTIM_CB *p_cb)
{
TIMER_LIST_ENT *p_tle;
BT_HDR *p_msg;
UINT32 new_ticks_count;
INT32 period_in_ticks;
/* To handle the case when the function is called less frequently than the period
we must convert determine the number of ticks since the last update, then
convert back to milliseconds before updating timer list */
new_ticks_count = GKI_get_tick_count();
/* Check for wrapped condition */
if (new_ticks_count >= p_cb->last_gki_ticks)
{
period_in_ticks = (INT32)(new_ticks_count - p_cb->last_gki_ticks);
}
else
{
period_in_ticks = (INT32)(((UINT32)0xffffffff - p_cb->last_gki_ticks)
+ new_ticks_count + 1);
}
/* update timer list */
GKI_update_timer_list(&p_cb->timer_queue, GKI_TICKS_TO_MS(period_in_ticks));
p_cb->last_gki_ticks = new_ticks_count;
/* while there are expired timers */
while((p_cb->timer_queue.p_first) && (p_cb->timer_queue.p_first->ticks <= 0))
{
/* removed expired timer from list */
p_tle = p_cb->timer_queue.p_first;
GKI_remove_from_timer_list(&p_cb->timer_queue, p_tle);
/* call timer callback */
if(p_tle->p_cback)
{
(*p_tle->p_cback)(p_tle);
}
else if(p_tle->event)
{
if ((p_msg = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
{
p_msg->event = p_tle->event;
p_msg->layer_specific = 0;
bta_sys_sendmsg(p_msg);
}
}
}
/* if timer list is empty stop periodic GKI timer */
if (p_cb->timer_queue.p_first == NULL)
{
GKI_stop_timer(p_cb->timer_id);
}
}
示例10: BTA_AvStart
/*******************************************************************************
**
** Function BTA_AvStart
**
** Description Start audio/video stream data transfer.
**
** Returns void
**
*******************************************************************************/
void BTA_AvStart(void)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL) {
p_buf->event = BTA_AV_API_START_EVT;
bta_sys_sendmsg(p_buf);
}
}
示例11: BTA_HdRegisterApp
/*******************************************************************************
**
** Function BTA_HdRegisterApp
**
** Description This function is called when application should be registered
**
** Returns void
**
*******************************************************************************/
extern void BTA_HdRegisterApp(tBTA_HD_APP_INFO *p_app_info, tBTA_HD_QOS_INFO *p_in_qos,
tBTA_HD_QOS_INFO *p_out_qos)
{
tBTA_HD_REGISTER_APP *p_buf;
APPL_TRACE_API("%s", __FUNCTION__);
if ((p_buf = (tBTA_HD_REGISTER_APP *) GKI_getbuf(sizeof(tBTA_HD_REGISTER_APP))) != NULL)
{
p_buf->hdr.event = BTA_HD_API_REGISTER_APP_EVT;
if (p_app_info->p_name)
{
BCM_STRNCPY_S(p_buf->name, sizeof(p_buf->name),
p_app_info->p_name, BTA_HD_APP_NAME_LEN);
p_buf->name[BTA_HD_APP_NAME_LEN] = '\0';
}
else
{
p_buf->name[0]= '\0';
}
if (p_app_info->p_description)
{
BCM_STRNCPY_S(p_buf->description, sizeof(p_buf->description), p_app_info->p_description,
BTA_HD_APP_DESCRIPTION_LEN);
p_buf->description[BTA_HD_APP_DESCRIPTION_LEN] = '\0';
}
else
{
p_buf->description[0]= '\0';
}
if (p_app_info->p_provider)
{
BCM_STRNCPY_S(p_buf->provider, sizeof(p_buf->provider), p_app_info->p_provider,
BTA_HD_APP_PROVIDER_LEN);
p_buf->provider[BTA_HD_APP_PROVIDER_LEN] = '\0';
}
else
{
p_buf->provider[0]= '\0';
}
p_buf->subclass = p_app_info->subclass;
p_buf->d_len = p_app_info->descriptor.dl_len;
memcpy(p_buf->d_data, p_app_info->descriptor.dsc_list, p_app_info->descriptor.dl_len);
// copy qos data as-is
memcpy(&p_buf->in_qos, p_in_qos, sizeof(tBTA_HD_QOS_INFO));
memcpy(&p_buf->out_qos, p_out_qos, sizeof(tBTA_HD_QOS_INFO));
bta_sys_sendmsg(p_buf);
}
}
示例12: bta_pan_tx_path
/*******************************************************************************
**
** Function bta_pan_tx_path
**
** Description Handle the TX data path (data sent from BTA to the phone).
**
**
** Returns void
**
*******************************************************************************/
void bta_pan_tx_path(tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
{
BT_HDR * p_buf;
/* if data path configured for tx pull */
if ((bta_pan_cb.flow_mask & BTA_PAN_TX_MASK) == BTA_PAN_TX_PULL)
{
bta_pan_pm_conn_busy(p_scb);
/* call application callout function for tx path */
bta_pan_co_tx_path(p_scb->handle, p_scb->app_id);
/* free data that exceeds queue level */
while(p_scb->data_queue.count > bta_pan_cb.q_level)
GKI_freebuf(GKI_dequeue(&p_scb->data_queue));
bta_pan_pm_conn_idle(p_scb);
}
/* if configured for zero copy push */
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)
{
/* read data from the queue */
if ((p_buf = (BT_HDR *)GKI_dequeue(&p_scb->data_queue)) != NULL)
{
/* send data to application */
bta_pan_co_tx_writebuf(p_scb->handle,
p_scb->app_id,
((tBTA_PAN_DATA_PARAMS *)p_buf)->src,
((tBTA_PAN_DATA_PARAMS *)p_buf)->dst,
((tBTA_PAN_DATA_PARAMS *)p_buf)->protocol,
p_buf,
((tBTA_PAN_DATA_PARAMS *)p_buf)->ext,
((tBTA_PAN_DATA_PARAMS *)p_buf)->forward);
}
/* free data that exceeds queue level */
while(p_scb->data_queue.count > bta_pan_cb.q_level)
GKI_freebuf(GKI_dequeue(&p_scb->data_queue));
/* if there is more data to be passed to
upper layer */
if(p_scb->data_queue.count)
{
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
{
p_buf->layer_specific = p_scb->handle;
p_buf->event = BTA_PAN_RX_FROM_BNEP_READY_EVT;
bta_sys_sendmsg(p_buf);
}
}
}
}
}
示例13: BTA_AvOpenRc
/*******************************************************************************
**
** Function BTA_AvOpenRc
**
** Description Open an AVRCP connection toward the device with the
** specified handle
**
** Returns void
**
*******************************************************************************/
void BTA_AvOpenRc(tBTA_AV_HNDL handle)
{
tBTA_AV_API_OPEN_RC *p_buf;
if ((p_buf = (tBTA_AV_API_OPEN_RC *) GKI_getbuf(sizeof(tBTA_AV_API_OPEN_RC))) != NULL) {
p_buf->hdr.event = BTA_AV_API_RC_OPEN_EVT;
p_buf->hdr.layer_specific = handle;
bta_sys_sendmsg(p_buf);
}
}
示例14: BTA_AvClose
/*******************************************************************************
**
** Function BTA_AvClose
**
** Description Close the current streams.
**
** Returns void
**
*******************************************************************************/
void BTA_AvClose(tBTA_AV_HNDL handle)
{
BT_HDR *p_buf;
if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL) {
p_buf->event = BTA_AV_API_CLOSE_EVT;
p_buf->layer_specific = handle;
bta_sys_sendmsg(p_buf);
}
}
示例15: BTA_AvDisconnect
/*******************************************************************************
**
** Function BTA_AvDisconnect
**
** Description Close the connection to the address.
**
** Returns void
**
*******************************************************************************/
void BTA_AvDisconnect(BD_ADDR bd_addr)
{
tBTA_AV_API_DISCNT *p_buf;
if ((p_buf = (tBTA_AV_API_DISCNT *) GKI_getbuf(sizeof(tBTA_AV_API_DISCNT))) != NULL) {
p_buf->hdr.event = BTA_AV_API_DISCONNECT_EVT;
bdcpy(p_buf->bd_addr, bd_addr);
bta_sys_sendmsg(p_buf);
}
}