summaryrefslogtreecommitdiffstats
path: root/notFinishedCode/tricode/mutexTry.php
diff options
context:
space:
mode:
Diffstat (limited to 'notFinishedCode/tricode/mutexTry.php')
-rwxr-xr-xnotFinishedCode/tricode/mutexTry.php77
1 files changed, 51 insertions, 26 deletions
diff --git a/notFinishedCode/tricode/mutexTry.php b/notFinishedCode/tricode/mutexTry.php
index 3ca6fa1..9e07b3d 100755
--- a/notFinishedCode/tricode/mutexTry.php
+++ b/notFinishedCode/tricode/mutexTry.php
@@ -89,6 +89,27 @@ if ($locking == '1') //1 means nobody is on the website
if ($received == "CONFIRM\n") //we got the confirmation from the testing software
{
+ //test finished successfully
+ $GSMRZ1 = 0;
+ $GSMRZ2 = 0;
+ $GSMRZ3 = 0;
+
+ $SIP = 0;
+ $UNISIP = 0;
+ $LANDLINE = 0;
+ $LSFKS = 0;
+
+ $GSMEE = 0;
+ $GSMEV = 0;
+ $GSMET = 0;
+ $GSMEO = 0;
+
+ $SIPP = 0;
+ $LANDLINEP = 0;
+ $UNISIPP = 0;
+ $NANOBTS1P = 0;
+ $NANOBTS2P = 0;
+ /////////// end of test!
echo '<div id="main">
<table summary = "Results">
<thead>
@@ -106,27 +127,6 @@ if ($locking == '1') //1 means nobody is on the website
}
elseif ($received == "TEST DONE\n")
{
- //test finished successfully
- $GSMRZ1 = 0;
- $GSMRZ2 = 10;
- $GSMRZ3 = 10;
-
- $SIP = 4;
- $UNISIP = -1;
- $LANDLINE = 0;
- $LSFKS = 1;
-
- $GSMEE = 10;
- $GSMEV = 10;
- $GSMET = -10;
- $GSMEO = 10;
-
- $SIPP = 0;
- $LANDLINEP = 0;
- $UNISIPP = 1;
- $NANOBTS1P = 1;
- $NANOBTS2P = 1;
- /////////// end of test!
echo '</tbody></table>';
echo '</div>';
@@ -141,12 +141,37 @@ if ($locking == '1') //1 means nobody is on the website
}
else
{
- //parse the received data!
+ //parse the received data!
+ $received = str_replace("\n",'',$received);
+ $dataForTable = explode("|", $received);
+ $callFrom = strtoupper($dataForTable[1]);
+ $callTo = strtoupper($dataForTable[2]);
+ $testStatus = strtoupper($dataForTable[3]);
+ //ADD HERE THE TEST CASES BUT MAKE IT INSIDE OF A FILE (e.q. include 'testing.php'); HERE I PUT IT ONLY FOR EXAMPLE PURPOSES!
+
+ if($callFrom == 'SIP' || $callTo == 'SIP')
+ {
+ if($testStatus == '200')
+ {
+ $SIP = 1;
+ echo 'SIP set to 1';
+ }
+ }
+ if($callFrom == 'GSMRZ1' || $callTo == 'GSMRZ1')
+ {
+ if($testStatus == '200')
+ {
+ echo 'GSMRZ1 set to 1';
+ $GSMRZ1 = 1;
+ }
+ }
+
+ //END OF TEST CASE EXAMPLE
echo '<tr>
- <th scope = "row" id = "r100"> SIP</th>
- <th scope = "row" id = "r100">GSM1 </th>
- <td> '. $received . ' </td>
- <td> 200</td>
+ <th scope = "row" id = "r100">'. $dataForTable[1] . '</th>
+ <th scope = "row" id = "r100">'. $dataForTable[2] . '</th>
+ <td> ' . $dataForTable[4] . ' </td>
+ <td>' . $dataForTable[3] . '</td>
</tr>';
//echo $received . '<br>';
echo str_repeat("\n",7024);