-
Notifications
You must be signed in to change notification settings - Fork 1
/
kissclient
54 lines (51 loc) · 1.25 KB
/
kissclient
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
### BEGIN INIT INFO
# Provides: kiss
# Required-Start: bluetooth prosody
# Required-Stop: bluetooth prosody
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: AX.25 Startup Daemon
# Description: This daemon starts initializing AX.25 port and starts the
# AX.25 Daemon Server
### END INIT INFO
case $1 in
start)
#Attach USB device USB0 as KISS AX.25 Port 1
if [ -c /dev/ttyUSB0 ]
then
/usr/sbin/kissattach -m 231 /dev/ttyUSB0 1
echo "Starting AX.25 Port on port USB0"
elif [ -c /dev/ttyACM0 ]
then
/usr/sbin/kissattach -m 231 /dev/ttyACM0 1
echo "Starting AX.25 Port on port ACM0"
else
echo "Cannot start AX.25 port"
exit 1
fi
sleep 1
#Set KISS mode to NO CRC
/usr/sbin/kissparms -p 1 -c 1
sleep 1
#Set AX25 Parameter
echo 1 > /proc/sys/net/ax25/ax0/standard_window_size
echo 231 > /proc/sys/net/ax25/ax0/maximum_packet_length
echo 5000 > /proc/sys/net/ax25/ax0/t1_timeout
echo 3000 > /proc/sys/net/ax25/ax0/t2_timeout
echo 30000 > /proc/sys/net/ax25/ax0/t3_timeout
sleep 1
;;
stop)
echo "Stopping KISS"
killall kissattach
;;
restart)
$0 stop && sleep 2 && $0 start
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 2
;;
esac
exit 0