Skip to content

Commit

Permalink
add signal metrics to ping result if available
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle committed Dec 23, 2024
1 parent 647ee32 commit a39e269
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/frontend/components/messages/ConversationDropDownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,34 @@ export default {
},
});
const pingResult = response.data.ping_result;
const rttMilliseconds = (pingResult.rtt * 1000).toFixed(3);
const rttDurationString = `${rttMilliseconds} ms`;
const info = [
`Valid reply from ${this.peer.destination_hash}`,
`Duration: ${rttDurationString}`,
`Hops There: ${pingResult.hops_there}`,
`Hops Back: ${pingResult.hops_back}`,
];
// add signal quality if available
if(pingResult.quality != null){
info.push(`Signal Quality: ${pingResult.quality}%`);
}
// add rssi if available
if(pingResult.rssi != null){
info.push(`RSSI: ${pingResult.rssi}dBm`);
}
// add snr if available
if(pingResult.snr != null){
info.push(`SNR: ${pingResult.snr}dB`);
}
// show result
DialogUtils.alert(response.data.message);
DialogUtils.alert(info.join("\n"));
} catch(e) {
console.log(e);
Expand Down

0 comments on commit a39e269

Please sign in to comment.