diff --git a/html/main.js b/html/main.js
index 085db57..1677a38 100644
--- a/html/main.js
+++ b/html/main.js
@@ -97,10 +97,14 @@ function update(callback) {
if (p.sfp_options & 0x40) {
iHTML += "
| Temp | : | " + (Number(p.sfp_temp) >> 8) + "." + ((Number(p.sfp_temp) & 0xff)/256.0 * 100).toFixed(0) + " ℃ |
";
iHTML += "| Vcc | : | " + (Number(p.sfp_vcc) / 10000.0).toFixed(2) + " V |
";
+ iHTML += "| TX-Fault | : | " + (Boolean(Number(p.sfp_state) & 0x4)) + " |
";
+ iHTML += "| TX-Disabled | : | " + (Boolean(Number(p.sfp_state) & 0x80)) + " |
";
iHTML += "| TX-Bias | : | " + (Number(p.sfp_txbias) / 500.0).toFixed(1) + " mA |
";
iHTML += "| TX-Power | : | " + (Number(p.sfp_txpower) / 10.0).toFixed(0) + " mW |
";
iHTML += "| RX-Power | : | " + (Number(p.sfp_rxpower) / 10.0).toFixed(0) + " mW |
";
+ iHTML += "| RX-LOS | : | " + (Boolean(Number(p.sfp_state) & 0x2)) + " |
";
}
+ iHTML += "| RX-LOS pin | : | " + Boolean(Number(p.sfp_los)) + " |
";
} else {
pAdvertised[n] = parseInt(p.adv, 2);
}
diff --git a/httpd/page_impl.c b/httpd/page_impl.c
index 82e5314..56aa523 100644
--- a/httpd/page_impl.c
+++ b/httpd/page_impl.c
@@ -655,7 +655,8 @@ void send_status(void)
slen += strtox(outbuf + slen,"\",\"sfp_serial\":\"");
for (register uint8_t s = 0; s < 16; s++)
outbuf[slen++] = sfp_module_serial[machine.is_sfp[i]-1][s];
- char_to_html('"');
+ slen += strtox(outbuf + slen,"\",\"sfp_los\":");
+ bool_to_html(sfp_pins_last & (0x2 << (((machine.is_sfp[i]-1) << 2))));
} else {
bool_to_html(0);
}
diff --git a/rtlplayground.c b/rtlplayground.c
index 041c7ed..8f320a7 100644
--- a/rtlplayground.c
+++ b/rtlplayground.c
@@ -124,6 +124,9 @@ __code uint16_t bit_mask[16] = {
__xdata uint8_t linkbits_last[4];
__xdata uint8_t linkbits_last_p89;
+// Last known state of the SFP detection/Loss of Signal pins
+// SFP1 b0 = 1 => module missing, b1 = 1 => LOS;
+// SFP2 b4 = 1 => module missing, b5 = 1 => LOS;
__xdata uint8_t sfp_pins_last;
__xdata char sfp_module_vendor[2][17];
__xdata char sfp_module_model[2][17];