jmavsim_run.sh: add -i to specify the IP

This commit is contained in:
Beat Küng
2017-03-10 09:00:24 +01:00
committed by Lorenz Meier
parent 62200e2a81
commit 541e53fdcf
+6 -2
View File
@@ -7,7 +7,8 @@ udp_port=14560
extra_args= extra_args=
baudrate=921600 baudrate=921600
device= device=
while getopts ":b:d:p:qr:" opt; do ip="127.0.0.1"
while getopts ":b:d:p:qr:i:" opt; do
case $opt in case $opt in
b) b)
baudrate=$OPTARG baudrate=$OPTARG
@@ -15,6 +16,9 @@ while getopts ":b:d:p:qr:" opt; do
d) d)
device="$OPTARG" device="$OPTARG"
;; ;;
i)
ip="$OPTARG"
;;
p) p)
udp_port=$OPTARG udp_port=$OPTARG
;; ;;
@@ -32,7 +36,7 @@ while getopts ":b:d:p:qr:" opt; do
done done
if [ "$device" == "" ]; then if [ "$device" == "" ]; then
device="-udp 127.0.0.1:$udp_port" device="-udp $ip:$udp_port"
else else
device="-serial $device $baudrate" device="-serial $device $baudrate"
fi fi