p910nd: add mdns support

Signed-off-by: Philipp Kerling <pkerling@casix.org>
This commit is contained in:
Philipp Kerling 2017-06-07 09:51:51 +02:00
parent d2049b6333
commit b9612a8354
3 changed files with 30 additions and 1 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=p910nd
PKG_VERSION:=0.97
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/p910nd

View File

@ -1,5 +1,24 @@
config p910nd
option device /dev/usb/lp0
# Actual TCP port is 9100 plus this value
# Valid values are 0,1,2
option port 0
option bidirectional 1
option enabled 0
# mDNS support - see Bonjour Printing Specification for details concerning the values
# Be aware that you can only advertise one printer on this host via mDNS
# Set to 1 to enable
option mdns 0
# Human-readable printer make and model
option mdns_ty 'My Printer Manufacturer/Model'
# Human-readable location
option mdns_note 'Basement'
# Post-Script product string, including parenthesis
option mdns_product ''
# IEEE-1284 Device ID MANUFACTURER/MFG string
option mdns_mfg ''
# IEEE-1284 Device ID MODEL/MDL string
option mdns_mdl ''
# IEEE-1284 Device ID COMMAND SET/CMD string
option mdns_cmd ''

View File

@ -41,6 +41,16 @@ start_p910nd() {
procd_open_instance $name
procd_set_param command /usr/sbin/p910nd $args
procd_set_param respawn
config_get_bool "mdns" "$section" "mdns" '0'
config_get mdns_note "$section" mdns_note
config_get mdns_ty "$section" mdns_ty
config_get mdns_product "$section" mdns_product
config_get mdns_mfg "$section" mdns_mfg
config_get mdns_mdl "$section" mdns_mdl
config_get mdns_cmd "$section" mdns_cmd
[ "$mdns" -gt 0 ] && procd_add_mdns "pdl-datastream" "tcp" "$((port+9100))" "note=$mdns_note" "ty=$mdns_ty" "product=$mdns_product" "usb_MFG=$mdns_mfg" "usb_MDL=$mdns_mdl" "usb_CMD=$mdns_cmd"
procd_close_instance
fi
}