diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2024-04-16 12:53:57 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2024-04-16 13:00:12 +0200 |
commit | 200ff43a0765b1f7c17c4d5db3144d860f6a9a1d (patch) | |
tree | b0bd227a51bf452ec48600a49b6d064b12a08761 | |
parent | e2ae9946ce1c7137d38fb8518a0301431c5f3936 (diff) |
dispatcher-modem-setup: update example test script with more detailsmain
-rw-r--r-- | data/dispatcher-modem-setup/0000:0000 | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/data/dispatcher-modem-setup/0000:0000 b/data/dispatcher-modem-setup/0000:0000 index 6489e9b3..2e4c67f2 100644 --- a/data/dispatcher-modem-setup/0000:0000 +++ b/data/dispatcher-modem-setup/0000:0000 @@ -2,24 +2,45 @@ # SPDX-License-Identifier: CC0-1.0 # 2024 Nero Sinaro <xu.zhang@fibocom.com> +# 2024 Google, Inc. # -# modem setup test script +# This is a test script given as reference. # -# This is the test script: -# Parameter list: vid pid device_path port_name -# device_path: Path of the device on the sys file system, it's a string -# port_name: Port name of the device enumeration, It's an array of strings +# Enabling this modem setup script may be done by renaming it with the +# exact vid:pid of the modem, and placing it in the 'modem-setup.d' +# directory: +# - User-provided modem setup scripts are expected in the package system +# configuration directory, e.g. /etc/ModemManager/modem-setup.d +# - Package-provided modem setup scripts are expected in the package library +# directory, e.g. /lib/ModemManager/modem-setup.d +# Please note that these directories may vary in your system. +# +# E.g. setting up this test script for a Fibocom L850 modem could look like: +# $ sudo cp /usr/share/ModemManager/modem-setup.available.d/0000\:0000 \ +# /etc/ModemManager/modem-setup.d/2cb7\:0007 +# +# And the output in syslog from the logger calls may look like this: +# [modem setup test] sysfs path: /sys/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.2/1-4.2.1 +# [modem setup test] port: cdc-wdm1 +# [modem setup test] port: ttyACM0 +# [modem setup test] port: ttyACM2 # -logger "[Test] ARGV:$@, ARG count:$#" +# require program name and at least 2 arguments +[ $# -lt 2 ] && exit 1 -count=1 -while [ $count -lt 10 ]; do - # will print logger to syslog - logger "[Test] (attempt #${i})" +# first argument is sysfs path +SYSFS_PATH=$1 +shift - sleep 0.5 - count=$((count + 1)) +logger "[modem setup test] sysfs path: ${SYSFS_PATH}" + +# second and next arguments are control port names +for PORT in "$@"; do + logger "[modem setup test] port: ${PORT}" done -exit $? +# now some setup being done +sleep 2 + +exit 0 |