lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LWIP 1.3.2


From: Sirjee Rooplall
Subject: Re: [lwip-users] LWIP 1.3.2
Date: Fri, 19 Mar 2010 07:27:38 +0200

Hi Kieran,

here is how I use neconn_recv. netconn_recv is used in NON-BLOCKING mode, it calls sys_arch_mbox_tryfetch().

This function below is called from a freeRTOS 1msTask to check for data messages.

void CheckForData(void)
{
  struct netbuf *pxRxBuffer=NULL;
  portCHAR *pcRxString; // will point to data.

  vPortEnterCritical();
  if (pxSeverConnectionHandle != NULL)
  {
     if ((tcpStatus==IOS_NW_CONNECTED)
      && (pxSeverConnectionHandle->state != NETCONN_WRITE))
   {
      vPortExitCritical();
      pxRxBuffer = netconn_recv( pxSeverConnectionHandle );

      if( pxRxBuffer != NULL )
     {
        /* Where is the data? */
        netbuf_data( pxRxBuffer, (void *) &pcRxString, &Length );

       // At this point we have received a TCP packet.
       // pxRxBuffer is a pointer to netbuf of received data.
       // pcRxString is a pointer to the data in the packet.
       // Length holds the length of the data portion of the packet.
       // Data from the server is in so now copy it to working buffer.

       processRxPacket((U8*)pcRxString, Length);
       netbuf_delete( pxRxBuffer );
    }
   }
 }
 else
   vPortExitCritical();
}


Kind Regards, Sirjee Rooplall Figment Design laboratories (Pty) Ltd mailto: address@hidden Mobile: +27 (0)83 230 8466 ----- Original Message ----- From: "Kieran Mansley" <address@hidden>
To: "Mailing list for lwIP users" <address@hidden>
Sent: Thursday, March 18, 2010 4:38 PM
Subject: Re: [lwip-users] LWIP 1.3.2


On Thu, 2010-03-18 at 15:59 +0200, Sirjee Rooplall wrote:
I am using neconn_recv in my application layer to check for message.

Can you give an example of how you use netconn_recv, and access the data
that it returns?

Kieran



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users






reply via email to

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