连续签到天数:1天 | 签到总天数:25天 | 签到总奖励:147金币 |
|
发表于 2022-5-23 23:44:50
来自手机
|
显示全部楼层
我用的是standard-oem-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 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"); } } |
|