bigbaicai

芯方式是以半导体人、电子工程师等电子行业相关领域从业人员为核心的知识经验学习、分享、交流社群。 凭借开放、合作、共赢的运营理念,聚集了来自国内外知名院校和顶尖科技公司的半导体人、电子工程师。 我们致力于营造专业、认真、有温度的分享交流环境,将高质量的内容和方案成规模地生产和分享,帮助个人和团队在芯方式找到有价值的Key。 http://www.icfans.com/

有些蓝牙耳机无法快进/快退

0
阅读(969) 评论(0)

[DESCRIPTION]
在11A1112以及之前的版本上,有些蓝牙耳机无法通过耳机上面的快进/快退键控制手机上音乐的快进/快退,而有些蓝
牙耳机可以。原因是:有些蓝牙耳机被按下快进之后,发过来的cmd是MMI_AVRCP_POP_FAST_FORWARD,而在11A1112之前
不支持这个cmd。对于快进/快退功能,一般蓝牙耳机发送过来的cmd都是MMI_AVRCP_POP_FORWARD,LONGPRESS。
[SOLUTION]来自半导体社区
如要兼容此蓝牙耳机,请修改mmi_medply_bt_avrcp_cmd_hdlr如下:
U8 mmi_medply_bt_avrcp_cmd_hdlr(U8 command, mmi_avrcp_key_events key_events) {
......
else if(g_medply.fullscreen)
{
switch (command)
{
case MMI_AVRCP_POP_PLAY:
case MMI_AVRCP_POP_STOP:
case MMI_AVRCP_POP_PAUSE:
case MMI_AVRCP_POP_FORWARD:
case MMI_AVRCP_POP_BACKWARD:
case MMI_AVRCP_POP_FAST_FORWARD: //添加这行
case MMI_AVRCP_POP_REWIND: //添加这行
{
result = MMI_AVRCP_CR_REJECT;
mmi_medply_toggle_full_screen();
goto avrcp_finish;
break;
}
default :
break;
}
break;
}
.......
#ifdef __MMI_TVOUT__
else if(g_medply.tvout_fullscreen)
{
switch (command)
{
case MMI_AVRCP_POP_PLAY:
case MMI_AVRCP_POP_STOP:
case MMI_AVRCP_POP_PAUSE:
case MMI_AVRCP_POP_FORWARD:
case MMI_AVRCP_POP_BACKWARD:
case MMI_AVRCP_POP_FAST_FORWARD: //添加这行
case MMI_AVRCP_POP_REWIND: //添加这行
{
result = MMI_AVRCP_CR_REJECT;
mmi_medply_toggle_tvout_full_screen();
goto avrcp_finish;
break;
}
default :
break;
}
break;
}
#endif
......
if (key_events == MMI_AVRCP_KEY_CANCELED)
{
switch (command)
{
case MMI_AVRCP_POP_PLAY:
case MMI_AVRCP_POP_STOP:
case MMI_AVRCP_POP_PAUSE:
case MMI_AVRCP_POP_FORWARD:
case MMI_AVRCP_POP_BACKWARD:
case MMI_AVRCP_POP_FAST_FORWARD://添加这行
case MMI_AVRCP_POP_REWIND://添加这行
mmi_medply_press_button_canceled();
break;
default :
break;
}
/*the return value do not mean anything in key canceled event*/
result = MMI_AVRCP_CR_REJECT;
goto avrcp_finish;
}
......
case MMI_AVRCP_POP_FORWARD:
case MMI_AVRCP_POP_FAST_FORWARD://添加这行
if (key_events == MMI_AVRCP_KEY_UP)
{
mmi_medply_press_next_button_up();
}
else if (key_events == MMI_AVRCP_KEY_DOWN)
{
mmi_medply_press_next_button_down();
}
else if(key_events == MMI_AVRCP_KEY_LONGPRESS)
{
if(GetActiveScreenId() == SCR_ID_MEDPLY_MAIN_SCREEN )
{
mmi_medply_fast_forward();
}
else
{
result = MMI_AVRCP_CR_REJECT;
}
}
else
{
result = MMI_AVRCP_CR_REJECT;
}
break;
case MMI_AVRCP_POP_BACKWARD:
case MMI_AVRCP_POP_REWIND://添加这行
if (key_events == MMI_AVRCP_KEY_UP)
{
mmi_medply_press_prev_button_up();
}
else if(key_events == MMI_AVRCP_KEY_DOWN)
{
mmi_medply_press_prev_button_down();
}
else if(key_events == MMI_AVRCP_KEY_LONGPRESS)
{
if(GetActiveScreenId() == SCR_ID_MEDPLY_MAIN_SCREEN )
{
mmi_medply_rewind();
}
else
{
result = MMI_AVRCP_CR_REJECT;
}
}
else
{
result = MMI_AVRCP_CR_REJECT;
}
break;


ICfans