Quantcast
Channel:
Viewing all articles
Browse latest Browse all 59170

Forum Post: RE: Adding a webserver to a project.

$
0
0
Hi Matt, We have been able to get a simple webserver running using FileX over EMMC  memory to host the files. Yes, you can just replace example the &ram_disk_media with maybe the &gp_media and be good to go. In our example, the code is: #if 1    // Files served from EMMC (g_fx_media) for HTTP server    status =  nx_http_server_create(&my_server, "My HTTP Server", &ip_0, &g_fx_media, http_server_pool_area, HTTP_SERVER_POOL_SIZE, &pool_0, my_authentication_check, my_get_notify);    /* Check for errors.  */    if (status)        error_counter++;    status =  nx_http_server_start(&my_server);    /* Check for errors.  */    if (status)        error_counter++; #endif We are calling nx_http_server_create, nx_http_server_start in the entry function of one of out user threads (in blinky_thread_entry) as shown above. You atill need to make the call to nx_packet_pool_create and nx_ip_create. We are calling this in tx_application_define_user()...i..e before any of the threads are set up. In terms of buffers, we are using this: static ULONG packet_pool_area[2048*32]; // in the call to nx_packet_pool_create static ULONG http_server_pool_area[ 4096*2]; // in the call to nx_http_server_create Hope this helps! One question we had is what library/framework are you using to serve up html,js,css, and images. We are encoding all our web server code into html (including page layouts) and updating the html markup manually when re-rendering the page. Is there a c library/framework that can be used on a bare metal platform like renesas which can make use of  html,js,css, and images easier?

Viewing all articles
Browse latest Browse all 59170

Trending Articles