diff --git a/examples/cc26xx/cc26xx-web-demo/httpd-simple.c b/examples/cc26xx/cc26xx-web-demo/httpd-simple.c
index 281567acf..29c22d22b 100644
--- a/examples/cc26xx/cc26xx-web-demo/httpd-simple.c
+++ b/examples/cc26xx/cc26xx-web-demo/httpd-simple.c
@@ -163,11 +163,6 @@ static const char *http_header_srv_str[] = {
NULL
};
-static const char *http_header_redir_location[] = {
- "Location: /config.html\r\n",
- NULL
-};
-
static const char *http_header_con_close[] = {
CONN_CLOSE,
NULL
@@ -197,37 +192,49 @@ static const char config_div_left[] = "
";
static const char config_div_right[] = "
";
static const char config_div_close[] = "
";
/*---------------------------------------------------------------------------*/
+static char generate_index(struct httpd_state *s);
+static char generate_config(struct httpd_state *s);
+/*---------------------------------------------------------------------------*/
typedef struct page {
struct page *next;
char *filename;
char *title;
+ char (*script)(struct httpd_state *s);
} page_t;
static page_t http_index_page = {
NULL,
"index.html",
"Index",
+ generate_index,
};
static page_t http_dev_cfg_page = {
NULL,
"config.html",
"Device Config",
+ generate_config,
};
#if CC26XX_WEB_DEMO_NET_UART
+static char generate_net_uart_config(struct httpd_state *s);
+
static page_t http_net_cfg_page = {
NULL,
- "net.html",
+ "netu.html",
"Net-UART Config",
+ generate_net_uart_config,
};
#endif
#if CC26XX_WEB_DEMO_MQTT_CLIENT
+static char generate_mqtt_config(struct httpd_state *s);
+
static page_t http_mqtt_cfg_page = {
NULL,
"mqtt.html",
"MQTT/IBM Cloud Config",
+ generate_mqtt_config,
};
#endif
/*---------------------------------------------------------------------------*/
@@ -395,12 +402,12 @@ PT_THREAD(generate_top_matter(struct httpd_state *s, const char *title,
s->page = list_head(pages_list);
PT_WAIT_THREAD(&s->top_matter_pt,
- enqueue_chunk(s, 0, "
[ %s ]",
+ enqueue_chunk(s, 0, "[
%s ]",
s->page->filename, s->page->title));
for(s->page = s->page->next; s->page != NULL; s->page = s->page->next) {
PT_WAIT_THREAD(&s->top_matter_pt,
- enqueue_chunk(s, 0, " |
[ %s ]",
+ enqueue_chunk(s, 0, " | [
%s ]",
s->page->filename, s->page->title));
}
@@ -531,7 +538,8 @@ PT_THREAD(generate_config(struct httpd_state *s))
PT_WAIT_THREAD(&s->generate_pt,
enqueue_chunk(s, 0,
- "
"));
PT_WAIT_THREAD(&s->generate_pt,
enqueue_chunk(s, 0,
- "