protocomm_httpd: Allow applications to pass HTTPD handle

This will be useful if a webserver is already running and the application
does not want protocomm to start a new instance.

Signed-off-by: Piyush Shah <piyush@espressif.com>
This commit is contained in:
Piyush Shah
2019-02-01 18:20:37 +05:30
parent 2790d4a049
commit 759b90a5e1
3 changed files with 69 additions and 29 deletions

View File

@@ -54,8 +54,13 @@ For complete example see :example:`provisioning/softap_prov`
{
protocomm_t *pc = protocomm_new();
/* Config for protocomm_httpd_start() */
protocomm_httpd_config_t pc_config = PROTOCOMM_HTTPD_DEFAULT_CONFIG();
protocomm_httpd_config_t pc_config = {
.data = {
.config = PROTOCOMM_HTTPD_DEFAULT_CONFIG()
}
};
/* Start protocomm server on top of HTTP */
protocomm_httpd_start(pc, &pc_config);