TCP Server Send Data loss

cychen
Posts: 4
Joined: Thu Mar 02, 2017 2:05 pm

TCP Server Send Data loss

Postby cychen » Thu Mar 02, 2017 2:29 pm

porj use UART recv data .after UART has data in, Tcp server will get the data sent to TCP client. we cannot know number of uart data in.so the porj Tcp send data will be sent erverone data in.

1,uartTaskRecv will run as ever 100us
2,uartTaskRecv of uart_tx_one_char sent data is OK no loss data.

question:
1,why tcp send data loss
2,how to use "espconn_regist_write_finish" to write buffer?

code :
sint8 ICACHE_FLASH_ATTR UartEspconSendData(uint8 *pdata,uint32 Len)
{
return(espconn_send(&TcpConfig,pdata,Len));
}
LOCAL void ICACHE_FLASH_ATTR uartTaskRecv(void)
{
uint8_t tmpdata,err;
tmpdata = uartTaskGetChar(&err);
if(err == COMM_NO_ERR){
if(tmpdata != '\n'){
uart_tx_one_char(0,tmpdata);
UartEspconSendData(tmpdata,1);
//os_printf("112233445566778899\r\n");
//espconn_send();
}else{
os_printf("AABBCCDDEE\r\n");
//uart_tx_one_char(0,'\n');
}
}
}

Who is online

Users browsing this forum: No registered users and 3 guests