AB532X系列TWS的接口调用
TWS的按键操作:
长按mode按键TWS配对,长按连接手机/回连手机
if(xcfg_cb.bt_tws_en && xcfg_cb.bt_tws_pair_mode == 2){
if(bt_tws_is_connected()) {
} else {
bt_tws_search_slave();
printf("bt_tws_search_slave\n");
}
}
if(bt_nor_is_connected()){//手机已经连接
printf("disconnect with boletooth\n");
bsp_clr_mute_sta();
bt_nor_disconnect();//M键断开手机蓝牙.或者bt_disconnect()
}else{
printf("connect with boletooth\n");
bt_connect();
// bt_nor_connect();//M键回连手机蓝牙
}
if(left_warning) { //left channel //slave
func_cb.mp3_res_play(RES_BUF_LEFT_CH_MP3, RES_LEN_LEFT_CH_MP3);
printf(" slave slave \n");
get_tws_chanl=2;//副机等于2
}
if(right_warning) { //right channel //master
delay_5ms(200);
func_cb.mp3_res_play(RES_BUF_RIGHT_CH_MP3, RES_LEN_RIGHT_CH_MP3);
printf(" master master \n");
get_tws_chanl=1;//主机等于1
}
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 JSMCU!