qcc3040 earbud工程如何单耳使用?
默认必须peer配对以后才能单耳使用,想做单耳配对使用,好像不是简单的去掉条件判断。同问 not30 发表于 2022-1-31 00:47
同问
有研究出来吗? 单耳可以使用3040来做 再坛友的帮助下已解决,感谢坛友帮助。 同问,怎么解决的? 我用的是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_topologyhandler 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"); } } gaillysu 发表于 2022-5-23 23:44
我用的是standard-oem-earbud工程,修改代码参考如下void TwsTopology_Start(Task requesting_task) { ...
代码有点乱,是这样?
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_topologyhandler 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");
}
}
本帖最后由 gaillysu 于 2022-6-9 15:09 编辑
jjr 发表于 2022-5-24 01:40
代码有点乱,是这样?
谢谢你的整理代码, 该代码只针对 qcc514x-qcc304x-src-1-0_qtil_standard_oem_earbud 有用, 对于高版本的 earbud-ADK-21.1-CS2-MR1-r00289.1不适用, 北纬@ allinsimple 微信号 怎么解决的,大佬,你是移植的3044的headset还是修改了3040的earbud
页:
[1]
2