mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Web: Handle missing LOS pin
When device has no LOS pin and module has no extended status, the RX LOS value will not be shown. When both are present, the equality check is performed. When only one is present, the present value will be shown. json from the switch, will still contain the field, but can be null for when pin is not available.
This commit is contained in:
+5
-1
@@ -656,7 +656,11 @@ void send_status(void)
|
||||
for (register uint8_t s = 0; s < 16; s++)
|
||||
outbuf[slen++] = sfp_module_serial[machine.is_sfp[i]-1][s];
|
||||
slen += strtox(outbuf + slen,"\",\"sfp_los\":");
|
||||
bool_to_html(sfp_pins_last & (0x2 << (((machine.is_sfp[i]-1) << 2))));
|
||||
if (machine.sfp_port[machine.is_sfp[i]-1].pin_los == GPIO_NA) {
|
||||
slen += strtox(outbuf + slen,"null");
|
||||
} else {
|
||||
bool_to_html(sfp_pins_last & (0x2 << (((machine.is_sfp[i]-1) << 2))));
|
||||
}
|
||||
} else {
|
||||
bool_to_html(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user