lawrencejiabin
3/12/2020 - 8:39 AM

693X定时监控打印

void X_timer_scan(void *priv)
{
#include "bt_tws.h"
    extern bool get_tws_phone_connect_state(void);
    extern int get_bt_tws_connect_status();
    r_printf("Phone connect:%d",get_tws_phone_connect_state());
    r_printf("tws connect:%d",get_bt_tws_connect_status());
    struct application *app;
    app = get_current_app();
    if (app) {
        r_printf("in %s app",app->name);
		    if(!strcmp(app->name, "earphone")){
		      	if (tws_api_get_role() == TWS_ROLE_MASTER) {
			        	r_printf("Master");
		      	}else{
			         	r_printf("Slave");
		      	}
	    	}
    }
}
sys_timer_add(NULL, X_timer_scan, 2000);