Merge pull request from cronyx/master

rewrite config read, added guard_interval and ldpc
pull/269/head
Igor Zalatov 2022-07-19 23:30:07 +03:00 committed by GitHub
commit 5abb03e194
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 19 deletions
general/package/wifibroadcast/files

View File

@ -3,19 +3,9 @@
# Start wifibroadcast # Start wifibroadcast
# #
config="/etc/wfb.conf" . /etc/wfb.conf
keydir="/etc"
wlan=`cat ${config} | grep wlan | cut -f 2 -d '='` keydir="/etc"
region=`cat ${config} | grep region | cut -f 2 -d '='`
channel=`cat ${config} | grep channel | cut -f 2 -d '='`
bandwidth=`cat ${config} | grep bandwidth | cut -f 2 -d '='`
stbc=`cat ${config} | grep stbc | cut -f 2 -d '='`
mcs_index=`cat ${config} | grep mcs_index | cut -f 2 -d '='`
udp_port=`cat ${config} | grep udp_port | cut -f 2 -d '='`
radio_port=`cat ${config} | grep radio_port | cut -f 2 -d '='`
rs_k=`cat ${config} | grep rs_k | cut -f 2 -d '='`
rs_n=`cat ${config} | grep rs_n | cut -f 2 -d '='`
load_rtl() { load_rtl() {
modprobe cfg80211 modprobe cfg80211
@ -31,10 +21,10 @@ load_ath() {
load_interface() { load_interface() {
if cat ${config} | grep "rtl" > /dev/null 2>&1; then if [ ${driver} = "rtl" ]; then
ifconfig ${wlan} up ifconfig ${wlan} up
iwconfig ${wlan} mode monitor iwconfig ${wlan} mode monitor
elif cat ${config} | grep "ath" > /dev/null 2>&1; then elif [ ${driver} = "ath" ]; then
iwconfig ${wlan} mode monitor iwconfig ${wlan} mode monitor
ifconfig ${wlan} up ifconfig ${wlan} up
fi fi
@ -44,20 +34,20 @@ load_interface() {
} }
start_wfb() { start_wfb() {
wfb_tx -p ${radio_port} -u ${udp_port} -K ${keydir}/drone.key -B ${bandwidth} -M ${mcs_index} -S ${stbc} -k ${rs_k} -n ${rs_n} ${wlan} & wfb_tx -p ${radio_port} -u ${udp_port} -K ${keydir}/drone.key -B ${bandwidth} -M ${mcs_index} -S ${stbc} -L ${ldpc} -G ${guard_interval} -k ${rs_k} -n ${rs_n} ${wlan} &
} }
case "$1" in case "$1" in
start) start)
if grep -q daemon=1 ${config}; then if [ ${daemon} -eq 1 ]; then
echo "Loading modules for selected driver..." echo "Loading modules for selected driver..."
if cat ${config} | grep "rtl"; then if [ ${driver} = "rtl" ]; then
if ! lsmod | grep "88XXau"; then if ! lsmod | grep "88XXau"; then
load_rtl load_rtl
fi fi
elif cat ${config} | grep "ath"; then elif ${driver} = "ath" ]; then
if ! lsmod | grep "ath9k_htc"; then if ! lsmod | grep "ath9k_htc"; then
load_ath load_ath
fi fi

View File

@ -4,9 +4,11 @@ wlan=wlan0
region=BO region=BO
channel=14 channel=14
bandwidth=20 bandwidth=20
stbc=1 stbc=0
ldpc=0
mcs_index=1 mcs_index=1
radio_port=3 radio_port=3
udp_port=5600 udp_port=5600
rs_k=8 rs_k=8
rs_n=12 rs_n=12
guard_interval=long