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鍵回連手機藍牙
}
從提示音得到主從機信息,和藍牙耳機的有所不同
void func_bt_warning(void);
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
}