亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hostag_receive.c

?? bluetooth audio gateway
?? C
字號:
#include "hostag_private.h"
#include "ag_types.h"
#include "ag.h"

#include <cm_rfcomm.h>

#include <panic.h>
#include <stdlib.h>
#include <string.h>
#include <vm.h>



/* TODO CM messages should not be passed in */



/* strnlen */
static uint16 strnlen(const uint8 *s, uint16 n)
{
    uint16 i;
    for(i = 0; i < n && s[i]; ++i) ;
    return i;
}


/*
    sendRemoteNameInd

    Remote name may be very long (up to 248 characters) so send it to
    the client using multiple packets.
*/
static void sendRemoteNameInd(const CM_INQUIRY_RESULT_IND_T *ind)
{
    int i;    
    for (i=1; i<HCI_LOCAL_NAME_BYTE_PACKET_PTRS && ind->handles[i]; i++)
    {
        uint8 *ptr = (uint8 *)VmGetPointerFromHandle(ind->handles[i]);
        uint16 len = strnlen(ptr, HCI_LOCAL_NAME_BYTES_PER_PTR);
        MAKE_PHONE_MSG_WITH_LEN(AG_REMOTE_NAME_IND, len);
        msg->ag_msg.remote_name_ind.length = len;
        memcpy(msg->ag_msg.remote_name_ind.device_name, ptr, len);
        msg->ag_msg.remote_name_ind.device_name[len] = '\0';
        msg->ag_msg.remote_name_ind.continuation_pkt_pending = 
            i+1 < HCI_LOCAL_NAME_BYTE_PACKET_PTRS && ind->handles[i+1]; /* More pending */
        hostAgPutHostMsg((void *)msg);
        free(ptr);
    }
}



/*
    handleStartCfm

    Send a message to the driver with the EAG version information This
    is really to assure the EAG driver application that the EAG is up
    and running.
*/
void handleStartCfm(void)
{
    MAKE_PHONE_MSG(AG_START_CFM);
    msg->ag_msg.start_cfm.version = EAG_VERSION;
    hostAgPutHostMsg((void *)msg);
}


/*
    handleInquiryResultInd

    An inquiry result has been received from the Connection Manager
    Inquiry results also contain the reply from a remote name request
    so must also be able to handle long device names.
*/
void handleInquiryResultInd(const CM_INQUIRY_RESULT_IND_T *ind)
{    
    if (ind->handles[0])
    {
        uint8 *ptr = (uint8 *) VmGetPointerFromHandle(ind->handles[0]);
        uint16 len = strnlen(ptr, HCI_LOCAL_NAME_BYTES_PER_PTR);
        MAKE_PHONE_MSG_WITH_LEN(AG_INQUIRY_RESULT_IND, len);
        
        msg->ag_msg.inquiry_result_ind.dev_address.nap = ind->inq_result.bd_addr.nap;
        msg->ag_msg.inquiry_result_ind.dev_address.uap = ind->inq_result.bd_addr.uap;
        msg->ag_msg.inquiry_result_ind.dev_address.lap = ind->inq_result.bd_addr.lap;
        msg->ag_msg.inquiry_result_ind.class_of_device = ind->inq_result.dev_class;
        msg->ag_msg.inquiry_result_ind.clock_offset = ind->inq_result.clock_offset;
        msg->ag_msg.inquiry_result_ind.page_scan_rep_mode = ind->inq_result.page_scan_rep_mode;
        msg->ag_msg.inquiry_result_ind.page_scan_mode = ind->inq_result.page_scan_mode;
        msg->ag_msg.inquiry_result_ind.page_scan_period_mode = ind->inq_result.page_scan_period_mode;
        msg->ag_msg.inquiry_result_ind.length = len;
        memcpy(msg->ag_msg.inquiry_result_ind.device_name, ptr, len);
        msg->ag_msg.inquiry_result_ind.device_name[len] = '\0';
        msg->ag_msg.inquiry_result_ind.continuation_pkt_pending = (ind->handles[1] != 0);       
        hostAgPutHostMsg((void *)msg);

        /* send next pkt with remote name data */
        sendRemoteNameInd(ind);
        
        free(ptr);
    }
    else
    {
        const char *text = "Remote name not discovered";
        const uint16 len    = strlen(text);
     
        
        /* remote name not valid */
        MAKE_PHONE_MSG_WITH_LEN(AG_INQUIRY_RESULT_IND, len);
        msg->ag_msg.inquiry_result_ind.dev_address.nap = ind->inq_result.bd_addr.nap;
        msg->ag_msg.inquiry_result_ind.dev_address.uap = ind->inq_result.bd_addr.uap;
        msg->ag_msg.inquiry_result_ind.dev_address.lap = ind->inq_result.bd_addr.lap;
        msg->ag_msg.inquiry_result_ind.class_of_device = ind->inq_result.dev_class;
        msg->ag_msg.inquiry_result_ind.clock_offset = ind->inq_result.clock_offset;
        msg->ag_msg.inquiry_result_ind.page_scan_rep_mode = ind->inq_result.page_scan_rep_mode;
        msg->ag_msg.inquiry_result_ind.page_scan_mode = ind->inq_result.page_scan_mode;
        msg->ag_msg.inquiry_result_ind.page_scan_period_mode = ind->inq_result.page_scan_period_mode;
        msg->ag_msg.inquiry_result_ind.continuation_pkt_pending = 0;
        msg->ag_msg.inquiry_result_ind.length = len+1;
        memcpy(msg->ag_msg.inquiry_result_ind.device_name, text, len+1); /*lint !e669 */
        hostAgPutHostMsg((void *)msg);        
    }
}


