|
1-Wire Weather Service for Java -- Server API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.TimerTask
wxservice.sensor.task.WSI603A.ReadTask
private abstract class WSI603A.ReadTask
Base class for WSI603A read tasks.
Field Summary | |
---|---|
protected int |
CHECKSUM_INDEX
Response buffer checksum index. |
protected int |
COMMAND_ADDRESS
Command buffer address. |
protected int |
COMMAND_INDEX
Response buffer command index. |
protected int |
LIGHT_INTENSITY_INDEX
Response buffer light intensity index. |
protected int |
LIGHT_STATUS_INDEX
Response buffer light status index. |
private boolean |
m_initialize
Flag to initialize sensor. |
protected java.lang.String |
m_taskName
Task name. |
protected int |
RESPONSE_ADDRESS
Response buffer address. |
protected int |
RESPONSE_LENGTH
Response buffer length. |
protected java.lang.String |
TIMEOUT_ERROR
Message format for timeout errors. |
protected java.lang.String |
VALIDATION_ERROR
Message format for validation errors. |
protected int |
VOLTAGE_INDEX
Response buffer voltage index. |
protected int |
WIND_DIRECTION_INDEX
Response buffer wind direction index. |
protected int |
WIND_SPEED_INDEX
Response buffer wind speed index. |
Constructor Summary | |
---|---|
WSI603A.ReadTask(java.lang.String taskName)
Constructs a new instance of Read Task. |
Method Summary | |
---|---|
protected void |
checksum(byte[] data,
int length,
byte checksum)
Performs a checksum on received data. |
protected void |
executeCommand(byte[] command)
Executes a command and spins in a loop waiting for it to complete. |
protected abstract java.lang.Number |
getData()
Gets implementation specific data from the sensor task. |
protected void |
initContainer()
Initializes the container instance. |
protected void |
initDevice()
Initializes the sensor for operation. |
protected byte[] |
readResponseBuffer()
Reads the response buffer, performs checksum for validation. |
void |
run()
Timer task process. |
protected void |
writeCommand(byte[] command)
Writes a command to the device and reads it back for validation. |
Methods inherited from class java.util.TimerTask |
---|
cancel, scheduledExecutionTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.String VALIDATION_ERROR
protected final java.lang.String TIMEOUT_ERROR
protected final int COMMAND_ADDRESS
protected final int RESPONSE_ADDRESS
protected final int RESPONSE_LENGTH
protected final int COMMAND_INDEX
protected final int WIND_SPEED_INDEX
protected final int WIND_DIRECTION_INDEX
protected final int LIGHT_STATUS_INDEX
protected final int LIGHT_INTENSITY_INDEX
protected final int VOLTAGE_INDEX
protected final int CHECKSUM_INDEX
protected java.lang.String m_taskName
private boolean m_initialize
Constructor Detail |
---|
WSI603A.ReadTask(java.lang.String taskName)
taskName
- to identify this task when posting data.Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.util.TimerTask
protected void initDevice() throws com.dalsemi.onewire.OneWireException, ServiceException
com.dalsemi.onewire.OneWireException
- if 1-Wire communication fails.
ServiceException
- if initialization fails.protected void initContainer() throws com.dalsemi.onewire.OneWireException, ServiceException
com.dalsemi.onewire.OneWireException
- if 1-Wire communication fails.
ServiceException
- if initialization fails.protected void executeCommand(byte[] command) throws com.dalsemi.onewire.OneWireException, ServiceException
command
- to execute.
com.dalsemi.onewire.OneWireException
- if 1-Wire communication fails.
ServiceException
- if validation fails.protected void writeCommand(byte[] command) throws com.dalsemi.onewire.OneWireException, ServiceException
command
- the command to write.
com.dalsemi.onewire.OneWireException
- if 1-Wire communication fails.
ServiceException
- if validation fails.protected byte[] readResponseBuffer() throws com.dalsemi.onewire.OneWireException, ServiceException
com.dalsemi.onewire.OneWireException
- if 1-Wire communication fails.
ServiceException
- if validation fails.protected void checksum(byte[] data, int length, byte checksum) throws ServiceException
data
- to check, including the checksum.length
- of the datachecksum
- value the data sum should equal.
ServiceException
- if validation fails.protected abstract java.lang.Number getData() throws com.dalsemi.onewire.OneWireException, ServiceException
com.dalsemi.onewire.OneWireException
- if 1-Wire communication fails.
ServiceException
- if validation fails.
|
Copyright © 2005-2009 Karl Uppiano | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |