p910nd: add mdns support
authorPhilipp Kerling <redacted>
Wed, 7 Jun 2017 07:51:51 +0000 (09:51 +0200)
committerPhilipp Kerling <redacted>
Mon, 15 Apr 2019 21:19:39 +0000 (23:19 +0200)
Signed-off-by: Philipp Kerling <redacted>
net/p910nd/Makefile
net/p910nd/files/p910nd.config
net/p910nd/files/p910nd.init

index 806748aec8a39f08c1baf3fa97b5e7c4c6cef635..12b4e86374d7e34f20db839ffed9eb0f8ebc5f46 100644 (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
index d5090359b6b82c82bba474252fab6e703aec26cd..b8257b77c9b8d77066c745c9a8e97bd345dfa839 100644 (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      ''
index 57e4c5209480781ac5b607d5b76c93b18bbd7d4c..479b8410feda4e95d9a9269a32bb60353f53f835 100644 (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
 }
git clone https://git.99rst.org/PROJECT