|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.onewire.container.OneWireContainer | +--com.dalsemi.onewire.container.OneWireContainer10
iButton container for iButton family type 10 (hex). This family type is a 'temperature' iButton (DS1920 (can) DS1820 (plastic)).
Field Summary | |
static double |
RESOLUTION_MAXIMUM
Useful constant for resolution of temperature reading. |
static double |
RESOLUTION_NORMAL
Useful constant for resolution of temperature reading. |
Fields inherited from interface com.dalsemi.onewire.container.TemperatureContainer |
ALARM_HIGH, ALARM_LOW |
Constructor Summary | |
OneWireContainer10()
Constructor OneWireContainer10 |
|
OneWireContainer10(DSPortAdapter sourceAdapter,
byte[] newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
|
OneWireContainer10(DSPortAdapter sourceAdapter,
long newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
|
OneWireContainer10(DSPortAdapter sourceAdapter,
java.lang.String newAddress)
Create a container with a provided adapter object and the address of the iButton or 1-Wire device. |
Method Summary | |
static double |
convertToCelsius(double fahrenheitTemperature)
Convert a temperature from Fahrenheit to Celsius. |
static double |
convertToFahrenheit(double celsiusTemperature)
Convert a temperature from Celsius to Fahrenheit. |
void |
doTemperatureConvert(byte[] state)
Perform an temperature conversion. |
java.lang.String |
getAlternateNames()
Retrieve the alternate Dallas Semiconductor part numbers or names. |
java.lang.String |
getDescription()
Retrieve a short description of the function of the iButton type. |
double |
getMaxTemperature()
Query to get the maximum temperature in degrees C. |
double |
getMinTemperature()
Query to get the minimum temperature in degrees C. |
java.lang.String |
getName()
Retrieve the Dallas Semiconductor part number of the iButton as a string. |
double |
getTemperature(byte[] state)
This method extracts the Temperature Value in degrees C from the state data retrieved from the 'readDevice()' method. |
double |
getTemperatureAlarm(int alarmType,
byte[] state)
This method extracts the specified Alarm value in degrees C from the state data retrieved from the 'readDevice()' method. |
double |
getTemperatureAlarmResolution()
Query to get the high/low resolution in degrees C. |
double |
getTemperatureResolution(byte[] state)
This method extracts the current resolution in degrees C from the state data retrieved from the 'readDevice()' method. |
double[] |
getTemperatureResolutions()
Query to get an array of available resolutions in degrees C. |
boolean |
hasSelectableTemperatureResolution()
Query to see if this device has selectable resolution. |
boolean |
hasTemperatureAlarms()
Query to see if this temperature measuring device has high/low trip alarms. |
byte[] |
readDevice()
This method retrieves the 1-Wire device sensor state. |
void |
setTemperatureAlarm(int alarmType,
double alarmValue,
byte[] state)
This method sets the alarm value in degrees C in the provided state data. |
void |
setTemperatureResolution(double resolution,
byte[] state)
This method sets the current resolution in degrees C in the provided state data. |
void |
writeDevice(byte[] state)
This method write the 1-Wire device sensor state that have been changed by the 'set' methods. |
Methods inherited from class com.dalsemi.onewire.container.OneWireContainer |
doSpeed, getAdapter, getAddress, getAddressAsLong, getAddressAsString, getMaxSpeed, getMemoryBanks, isAlarming, isPresent, setSpeed, setupContainer, setupContainer, setupContainer |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double RESOLUTION_NORMAL
public static final double RESOLUTION_MAXIMUM
Constructor Detail |
public OneWireContainer10()
public OneWireContainer10(DSPortAdapter sourceAdapter, byte[] newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire devicepublic OneWireContainer10(DSPortAdapter sourceAdapter, long newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire devicepublic OneWireContainer10(DSPortAdapter sourceAdapter, java.lang.String newAddress)
sourceAdapter
- adapter object required to communicate with
this iButton.newAddress
- address of this 1-Wire deviceMethod Detail |
public java.lang.String getName()
getName
in class OneWireContainer
public java.lang.String getAlternateNames()
getAlternateNames
in class OneWireContainer
String
representation of the alternate names.public java.lang.String getDescription()
getDescription
in class OneWireContainer
public boolean hasTemperatureAlarms()
hasTemperatureAlarms
in interface TemperatureContainer
public boolean hasSelectableTemperatureResolution()
hasSelectableTemperatureResolution
in interface TemperatureContainer
public double[] getTemperatureResolutions()
getTemperatureResolutions
in interface TemperatureContainer
public double getTemperatureAlarmResolution()
getTemperatureAlarmResolution
in interface TemperatureContainer
public double getMaxTemperature()
getMaxTemperature
in interface TemperatureContainer
public double getMinTemperature()
getMinTemperature
in interface TemperatureContainer
public void doTemperatureConvert(byte[] state) throws OneWireIOException, OneWireException
doTemperatureConvert
in interface TemperatureContainer
state
- - byte array of device stateOneWireIOException
- OneWireException
- public double getTemperature(byte[] state) throws OneWireIOException
getTemperature
in interface TemperatureContainer
state
- - byte array of device statepublic double getTemperatureAlarm(int alarmType, byte[] state)
getTemperatureAlarm
in interface TemperatureContainer
alarmType
- - integer, indicating trip type ALARM_HIGH (1)
or ALARM_LOW (0)state
- - byte array of device statepublic double getTemperatureResolution(byte[] state)
getTemperatureResolution
in interface TemperatureContainer
state
- - byte array of device statepublic void setTemperatureAlarm(int alarmType, double alarmValue, byte[] state)
setTemperatureAlarm
in interface TemperatureContainer
alarmType
- - integer, indicating trip type ALARM_HIGH (1)
or ALARM_LOW (0)alarmValue
- - double, high trip value in degrees Cstate
- - byte array of device statepublic void setTemperatureResolution(double resolution, byte[] state)
setTemperatureResolution
in interface TemperatureContainer
resolution
- - double, temperature resolution in degrees C. Use
RESOLUTION_NORMAL or RESOLUTION_MAXIMUM.state
- - byte array of device stateRESOLUTION_NORMAL
,
RESOLUTION_MAXIMUM
public byte[] readDevice() throws OneWireIOException, OneWireException
readDevice
in interface OneWireSensor
byte[]<\code> 1-Wire device sensor state *- Throws:
OneWireIOException
- OneWireException
-
public void writeDevice(byte[] state) throws OneWireIOException, OneWireException
writeDevice
in interface OneWireSensor
state
- - byte array of clock register page contentsOneWireIOException
- OneWireException
- public static double convertToFahrenheit(double celsiusTemperature)
celsiusTemperature
- the temperature value to convertpublic static double convertToCelsius(double fahrenheitTemperature)
fahrenheitTemperature
- the temperature value to convert
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |