Skip to content

Commit

Permalink
interfaces: optionally allow to set txpower
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Aug 1, 2016
1 parent 4e662fe commit 3da906b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/etc/inc/interfaces.inc
Expand Up @@ -2293,10 +2293,6 @@ function interface_wireless_configure($if, &$wl, &$wlcfg)
$wlcmd[] = "-mediaopt turbo";
}

/* handle txpower setting */
/* if($wlcfg['txpower'] <> "")
$wlcmd[] = "txpower " . escapeshellarg($wlcfg['txpower']);
*/
/* handle wme option */
if (isset($wlcfg['wme']['enable'])) {
$wlcmd[] = "wme";
Expand Down Expand Up @@ -2579,6 +2575,10 @@ EOD;
mwexec("/sbin/ifconfig " . escapeshellarg($if) . " " . $wlcmd_args, false);
unset($wlcmd_args, $wlcmd);

/* configure txpower setting (it has been known to fail so run it separately) */
if (!empty($wlcfg['txpower'])) {
mwexecf('/sbin/ifconfig %s txpower %s', array($if, $wlcfg['txpower']));
}

sleep(1);
/* execute hostapd and wpa_supplicant if required in shell */
Expand Down
3 changes: 2 additions & 1 deletion src/www/interfaces.php
Expand Up @@ -2792,9 +2792,10 @@ function toggle_allcfg() {
<td><a id="help_for_txpower" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Transmit power"); ?></td>
<td>
<select name="txpower" class="selectpicker" data-size="10" data-style="btn-default" id="txpower">
<option value=""><?= gettext('default') ?></option>
<?php
for($x = 99; $x > 0; $x--):?>
<option value="<?=$x;?>" <?=$pconfig["txpower"] == $x ? "selected=\"selected\"" : "";?> ><?=$x;?></option>
<option value="<?=$x;?>" <?=$pconfig['txpower'] == $x ? 'selected="selected"' : '';?>><?=$x;?></option>
<?php
endfor;?>
</select>
Expand Down

0 comments on commit 3da906b

Please sign in to comment.