1 -- Copyright 2008 Yanira <forum-2008@email.de>
2 -- Copyright 2012 Jo-Philipp Wich <jow@openwrt.org>
3 -- Licensed to the public under the Apache License 2.0.
5 local uci = luci.model.uci.cursor_state()
6 local net = require "luci.model.network"
9 m = Map("p910nd", translate("p910nd - Printer server"),
10 translatef("First you have to install the packages to get support for USB (kmod-usb-printer) or parallel port (kmod-lp)."))
14 s = m:section(TypedSection, "p910nd", translate("Settings"))
18 s:option(Flag, "enabled", translate("enable"))
20 s:option(Value, "device", translate("Device")).rmempty = true
22 b = s:option(Value, "bind", translate("Interface"), translate("Specifies the interface to listen on."))
23 b.template = "cbi/network_netlist"
27 function b.cfgvalue(...)
28 local v = Value.cfgvalue(...)
30 return (net:get_status_by_address(v))
34 function b.write(self, section, value)
35 local n = net:get_network(value)
36 if n and n:ipaddr() then
37 Value.write(self, section, n:ipaddr())
41 p = s:option(ListValue, "port", translate("Port"), translate("TCP listener port."))
47 s:option(Flag, "bidirectional", translate("Bidirectional mode"))