lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] LWIP client code causes hard fault error


From: Funk, Artur
Subject: Re: [lwip-users] LWIP client code causes hard fault error
Date: Tue, 26 Jun 2012 15:55:06 +0200

>Please correct me if i am wrong.

No, you are not. I wasn't sure if the code is complete.

I'm not sure if it could help, try to add a call back function to your
TCPConnection_start function 

struct dataname 
{
  int length;
  char bytes[MAX_NAME_SIZE];
};


static void my_tcp_err(void *arg, err_t err)
{
  struct dataname * dataname;
  dataname = (struct dataname*)arg;
        printf("\r\n Error occured");
  mem_free(dataname);
}

>>>> void TCPConnection_start(void)
>>>> {
>>>>     struct ip_addr DestIPaddr;
>>>>    
>>>>     /* create new tcp pcb */
>>>>     pcb = tcp_new();
>>>>     if (pcb != NULL)
>>>>     {
>>>>       IP4_ADDR( &DestIPaddr, DEST_IP_ADDR0, DEST_IP_ADDR1, 
>>>> DEST_IP_ADDR2,
>>>> DEST_IP_ADDR3 );
>>>>         
                tcp_err(pcb, my_tcp_err); 
>>>>       /* connect to destination address/port */
>>>>
tcp_connect(pcb,&DestIPaddr,DEST_PORT,TCPConnection_Established);
>>>>     }
>>>> }
>>>>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]