中科蓝讯 --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键回连手机蓝牙

}

从提示音得到主从机信息,和蓝牙耳机的有所不同
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	
        }
发布了65 篇原创文章 · 获赞 36 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/qq_40860986/article/details/103303204