diagnostico: fix ethernet e Rx Power_p2
Signed-off-by: Rodrigo Bertoldo de Sousa Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
1 parent
c890a38587
commit
4d8fa3362c
1 file changed
+11
-20
+11
-20
@@ -882,33 +882,28 @@ class FiberhomeManager {
|
||||
}
|
||||
}
|
||||
|
||||
// Extrair informações de potência se disponível na listagem
|
||||
// Extrair informações de potência se disponível na listagem (apenas como fallback)
|
||||
if (resultado.rxPower === 'N/A') {
|
||||
const rxMatches = [
|
||||
dadosCompletos.match(/RX[=\s:]+([+-]?\d+\.?\d*)/gi),
|
||||
dadosCompletos.match(/RXPOWER[=\s:]+([+-]?\d+\.?\d*)/gi)
|
||||
];
|
||||
|
||||
for (const matches of rxMatches) {
|
||||
if (matches && matches.length > 0) {
|
||||
const match = matches[0].match(/([+-]?\d+\.?\d*)/);
|
||||
if (match) {
|
||||
resultado.rxPower = `${match[1]} dBm`;
|
||||
break;
|
||||
if (match) { resultado.rxPower = `${match[1]} dBm`; break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (resultado.txPower === 'N/A') {
|
||||
const txMatches = [
|
||||
dadosCompletos.match(/TX[=\s:]+([+-]?\d+\.?\d*)/gi),
|
||||
dadosCompletos.match(/TXPOWER[=\s:]+([+-]?\d+\.?\d*)/gi)
|
||||
];
|
||||
|
||||
for (const matches of txMatches) {
|
||||
if (matches && matches.length > 0) {
|
||||
const match = matches[0].match(/([+-]?\d+\.?\d*)/);
|
||||
if (match) {
|
||||
resultado.txPower = `${match[1]} dBm`;
|
||||
break;
|
||||
if (match) { resultado.txPower = `${match[1]} dBm`; break; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -918,29 +913,25 @@ class FiberhomeManager {
|
||||
if (dadosONU.detalhes) {
|
||||
this.logger.debug('Processando dados detalhados da ONU:', dadosONU.detalhes);
|
||||
|
||||
// Extrair RX Power
|
||||
// Extrair RX Power (apenas como fallback)
|
||||
if (resultado.rxPower === 'N/A') {
|
||||
const rxMatches = [
|
||||
dadosONU.detalhes.match(/RXPOWER[=\s:]+([+-]?\d+\.?\d*)/i),
|
||||
dadosONU.detalhes.match(/RX[=\s:]+([+-]?\d+\.?\d*)/i)
|
||||
];
|
||||
|
||||
for (const match of rxMatches) {
|
||||
if (match) {
|
||||
resultado.rxPower = `${match[1]} dBm`;
|
||||
break;
|
||||
if (match) { resultado.rxPower = `${match[1]} dBm`; break; }
|
||||
}
|
||||
}
|
||||
|
||||
// Extrair TX Power
|
||||
// Extrair TX Power (apenas como fallback)
|
||||
if (resultado.txPower === 'N/A') {
|
||||
const txMatches = [
|
||||
dadosONU.detalhes.match(/TXPOWER[=\s:]+([+-]?\d+\.?\d*)/i),
|
||||
dadosONU.detalhes.match(/TX[=\s:]+([+-]?\d+\.?\d*)/i)
|
||||
];
|
||||
|
||||
for (const match of txMatches) {
|
||||
if (match) {
|
||||
resultado.txPower = `${match[1]} dBm`;
|
||||
break;
|
||||
if (match) { resultado.txPower = `${match[1]} dBm`; break; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user