Skip to content

Commit c3a13e4

Browse files
authored
Merge pull request #6 from SP0DZ:RFModule-BW-parameter-added
RF module update (BW parameter added)
2 parents 278dc2f + 500cf6d commit c3a13e4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

rf/index.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,15 @@
176176
$squelch = $_POST['squelch'];
177177
$ctcss = $_POST['ctcss'];
178178
$tail = $_POST['tail'];
179+
$bw = $_POST['bw'];
180+
/* $bw = 0; */
181+
179182

180-
$command = "sa818 --port \"" .$port. "\" radio --frequency \"" .$freq. "\" --offset \"" .$offset. "\" --squelch \"" .$squelch. "\" --ctcss \"" .$ctcss. "\" --close-tail \"" .$tail. "\" 2>&1";
183+
$command = "sa818 --port \"" .$port. "\" radio --bw \"" .$bw. "\" --frequency \"" .$freq. "\" --offset \"" .$offset. "\" --squelch \"" .$squelch. "\" --ctcss \"" .$ctcss. "\" --close-tail \"" .$tail. "\" 2>&1";
181184
if (!$retval) exec($command,$screen,$retval);
182185

183186
if (!$retval) {
184-
$RfData['port']=$port;$RfData['freq']=$freq;$RfData['offset']=$offset;$RfData['squelch']=$squelch;$RfData['ctcss']=$ctcss;$RfData['tail']=$tail;
187+
$RfData['port']=$port;$RfData['freq']=$freq;$RfData['offset']=$offset;$RfData['squelch']=$squelch;$RfData['ctcss']=$ctcss;$RfData['tail']=$tail;$RfData['bw']=$bw;
185188
$jsonRfData = json_encode($RfData);
186189
file_put_contents("/var/www/html/rf/sa818.json", $jsonRfData ,FILE_USE_INCLUDE_PATH);
187190
//archive the current config
@@ -244,7 +247,7 @@
244247
//load json
245248

246249
$port = $RfData['port'];
247-
$freq = $RfData['freq'];$offset=$RfData['offset'];$ctcss=$RfData['ctcss'];$tail=$RfData['tail'];$squelch=$RfData['squelch'];
250+
$freq = $RfData['freq'];$offset=$RfData['offset'];$ctcss=$RfData['ctcss'];$tail=$RfData['tail'];$squelch=$RfData['squelch'];$bw=$RfData['bw'];
248251
$fEmph = $RfData['fEmph'];$fLow=$RfData['fLow'];$fHigh=$RfData['fHigh'];
249252
$volume = $RfData['volume'];
250253

@@ -259,6 +262,7 @@
259262
if ($ctcss === "" || is_null($ctcss)) $ctcss = "77.0";
260263
if ($tail === "" || is_null($tail)) $tail = "yes";
261264
if ($squelch === "" || is_null($squelch)) $squelch = "5";
265+
if ($bw ==="" || is_null($bw)) $bw = "1";
262266

263267
//filter
264268
if ($fEmph === "" || is_null($fEmph)) $fEmph = "no";
@@ -313,7 +317,8 @@
313317
</tr>
314318
<tr>
315319
<Td>
316-
Freq: <input type "text" name="freq" style="width: 180px" value="<?php echo $freq;?>">
320+
Freq: <input type "text" name="freq" style="width: 120px" value="<?php echo $freq;?>">
321+
Bw: <input type "text" name="bw" style="width: 50px" value="<?php echo $bw;?>">
317322
Shift: <input type "text" name="offset" style="width: 50px" value="<?php echo $offset;?>"> <br>
318323
Ctcss: <input type "text" name="ctcss" style="width: 50px" value="<?php echo $ctcss;?>">
319324
Squelch: <input type "text" name="squelch" style="width: 50px" value="<?php echo $squelch;?>">

0 commit comments

Comments
 (0)