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.


Messages - phomann

Pages: 1 2 3 [4]
46
Luminary Micro TM LM3SXXXX / Re: TCP simple example problems.
« on: September 25, 2008, 03:21:44 AM »
Hi Mark,

Thanks for that. I was just trying to implement the example verbatim as in your example in
http://www.utasker.com/forum/index.php?topic=25.0

I'll let you know how I go.

Cheers,

Peter.

47
Luminary Micro TM LM3SXXXX / TCP simple example problems.
« on: September 19, 2008, 06:07:10 AM »
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#msg73

I'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;

Code: [Select]
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;

Code: [Select]
#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






Pages: 1 2 3 [4]