local CMD
local CLS
local DES
+ local DRV
local CID
local CMT
local SN
+ local VER
# Build array of /dev/usb/lpX character devices already configured
[ $DEBUG ] && echo i:"$i"
case $i in
- MFG:* | MANUFACTURER:* )
+ MFG:* | MANUFACTURER:* | MFR:* )
MFG=${i##*:};;
MDL:* | MODEL:* )
MDL=${i##*:};;
CMD=${i##*:};;
CLS:* )
CLS=${i##*:};;
- DES:* )
+ DES:* | DESCRIPTION:* )
DES=${i##*:};;
+ DRV:* )
+ DRV=${i##*:};;
CID:* | COMPATIBLEID:* )
CID=${i##*:};;
COMMENT:* )
CMT=${i##*:};;
- SN:* )
+ SN:* | SERIALNUMBER:* | SERN:* )
SN=${i##*:};;
+ VER:* )
+ VER=${i##*:};;
esac
[ -n "$SN" ] || SN=$iSerialNumber
[ -z "$(eval "$uqgddu_cmd".mdns_cid)" ] && [ -n "$CID" ] && eval "$uqsddu_cmd.mdns_cid='$CID'"
[ -z "$(eval "$uqgddu_cmd".mdns_cls)" ] && [ -n "$CLS" ] && eval "$uqsddu_cmd.mdns_cls='$CLS'"
[ -z "$(eval "$uqgddu_cmd".mdns_cmt)" ] && [ -n "$CMT" ] && eval "$uqsddu_cmd.mdns_cmt='$CMT'"
+ [ -z "$(eval "$uqgddu_cmd".mdns_drv)" ] && [ -n "$DRV" ] && eval "$uqsddu_cmd.mdns_drv='$DRV'"
[ -z "$(eval "$uqgddu_cmd".mdns_sn)" ] && [ -n "$SN" ] && eval "$uqsddu_cmd.mdns_sn='$SN'"
+ [ -z "$(eval "$uqgddu_cmd".mdns_ver)" ] && [ -n "$VER" ] && eval "$uqsddu_cmd.mdns_ver='$VER'"
# No previously configured device? Configure this instance. Set CHAR_DEV so we can send driver.
[ $UCI_DEV_CFG_NUMBER -eq -1 ] && eval "$uqsddu_cmd.device=/dev/'$DEVNAME'" && CHAR_DEV=/dev/"$DEVNAME"
config_get mdns_mfg "$section" mdns_mfg
config_get mdns_mdl "$section" mdns_mdl
config_get mdns_cmd "$section" mdns_cmd
+ # Optional parameters
+ config_get mdns_cid "$section" mdns_cid
+ config_get mdns_cls "$section" mdns_cls
+ config_get mdns_cmt "$section" mdns_cmt
+ config_get mdns_des "$section" mdns_des
+ config_get mdns_drv "$section" mdns_drv
+ config_get mdns_sn "$section" mdns_sn
+ config_get mdns_ver "$section" mdns_ver
# Set initial arguments
set -- "pdl-datastream" "tcp" "$((port+9100))"
[ -n "$mdns_mfg" ] && set -- "$@" "usb_MFG=$mdns_mfg"
[ -n "$mdns_mdl" ] && set -- "$@" "usb_MDL=$mdns_mdl"
[ -n "$mdns_cmd" ] && set -- "$@" "usb_CMD=$mdns_cmd"
+ # Optional parameters
+ [ -n "$mdns_cid" ] && set -- "$@" "usb_CID=$mdns_cid"
+ [ -n "$mdns_cls" ] && set -- "$@" "usb_CLS=$mdns_cls"
+ [ -n "$mdns_cmt" ] && set -- "$@" "usb_CMT=$mdns_cmt"
+ [ -n "$mdns_des" ] && set -- "$@" "usb_DES=$mdns_des"
+ [ -n "$mdns_drv" ] && set -- "$@" "usb_DRV=$mdns_drv"
+ [ -n "$mdns_sn" ] && set -- "$@" "usb_SN=$mdns_sn"
+ [ -n "$mdns_ver" ] && set -- "$@" "usb_VER=$mdns_ver"
# Call procd_add_mdns with the positional parameters
procd_add_mdns "$@"