Allows exploration of the 1-Wire network attached to the SNAP.
This servlet allows you to drill down from the adapters, through
the devices, and into the internal memory of each device.
This servlet can be configured to provide alternative information
for each family code by specifying an "include" servlet in the list
of initialization parameters. For example, here is a possible
snippet for a servlets.props file:
[Very important NOTE: JDK 1.1, and therefore SNAP,
does not support continuation lines with the '\' character. Thus,
make sure you put the initParams on one line. The
use of this in the following example is just for illustration.]
#
# Useful servlet that can explore all aspects of a 1-Wire system
#
OneWireServlet.mapping=/servlet/OneWireServlet
OneWireServlet.class=com.qindesign.servlet.example.OneWireServlet
OneWireServlet.initParams=familyCode10=TemperatureInclude,\
familyCode21=TemperatureInclude,\
familyCode05=SwitchInclude,\
familyCode12=SwitchInclude,\
familyCode1f=SwitchInclude
#
# Family code includes for use by OneWireServlet
#
TemperatureInclude.mapping=
TemperatureInclude.class=com.qindesign.servlet.example.TemperatureInclude
SwitchInclude.mapping=
SwitchInclude.class=com.qindesign.servlet.example.SwitchInclude
Note the use of two additional servlets, one for temperature
and one for switches. You can write your own family code servlets
simply by adding yours to the initialization parameters of this
servlet. Specify
familyCodeXX=<servlet name> .
There are two request attributes that will be passed to
these servlets. These are container and
queryString . The container attribute
will contain an instance of the specific container class appropriate
for the family code, and queryString will contain the
exact query string necessary to append to the request for access to
the included servlet.
In addition, there is a base OneWireSensorInclude
class that provides checking for a valid request, and also prints
a small header summarizing the name and address of the device.
The TemperatureInclude and SwitchInclude
servlets extend this class.
Please consult the source code for additional information.
|