SBL2e TCP connect and TCP write problems
Posted: Thu Aug 28, 2014 6:24 am
Hi,
I have problems with my SBL2e module.
- When I am trying to connect to server I have to connect multiple times for connection to success.
- The bigger problem is that when the connection is up sbl2e module transmuting tcp bursts from different source ports not the same all the time.
My program example:
My question. How can I force SBL2e to always use the same TCP source port?
Other question. Is possible for rutine tcp.connect to return wrong response ? I did see in my logs that sbl2e did try to connect and did but sbl2e tcp.connect returned no connection made!
Best regards,
I have problems with my SBL2e module.
- When I am trying to connect to server I have to connect multiple times for connection to success.
- The bigger problem is that when the connection is up sbl2e module transmuting tcp bursts from different source ports not the same all the time.
My program example:
Code: Select all
InitializeStack(); // Initialize stack
OSChangePrio(MAIN_PRIO); // Initialize OS Prio
EnableAutoUpdate(); // Enable auto update
InitIRQUart( UART1, UART1_BAUD, 1, 8, eParityNone );
InitIRQUart( UART2, UART2_BAUD, 1, 8, eParityNone );
assign_stdio(UART1); // Assigne printf to port UART2
OSTimeDly(1);
unsigned int retry = 0;
if( tcp.Connected() )
{
tcp.Close();
}
while( retry < 3 )
{
if( tcp.Connect( IP, PORT, 40 ))
{
iprintf("Connected!");
break;
}
else // Retry connection
{
retry++;
iprintf("Error!");
}
}
while( true )
{
tcp.write("Code testing!", 13, 20 );
OSTimeDly(20);
}
Other question. Is possible for rutine tcp.connect to return wrong response ? I did see in my logs that sbl2e did try to connect and did but sbl2e tcp.connect returned no connection made!
Best regards,