⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ofindhsx

📁 udev是一种工具
💻
字号:
#!/bin/bash## Sample Script to find out the ttyHSO to functional matching# search_device# search for all Option USB WWAN modem and# return the full path of the base device# input parameter:#   none# return:#   in RETVAL the result#   0 on susscess#   1 on errorfunction search_device() {    local ROOT="/sys/bus/usb/devices"    local VENDOR="0af0"    RETVAL=""    for DIR in $( ls ${ROOT} ); do	if [ -L "${ROOT}/${DIR}" ]; then	    if [ -f "${ROOT}/${DIR}/idVendor" ]; then		IDVENDOR=$( cat "${ROOT}/${DIR}/idVendor" )		if [ "${IDVENDOR}" = "${VENDOR}" ]; then		    RETVAL="${RETVAL} ${ROOT}/${DIR}"		fi	    fi	fi    done    if [ -z "${RETVAL}" ]; then	return 1    fi    return 0}search_devicefor dev in  ${RETVAL}; do    cd ${dev}    DEVID=0x$( cat idProduct )    echo "Found Option Device with DeviceID = ${DEVID}"    for ttytype in $( find . -name hsotype ); do	HSOTYPE=$( cat ${ttytype} )	TTYHSO=/dev/$( echo ${ttytype} | sed -e "s/.*\/\(ttyHS[0-9]\+\)\/hsotype/\1/" )	echo "${TTYHSO} is ${HSOTYPE}"    donedone

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -