Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - kno

Pages: [1]
1
FreescaleTM MC9S12NE64 / TCP send problem
« on: May 27, 2010, 11:51:59 PM »

Here is my problem. I can send a tcp data once at each command like this,
 
void cmd_run(void){       
send_nack("first\n");       
tcp_send_buffer;      } 
 
void cmd_run1(void){
send_nack("EXIT\n");
tcp_send_buffer;        }
 
Both run and run1 are working fine, however if I try like this
 
 
void cmd_run(void){
         send_nack("first\n");
         tcp_send_buffer;
         send_nack("EXIT\n");
         tcp_send_buffer;
         }
 
 
It's not working. It freezes after display "first". You guys have any idea? Thanks in advance.
 
Here is a tcp_send_buffer. It's from the OpenTCP example files.
 
 
void tcp_send_buffer(void)
{
UINT32 len;
while(tcp_checksend(tcp_soch) < 0);     
for(len=0;
    {
net_buf[TCP_APP_OFFSET+len] = udp_tcp_buf[len];
if(udp_tcp_buf[len++] == '\n')
   break;
}
 
if(tcp_send(tcp_soch, &net_buf[TCP_APP_OFFSET], NETWORK_TX_BUFFER_SIZE - TCP_APP_OFFSET, len) == len)
   {
DEBUGOUT("TCP: bytes reply sent!\r\n");
}
else
{
    DEBUGOUT("TCP: error occured while trying to send data!\r\n");
}
}

Pages: [1]