ntnu-b2xx: Added some services. (force_10mbit, rtc, rtklib, vsp_pair)

This commit is contained in:
Kristian Klausen 2015-11-13 15:15:13 +01:00
parent 87b021ab77
commit b534d4d992
5 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,9 @@
start()
{
ethtool -s eth0 speed 10 duplex full autoneg off
}
stop()
{
ethtool -s eth0 autoneg on
}

View File

@ -0,0 +1,10 @@
start()
{
echo ds3231 0x68 >/sys/bus/i2c/devices/i2c-2/new_device
hwclock -f /dev/rtc1 -s
}
stop()
{
echo "no stop-operation for rtc"
}

View File

@ -0,0 +1,27 @@
start()
{
rtkrcv -s -o /etc/rtklib/conf/rtkrcv.conf < /dev/null > /dev/null 2>&1 &
}
stop()
{
while [ 1 ]; do
echo "* Stopping process..."
killall rtkrcv > /dev/null 2>&1
for r in 0 1 2 3 4 5 6 7 8 9; do
if [ -n "$(pidof rtkrcv)" ]; then
echo "* Waiting for process to exit ($r)..."
sleep 1
else
echo "* Process not running."
return 1
fi
done
echo "* Forcing exit..."
killall -9 rtkrcv > /dev/null 2>&1
sleep 1
done
}

View File

@ -0,0 +1,27 @@
start()
{
str2str -in serial://uart/2:9600:8:n:1:off -c /etc/rtklib/data/ubx_raw_10hz.cmd -out tcpsvr://:50022 < /dev/null > /dev/null 2>&1 &
}
stop()
{
while [ 1 ]; do
echo "* Stopping process..."
killall str2str > /dev/null 2>&1
for r in 0 1 2 3 4 5 6 7 8 9; do
if [ -n "$(pidof str2str)" ]; then
echo "* Waiting for process to exit ($r)..."
sleep 1
else
echo "* Process not running."
return 1
fi
done
echo "* Forcing exit..."
killall -9 str2str > /dev/null 2>&1
sleep 1
done
}

View File

@ -0,0 +1,27 @@
start()
{
socat -d -d pty,raw,echo=0,link=/tmp/ttyV0 pty,raw,echo=0,link=/tmp/ttyV1 < /dev/null > /dev/null &
}
stop()
{
while [ 1 ]; do
echo "* Stopping process..."
killall socat > /dev/null 2>&1
for r in 0 1 2 3 4 5 6 7 8 9; do
if [ -n "$(pidof socat)" ]; then
echo "* Waiting for process to exit ($r)..."
sleep 1
else
echo "* Process not running."
return 1
fi
done
echo "* Forcing exit..."
killall -9 socat > /dev/null 2>&1
sleep 1
done
}