1

For a school project we need to make a micro controller that takes the information off the CAN network and show these parameters on a web page. I'm trying now to expand the project to make it also possible to change those values on the web page and post them to the micro controller.

To realize this I'm using the ASF Package and an ATSAM4E Xplained Pro

The problem is now that I can filter when I get the "GET" or "POST" request but when I try the "POST" command I can only receive 1 package.

if(( NULL != pcRxString) && ( !strncmp( pcRxString, "POST", 4 )))
{
    printf("\r\n %s", pcRxString);

    while(!strncmp( pcRxString, "Keep-Alive", 10 ))
    {
        /* Write out the HTTP OK header. */
        netconn_write( pxNetCon, webHTTP_OK, (u16_t) strlen( webHTTP_OK ), NETCONN_COPY );

        #if ( (LWIP_VERSION) == ((1U << 24) | (3U << 16) | (2U << 8) | (LWIP_VERSION_RC)) )
                /* We expect to immediately get data. */
                pxRxBuffer = netconn_recv( pxNetCon );
        #else
                while(netconn_recv( pxNetCon, &pxRxBuffer) != ERR_OK)
                {
                    vTaskDelay( webSHORT_DELAY );
                }
        #endif

        netbuf_data( pxRxBuffer, ( void * ) &pcRxString, &usLength );
        printf("\r\n %s", pcRxString);
    }

}

The Code I've currently wrote.

The following error messages are in my wireshark Error message, printf data

I also see that not the entire package is received, is there a way to communicate with the browser the maximum size of the packages?

BobLee
  • 9
  • 3

0 Answers0