need help in understanding this code

blackpearl21
Posts: 12
Joined: Wed Feb 21, 2018 4:28 pm

need help in understanding this code

Postby blackpearl21 » Thu Apr 12, 2018 5:26 am

hi all,

i wanted to implement httpserver in my project, i came across one example, but i have failed to understand this code as you can see in below link,
https://github.com/tonyp7/esp32-wifi-ma ... p_server.c

1. i couldnt understand what this signifies, or purpose, also this is extern means it is defined at another location,

Code: Select all

* embedded binary data */
extern const uint8_t style_css_start[] asm("_binary_style_css_start");
extern const uint8_t style_css_end[]   asm("_binary_style_css_end");
extern const uint8_t jquery_gz_start[] asm("_binary_jquery_gz_start");
extern const uint8_t jquery_gz_end[] asm("_binary_jquery_gz_end");
extern const uint8_t code_js_start[] asm("_binary_code_js_start");
extern const uint8_t code_js_end[] asm("_binary_code_js_end");
extern const uint8_t index_html_start[] asm("_binary_index_html_start");
extern const uint8_t index_html_end[] asm("_binary_index_html_end");
2. i understood he is trying to sent index.html file data from below line, but how it works i didnt understand

Code: Select all

netconn_write(conn, index_html_start, index_html_end - index_html_start, NETCONN_NOCOPY);
i juts need help in understanding execution of this code, as i need to code my own webconsole,

any help would be appreciated.

Thanks!


blackpearl21
Posts: 12
Joined: Wed Feb 21, 2018 4:28 pm

Re: need help in understanding this code

Postby blackpearl21 » Thu Apr 12, 2018 7:50 am

thank you for reply
that helps

Who is online

Users browsing this forum: No registered users and 323 guests