BES2300Z开发真无线蓝牙降噪TWS+ANC耳机之主从通讯

使用BES2300Z开发TWS,实现左右耳之间通讯,方法如下:

1. 在app_tws_cmd_handler.h的APP_TWS_CMD_CODE_E中添加命令ID,比如:APP_TWS_CMD_TWS_POWER_OFF。
2. 在app_tws_ui.cpp中添加如下代码:
static void app_tws_cmd_tws_power_off_handler(uint8_t *ptrParam, uint32_t paramLen)//TWS接收CMD处理
{
  ;添加代码
}

TWS_CUSTOM_COMMAND_TO_ADD(APP_TWS_CMD_TWS_POWER_OFF, app_tws_cmd_tws_power_off_handler);//TWS接收

void app_tws_ask_tws_to_power_off(uint32_t kk)    //TWS 发送 CMD
{
        app_tws_rec_req_received_t tRequest = {kk};
        app_tws_send_cmd_without_rsp(APP_TWS_CMD_TWS_POWER_OFF,
                                     ( uint8_t * )&tRequest,
                                     sizeof(tRequest));
    }
}
3.使用方法
调用app_tws_ask_tws_to_power_off启动TWS发送。
在app_tws_cmd_tws_power_off_handler添加接收TWS CMD处理代码。

你可能感兴趣的:(BES2300Z降噪TWS耳机)