/*
    handleInquiryCompleteCfm

    Inquiry has completed so send status to the off-chip driver
*/
void handleInquiryCompleteCfm(ag_inquiry_status_t status)
{
    MAKE_PHONE_MSG(AG_INQUIRY_COMPLETE_CFM);
    msg->ag_msg.inquiry_complete_cfm.status = status;                        
    hostAgPutHostMsg((void *)msg);
}


/*
    handlePinReq

    PIN code request received
*/
void handlePinReq(BD_ADDR_T addr)
{
    /* 
        Send a message to the off-chip app as the PIN needs to be supplied
        by the user.
    */
    MAKE_PHONE_MSG(AG_PIN_CODE_REQUEST_IND);
    msg->ag_msg.pin_code_req_ind.dev_address.nap = addr.nap;
    msg->ag_msg.pin_code_req_ind.dev_address.uap = addr.uap;
    msg->ag_msg.pin_code_req_ind.dev_address.lap = addr.lap;
    hostAgPutHostMsg((void *)msg);
}


/*
    handlePairCfm

    Pair confimation received
*/
void handlePairCfm(BD_ADDR_T addr, ag_pair_status_t status, const uint8 *link_key)
{
    /* Pairing finished so send stored link key */
    MAKE_PHONE_MSG(AG_PAIR_CFM);
    msg->ag_msg.pair_cfm.dev_address.nap = addr.nap;
    msg->ag_msg.pair_cfm.dev_address.uap = addr.uap;
    msg->ag_msg.pair_cfm.dev_address.lap = addr.lap;
    msg->ag_msg.pair_cfm.status = status;

    if (link_key)
        memcpy(msg->ag_msg.pair_cfm.link_key, link_key, AG_SIZE_LINK_KEY);
    else
        memset(msg->ag_msg.pair_cfm.link_key, 0, AG_SIZE_LINK_KEY);
    
    hostAgPutHostMsg((void *)msg);
}


/*
    handleLinkKeyReq

    Link key request received 
*/
void handleLinkKeyReq(uint16 handle)
{
    MAKE_PHONE_MSG(AG_LINK_KEY_REQUEST_IND);
    msg->ag_msg.link_key_request_ind.handle = handle; 
    hostAgPutHostMsg((void *)msg);
}


/*
    handleConnectionHandleMap

    The EAG passes the mapping between connection handle and device address 
    so that it can be passed to the external application if necessary
*/
void handleConnectionHandleMap(ag_handle_t hdl, bd_addr_t addr)
{
    /* 
        Includes both the device address and the handle assigned to it
        so the client knows which device is mapped to which handle.
    */    
    MAKE_PHONE_MSG(AG_CONNECT_REQUEST_IND);
    msg->ag_msg.connect_request_ind.handle = hdl;
    msg->ag_msg.connect_request_ind.dev_address.nap = addr.nap;
    msg->ag_msg.connect_request_ind.dev_address.uap = addr.uap;
    msg->ag_msg.connect_request_ind.dev_address.lap = addr.lap;
    hostAgPutHostMsg((void *)msg);
}


