Other Parts Discussed in Thread: UNIFLASH
Hello,
I am attempting to use the framework for the internal NWP HTTP server. I have been through the programmer's guide and this forum for help. But, to no avail.
I need a custom function to fully create the web page at "/html_page1". I am up to the point where my custom function is called by httpPostHandler(netAppRequest). In my custom function, I have:
UART_PRINT("Will now send custom html_page1\n");
// setup body of response
strcpy((char *)gPayloadBuffer, "<html>Hello</html>");
status = 1;
// prepare header
metadataLen = prepareGetMetadata(status, strlen((char *)gPayloadBuffer), HttpContentTypeList_TextHtml);
// send header with continuation
sl_NetAppSend (netAppRequest->Handle, metadataLen, gMetadataBuffer, SL_NETAPP_REQUEST_RESPONSE_FLAGS_CONTINUATION | SL_NETAPP_REQUEST_RESPONSE_FLAGS_METADATA);
// send payload
sl_NetAppSend (netAppRequest->Handle, strlen ((char *)gPayloadBuffer), gPayloadBuffer, 0);
Unfortunately, when I point my browser to "192.168.2.114/html_page1", it reports "404 - Sorry page not found".
And, I get the following out of the serial console. It appears there is data being sent.
[Link local task] NetApp Request Received - AppId = 1, Type = 1, Handle = 273
[Link local task] Metadata:
[Link local task] HTTP Version: HTTP/1.1
[Link local task] Request URI: /html_page1
[Link local task] Host: 192.168.2.114
[Link local task] User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0
[Link local task] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
[Link local task] Accept-Language: en-US,en;q=0.5
[Link local task] Accept-Encoding: gzip, deflate, br
[Link local task] Connection: keep-alive
[Link local task] Content-Length: 536870912
[Provisioning task] detected device is CC323xSF
Will now send custom html_page1
[html_page1] Data Sent [18 bytes]
[NETAPP EVENT] Unexpected event [0x10187b]
Hmmm. Are there any examples of *simple, simple* custom page rendering using the internal NWP?
Thanks!