mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-02 11:27:48 +00:00
ucentral-schema: add gps support
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
40
feeds/ucentral/ucentral-schema/files/etc/init.d/ucentral-gps
Executable file
40
feeds/ucentral/ucentral-schema/files/etc/init.d/ucentral-gps
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
gps_enable() {
|
||||
case "$(board_name)" in
|
||||
"edgecore,oap101"|\
|
||||
"edgecore,oap101e"|\
|
||||
"edgecore,oap101-6e"|\
|
||||
"edgecore,oap101e-6e")
|
||||
echo 0 > /sys/class/gpio/ble_enable/value
|
||||
echo 1 > /sys/class/gpio/gps_reset/value
|
||||
sleep 1
|
||||
echo 0 > /sys/class/gpio/gps_reset/value
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
gps_disable() {
|
||||
case "$(board_name)" in
|
||||
"edgecore,oap101"|\
|
||||
"edgecore,oap101e"|\
|
||||
"edgecore,oap101-6e"|\
|
||||
"edgecore,oap101e-6e")
|
||||
echo 1 > /sys/class/gpio/gps_reset/value
|
||||
echo 1 > /sys/class/gpio/ble_enable/value
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
start() {
|
||||
local disabled=$(uci get gps.@gps[-1].disabled)
|
||||
if [ "$disabled" -eq 1 ]; then
|
||||
gps_disable
|
||||
else
|
||||
gps_enable
|
||||
fi
|
||||
}
|
||||
17
feeds/ucentral/ucentral-schema/files/etc/uci-defaults/99-ucentral-gps
Executable file
17
feeds/ucentral/ucentral-schema/files/etc/uci-defaults/99-ucentral-gps
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
case "$(board_name)" in
|
||||
"edgecore,oap101"|\
|
||||
"edgecore,oap101e"|\
|
||||
"edgecore,oap101-6e"|\
|
||||
"edgecore,oap101e-6e")
|
||||
uci set gps.@gps[-1].tty='ttyMSM1'
|
||||
uci set gps.@gps[-1].adjust_time=0
|
||||
uci set gps.@gps[-1].disabled=0
|
||||
uci set gps.@gps[-1].baudrate=115200
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user