/*
    handleScoStatusInd

    The status of the SCO connection has changed
*/
void handleScoStatusInd(ag_handle_t hdl, ag_connection_status_t status, hci_connection_handle_t sco_handle)
{
    MAKE_PHONE_MSG(AG_SCO_CONNECTION_STATUS_IND);        
    msg->ag_msg.sco_connection_status_ind.handle = hdl;
    msg->ag_msg.sco_connection_status_ind.status = status;
    msg->ag_msg.sco_connection_status_ind.sco_handle = sco_handle;
    hostAgPutHostMsg((void *)msg);
}


/*
    handleRfcommStatusInd

    The status of the service level connection has changed
*/
void handleRfcommStatusInd(ag_handle_t hdl, ag_connection_status_t status, ag_profile_role_t role)
{
    MAKE_PHONE_MSG(AG_RFCOMM_CONNECTION_STATUS_IND);
    msg->ag_msg.rfcomm_connection_status_ind.handle = hdl;
    msg->ag_msg.rfcomm_connection_status_ind.status = status;
	msg->ag_msg.rfcomm_connection_status_ind.profile_role = role;
    hostAgPutHostMsg((void *)msg);
}


/*
    handleVolumeChangeInd

    The volume settings have changed (could be as a result of a
    local action or a command from the remote device)
*/
void handleVolumeChangeInd(ag_handle_t hdl, uint8 gain)
{
    MAKE_PHONE_MSG(AG_VOLUME_CHANGE_IND) ;    
    msg->ag_msg.volume_change_ind.handle = hdl;
    msg->ag_msg.volume_change_ind.gain = gain;
    hostAgPutHostMsg((void *)msg);
}


/*
    handleMicrophoneChangeInd

    The mic settings have changed (could be as a result of a
    local action or a command from the remote device)
*/
void handleMicrophoneChangeInd(ag_handle_t hdl, uint8 gain)
{
    MAKE_PHONE_MSG(AG_MIC_CHANGE_IND) ;
    msg->ag_msg.mic_change_ind.handle = hdl;
    msg->ag_msg.mic_change_ind.gain = gain;
    hostAgPutHostMsg((void *)msg);
}


/*
    handleButtonPressInd

    Button press indication received from remote device
*/
void handleButtonPressInd(ag_handle_t hdl)
{
    MAKE_PHONE_MSG(AG_BUTTON_PRESS_IND);
    msg->ag_msg.button_press_ind.handle = hdl;
    hostAgPutHostMsg((void *)msg);
}


/*
    handleCallAnsweredInd

    Call answered or rejected the accept_flag used to indicate which
*/
void handleCallAnsweredInd(ag_handle_t hdl, uint16 accept_flag)
{
    MAKE_PHONE_MSG(AG_CALL_ACCEPT_STATUS_IND);
    msg->ag_msg.call_accept_status_ind.handle = hdl; 
    msg->ag_msg.call_accept_status_ind.accept_or_reject = accept_flag;
    hostAgPutHostMsg((void *)msg);
}


/*
    handleRemoteDialReq

    Dial request received from the remote dveice 
*/
void handleRemoteDialReq(ag_handle_t hdl, dial_mode_t dial_what, uint16 length, const uint8 *data)
{
    /* Alert the client */
    MAKE_PHONE_MSG_WITH_LEN(AG_DIAL_FROM_HF_REQUEST_IND, length);
    msg->ag_msg.dial_from_hf_request_ind.handle = hdl;
    msg->ag_msg.dial_from_hf_request_ind.dial_this = dial_what;
    msg->ag_msg.dial_from_hf_request_ind.length = length;

    /* The length could be zero since a last number redial does not supply data */
    if (length)
        memcpy(msg->ag_msg.dial_from_hf_request_ind.dial_data, data, length);
    else
        msg->ag_msg.dial_from_hf_request_ind.dial_data[0] = 0;

    hostAgPutHostMsg((void *)msg);            
}


