请教: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;
那么楼主 解决了没有啊,,,我也想知道
mark!:lol:lol
路过看看!:P
楼主,没消息呢,搞掂没呢?
没解决,看来没人愿意说的:(
把语音报号功能加上试试
路过学习学习....积累知识
估计你这个 case 就没有走吧。。。case HFP_CALLER_ID_IND:
请问楼主解决了吗? 来电显示name
页:
[1]
2