PnP - Corrected multiple issues preventing the IC-705 from going through multiple un-plug and plug-in events: 1) Replaced add event with systemd rigcltd start; 2) Fixed incorrect wrapper script call to the GPS add rule; 3) Replaced the remove event script the rigctld wrapper' 4) Implemented the remove function in the rigctld wrapper

This commit is contained in:
Gaston Gonzalez
2024-10-10 07:10:46 -07:00
parent 88b003d01a
commit 66051d6661
2 changed files with 16 additions and 5 deletions
+9 -4
View File
@@ -10,6 +10,7 @@
# 1. /dev/et-cat created # 1. /dev/et-cat created
# 2. /dev/et-gps created # 2. /dev/et-gps created
# 3. rigctld is started # 3. rigctld is started
# 4. gpsd is started
# #
# Resources # Resources
# - https://www.florian-wolters.de/posts/ic705-serial-device-symlinks/ # - https://www.florian-wolters.de/posts/ic705-serial-device-symlinks/
@@ -23,15 +24,19 @@ KERNEL=="ttyACM[0-9]*", SUBSYSTEM=="tty", ATTRS{product}=="IC-705", \
ENV{ET_DEVICE}=="IC-705", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="00", \ ENV{ET_DEVICE}=="IC-705", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="00", \
ACTION=="add", \ ACTION=="add", \
ENV{ET_SUBDEVICE}="CAT", GROUP="dialout", MODE="0660", SYMLINK+="et-cat", \ ENV{ET_SUBDEVICE}="CAT", GROUP="dialout", MODE="0660", SYMLINK+="et-cat", \
RUN+="/opt/emcomm-tools/sbin/wrapper-rigtctld.sh start" RUN+="/usr/bin/systemctl start rigctld"
# Create consistent device name/path for the GPS serial device # Create consistent device name/path for the GPS serial device
ENV{ET_DEVICE}=="IC-705", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="02", \ ENV{ET_DEVICE}=="IC-705", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="02", \
ACTION=="add", \ ACTION=="add", \
ENV{ET_SUBDEVICE}="GPS", GROUP="dialout", MODE="0660", SYMLINK+="et-gps", \ ENV{ET_SUBDEVICE}="GPS", GROUP="dialout", MODE="0660", SYMLINK+="et-gps", \
RUN+="/usr/bin/systemctl start rigctld" RUN+="/opt/emcomm-tools/sbin/wrapper-gpsd.sh start"
# TODO make more specific # TODO: Make this rule more specific
SUBSYSTEM=="tty", ACTION=="remove", RUN+="/usr/bin/systemctl stop rigctld" #
# If we do not stop rigctld, the rigctl progress will continue to run and maintain
# a stale reference to /dev/et-cat. This condition will prevent subsequent attach
# and detatch events of the radio from working.
SUBSYSTEM=="tty", ACTION=="remove", RUN+="/opt/emcomm-tools/sbin/wrapper-rigctld.sh stop"
# TODO: Add rules for sound card # TODO: Add rules for sound card
@@ -58,7 +58,13 @@ start() {
} }
stop() { stop() {
et-log "Not implemented yet" et-log "Stopping rigctld service..."
systemctl stop rigctld
if [ -L /dev/et-cat ]; then
et-log "Removing stale /dev/et-cat symlink"
rm -f /dev/et-cat
fi
} }
usage() { usage() {