From b9612a83548225d32b6e043571e98ac43cc17a16 Mon Sep 17 00:00:00 2001 From: Philipp Kerling Date: Wed, 7 Jun 2017 09:51:51 +0200 Subject: [PATCH] p910nd: add mdns support Signed-off-by: Philipp Kerling --- net/p910nd/Makefile | 2 +- net/p910nd/files/p910nd.config | 19 +++++++++++++++++++ net/p910nd/files/p910nd.init | 10 ++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/net/p910nd/Makefile b/net/p910nd/Makefile index 806748aec..12b4e8637 100644 --- a/net/p910nd/Makefile +++ b/net/p910nd/Makefile @@ -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 diff --git a/net/p910nd/files/p910nd.config b/net/p910nd/files/p910nd.config index d5090359b..b8257b77c 100644 --- a/net/p910nd/files/p910nd.config +++ b/net/p910nd/files/p910nd.config @@ -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 '' diff --git a/net/p910nd/files/p910nd.init b/net/p910nd/files/p910nd.init index 57e4c5209..479b8410f 100644 --- a/net/p910nd/files/p910nd.init +++ b/net/p910nd/files/p910nd.init @@ -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 }