PnP - Refactored the PnP implementation to handle the DigiRig Mobile no CAT control use case. Currently, the best workaround for the moment is to restore the JS8Call INI configuration on every startup using a template file. This will wipe out user settings on every start-up, but it is stable for now. I have a couple of long term solutions to preserve the user's settings.

This commit is contained in:
Gaston Gonzalez
2024-10-25 14:10:54 -07:00
parent be41c4aaa7
commit c9743be323
5 changed files with 77 additions and 7 deletions
+19 -2
View File
@@ -6,10 +6,12 @@
# Purpose : Wrapper script for starting JS8Call with PnP support
#
# Preconditions
# 1. Support radio and audio interface are connected and properly detected
# 1. Supported radio and audio interface are connected and properly detected
#
# Postconditions
# 1. JS8Call is started with audio settings updated
# 1. JS8Call audio settings updated
# 2. JS8Call rig settings updated
# 3. JS8Call started
usage() {
echo "usage: $(basename $0) <command>"
@@ -36,6 +38,20 @@ start() {
update-config () {
JS8CALL_CONF_FILE="${HOME}/.config/JS8Call.ini"
JS8CALL_TEMPLATE_CONF_FILE=${ET_HOME}/conf/template.d/js8call/JS8Call.rigctl.ini
# Special case for the DigiRig Mobile when connected to a radio that does
# not support CAT control.
if [ -L "${ET_HOME}/conf/radios.d/active-radio.json" ]; then
RIG_ID=$(cat "${ET_HOME}/conf/radios.d/active-radio.json" | jq -r .rigctrl.id)
if [ "${RIG_ID}" = "6" ]; then
JS8CALL_TEMPLATE_CONF_FILE=${ET_HOME}/conf/template.d/js8call/JS8Call.no-rigctl.ini
fi
fi
cp ${JS8CALL_TEMPLATE_CONF_FILE} ${JS8CALL_CONF_FILE}
et-log "Replaced JS8Call configuration with template: ${JS8CALL_TEMPLATE_CONF_FILE}"
# 1. Check if the symlink was created by the udev rules
if [ -e /dev/et-audio ]; then
@@ -75,6 +91,7 @@ update-config () {
notify_user "Can't start JS8Call. No supported audio device plugged in."
exit 1
fi
}
case $1 in