diff --git a/httpd/page_impl.c b/httpd/page_impl.c index f9c55b83..0d054be9 100644 --- a/httpd/page_impl.c +++ b/httpd/page_impl.c @@ -743,18 +743,16 @@ void send_lldp(void) slen += strtox(outbuf + slen, "{\"on\":"); bool_to_html(lldp_enabled); - slen += strtox(outbuf + slen, ",\"port_status\": ["); + slen += strtox(outbuf + slen, ",\"port_status\":["); for (uint8_t port = machine.min_port; port <= machine.max_port; port++) { bool_to_html((1 << machine.log_to_phys_port[port]) & lldp_physical_port_status); slen += strtox(outbuf + slen, ","); } - + slen--; //overwrite the last comma slen += strtox(outbuf + slen, "]}"); } - - void send_eee(void) { dbg_string("send_eee called\nsending EEE status\n"); diff --git a/test/env_tables.c b/test/env_tables.c index 274a67d5..3b246948 100644 --- a/test/env_tables.c +++ b/test/env_tables.c @@ -84,6 +84,9 @@ char port_names[9][PORT_NAME_SIZE]; struct flash_region_t flash_region; struct syslog_state syslog_state; bool stp_enabled; +bool lldp_enabled; +uint16_t lldp_physical_port_status; + uip_ipaddr_t uip_hostaddr, uip_draddr, uip_netmask; struct uip_eth_addr uip_ethaddr = { .addr = { 0x02, 0x11, 0x22, 0x33, 0x44, 0x55 } }; diff --git a/test/test_httpd_tx.c b/test/test_httpd_tx.c index c7ccf09c..4df05472 100644 --- a/test/test_httpd_tx.c +++ b/test/test_httpd_tx.c @@ -152,6 +152,7 @@ void send_lag(void) { } void send_stp(void) { } void send_stp_counters(void) { } void send_vlanlist(void) { } +void send_lldp(void) {} extern uint8_t authenticated; diff --git a/tools/httpd_sim.c b/tools/httpd_sim.c index efa367c6..53a4d403 100644 --- a/tools/httpd_sim.c +++ b/tools/httpd_sim.c @@ -459,7 +459,7 @@ void send_lldp(int s) char *header = "HTTP/1.1 200 OK\r\n" "Content-Type: application/json; charset=UTF-8\r\n\r\n"; - char *body = "{\"on\": true, \"port_status\":[true,true,false,true,true,true,true,false,false]}"; + char *body = "{\"on\": 1,\"port_status\":[1,1,0,1,1,1,1,0,0]}"; write(s, header, strlen(header)); write(s, body, strlen(body));