//关闭与客户端的连接
printf("do_disconnect...\r\n");
sleep(DELAY_1S);
close(connfd);
sleep(DELAY_1S); // for debug
}else{
printf("_______________________________________\r\n");
printf("The data received from the client is %s \r\n", request);
}
//关闭与客户端的连接
printf("do_disconnect...\r\n");
sleep(DELAY_1S);
close(connfd);
sleep(DELAY_1S); // for debug
}else{
printf("The data responsed to the client is %s\r\n", request);
}
/************************tcp 客户端发送12345678控制不同的音调****************************/
int i=atoi(request); // 将字符串request转换成int类型
hi_pwm_set_clock(PWM_CLK_XTAL); // 设置时钟源为晶体时钟(40MHz,默认时钟源160MHz)
switch (i)
{
case 1:
printf("Tone is 1\n" );