Hi,
I have a project that I am working on that makes https tls connection to aws api with asp.net core 3.1, the api requires 3 header keys added to the get request and if those match our security requirements then the connection is made and I can run the following code to get the response from the server.
if(status == NX_SUCCESS){ bytes_copied = 0; j = 0;
do { statusRX = nx_web_http_client_response_body_get(&g_web_http_client0, &receive_packet, HTTP_CLIENT_WAIT_OPTION);
for(i = 0; i < RECEIVE_BUFFER_SIZE; i++){ g_receive_buffer[i] = 0; }
if ((NX_SUCCESS == statusRX) || (NX_WEB_HTTP_GET_DONE == statusRX)) { bytes_in_packet = receive_packet->nx_packet_length; bytes_offset = 0; do{ /* Process response packets */ status = nx_packet_data_extract_offset(receive_packet, bytes_offset, g_receive_buffer, RECEIVE_BUFFER_SIZE, &bytes_copied); // status = nx_packet_data_retrieve(receive_packet, g_receive_buffer, &bytes_copied);
// Process the file to QSPI // processRXData((char *)g_receive_buffer);
// Reset all variables and move markers accordingly bytes_in_packet -= bytes_copied; bytes_offset += bytes_copied;
for(i = 0; i < RECEIVE_BUFFER_SIZE; i++){ g_receive_buffer[i] = 0; } bytes_copied = 0; }while(bytes_in_packet > 0);
/* Regardless if an error occurs extracting the data, release the packet. We are done with it. */ nx_packet_release (receive_packet); }else{ break; } j++; }while(statusRX != NX_WEB_HTTP_GET_DONE); }
now all works perfect with connection and I do get data from the server, with one HUGE issue, if the response data has more than 4094 bytes in it then I don't get the response from the server with this call
statusRX = nx_web_http_client_response_body_get(&g_web_http_client0, &receive_packet, HTTP_CLIENT_WAIT_OPTION);
the statusRX has the value 0x01 in it, which seems to relate to the following error -
#define NX_NO_PACKET 0x01
Added info for those that will try and assist me finding the issue -
e2studio 7.5.1 Synergy with SSP 1.7.0 running a custom board with S5D9 - Framework used is XWare - NetX Duo Web HTTP/HTTPS Client.
I have tried changing packet pool packet size, as well as number of packets, no joy, I have tried turning on the HTTP Web common fragmentation option, also tried the ip instance fragment option, but none of this helps....
Now from the manual I have this -
UINT nx_web_http_client_response_body_get(NX_WEB_HTTP_CLIENT *client_ptr,NX_PACKET **packet_ptr, ULONGwait_option);
This service retrieves the next packet of content of the resourcerequested by the previous nx_web_http_client_get_start() ornx_web_http_client_get_secure_start() call. Successive calls to thisroutine should be made until the return status ofNX_WEB_HTTP_GET_DONE is received.
This means I should be able to get the entire contents from the server until I get NX_WEB_HTTP_GET_DONE... and this is not the case.
I want to add that before I switched to HTTPS, I had this test code with no security to check if I could receive large files, I used miniweb as the web server to test as its small and efficient at just hosting a file for testing on local PC, this is the code I used and it worked to receive a file with over 400 KB of data -
can i get code for the https client and how to insert the server certificate on to the device..?
learn.microsoft.com/.../chapter2