From 44446bc6422e17c0b8ea53b7e524e95491277a24 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Thu, 19 May 2016 20:24:59 +0000 Subject: [PATCH] added sending or receiving SMS in LH and local TX-Lists --- include/functions.php | 55 ++++++++++++++++++++++++++----------------- include/lh.php | 6 +++-- include/localtx.php | 4 +++- 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/include/functions.php b/include/functions.php index 0c0d449..d21fe4f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -129,7 +129,7 @@ function getHeardList($logLines) { continue; } - if(strpos($logLine,"end of") || strpos($logLine,"watchdog has expired")) { + if(strpos($logLine,"end of") || strpos($logLine,"watchdog has expired") || strpos($logLine,"ended RF data") || strpos($logLine,"ended network")) { $lineTokens = explode(", ",$logLine); $duration = strtok($lineTokens[2], " "); @@ -144,27 +144,38 @@ function getHeardList($logLines) { $ber = substr($lineTokens[4], 5); } - switch (substr($logLine, 27, strpos($logLine,",") - 27)) { - case "D-Star": - $dstarduration = $duration; - $dstarloss = $loss; - $dstarber = $ber; - break; - case "DMR Slot 1": - $ts1duration = $duration; - $ts1loss = $loss; - $ts1ber = $ber; - break; - case "DMR Slot 2": - $ts2duration = $duration; - $ts2loss = $loss; - $ts2ber = $ber; - break; - case "YSF": - $ysfduration = $duration; - $ysfloss = $loss; - $ysfber = $ber; - break; + if (strpos($logLine,"ended RF data") || strpos($logLine,"ended network")) { + switch (substr($logLine, 27, strpos($logLine,",") - 27)) { + case "DMR Slot 1": + $ts1duration = "SMS"; + break; + case "DMR Slot 2": + $ts2duration = "SMS"; + break; + } + } else { + switch (substr($logLine, 27, strpos($logLine,",") - 27)) { + case "D-Star": + $dstarduration = $duration; + $dstarloss = $loss; + $dstarber = $ber; + break; + case "DMR Slot 1": + $ts1duration = $duration; + $ts1loss = $loss; + $ts1ber = $ber; + break; + case "DMR Slot 2": + $ts2duration = $duration; + $ts2loss = $loss; + $ts2ber = $ber; + break; + case "YSF": + $ysfduration = $duration; + $ysfloss = $loss; + $ysfber = $ber; + break; + } } } diff --git a/include/lh.php b/include/lh.php index f5d4ebe..710a757 100644 --- a/include/lh.php +++ b/include/lh.php @@ -27,8 +27,10 @@ for ($i = 0; ($i < LHLINES) AND ($i < count($lastHeard)); $i++) { echo"$listElem[4]"; echo"$listElem[5]"; if ($listElem[6] == null) { - echo'transmitting'; - } else { + echo'transmitting'; + } else if ($listElem[6] == "SMS") { + echo'sending or receiving SMS'; + } else { echo"$listElem[6]"; echo"$listElem[7]"; echo"$listElem[8]"; diff --git a/include/localtx.php b/include/localtx.php index 6e75d8c..46cc3de 100644 --- a/include/localtx.php +++ b/include/localtx.php @@ -33,7 +33,9 @@ for ($i = 0; $i < count($localTXList); $i++) { echo"$listElem[4]"; echo"$listElem[5]"; if ($listElem[6] == null) { - echo'transmitting'; + echo'transmitting'; + } else if ($listElem[6] == "SMS") { + echo'sending or receiving SMS'; } else { echo"$listElem[6]"; echo"$listElem[7]";