mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Web: Add SFP state/pin status
The state of the SFP module is being already send in status.json, but was not parsed via Web UI. When debuging SFP LOS/Signal detection it is usefull to see what module is reporting back. Extended the SFP mouse-over information with: - RX LOS as reported in 0x02 bit of register 238 - External TX Disabled from 0x80 bit of register 238 - TX fault from 0x04 of the same register - The last state of RX LOS pin (available also when there is no 0x40 option on the module) This should help identify missing/incorrect setup of TX disabled pin.
This commit is contained in:
@@ -97,10 +97,14 @@ function update(callback) {
|
||||
if (p.sfp_options & 0x40) {
|
||||
iHTML += "<tr><td>Temp</td><td>:</td><td>" + (Number(p.sfp_temp) >> 8) + "." + ((Number(p.sfp_temp) & 0xff)/256.0 * 100).toFixed(0) + " ℃</td></tr>";
|
||||
iHTML += "<tr><td>Vcc</td><td>:</td><td>" + (Number(p.sfp_vcc) / 10000.0).toFixed(2) + " V</td></tr>";
|
||||
iHTML += "<tr><td>TX-Fault</td><td>:</td><td>" + (Boolean(Number(p.sfp_state) & 0x4)) + "</td></tr>";
|
||||
iHTML += "<tr><td>TX-Disabled</td><td>:</td><td>" + (Boolean(Number(p.sfp_state) & 0x80)) + "</td></tr>";
|
||||
iHTML += "<tr><td>TX-Bias</td><td>:</td><td>" + (Number(p.sfp_txbias) / 500.0).toFixed(1) + " mA</td></tr>";
|
||||
iHTML += "<tr><td>TX-Power</td><td>:</td><td>" + (Number(p.sfp_txpower) / 10.0).toFixed(0) + " mW</td></tr>";
|
||||
iHTML += "<tr><td>RX-Power</td><td>:</td><td>" + (Number(p.sfp_rxpower) / 10.0).toFixed(0) + " mW</td></tr>";
|
||||
iHTML += "<tr><td>RX-LOS</td><td>:</td><td>" + (Boolean(Number(p.sfp_state) & 0x2)) + "</td></tr>";
|
||||
}
|
||||
iHTML += "<tr><td>RX-LOS pin</td><td>:</td><td>" + Boolean(Number(p.sfp_los)) + "</td></tr>";
|
||||
} else {
|
||||
pAdvertised[n] = parseInt(p.adv, 2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user