Fix the bug that dectmngr fails to start at the first attempt

Wait for the target up and running before starting dectmngr. Otherwise HELLO_REPLY
cannot be received and dectmngr exits and is started again by procd.
This commit is contained in:
Yalu Zhang 2021-12-23 10:58:42 +01:00
parent 55f1310daa
commit 2f8a76e34d

View file

@ -31,6 +31,8 @@ start_service() {
test $(db get hw.board.hasDect) = "0" && return
echo 1 > /sys/class/gpio/gpio14/value
# wait for the target starts up
sleep 2
rfpi=$(db -q get hw.board.dect_rfpi)
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
@ -43,7 +45,7 @@ start_service() {
opt_ext="$opt_ext -model $model_id"
rxtun=$(db -q get hw.board.dect_rxtun)
[ -n "$rxtun" -a ${#rxtun} -eq 2 ] && opt_ext="$opt_ext -rxtun $rxtun"
[ -n "$rxtun" -a ${#rxtun} -eq 2 ] && opt_ext="$opt_ext -rxtun $rxtun"
config_load dect
config_get log_dect_cmbs global log_dect_cmbs syslog