fix duration when coming from RF (round values)

master
Dominic Reich 4 years ago
parent fff72f07dd
commit 491178567f

@ -109,7 +109,7 @@ function getLastHeard($limit = MAXENTRIES) {
$time = date( "Y-m-d H:i:s", strtotime( substr( $line, 3, 23 )." UTC" )); $time = date( "Y-m-d H:i:s", strtotime( substr( $line, 3, 23 )." UTC" ));
$callsign = substr( $line, 69, strpos( $line, "to" ) - 69 ); $callsign = substr( $line, 69, strpos( $line, "to" ) - 69 );
$dgid = substr( $line, 89, strpos( $line, ",", 89 ) - 89 ); $dgid = substr( $line, 89, strpos( $line, ",", 89 ) - 89 );
$duration = trim( substr( $line, 92, strpos( $line, "seconds,", 92 ) - 92 ), " ,"); $duration = round( trim( substr( $line, 92, strpos( $line, "seconds,", 92 ) - 92 ), " ," ));
$rssi_values = explode( "/", substr( $line, 113, strpos( $line, "dBm", 113 ) - 113 )); $rssi_values = explode( "/", substr( $line, 113, strpos( $line, "dBm", 113 ) - 113 ));
$rssi = rssiCalc( round( array_sum( $rssi_values ) / count( $rssi_values ))); $rssi = rssiCalc( round( array_sum( $rssi_values ) / count( $rssi_values )));
$loss = "---"; $loss = "---";

Loading…
Cancel
Save