Inherited by OneWireContainer22.
Public Member Functions | |
OneWireContainer28 () | |
Creates an empty OneWireContainer28 . | |
OneWireContainer28 (DSPortAdapter sourceAdapter, byte[] newAddress) | |
Creates a OneWireContainer28 with the provided adapter object and the address of this One-Wire device. | |
OneWireContainer28 (DSPortAdapter sourceAdapter, long newAddress) | |
Creates a OneWireContainer28 with the provided adapter object and the address of this One-Wire device. | |
OneWireContainer28 (DSPortAdapter sourceAdapter, String newAddress) | |
Creates a OneWireContainer28 with the provided adapter object and the address of this One-Wire device. | |
String | getName () |
Retrieves the Maxim Integrated Products part number of this OneWireContainer28 as a String . | |
String | getAlternateNames () |
Retrieves the alternate Maxim Integrated Products part numbers or names. | |
String | getDescription () |
Retrieves a short description of the function of this OneWireContainer28 type. | |
boolean | hasTemperatureAlarms () |
Checks to see if this temperature measuring device has high/low trip alarms. | |
boolean | hasSelectableTemperatureResolution () |
Checks to see if this device has selectable temperature resolution. | |
double[] | getTemperatureResolutions () |
Gets an array of available temperature resolutions in Celsius. | |
double | getTemperatureAlarmResolution () |
Gets the temperature alarm resolution in Celsius. | |
double | getMaxTemperature () |
Gets the maximum temperature in Celsius. | |
double | getMinTemperature () |
Gets the minimum temperature in Celsius. | |
void | doTemperatureConvert (byte[] state) throws OneWireIOException, OneWireException |
Performs a temperature conversion on state information. | |
double | getTemperature (byte[] state) throws OneWireIOException |
Gets the temperature value in Celsius from the state data retrieved from the readDevice() method. | |
double | getTemperatureAlarm (int alarmType, byte[] state) |
Gets the specified temperature alarm value in Celsius from the state data retrieved from the readDevice() method. | |
double | getTemperatureResolution (byte[] state) |
Gets the current temperature resolution in Celsius from the state data retrieved from the readDevice() method. | |
void | setTemperatureAlarm (int alarmType, double alarmValue, byte[] state) throws OneWireException, OneWireIOException |
Sets the temperature alarm value in Celsius in the provided state data. | |
void | setTemperatureResolution (double resolution, byte[] state) throws OneWireException |
Sets the current temperature resolution in Celsius in the provided state data. | |
byte[] | readDevice () throws OneWireIOException, OneWireException |
Retrieves this OneWireContainer28 state information. | |
void | writeDevice (byte[] state) throws OneWireIOException, OneWireException |
Writes to this OneWireContainer28 state information that have been changed by 'set ' methods. | |
byte[] | readScratchpad () throws OneWireIOException, OneWireException |
Reads the Scratchpad of the DS18B20. | |
void | writeScratchpad (byte[] data) throws OneWireIOException, OneWireException |
Writes to the Scratchpad of the DS18B20. | |
void | copyScratchpad () throws OneWireIOException, OneWireException |
Copies the Scratchpad to the E-squared memory of the DS18B20. | |
byte[] | recallE2 () throws OneWireIOException, OneWireException |
Recalls the DS18B20 temperature trigger values (ALARM_HIGH and ALARM_LOW ) and the configuration register to the scratchpad and reads the scratchpad. | |
boolean | isExternalPowerSupplied () throws OneWireIOException, OneWireException |
Reads the way power is supplied to the DS18B20. | |
float | convertToFahrenheit (float celsiusTemperature) |
Converts a temperature reading from Celsius to Fahrenheit. | |
Static Public Attributes | |
static final byte | WRITE_SCRATCHPAD_COMMAND = ( byte ) 0x4E |
DS18B20 writes data to scratchpad command. | |
static final byte | READ_SCRATCHPAD_COMMAND = ( byte ) 0xBE |
DS18B20 reads data from scratchpad command. | |
static final byte | COPY_SCRATCHPAD_COMMAND = ( byte ) 0x48 |
DS18B20 copys data from scratchpad to E-squared memory command. | |
static final byte | CONVERT_TEMPERATURE_COMMAND = ( byte ) 0x44 |
DS18B20 converts temperature command. | |
static final byte | RECALL_E2MEMORY_COMMAND = ( byte ) 0xB8 |
DS18B20 recalls E-squared memory command. | |
static final byte | READ_POWER_SUPPLY_COMMAND = ( byte ) 0xB4 |
DS18B20 reads power supply command. | |
static final byte | RESOLUTION_12_BIT = ( byte ) 0x7F |
DS18B20 12-bit resolution constant for CONFIG byte. | |
static final byte | RESOLUTION_11_BIT = ( byte ) 0x5F |
DS18B20 11-bit resolution constant for CONFIG byte. | |
static final byte | RESOLUTION_10_BIT = ( byte ) 0x3F |
DS18B20 10-bit resolution constant for CONFIG byte. | |
static final byte | RESOLUTION_9_BIT = ( byte ) 0x1F |
DS18B20 9-bit resolution constant for CONFIG byte. |
Creates an empty OneWireContainer28
.
Must call setupContainer()
before using this new container.
This is one of the methods to construct a OneWireContainer28
. The others are through creating a OneWireContainer28
with parameters.
OneWireContainer28 | ( | DSPortAdapter | sourceAdapter, | |
byte[] | newAddress | |||
) |
Creates a OneWireContainer28
with the provided adapter object and the address of this One-Wire device.
This is one of the methods to construct a OneWireContainer28
. The others are through creating a OneWireContainer28
with different parameters types.
sourceAdapter | adapter object required to communicate with this One-Wire device | |
newAddress | address of this One-Wire device |
OneWireContainer28 | ( | DSPortAdapter | sourceAdapter, | |
long | newAddress | |||
) |
Creates a OneWireContainer28
with the provided adapter object and the address of this One-Wire device.
This is one of the methods to construct a OneWireContainer28
. The others are through creating a OneWireContainer28
with different parameters types.
sourceAdapter | adapter object required to communicate with this One-Wire device | |
newAddress | address of this One-Wire device |
OneWireContainer28(DSPortAdapter,byte[])
OneWireContainer28 | ( | DSPortAdapter | sourceAdapter, | |
String | newAddress | |||
) |
Creates a OneWireContainer28
with the provided adapter object and the address of this One-Wire device.
This is one of the methods to construct a OneWireContainer28
. The others are through creating a OneWireContainer28
with different parameters types.
sourceAdapter | adapter object required to communicate with this One-Wire device | |
newAddress | address of this One-Wire device |
OneWireContainer28(DSPortAdapter,byte[])
String getName | ( | ) |
Retrieves the Maxim Integrated Products part number of this OneWireContainer28
as a String
.
For example 'DS18B20'.
OneWireContainer28
name Reimplemented from OneWireContainer.
Reimplemented in OneWireContainer22.
String getAlternateNames | ( | ) |
Retrieves the alternate Maxim Integrated Products part numbers or names.
A 'family' of 1-Wire Network devices may have more than one part number depending on packaging. There can also be nicknames such as 'Crypto iButton'.
OneWireContainer28
alternate names Reimplemented from OneWireContainer.
Reimplemented in OneWireContainer22.
String getDescription | ( | ) |
Retrieves a short description of the function of this OneWireContainer28
type.
OneWireContainer28
functional description Reimplemented from OneWireContainer.
Reimplemented in OneWireContainer22.
boolean hasTemperatureAlarms | ( | ) |
Checks to see if this temperature measuring device has high/low trip alarms.
true
if this OneWireContainer28
has high/low trip alarmsImplements TemperatureContainer.
boolean hasSelectableTemperatureResolution | ( | ) |
Checks to see if this device has selectable temperature resolution.
true
if this OneWireContainer28
has selectable temperature resolutionImplements TemperatureContainer.
double [] getTemperatureResolutions | ( | ) |
Gets an array of available temperature resolutions in Celsius.
OneWireContainer28
. The minimum resolution is returned as the first element and maximum resolution as the last element.Implements TemperatureContainer.
double getTemperatureAlarmResolution | ( | ) |
Gets the temperature alarm resolution in Celsius.
OneWireContainer28
Implements TemperatureContainer.
double getMaxTemperature | ( | ) |
Gets the maximum temperature in Celsius.
OneWireContainer28
Implements TemperatureContainer.
double getMinTemperature | ( | ) |
Gets the minimum temperature in Celsius.
OneWireContainer28
Implements TemperatureContainer.
void doTemperatureConvert | ( | byte[] | state | ) | throws OneWireIOException, OneWireException |
Performs a temperature conversion on state
information.
state | byte array with device state information |
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer28 . This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter |
Implements TemperatureContainer.
double getTemperature | ( | byte[] | state | ) | throws OneWireIOException |
Gets the temperature value in Celsius from the state
data retrieved from the readDevice()
method.
state | byte array with device state information for this OneWireContainer28 |
doTemperatureConvert()
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer28 . This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. |
Implements TemperatureContainer.
double getTemperatureAlarm | ( | int | alarmType, | |
byte[] | state | |||
) |
Gets the specified temperature alarm value in Celsius from the state
data retrieved from the readDevice()
method.
alarmType | valid value: ALARM_HIGH or ALARM_LOW | |
state | byte array with device state information |
OneWireContainer28
Implements TemperatureContainer.
double getTemperatureResolution | ( | byte[] | state | ) |
Gets the current temperature resolution in Celsius from the state
data retrieved from the readDevice()
method.
state | byte array with device state information |
OneWireContainer28
Implements TemperatureContainer.
void setTemperatureAlarm | ( | int | alarmType, | |
double | alarmValue, | |||
byte[] | state | |||
) | throws OneWireException, OneWireIOException |
Sets the temperature alarm value in Celsius in the provided state
data.
Use the method writeDevice()
with this data to finalize the change to the device.
alarmType | valid value: ALARM_HIGH or ALARM_LOW | |
alarmValue | alarm trip value in Celsius | |
state | byte array with device state information |
Implements TemperatureContainer.
void setTemperatureResolution | ( | double | resolution, | |
byte[] | state | |||
) | throws OneWireException |
Sets the current temperature resolution in Celsius in the provided state
data.
Use the method writeDevice()
with this data to finalize the change to the device.
resolution | temperature resolution in Celsius. Valid values are RESOLUTION_9_BIT , RESOLUTION_10_BIT , RESOLUTION_11_BIT and RESOLUTION_12_BIT . | |
state | byte array with device state information |
Implements TemperatureContainer.
byte [] readDevice | ( | ) | throws OneWireIOException, OneWireException |
Retrieves this OneWireContainer28
state information.
The state information is returned as a byte array. Pass this byte array to the 'get
' and 'set
' methods. If the device state needs to be changed, then call the writeDevice()
to finalize the changes.
OneWireContainer28
state information. Device state looks like this: 0 : temperature LSB 1 : temperature MSB 2 : trip high 3 : trip low 4 : configuration register (for resolution) 5 : reserved 6 : reserved 7 : reserved 8 : an 8 bit CRC of the previous 8 bytes
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer28 . This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter |
Implements OneWireSensor.
void writeDevice | ( | byte[] | state | ) | throws OneWireIOException, OneWireException |
Writes to this OneWireContainer28
state
information that have been changed by 'set
' methods.
Only the state registers that changed are updated. This is done by referencing a field information appended to the state data.
state | byte array with device state information |
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer28 . This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter |
Implements OneWireSensor.
byte [] readScratchpad | ( | ) | throws OneWireIOException, OneWireException |
Reads the Scratchpad of the DS18B20.
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer28 . This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter |
void writeScratchpad | ( | byte[] | data | ) | throws OneWireIOException, OneWireException |
Writes to the Scratchpad of the DS18B20.
data | data to be written to the scratchpad. First byte of data must be the temperature High Trip Point, the second byte must be the temperature Low Trip Point, and the third must be the Resolution (configuration register). |
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer28 . This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter | |
IllegalArgumentException | when data is of invalid length |
void copyScratchpad | ( | ) | throws OneWireIOException, OneWireException |
Copies the Scratchpad to the E-squared memory of the DS18B20.
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer28 . This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter |
byte [] recallE2 | ( | ) | throws OneWireIOException, OneWireException |
Recalls the DS18B20 temperature trigger values (ALARM_HIGH
and ALARM_LOW
) and the configuration register to the scratchpad and reads the scratchpad.
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer28 . This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter |
boolean isExternalPowerSupplied | ( | ) | throws OneWireIOException, OneWireException |
Reads the way power is supplied to the DS18B20.
true
for external power, false
for parasite powerOneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from this OneWireContainer28 . This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter |
float convertToFahrenheit | ( | float | celsiusTemperature | ) |
Converts a temperature reading from Celsius to Fahrenheit.
celsiusTemperature | temperature value in Celsius |
final byte READ_POWER_SUPPLY_COMMAND = ( byte ) 0xB4 [static] |
DS18B20 reads power supply command.
This command is used to determine if external power is supplied.