连续签到天数:1天 | 签到总天数:25天 | 签到总奖励:147金币 |
|
发表于 2021-12-7 11:16:00
|
显示全部楼层
可以做,使用 earbud 工程, 直接跳过对耳配对的流程,然后执 主模式下的手机配对流程
参考代码如下:
- void TwsTopology_Start(Task requesting_task)
- {
- twsTopologyTaskData *twst = TwsTopologyGetTaskData();
- twst->start_cfm_needed = TRUE;
- if (!twst->started)
- {
- DEBUG_LOG("TwsTopology_Start (normal start)");
- twst->started = TRUE;
- twst->app_task = requesting_task;
- twst->pairing_notification_task.handler = twsTopology_HandlePairingActivityNotification;
- Pairing_ActivityClientRegister(&twst->pairing_notification_task);
- #if 0
- MessageSend(TwsTopologyGetTask(), TWSTOP_INTERNAL_START, NULL);
- #else
- //// new code for headset device,gaillysu@qq.com added 2021.10.29
- peer_find_role_completed(PEER_FIND_ROLE_PRIMARY);
- //// peer_find_role_completed(PEER_FIND_ROLE_PRIMARY) will send PEER_FIND_ROLE_PRIMARY to tws_topology handler message right now
- //// see to twsTopology_HandlePeerFindRolePrimary(), this function will do two things
- //// 1: start pairing with headset (this device is primary role)
- //// 2: start connecting peer earbud (secondary role)
- #endif
- }
- else if ( twst->role == tws_topology_role_primary
- || twst->role == tws_topology_role_secondary)
- {
- DEBUG_LOG("TwsTopology_Start, sending immediate success");
- TwsTopology_SendStartCfm(tws_topology_status_success, twst->role);
- }
- else
- {
- DEBUG_LOG("TwsTopology_Start called again. Response waiting for a role");
- }
- }
复制代码
|
|