Page 1 of 1

need help in understanding this code

Posted: Thu Apr 12, 2018 5:26 am
by blackpearl21
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!

Re: need help in understanding this code

Posted: Thu Apr 12, 2018 6:23 am
by WiFive

Re: need help in understanding this code

Posted: Thu Apr 12, 2018 7:50 am
by blackpearl21
thank you for reply
that helps