From 1f6624f845d49078ed693f96918f88a0c9a34f4b Mon Sep 17 00:00:00 2001 From: dg9vh Date: Sun, 25 Sep 2016 16:25:42 +0000 Subject: [PATCH] Show connected YSFReflector in repeater-info --- include/functions.php | 22 ++++++++++++++++++++++ include/init.php | 1 + include/repeaterinfo.php | 4 +++- include/ysfgatewayinfo.php | 1 - 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/include/functions.php b/include/functions.php index 77cbcbd..115cd18 100644 --- a/include/functions.php +++ b/include/functions.php @@ -441,6 +441,20 @@ function getActualLink($logLines, $mode) { } return "not linked"; break; + case "YSF": + +// 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122 +// 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901 +// M: 2016-09-25 16:08:05.811 Connect to 62829 has been requested by DG9VH + foreach($logLines as $logLine) { + $to = ""; + if (strpos($logLine,"Connect to")) { + $to = substr($logLine, 47, 5); + } + if ($to !== "") { + return $to; + } + } } return "something went wrong!"; } @@ -507,6 +521,14 @@ function getActiveYSFReflectors($logLines) { return $reflectorlist; } +function getYSFReflectorById($id, $reflectors) { + foreach($reflectors as $reflector) { + if ($reflector[2] === $id) { + return $reflector[0]; + } + } +} + function getName($callsign) { if (is_numeric($callsign)) { return "---"; diff --git a/include/init.php b/include/init.php index 9386210..e5d1718 100644 --- a/include/init.php +++ b/include/init.php @@ -10,5 +10,6 @@ if (defined("ENABLEYSFGATEWAY")) { $logLinesYSFGateway = getYSFGatewayLog(); $reverseLogLinesYSFGateway = $logLinesYSFGateway; array_multisort($reverseLogLinesYSFGateway,SORT_DESC); + $activeYSFReflectors = getActiveYSFReflectors($reverseLogLinesYSFGateway); } ?> diff --git a/include/repeaterinfo.php b/include/repeaterinfo.php index c5b7e97..0f4979b 100644 --- a/include/repeaterinfo.php +++ b/include/repeaterinfo.php @@ -7,6 +7,7 @@ Actual Mode D-Star linked to + YSF linked to DMR TS1 last linked to DMR TS2 last linked to @@ -14,12 +15,13 @@ echo""; echo"".getActualMode($lastHeard, $mmdvmconfigs).""; echo"".getActualLink($reverseLogLinesMMDVM, "D-Star").""; + echo"".getYSFReflectorById(getActualLink($reverseLogLinesYSFGateway, "YSF"), $activeYSFReflectors).""; echo"".getActualLink($reverseLogLinesMMDVM, "DMR Slot 1").""; echo"".getActualLink($reverseLogLinesMMDVM, "DMR Slot 2")."/". getActualReflector($reverseLogLinesMMDVM, "DMR Slot 2") .""; echo"\n"; ?> - + diff --git a/include/ysfgatewayinfo.php b/include/ysfgatewayinfo.php index 00ebd93..fee6e85 100644 --- a/include/ysfgatewayinfo.php +++ b/include/ysfgatewayinfo.php @@ -27,7 +27,6 @@ 0) { ?>
Location