- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
When I was doing usart data sent to the TCP encountered a problem:
Somewhile ,when I through the usart send “abcdefg” to the BCM943362WCD4 , It can receive the data ”abc”. But it lost the data “defg”. And I send “abcdefg” to the BCM943362WCD4 again, It receive the data ”defgabcdefg”.Why is this?
My English is not good, I hope you can understand ^_^ thx.
while(1){
while (wiced_uart_receive_bytes( WICED_UART_1, &c, 1, 1 )==WICED_SUCCESS )
{
rxbuf[rxcount++]=c;
readflag=true;
}
if(readflag==true)
{
wiced_tcp_send_buffer( &tcp_client_socket,rxbuf,rxcount);
wiced_uart_transmit_bytes( WICED_UART_1,rxbuf,rxcount);
memset(rxbuf,0,rxcount);
rxcount=0;
readflag=false;
}
}
Solved! Go to Solution.
- Labels:
-
TCPIP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you using ring buffer? One thing that catches my attention here is wiced_uart_receive_bytes() only waits for 1 millisecond. Try changing that to WICED_NEVER_TIMEOUT.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you using ring buffer? One thing that catches my attention here is wiced_uart_receive_bytes() only waits for 1 millisecond. Try changing that to WICED_NEVER_TIMEOUT.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes,I am using the ring buffer.
I changed the WICED_NEVER_TIMEOUT=5 millisecond,it perfect to accept.
Thank you very much.^_^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you mean that you changed the timeout_ms argument from 1 to 5?
Please do not change the default definition of WICED_NEVER_TIMEOUT.