连续签到天数:1天 | 签到总天数:1052天 | 签到总奖励:14870金币 |
|
马上注册,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册 
×
先前看了论坛里放出的那个视频,尝试在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_t inputManager;
- #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[20];
- 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[k]=ind->caller_info[k];
- }
- }
- /*读取手机列表里边的名字*/
- 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;
复制代码
|
|