Merge pull request #43 from phl0/P25

Add basic support for P25
This commit is contained in:
Kim - DG9VH 2016-09-20 14:03:39 +02:00 committed by GitHub
commit b0af1da0e2
3 changed files with 80 additions and 67 deletions

View file

@ -135,6 +135,7 @@ function getYSFGatewayLog() {
// M: 2016-04-29 00:15:00.013 D-Star, received network header from DG9VH /ZEIT to CQCQCQ via DCS002 S // M: 2016-04-29 00:15:00.013 D-Star, received network header from DG9VH /ZEIT to CQCQCQ via DCS002 S
// M: 2016-04-29 19:43:21.839 DMR Slot 2, received network voice header from DL1ESZ to TG 9 // M: 2016-04-29 19:43:21.839 DMR Slot 2, received network voice header from DL1ESZ to TG 9
// M: 2016-04-30 14:57:43.072 DMR Slot 2, received RF voice header from DG9VH to 5000 // M: 2016-04-30 14:57:43.072 DMR Slot 2, received RF voice header from DG9VH to 5000
// M: 2016-09-16 09:14:12.886 P25, received RF from DF2ET to TG10100
function getHeardList($logLines, $onlyLast) { function getHeardList($logLines, $onlyLast) {
$heardList = array(); $heardList = array();
$ts1duration = ""; $ts1duration = "";
@ -147,8 +148,8 @@ function getHeardList($logLines, $onlyLast) {
$dstarloss = ""; $dstarloss = "";
$dstarber = ""; $dstarber = "";
$ysfduration = ""; $ysfduration = "";
$ysfloss = ""; $ysfloss = "";
$ysfber = ""; $ysfber = "";
foreach ($logLines as $logLine) { foreach ($logLines as $logLine) {
$duration = ""; $duration = "";
$loss = ""; $loss = "";
@ -217,6 +218,11 @@ function getHeardList($logLines, $onlyLast) {
$ysfloss = $loss; $ysfloss = $loss;
$ysfber = $ber; $ysfber = $ber;
break; break;
case "P25":
$p25duration = $duration;
$p25loss = $loss;
$p25ber = $ber;
break;
} }
} }
} }
@ -258,10 +264,15 @@ function getHeardList($logLines, $onlyLast) {
$ber = $ts2ber; $ber = $ts2ber;
break; break;
case "YSF": case "YSF":
$duration = $ysfduration; $duration = $ysfduration;
$loss = $ysfloss; $loss = $ysfloss;
$ber = $ysfber; $ber = $ysfber;
break; break;
case "P25":
$duration = $p25duration;
$loss = $p25loss;
$ber = $p25ber;
break;
} }
// Callsign or ID should be less than 11 chars long, otherwise it could be errorneous // Callsign or ID should be less than 11 chars long, otherwise it could be errorneous
@ -285,7 +296,7 @@ function getLastHeard($logLines, $onlyLast) {
$heardList = getHeardList($logLines, $onlyLast); $heardList = getHeardList($logLines, $onlyLast);
$counter = 0; $counter = 0;
foreach ($heardList as $listElem) { foreach ($heardList as $listElem) {
if ( ($listElem[1] == "D-Star") || ($listElem[1] == "YSF") || (startsWith($listElem[1], "DMR")) ) { if ( ($listElem[1] == "D-Star") || ($listElem[1] == "YSF") || ($listElem[1] == "P25") || (startsWith($listElem[1], "DMR")) ) {
if(!(array_search($listElem[2]."#".$listElem[1].$listElem[3], $heardCalls) > -1)) { if(!(array_search($listElem[2]."#".$listElem[1].$listElem[3], $heardCalls) > -1)) {
array_push($heardCalls, $listElem[2]."#".$listElem[1].$listElem[3]); array_push($heardCalls, $listElem[2]."#".$listElem[1].$listElem[3]);
array_push($lastHeard, $listElem); array_push($lastHeard, $listElem);
@ -391,45 +402,45 @@ function getActualLink($logLines, $mode) {
//M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094 //M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094
//M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094 //M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094
switch ($mode) { switch ($mode) {
case "D-Star": case "D-Star":
if (isProcessRunning(IRCDDBGATEWAY)) { if (isProcessRunning(IRCDDBGATEWAY)) {
return getDSTARLinks(); return getDSTARLinks();
} else { } else {
return "ircddbgateway not running!"; return "ircddbgateway not running!";
} }
break; break;
case "DMR Slot 1": case "DMR Slot 1":
foreach ($logLines as $logLine) { foreach ($logLines as $logLine) {
if(strpos($logLine,"unable to decode the network CSBK")) { if(strpos($logLine,"unable to decode the network CSBK")) {
continue; continue;
} else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 1") { } else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 1") {
$to = ""; $to = "";
if (strpos($logLine,"to")) { if (strpos($logLine,"to")) {
$to = trim(substr($logLine, strpos($logLine,"to") + 3)); $to = trim(substr($logLine, strpos($logLine,"to") + 3));
}
if ($to !== "") {
return $to;
}
} }
if ($to !== "") { }
return $to; return "not linked";
break;
case "DMR Slot 2":
foreach ($logLines as $logLine) {
if(strpos($logLine,"unable to decode the network CSBK")) {
continue;
} else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") {
$to = "";
if (strpos($logLine,"to")) {
$to = trim(substr($logLine, strpos($logLine,"to") + 3));
}
if ($to !== "") {
return $to;
}
} }
} }
} return "not linked";
return "not linked"; break;
break;
case "DMR Slot 2":
foreach ($logLines as $logLine) {
if(strpos($logLine,"unable to decode the network CSBK")) {
continue;
} else if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") {
$to = "";
if (strpos($logLine,"to")) {
$to = trim(substr($logLine, strpos($logLine,"to") + 3));
}
if ($to !== "") {
return $to;
}
}
}
return "not linked";
break;
} }
return "something went wrong!"; return "something went wrong!";
} }
@ -439,8 +450,8 @@ function getActualReflector($logLines, $mode) {
//M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S" //M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S"
//M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094 //M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094
//M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094 //M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094
foreach ($logLines as $logLine) { foreach ($logLines as $logLine) {
if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") {
$from = substr($logLine, strpos($logLine,"from") + 5, strpos($logLine,"to") - strpos($logLine,"from") - 6); $from = substr($logLine, strpos($logLine,"from") + 5, strpos($logLine,"to") - strpos($logLine,"from") - 6);
if (strlen($from) == 4 && startsWith($from,"4")) { if (strlen($from) == 4 && startsWith($from,"4")) {

View file

@ -34,7 +34,7 @@ $localTXList = getHeardList($reverseLogLinesMMDVM, FALSE);
<?php <?php
for ($i = 0; $i < count($localTXList); $i++) { for ($i = 0; $i < count($localTXList); $i++) {
$listElem = $localTXList[$i]; $listElem = $localTXList[$i];
if ($listElem[5] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF")) { if ($listElem[5] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) {
echo"<tr>"; echo"<tr>";
echo"<td nowrap>$listElem[0]</td>"; echo"<td nowrap>$listElem[0]</td>";
echo"<td nowrap>$listElem[1]</td>"; echo"<td nowrap>$listElem[1]</td>";

View file

@ -10,6 +10,8 @@
<?php showMode("D-Star Network", $mmdvmconfigs);?> <?php showMode("D-Star Network", $mmdvmconfigs);?>
<?php showMode("System Fusion", $mmdvmconfigs);?> <?php showMode("System Fusion", $mmdvmconfigs);?>
<?php showMode("System Fusion Network", $mmdvmconfigs);?> <?php showMode("System Fusion Network", $mmdvmconfigs);?>
<?php showMode("P25", $mmdvmconfigs);?>
<?php showMode("P25 Network", $mmdvmconfigs);?>
</tr> </tr>
</table> </table>
</div> </div>