Skip to content

Commit 320c185

Browse files
committed
applications: serial_lte_modem: Add serial parameter for script
Add parameter for defining serial port and baud rate for PPP start up script. Signed-off-by: Seppo Takalo <[email protected]>
1 parent 196691d commit 320c185

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

applications/serial_lte_modem/scripts/slm_start_ppp.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ BAUD=115200
1414
PPP_CMUX=/dev/gsmtty2
1515
AT_CMUX=/dev/gsmtty1
1616
CHATOPT="-vs"
17+
TIMEOUT=60
18+
19+
# Parse command line parameters
20+
while getopts s:b:t:h flag
21+
do
22+
case "${flag}" in
23+
s) MODEM=${OPTARG};;
24+
b) BAUD=${OPTARG};;
25+
t) TIMEOUT=${OPTARG};;
26+
h|?) echo "Usage: $0 [-s serial_port] [-b baud_rate] [-t timeout]"; exit 0;;
27+
esac
28+
done
1729

1830
cleanup() {
1931
set +eu
@@ -42,7 +54,7 @@ stty -F $AT_CMUX clocal
4254

4355
echo "Connect and wait for PPP link..."
4456
test -c $AT_CMUX
45-
chat $CHATOPT -t60 "" "AT+CFUN=1" "OK" "\c" "#XPPP: 1,0" >$AT_CMUX <$AT_CMUX
57+
chat $CHATOPT -t$TIMEOUT "" "AT+CFUN=1" "OK" "\c" "#XPPP: 1,0" >$AT_CMUX <$AT_CMUX
4658

4759
pppd $PPP_CMUX noauth novj nodeflate nobsdcomp debug noipdefault passive +ipv6 \
4860
noremoteip local linkname nrf91 defaultroute defaultroute-metric -1

applications/serial_lte_modem/scripts/slm_stop_ppp.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
# using Serial LTE Modem
1010
#
1111

12-
MODEM=/dev/ttyACM0
13-
BAUD=115200
14-
PPP_CMUX=/dev/gsmtty2
1512
AT_CMUX=/dev/gsmtty1
1613
CHATOPT="-vs"
1714

0 commit comments

Comments
 (0)