mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Fixing missing parts to make the tests pass
boot_to_html outputs 1 and 0 not true and false, making the sim match the real implementation. lldp.json has a hanging , in the array; so overwriting it
This commit is contained in:
1 parent
72c2625121
commit
2dfe531fe0
4 files changed
+6
-4
No files matched your search
+1
-3
@@ -749,12 +749,10 @@ void send_lldp(void)
|
|||||||
bool_to_html((1 << machine.log_to_phys_port[port]) & lldp_physical_port_status);
|
bool_to_html((1 << machine.log_to_phys_port[port]) & lldp_physical_port_status);
|
||||||
slen += strtox(outbuf + slen, ",");
|
slen += strtox(outbuf + slen, ",");
|
||||||
}
|
}
|
||||||
|
slen--; //overwrite the last comma
|
||||||
slen += strtox(outbuf + slen, "]}");
|
slen += strtox(outbuf + slen, "]}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void send_eee(void)
|
void send_eee(void)
|
||||||
{
|
{
|
||||||
dbg_string("send_eee called\nsending EEE status\n");
|
dbg_string("send_eee called\nsending EEE status\n");
|
||||||
|
|||||||
@@ -84,6 +84,9 @@ char port_names[9][PORT_NAME_SIZE];
|
|||||||
struct flash_region_t flash_region;
|
struct flash_region_t flash_region;
|
||||||
struct syslog_state syslog_state;
|
struct syslog_state syslog_state;
|
||||||
bool stp_enabled;
|
bool stp_enabled;
|
||||||
|
bool lldp_enabled;
|
||||||
|
uint16_t lldp_physical_port_status;
|
||||||
|
|
||||||
|
|
||||||
uip_ipaddr_t uip_hostaddr, uip_draddr, uip_netmask;
|
uip_ipaddr_t uip_hostaddr, uip_draddr, uip_netmask;
|
||||||
struct uip_eth_addr uip_ethaddr = { .addr = { 0x02, 0x11, 0x22, 0x33, 0x44, 0x55 } };
|
struct uip_eth_addr uip_ethaddr = { .addr = { 0x02, 0x11, 0x22, 0x33, 0x44, 0x55 } };
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ void send_lag(void) { }
|
|||||||
void send_stp(void) { }
|
void send_stp(void) { }
|
||||||
void send_stp_counters(void) { }
|
void send_stp_counters(void) { }
|
||||||
void send_vlanlist(void) { }
|
void send_vlanlist(void) { }
|
||||||
|
void send_lldp(void) {}
|
||||||
|
|
||||||
extern uint8_t authenticated;
|
extern uint8_t authenticated;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -459,7 +459,7 @@ void send_lldp(int s)
|
|||||||
char *header = "HTTP/1.1 200 OK\r\n"
|
char *header = "HTTP/1.1 200 OK\r\n"
|
||||||
"Content-Type: application/json; charset=UTF-8\r\n\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, header, strlen(header));
|
||||||
write(s, body, strlen(body));
|
write(s, body, strlen(body));
|
||||||
|
|||||||
Reference in new issue
Block a user