Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

Problem with nx_http_client_get_start function (0xE2)

$
0
0

Hi,

I am trying to create a HTTP Client using NETX on SK-S7G2 Board. I have able to ping to specific ip , and my test server getting HTTP 1.0 Get call also packet returning successfully . i have confirmed it using Wireshark. But my problems are

1) nx_http_client_get_start returning 0xE2 (NX_HTTP_FAILED) instead of NX_SUCCESS.

2) NX_PACKET->nx_packet_data_end and NX_PACKET->nx_packet_data_start are showing same value

I am attaching my code and renesas virtual console log also. Please have a look.  

-------------Code-----------------

 void http_get_call(){
    UINT status;
    /* Allocate a packet.  */
    printf("Before allocate  = %d\n", http_cli_res_pkt->nx_packet_length);
    status =  nx_packet_allocate(&g_packet_pool0, &http_cli_res_pkt, NX_TCP_PACKET, NX_WAIT_FOREVER);
    printf("status 0 = %x\n", status);
    printf("After allocate  = %d\n", http_cli_res_pkt->nx_packet_length);

    while (1)
    {

        status = nx_http_client_get_start(&g_http_client0, IP_ADDRESS(192,168,3,100),
                                          "/test.htm", NX_NULL, 0, NX_NULL, NX_NULL, TX_WAIT_FOREVER);

        printf("status 1 = %x\n", status);

        do{

            status = nx_http_client_get_packet(&g_http_client0, &http_cli_res_pkt, TX_WAIT_FOREVER);
            printf("status 2 = %x\n", status);
            printf("packet next = %p last= %p\n", http_cli_res_pkt->nx_packet_next, http_cli_res_pkt->nx_packet_last);
            printf("packet prepend = %p append= %p\n", http_cli_res_pkt->nx_packet_prepend_ptr, http_cli_res_pkt->nx_packet_append_ptr);
            printf("packet start = %p end= %p\n", http_cli_res_pkt->nx_packet_data_start, http_cli_res_pkt->nx_packet_data_end);


            //if (status == NX_SUCCESS)
            {
                printf("packet length = %d\n", http_cli_res_pkt->nx_packet_length);
                UTILITY_PrintBuffer(http_cli_res_pkt->nx_packet_data_start, http_cli_res_pkt->nx_packet_data_end - http_cli_res_pkt->nx_packet_data_start, 0);
            }
        }while(status != NX_HTTP_GET_DONE);

        nx_packet_release(http_cli_res_pkt);
        tx_thread_sleep (2000);
    }
}

-------------Virtual console log-----------------
before allocate  = 18193
status 0 = 0
after allocate  = 0

status 1 = e2
status 2 = ea
packet next = 0x4711 last= 0x4711
packet prepend = 0x4711 append= 0x4711
packet start = 0 end= 0
packet length = 18193
Buffer Length To Print = 0 // print code in UTILITY_PrintBuffer
 
status 2 = ea
packet next = 0x4711 last= 0x4711
packet prepend = 0x4711 append= 0x4711
packet start = 0 end= 0
packet length = 18193
Buffer Length To Print = 0  // print code in UTILITY_PrintBuffer
 


Viewing all articles
Browse latest Browse all 5781

Trending Articles