/*
    handleErrorInd

    An error has occurred
*/
void handleErrorInd(ag_handle_t hdl, ag_error_code_t error_reason)
{
    MAKE_PHONE_MSG(AG_ERROR_IND);
    msg->ag_msg.error_ind.handle = hdl;
    msg->ag_msg.error_ind.reason = error_reason;
    hostAgPutHostMsg((void *)msg);
}


/*
    handleUnparsedData

    Called when RFCOMM data could not be parsed
*/
void handleUnparsedData(ag_handle_t hdl, uint16 length, const uint8 *data)
{
    MAKE_PHONE_MSG_WITH_LEN(AG_DATA_IND, length);
    msg->ag_msg.data_ind.handle = hdl;
    msg->ag_msg.data_ind.length = length;
    memcpy(msg->ag_msg.data_ind.data, data, length);
    hostAgPutHostMsg((void *)msg);
}


/*
	handleVoiceRecognitionInd

	A command enabling/ disabling voice recognition has been received and the AG
	supports it so handle it here 
*/
void handleVoiceRecognitionInd(ag_handle_t hdl, uint16 status)
{
	MAKE_PHONE_MSG(AG_VOICE_RECOG_ENABLE_IND);
	msg->ag_msg.voice_recog_enable_ind.handle = hdl;
	msg->ag_msg.voice_recog_enable_ind.enable = status;
	hostAgPutHostMsg((void *)msg);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产福利精品一区二区| 精品无人区卡一卡二卡三乱码免费卡 | 91亚洲精华国产精华精华液| 国产精品一二三四| 色综合色综合色综合| 亚洲一卡二卡三卡四卡五卡| 婷婷综合久久一区二区三区| 欧美综合在线视频| 天天爽夜夜爽夜夜爽精品视频| 欧美亚洲动漫另类| 日韩成人伦理电影在线观看| 精品精品国产高清a毛片牛牛| 国产精品一区在线观看乱码| 欧美激情一区二区三区全黄| 国产精品一级二级三级| 久久免费精品国产久精品久久久久| 久久99精品久久久| 亚洲精品在线免费播放| 色先锋资源久久综合| 中文字幕在线观看一区| 一本一道波多野结衣一区二区| 国产精品美女一区二区三区| 欧美日韩一区在线| 日韩高清不卡一区二区三区| 久久综合国产精品| 成人免费毛片片v| 亚洲美女少妇撒尿| 91麻豆精品国产自产在线观看一区 | 成人午夜免费av| 亚洲欧美日韩国产中文在线| 在线播放国产精品二区一二区四区| 偷偷要91色婷婷| 国产片一区二区| 欧美日韩黄色影视| 国产精品一区二区久久不卡| 中文字幕在线观看不卡| 欧美丰满少妇xxxxx高潮对白| 国产精品一区在线| 亚洲自拍另类综合| 日本一区二区在线不卡| 欧美日韩一区三区四区| 色噜噜狠狠色综合中国| 久久精品久久久精品美女| 国产精品成人免费在线| 久久看人人爽人人| 制服丝袜中文字幕一区| 日本精品免费观看高清观看| 黑人巨大精品欧美黑白配亚洲| 污片在线观看一区二区| 亚洲美女区一区| 亚洲乱码国产乱码精品精小说 | 国产精品中文字幕日韩精品| 看国产成人h片视频| 亚洲综合视频网| 亚洲一区在线观看视频| 亚洲欧美一区二区视频| 日韩免费一区二区三区在线播放| 亚洲欧洲国产日韩| 欧美国产日韩亚洲一区| 国产精品亲子乱子伦xxxx裸| 久久伊人蜜桃av一区二区| 国产日韩欧美电影| 亚洲精品国产无天堂网2021| 亚洲成人午夜影院| 国产永久精品大片wwwapp | 免费一级片91| 国产成人一区在线| 色噜噜狠狠色综合中国| 日韩一区二区三区四区| 亚洲私人影院在线观看| 精品亚洲aⅴ乱码一区二区三区| 成人sese在线| 精品动漫一区二区三区在线观看| 亚洲免费观看高清完整版在线观看 | 九九视频精品免费| 91国产成人在线| 久久久不卡影院| 日本亚洲三级在线| 色天天综合色天天久久| 欧美国产激情一区二区三区蜜月| 天天色天天操综合| 色婷婷国产精品综合在线观看| 久久人人97超碰com| 美女视频第一区二区三区免费观看网站 | 国产精品短视频| 久草精品在线观看| 777午夜精品免费视频| 亚洲激情图片一区| 91成人免费网站| 国产欧美日韩不卡免费| 成人一区二区三区视频| 久久伊人蜜桃av一区二区| 日本v片在线高清不卡在线观看| 色综合久久久久久久久| 国产精品成人午夜| 成人av免费网站| 亚洲女人的天堂| 日本久久一区二区三区| 亚洲国产视频一区| 欧美中文字幕一区二区三区亚洲| 亚洲免费视频成人| 91精品国产综合久久久久久| 日本麻豆一区二区三区视频| 日韩精品一区二区三区视频在线观看| 日韩精品久久久久久| 日韩精品一区在线| 国产成人av一区二区三区在线 | 91日韩在线专区| 亚洲电影一级片| 精品日产卡一卡二卡麻豆| 国产精品自拍av| 久99久精品视频免费观看| 欧美激情一区不卡| 欧美日韩国产成人在线91| 久久69国产一区二区蜜臀| 国产精品色呦呦| 91精品国产综合久久久久| 99久久婷婷国产综合精品电影| 亚洲成人av电影| 中文字幕欧美激情| 欧美大片免费久久精品三p| 成人av资源在线| 久久精品国产久精国产| 亚洲高清免费观看高清完整版在线观看| 日韩欧美一区二区不卡| 色狠狠色噜噜噜综合网| 国产成人午夜电影网| 免费人成网站在线观看欧美高清| 国产精品久久看| 国产清纯美女被跳蛋高潮一区二区久久w| 欧洲一区在线观看| www.亚洲在线| 国产99久久久久久免费看农村| 麻豆国产一区二区| 日韩成人一区二区| 亚洲成人中文在线| 一区二区三区欧美亚洲| 国产精品福利一区二区三区| 久久久精品黄色| 欧美videossexotv100| 91精品国产手机| 日韩欧美国产综合一区| 欧美欧美午夜aⅴ在线观看| 国产亚洲va综合人人澡精品| 欧美日韩国产一区| 在线观看视频91| 欧美亚洲图片小说| 欧美网站一区二区| 欧美精三区欧美精三区 | 午夜精品久久久久影视| 亚洲一区二区三区爽爽爽爽爽 | 日本91福利区| 精品一区精品二区高清| 狠狠色丁香久久婷婷综| 粉嫩嫩av羞羞动漫久久久 | 欧美精品一区二区在线观看| 精品奇米国产一区二区三区| 国产日韩欧美精品一区| 亚洲另类在线一区| 日韩av电影天堂| 激情图片小说一区| 色偷偷久久人人79超碰人人澡| 欧美日韩美女一区二区| 亚洲精品在线观| 丰满亚洲少妇av| 91麻豆精品国产91久久久资源速度| 精品久久久久久久久久久久久久久久久 | 午夜久久福利影院| 久久成人免费电影| 91久久一区二区| 久久久精品免费免费| 丝袜脚交一区二区| 成人国产精品免费观看视频| 欧美久久久一区| 亚洲欧洲99久久| 国产大陆精品国产| 精品久久久久香蕉网| 日韩在线卡一卡二| 91丝袜国产在线播放| 欧美成人一区二区| 午夜欧美在线一二页| 91浏览器在线视频| 亚洲婷婷综合久久一本伊一区 | 亚洲欧美激情小说另类| 福利一区二区在线| 国产视频一区在线播放| 麻豆精品国产91久久久久久| 日韩色在线观看| 同产精品九九九| 欧美日韩不卡在线| 一区二区三区四区五区视频在线观看| 国产乱色国产精品免费视频| 精品少妇一区二区三区免费观看| 亚洲午夜久久久久中文字幕久| 一本到不卡精品视频在线观看| 中文字幕免费一区| 99久久婷婷国产综合精品| 亚洲人吸女人奶水| 在线观看国产91| 午夜影视日本亚洲欧洲精品|