Hi Mark,
I'm using the LM3S6965 EK board with the Code Sourcery compiler (Or will be) and am trying to get the example shown in;
http://www.utasker.com/forum/index.php?topic=25.msg73#msg73I've copied the uTasker project to a new project called TestIP and added the code in the above message to the application.c file. When I compile it, I get the fowwowing errors;
1>Compiling...
1>application.c
1>c:\utaskerv1.3_beta-lm3s\applications\testip\application.c(584) : error C2232: '->tTCP_Header' : left operand has 'struct' type, use '.'
1>c:\utaskerv1.3_beta-lm3s\applications\testip\application.c(584) : warning C4047: 'function' : 'unsigned char *' differs in levels of indirection from 'int'
1>c:\utaskerv1.3_beta-lm3s\applications\testip\application.c(584) : warning C4024: 'fnSendTCP' : different types for formal and actual parameter 2
1>c:\utaskerv1.3_beta-lm3s\applications\testip\application.c(584) : error C2198: 'fnSendTCP' : too few arguments for call
The code as inserted into application.c is identical as far as I can tell. and shown below. I presume that I am doing something wrong;
#define TEST_BUFFER_LENGTH 300
typedef struct stTCP_MESSAGE
{
TCP_HEADER tTCP_Header; // reserve header space
unsigned char ucTCP_Message[TEST_BUFFER_LENGTH];
} TCP_MESSAGE;
static unsigned short usTestPort = 9999;
static int fnTestListener(USOCKET Socket, unsigned char ucEvent, unsigned char *ucIp_Data, unsigned short usPortLen)
{
TCP_MESSAGE test_message;
switch (ucEvent) {
case TCP_EVENT_CONREQ:
case TCP_EVENT_CONNECTED:
case TCP_EVENT_CLOSE:
case TCP_EVENT_ACK:
case TCP_EVENT_ARP_RESOLUTION_FAILED:
case TCP_EVENT_PARTIAL_ACK:
break;
case TCP_EVENT_REGENERATE:
case TCP_EVENT_DATA:
if ((ucEvent == TCP_EVENT_REGENERATE) || (!uMemcmp((CHAR*)ucIp_Data, "TEST" , 4)))
{
uStrcpy((CHAR*)test_message.ucTCP_Message, "Hi!!");
if (fnSendTCP(Socket, (unsigned char *)&test_message->tTCP_Header, 4, TCP_FLAG_PUSH) > 0)
{
return APP_SENT_DATA;
}
}
break;
case TCP_EVENT_ABORT:
case TCP_EVENT_CLOSED:
{
fnTCP_Listen(Socket, usTestPort, 0); // go back to listening state on next port number
break;
}
}
return APP_ACCEPT;
}
Cheers,
Peter