wago2008 发表于 2015-8-15 12:00:05

请教:ADK3.5 8670如何实现pbap的获取?

先前看了论坛里放出的那个视频,尝试在8670上获取电话本,但是不成功,有没有做过的大师出来指点一下,感谢
1.在ADK中使能pbap,“vm-sink”->"properties"->"build system"->"General"->"PBAP" 改为“Enable”,然后编译,下载,pskey下载
2.在configtool中“profile”->"PBAP" 勾选enable pbap 写入,reset
3.代码中添加
sink_private.h
/* runtime data stored in block */
typedef struct
{
#ifdef ENABLE_GAIA   
    gaia_settings_t      gaia_data;
#endif            
    sink_battery_limits battery_limits;
    defrag_config          defrag;
    uint16               old_state;
    uint16               connection_in_progress; /* flag used to block role switch requests until all connections are complete or abandoned */
   
#ifdef ENABLE_SQIFVP
    unsigned               partitions_mounted:8;/* mask of SQIF partitons currently mounted */
    unsigned               partitions_free:8;   /* mask of SQIF partitions available to use */
#endif
   
#ifdef ENABLE_MAPC
    /* Data for mapc feature */
    mapcData_t             mapc_data;   
#endif   
    /* runtime data for the currently routed audio source */
    audio_sources          requested_audio_source;
    audio_sources          routed_audio_source;

#ifdef ENABLE_PARTYMODE
    pty_pause_state_t       partymode_pause;
#endif
   
    /* task data for codec lib */
    CsrInternalCodecTaskData codec;
    /*WolfsonCodecTaskData   codec;*//* - if using Wolfson codec */


/* Input manager data */
#if defined(ENABLE_IR_REMOTE) || (defined(BLE_ENABLED) && defined(GATT_CLIENT_ENABLED))
    inputManagerTaskData_tinputManager;
#if (defined(BLE_ENABLED) && defined(GATT_CLIENT_ENABLED))
    bleHidRCTaskData_t      bleInputMonitor;
#endif
#ifdef ENABLE_IR_REMOTE
    irRCTaskData_t          irInputMonitor;
#endif
#endif /* Input manager data */

#ifdef ENABLE_SUBWOOFER
    subwooferData_t         subwoofer;
#endif

#ifndef GATT_DISABLED
    gattRuntimeData_t       gatt;
#endif
   
<font color="#ff0000">    /*add pbap*/
    uint8 numname;
    uint16 numsize;
    /*add end*/</font>
}runtime_block1_t;
sink_pbap.c中 修改handleAppPullVcardList()
static void handleAppPullVcardList(void)
{
    PBAP_DEBUG(("PBAPC_APP_PULL_VCARD_LIST, "));
    if(theSink.pbapc_data.pbap_active_link != pbapc_invalid_link)
    {
      PbapcPullvCardListParams *pParams = (PbapcPullvCardListParams *)mallocPanic(sizeof(PbapcPullvCardListParams));
      if(pParams)
      {
            memset(pParams, 0, sizeof(PbapcPullvCardListParams));

            pParams->order    = pbap_order_idx;
            pParams->srchAttr = pbap_search_number;
          /*====modify pbap====*/
          /*
            pParams->srchVal= NULL;
            pParams->srchValLen = 0;
            */
<font color="#ff0000">            pParams->srchVal= theSink.rundata->numname;
            pParams->srchValLen = theSink.rundata->numsize;</font>
            /*====modify end====*/
            pParams->maxList    = PBAPC_MAX_LIST;
            pParams->listStart= PBAPC_LIST_START;
   
                     PbapcPullVcardListingRequest( theSink.pbapc_data.pbap_active_link, pbap_root, pParams );
               
            freePanic(pParams);
      }
    }
    else
        {
          PBAP_DEBUG(("    Pbap in incorrect state\n"));
        }
}

main.c 中函数static void handleHFPMessage( Task task, MessageId id, Message message )里修改如下:
case HFP_CALLER_ID_IND:
      {
          /*====add pbap====*/
<font color="#ff0000">          uint8 k;</font>
          /*====add pbap end====*/
            HFP_CALLER_ID_IND_T *ind = (HFP_CALLER_ID_IND_T *) message;

            /* ensure this is not a HSP profile */
            MAIN_DEBUG(("HFP_CALLER_ID_IND number %s", ind->caller_info + ind->offset_number));
            MAIN_DEBUG((" name %s\n", ind->caller_info + ind->offset_name));
          /*====add pbap====*/
          /*根据来电的号码*/
          theSink.rundata->numsize = ind->size_number;
          if(theSink.rundata->numsize>0)
                  {
                        for(k=0;k<=ind->size_number;k++)
                                {
                                        theSink.rundata->numname=ind->caller_info;
                                }
                }
          /*读取手机列表里边的名字*/
          MessageCancelAll(&theSink.task,EventUsrPbapBrowseList);
          MessageSendLater(&theSink.task,EventUsrPbapBrowseList,0,100);
          /*====add pbap end====*/
            
            /* Show name or number on display */
            if (ind->size_name)
                displayShowSimpleText((char *) ind->caller_info + ind->offset_name, 1);
            
            else
                displayShowSimpleText((char *) ind->caller_info + ind->offset_number, 1);
               
            /* Attempt to play caller name */
            if(!AudioPromptPlayCallerName (ind->size_name, ind->caller_info + ind->offset_name))
            {
                /* Caller name not present or not supported, try to play number */
                AudioPromptPlayCallerNumber(ind->size_number, ind->caller_info + ind->offset_number) ;
            }
      }
   
    break;

tzc986858997 发表于 2015-8-18 15:01:31

那么楼主 解决了没有啊,,,我也想知道

zx104700 发表于 2015-8-20 15:29:38

mark!:lol:lol

cnc202 发表于 2015-8-20 20:35:19

路过看看!:P

bluetooth_ble 发表于 2015-8-25 09:16:41

楼主,没消息呢,搞掂没呢?

wago2008 发表于 2015-8-26 13:27:46

没解决,看来没人愿意说的:(

zx104700 发表于 2015-8-26 13:39:49

把语音报号功能加上试试

tzc986858997 发表于 2015-8-26 14:58:58

路过学习学习....积累知识

勇敢向前走 发表于 2015-8-28 13:16:52

估计你这个 case 就没有走吧。。。case HFP_CALLER_ID_IND:

tzc986858997 发表于 2016-4-12 11:34:58

请问楼主解决了吗? 来电显示name
页: [1] 2
查看完整版本: 请教:ADK3.5 8670如何实现pbap的获取?