|
||||||||||
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.OneWireContainer30
1-Wire® container that encapsulates the functionality of the 1-Wire family type 30 (hex), Dallas Semiconductor part number: DS2760, High Precision Li-ion Battery Monitor.
Field Summary | |
static byte |
CC_PIN_STATE_FLAG
PROTECTION REGISTER FLAG: Mirrors the !CC output pin. |
static byte |
CHARGE_ENABLE_FLAG
PROTECTION REGISTER FLAG: Reseting this flag will disable charging regardless of cell or pack conditions. |
static byte |
CHARGE_OVERCURRENT_FLAG
PROTECTION REGISTER FLAG: When this flag is true the
battery has experienced a charge-direction overcurrent condition. |
static byte |
DC_PIN_STATE_FLAG
PROTECTION REGISTER FLAG: Mirrors the !DC output pin. |
static byte |
DISCHARGE_ENABLE_FLAG
PROTECTION REGISTER FLAG: Reseting this flag will disable discharging. |
static byte |
DISCHARGE_OVERCURRENT_FLAG
PROTECTION REGISTER FLAG: When this flag is true the
battery has experienced a discharge-direction overcurrent condition. |
static byte |
EEPROM_BLOCK_0_LOCK_FLAG
EEPROM REGISTER FLAG: When this flag is true , Block 0
of the EEPROM (addresses 32-47) is read-only. |
static byte |
EEPROM_BLOCK_1_LOCK_FLAG
EEPROM REGISTER FLAG: When this flag is true , Block 1
of the EEPROM (addresses 48-63) is read-only. |
static byte |
EEPROM_COPY_FLAG
EEPROM REGISTER FLAG: This flag will be true if the Copy
Data Command is in progress. |
static byte |
EEPROM_LOCK_ENABLE_FLAG
EEPROM REGISTER FLAG: When this flag is true , the Lock
Command is enabled. |
static byte |
EEPROM_REGISTER
Address of the EEPROM Register. |
static byte |
OVERVOLTAGE_FLAG
PROTECTION REGISTER FLAG: When this flag is true , it
indicates that the battery pack has experienced an overvoltage
condition. |
static byte |
PIO_PIN_SENSE_AND_CONTROL_FLAG
SPECIAL FEATURE REGISTER FLAG: Mirrors/sets the state of the PIO pin. |
static byte |
PROTECTION_REGISTER
Address of the Protection Register. |
static byte |
PS_PIN_STATE_FLAG
SPECIAL FEATURE REGISTER FLAG: Mirrors the state of the !PS pin. |
static byte |
READ_NET_ADDRESS_OPCODE_FLAG
STATUS REGISTER FLAG: If set, the opcode for the Read Net Address command will be set to 33h. |
static byte |
SLEEP_MODE_ENABLE_FLAG
STATUS REGISTER FLAG: Enables/disables the DS2760 to enter sleep mode when the DQ line goes low for greater than 2 seconds. |
static byte |
SPECIAL_FEATURE_REGISTER
Address of the Special Feature Register (SFR). |
static byte |
STATUS_REGISTER
Address of the Status Register. |
static byte |
UNDERVOLTAGE_FLAG
PROTECTION REGISTER FLAG: When this flag is true , the
battery pack has experienced an undervoltage. |
Fields inherited from interface com.dalsemi.onewire.container.ADContainer |
ALARM_HIGH, ALARM_LOW |
Fields inherited from interface com.dalsemi.onewire.container.TemperatureContainer |
ALARM_HIGH, ALARM_LOW |
Constructor Summary | |
OneWireContainer30()
Default constructor |
|
OneWireContainer30(DSPortAdapter sourceAdapter,
byte[] newAddress)
Creates a container with a provided adapter object and the address of this 1-Wire device. |
|
OneWireContainer30(DSPortAdapter sourceAdapter,
long newAddress)
Creates a container with a provided adapter object and the address of this 1-Wire device. |
|
OneWireContainer30(DSPortAdapter sourceAdapter,
String newAddress)
Creates a container with a provided adapter object and the address of this 1-Wire device. |
Method Summary | |
boolean |
canADMultiChannelRead()
Queries to see if this A/D device supports doing multiple voltage conversions at the same time. |
void |
clearConditions()
Clears the overvoltage, undervoltage, charge overcurrent, and discharge overcurrent flags. |
void |
doADConvert(boolean[] doConvert,
byte[] state)
Performs voltage conversion on all specified channels. |
void |
doADConvert(int channel,
byte[] state)
Performs voltage conversion on the specified channel. |
void |
doTemperatureConvert(byte[] state)
Performs a temperature conversion. |
double |
getADAlarm(int channel,
int alarmType,
byte[] state)
Extracts the alarm voltage value of the specified channel from the provided state buffer. |
boolean |
getADAlarmEnable(int channel,
int alarmType,
byte[] state)
Extracts the alarm enable value of the specified channel from the provided state buffer. |
double |
getADRange(int channel,
byte[] state)
Extracts the A/D input voltage range of the specified channel from the provided state buffer. |
double[] |
getADRanges(int channel)
Queries to get an array of available ranges for the specified A/D channel. |
double |
getADResolution(int channel,
byte[] state)
Extracts the A/D conversion resolution of the specified channel from the provided state buffer expressed in volts. |
double[] |
getADResolutions(int channel,
double range)
Queries to get an array of available resolutions based on the specified range on the specified A/D channel. |
double[] |
getADVoltage(byte[] state)
Reads the voltage values. |
double |
getADVoltage(int channel,
byte[] state)
Reads a channel voltage value. |
String |
getAlternateNames()
Returns the alternate Dallas Semiconductor part number or name. |
double |
getCurrent(byte[] state)
Gets the instantaneous current. |
String |
getDescription()
Returns a short description of the function of this 1-Wire device type. |
boolean |
getFlag(int memAddr,
byte flagToGet)
Checks the specified flag in the specified register. |
boolean |
getLatchState()
Returns the latch state of the Programmable Input/Ouput pin on the DS2760. |
double |
getMaxTemperature()
Queries to get the maximum temperature in degrees C. |
Enumeration |
getMemoryBanks()
Get an enumeration of memory bank instances that implement one or more of the following interfaces: MemoryBank ,
PagedMemoryBank ,
and OTPMemoryBank . |
double |
getMinTemperature()
Queries to get the minimum temperature in degrees C. |
String |
getName()
Returns the Dallas Semiconductor part number of this 1-Wire device as a string. |
int |
getNumberADChannels()
Queries to get the number of channels supported by this A/D device. |
double |
getRemainingCapacity(byte[] state)
Calculates the remaining capacity in mAHours from the current Accumulator. |
double |
getTemperature(byte[] state)
Extracts the temperature value in degrees C from the state data retrieved from the readDevice() method. |
double |
getTemperatureAlarm(int alarmType,
byte[] state)
Extracts the specified temperature alarm value in degrees C from the state data retrieved from the readDevice() method. |
double |
getTemperatureAlarmResolution()
Queries to get the high/low temperature alarm resolution in degrees C. |
double |
getTemperatureResolution(byte[] state)
Extracts the current temperature resolution in degrees C from the state data retrieved from the readDevice() method. |
double[] |
getTemperatureResolutions()
Queries to get an array of available temperature resolutions in degrees C. |
boolean |
hasADAlarmed(int channel,
int alarmType,
byte[] state)
Checks the A/D alarm event value of the specified channel from the provided state buffer. |
boolean |
hasADAlarms()
Queries to see if this A/D measuring device has high/low alarms. |
boolean |
hasSelectableTemperatureResolution()
Queries to see if this device has selectable temperature resolution. |
boolean |
hasTemperatureAlarms()
Queries to see if this temperature measuring device has high/low trip alarms. |
void |
lockBlock(int blockNumber)
Permanently write-protects one of the user blocks of EEPROM. |
byte |
readByte(int memAddr)
Reads a register byte from the memory of the DS2760. |
void |
readBytes(int memAddr,
byte[] buffer,
int start,
int len)
Reads bytes from the DS2760. |
byte[] |
readDevice()
Retrieves the 1-Wire device sensor state. |
byte[] |
readEEPROMBlock(int blockNumber)
Reads a 16 byte data block from one of the user EEPROM blocks. |
void |
setADAlarm(int channel,
int alarmType,
double alarm,
byte[] state)
Sets the A/D alarm voltage value of the specified channel in the provided state buffer. |
void |
setADAlarmEnable(int channel,
int alarmType,
boolean alarmEnable,
byte[] state)
Sets the A/D alarm enable value of the specified channel in the provided state buffer. |
void |
setADRange(int channel,
double range,
byte[] state)
Sets the A/D input range for the specified channel in the provided state buffer. |
void |
setADResolution(int channel,
double resolution,
byte[] state)
Sets the A/D conversion resolution value for the specified channel in the provided state buffer. |
void |
setFlag(int memAddr,
byte flagToSet,
boolean flagValue)
Sets one of the flags in one of the registers. Valid registers are: PROTECTION_REGISTER ,
STATUS_REGISTER ,
EEPROM_REGISTER and
SPECIAL_FEATURE_REGISTER . |
void |
setLatchState(boolean on)
Sets the state for the Programmable Input/Output pin. |
void |
setRemainingCapacity(double remainingCapacity)
Allows user to set the remaining capacity. |
void |
setResistorExternal(double Rsens)
Sets the DS2760 to use an external, user-selectable resistance. |
void |
setResistorInternal()
Sets the DS2760 to use its internal .025 ohm resistor for measurements. |
void |
setTemperatureAlarm(int alarmType,
double alarmValue,
byte[] state)
Sets the temperature alarm value in degrees C in the provided state data. |
void |
setTemperatureResolution(double resolution,
byte[] state)
Sets the current temperature resolution in degrees C in the provided state data. |
void |
writeByte(int memAddr,
byte data)
Writes a register byte to the memory of the DS2760. |
void |
writeDevice(byte[] state)
Writes the 1-Wire device sensor state that have been changed by the 'set' methods. |
void |
writeEEPROMBlock(int blockNumber,
byte[] data)
Writes a 16 byte data block to one of the user blocks. |
Methods inherited from class com.dalsemi.onewire.container.OneWireContainer |
doSpeed, equals, getAdapter, getAddress, getAddressAsLong, getAddressAsString, getMaxSpeed, hashCode, isAlarming, isPresent, setSpeed, setupContainer, setupContainer, setupContainer, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte PROTECTION_REGISTER
setFlag()/getFlag()
.public static final byte STATUS_REGISTER
setFlag()/getFlag()
.public static final byte EEPROM_REGISTER
setFlag()/getFlag()
.public static final byte SPECIAL_FEATURE_REGISTER
getFlag()
.public static final byte OVERVOLTAGE_FLAG
true
, it
indicates that the battery pack has experienced an overvoltage
condition.
This flag must be reset!
Accessed with getFlag()
.public static final byte UNDERVOLTAGE_FLAG
true
, the
battery pack has experienced an undervoltage.
This flag must be reset!
Accessed with getFlag()
public static final byte CHARGE_OVERCURRENT_FLAG
true
the
battery has experienced a charge-direction overcurrent condition.
This flag must be reset!
Accessed with getFlag()
public static final byte DISCHARGE_OVERCURRENT_FLAG
true
the
battery has experienced a discharge-direction overcurrent condition.
This flag must be reset()
!
Accessed with getFlag()
public static final byte CC_PIN_STATE_FLAG
getFlag()
public static final byte DC_PIN_STATE_FLAG
getFlag()
public static final byte CHARGE_ENABLE_FLAG
getFlag()/setFlag()
.public static final byte DISCHARGE_ENABLE_FLAG
getFlag()/setFlag()
.public static final byte SLEEP_MODE_ENABLE_FLAG
getFlag()/setFlag()
.public static final byte READ_NET_ADDRESS_OPCODE_FLAG
getFlag()/setFlag()
.public static final byte EEPROM_COPY_FLAG
true
if the Copy
Data Command is in progress. Data may be written to EEPROM when this
reads false
.
Accessed with getFlag()/setFlag()
.public static final byte EEPROM_LOCK_ENABLE_FLAG
true
, the Lock
Command is enabled. The lock command is used to make memory permanently
read only.
Accessed with getFlag()/setFlag()
.public static final byte EEPROM_BLOCK_1_LOCK_FLAG
true
, Block 1
of the EEPROM (addresses 48-63) is read-only.
Accessed with getFlag()
.public static final byte EEPROM_BLOCK_0_LOCK_FLAG
true
, Block 0
of the EEPROM (addresses 32-47) is read-only.
Accessed with getFlag()
.public static final byte PS_PIN_STATE_FLAG
getFlag()
.public static final byte PIO_PIN_SENSE_AND_CONTROL_FLAG
getFlag()/setFlag()
.Constructor Detail |
public OneWireContainer30()
public OneWireContainer30(DSPortAdapter sourceAdapter, byte[] newAddress)
sourceAdapter
- adapter object required to communicate with
this 1-Wire devicenewAddress
- address of this 1-Wire devicepublic OneWireContainer30(DSPortAdapter sourceAdapter, long newAddress)
sourceAdapter
- adapter object required to communicate with
this 1-Wire devicenewAddress
- address of this 1-Wire devicepublic OneWireContainer30(DSPortAdapter sourceAdapter, String newAddress)
sourceAdapter
- adapter object required to communicate with
this 1-Wire devicenewAddress
- address of this 1-Wire deviceMethod Detail |
public String getName()
getName
in class OneWireContainer
public String getAlternateNames()
getAlternateNames
in class OneWireContainer
public String getDescription()
getDescription
in class OneWireContainer
public Enumeration getMemoryBanks()
MemoryBank
,
PagedMemoryBank
,
and OTPMemoryBank
.getMemoryBanks
in class OneWireContainer
Enumeration
of memory bankspublic void setResistorInternal()
public void setResistorExternal(double Rsens)
Rsens
- resistance in ohmspublic byte readByte(int memAddr) throws OneWireIOException, OneWireException
Note: This function should only be used when reading the register memory of the DS2760. The EEPROM blocks (addresses 32-64) should be accessed with writeBlock/readBlock.
memAddr
- the address to read (0-255)OneWireIOException
- Error reading dataOneWireException
- Could not find partpublic void readBytes(int memAddr, byte[] buffer, int start, int len) throws OneWireIOException, OneWireException
Note: This function should only be used when reading the register memory of the DS2760. The EEPROM blocks (addresses 32-64) should be accessed with writeBlock/readBlock.
memAddr
- the address to read (0-255)buffer
- buffer to receive datastart
- start position within buffer to place datalen
- length of bufferOneWireIOException
- Error reading dataOneWireException
- Could not find partpublic void writeByte(int memAddr, byte data) throws OneWireIOException, OneWireException
Note: This method should only be used when writing to the register memory of the DS2760. The EEPROM blocks (addresses 32-64) require special treatment and thus the writeBlock/readBlock functions should be used for those.
memAddr
- address to write (0-255)data
- data byte to write to memoryOneWireIOException
- Error writing dataOneWireException
- Could not find partpublic byte[] readEEPROMBlock(int blockNumber) throws OneWireIOException, OneWireException
blockNumber
- the EEPROM block number to read,
acceptable parameters are 0 and 1OneWireIOException
- Error reading dataOneWireException
- Could not find partpublic void writeEEPROMBlock(int blockNumber, byte[] data) throws OneWireIOException, OneWireException
lockBlock()
.
This method performs error checking by verifying data written.blockNumber
- block to write,
acceptable parameters are 0 and 1data
- 16 bytes of data to writeOneWireIOException
- Error writing dataOneWireException
- Could not find partpublic void lockBlock(int blockNumber) throws OneWireIOException, OneWireException
blockNumber
- block number to permanently write protect,
acceptable parameters are 0 and 1.OneWireIOException
- Error locking blockOneWireException
- Could not find partpublic boolean getFlag(int memAddr, byte flagToGet) throws OneWireIOException, OneWireException
PROTECTION_REGISTER
,
STATUS_REGISTER
,
EEPROM_REGISTER
and
SPECIAL_FEATURE_REGISTER
.memAddr
- registers address. Pre-defined
fields for each register are defined above.flagToGet
- bitmask of desired flag, the acceptable parameters
pertaining to each register are defined as constant fields abovetrue
if flag is set (=1)OneWireIOException
- Error reading dataOneWireException
- Could not find partpublic void setFlag(int memAddr, byte flagToSet, boolean flagValue) throws OneWireIOException, OneWireException
PROTECTION_REGISTER
,
STATUS_REGISTER
,
EEPROM_REGISTER
and
SPECIAL_FEATURE_REGISTER
.memAddr
- register address, these addresses are
predefined aboveflagToSet
- bitmask of flag to set, valid
parameters pertaining to each register are defined
as constant fields aboveflagValue
- value to set the flag toOneWireIOException
- Error setting flagOneWireException
- Could not find partpublic double getCurrent(byte[] state) throws OneWireIOException, OneWireException
state
- device stateOneWireIOException
- Error reading dataOneWireException
- Could not find partpublic void setRemainingCapacity(double remainingCapacity) throws OneWireIOException, OneWireException
By measuring the battery's current and voltage when it is fully charged and when it is empty, the voltage corresponding to an empty battery and the current corresponding to a full one can be derived. These values can be detected in user program and the remaining capacity can be set to the empty/full levels accordingly for nice accuracy.
remainingCapacity
- remaining capacity in mAHOneWireIOException
- Error reading dataOneWireException
- Could not find partpublic double getRemainingCapacity(byte[] state) throws OneWireIOException, OneWireException
state
- device stateOneWireIOException
- Error reading dataOneWireException
- Could not find partpublic void setLatchState(boolean on) throws OneWireIOException, OneWireException
on
- state of the PIO pin to setOneWireIOException
- Error writting dataOneWireException
- Could not find partpublic boolean getLatchState() throws OneWireIOException, OneWireException
OneWireIOException
- Error reading dataOneWireException
- Could not find partpublic void clearConditions() throws OneWireIOException, OneWireException
OneWireIOException
- Error writting dataOneWireException
- Could not find partpublic int getNumberADChannels()
[0 to (getNumberChannels() - 1)]
.getNumberADChannels
in interface ADContainer
public boolean hasADAlarms()
hasADAlarms
in interface ADContainer
true
if has high/low tripspublic double[] getADRanges(int channel)
getADRanges
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
public double[] getADResolutions(int channel, double range)
getADResolutions
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
range
- range of channel specified in channel parameterpublic boolean canADMultiChannelRead()
canADMultiChannelRead
in interface ADContainer
true
if can do multi-channel voltage readspublic void doADConvert(int channel, byte[] state) throws OneWireIOException, OneWireException
getADVoltage()
can be used to read the result of the
conversion.doADConvert
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
state
- current state of this
device returned from readDevice()
OneWireIOException
- Error writting dataOneWireException
- Could not find devicepublic void doADConvert(boolean[] doConvert, byte[] state) throws OneWireIOException, OneWireException
getADVoltage()
can be used to read the result
of the conversion. This A/D must support multi-channel read
canMultiChannelRead()
if there are more than 1 channel
is specified.doADConvert
in interface ADContainer
doConvert
- channels to perform conversion onstate
- current state of the
device returned from readDevice()
OneWireIOException
- Error writting dataOneWireException
- Device does not support multi-channel readingpublic double[] getADVoltage(byte[] state) throws OneWireIOException, OneWireException
doADConvert()
method call. Also must include the last valid state from the
readDevice()
method and this A/D must support multi-channel
read canMultiChannelRead()
if there are more than 1 channel.getADVoltage
in interface ADContainer
state
- current state of the
device returned from readDevice()
OneWireIOException
- Error writting dataOneWireException
- Device does not support multi-channel readingpublic double getADVoltage(int channel, byte[] state) throws OneWireIOException, OneWireException
doADConvert()
method call. Also must
include the last valid state from the readDevice()
method.
Note, if more than one channel is to be read then it is more
efficient to use the getADVoltage(byte[])
method that returns all
channel values.getADVoltage
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
state
- current state of the
device returned from readDevice()
OneWireIOException
- Error reading dataOneWireException
- Could not find devicepublic double getADAlarm(int channel, int alarmType, byte[] state) throws OneWireException
readDevice()
method.getADAlarm
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
alarmType
- desired alarm, ALARM_HIGH (1)
or ALARM_LOW (0)
state
- current state of the
device returned from readDevice()
OneWireException
- Device does not support A/D alarmspublic boolean getADAlarmEnable(int channel, int alarmType, byte[] state) throws OneWireException
readDevice()
method.getADAlarmEnable
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
alarmType
- desired alarm, ALARM_HIGH (1)
or ALARM_LOW (0)
state
- current state of the device
returned from readDevice()
true
if specified alarm is enabledOneWireException
- Device does not support A/D alarmspublic boolean hasADAlarmed(int channel, int alarmType, byte[] state) throws OneWireException
readDevice()
method.hasADAlarmed
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
alarmType
- desired alarm, ALARM_HIGH (1)
or ALARM_LOW (0)
state
- current state of the device
returned from readDevice()
true
if specified alarm occurredOneWireException
- Device does not support A/D alarmspublic double getADResolution(int channel, byte[] state)
readDevice()
method.getADResolution
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
state
- current state of the device
returned from readDevice()
public double getADRange(int channel, byte[] state)
readDevice()
method.getADRange
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
state
- current state of the device
returned from readDevice()
public void setADAlarm(int channel, int alarmType, double alarm, byte[] state) throws OneWireException
readDevice()
method. The method writeDevice()
must be called to finalize these changes to the device. Note that
multiple 'set' methods can be called before one call to
writeDevice()
.setADAlarm
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
alarmType
- desired alarm, ALARM_HIGH (1)
or ALARM_LOW (0)
alarm
- A/D alarm value (will be reduced to 8 bit resolution)state
- current state of the
device returned from readDevice()
OneWireException
- Device does not support A/D alarmspublic void setADAlarmEnable(int channel, int alarmType, boolean alarmEnable, byte[] state) throws OneWireException
readDevice()
method. The method writeDevice()
must be called to finalize these changes to the device. Note that
multiple 'set' methods can be called before one call to
writeDevice()
.setADAlarmEnable
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
alarmType
- desired alarm, ALARM_HIGH (1)
or ALARM_LOW (0)
alarmEnable
- A/D alarm enable valuestate
- current state of the
device returned from readDevice()
OneWireException
- Device does not support A/D alarmspublic void setADResolution(int channel, double resolution, byte[] state)
readDevice()
method.
The method writeDevice()
must be called to finalize these
changes to the device. Note that multiple 'set' methods can
be called before one call to writeDevice()
.setADResolution
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
resolution
- A/D resolution in voltsstate
- current state of the
device returned from readDevice()
public void setADRange(int channel, double range, byte[] state)
readDevice()
method. The method writeDevice()
must be called to finalize
these changes to the device. Note that multiple 'set' methods can
be called before one call to writeDevice()
.setADRange
in interface ADContainer
channel
- channel in the range
[0 to (getNumberChannels() - 1)]
range
- max A/D volt range, use
getRanges()
method to get available rangesstate
- current state of the
device returned from readDevice()
public boolean hasTemperatureAlarms()
hasTemperatureAlarms
in interface TemperatureContainer
true
if has high/low temperature trip alarmspublic boolean hasSelectableTemperatureResolution()
hasSelectableTemperatureResolution
in interface TemperatureContainer
true
if has selectable temperature resolutionpublic double[] getTemperatureResolutions()
getTemperatureResolutions
in interface TemperatureContainer
public double getTemperatureAlarmResolution() throws OneWireException
getTemperatureAlarmResolution
in interface TemperatureContainer
OneWireException
- Device does not support temperature alarmspublic 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
- device stateOneWireIOException
- Error writting dataOneWireException
- Could not find devicepublic double getTemperature(byte[] state)
readDevice()
method.getTemperature
in interface TemperatureContainer
state
- device statedoTemperatureConvert()
public double getTemperatureAlarm(int alarmType, byte[] state) throws OneWireException
readDevice()
method.getTemperatureAlarm
in interface TemperatureContainer
alarmType
- trip type ALARM_HIGH (1)
or ALARM_LOW (0)
state
- device stateOneWireException
- Device does not support temerature alarmspublic double getTemperatureResolution(byte[] state)
readDevice()
method.getTemperatureResolution
in interface TemperatureContainer
state
- device statepublic void setTemperatureAlarm(int alarmType, double alarmValue, byte[] state) throws OneWireException, OneWireIOException
writeDevice()
with
this data to finalize the change to the device.setTemperatureAlarm
in interface TemperatureContainer
alarmType
- trip type ALARM_HIGH (1)
or ALARM_LOW (0)
alarmValue
- high/low temperature trip value in degrees Cstate
- device stateOneWireIOException
- Error writting dataOneWireException
- Device does not support temperature alarmspublic void setTemperatureResolution(double resolution, byte[] state) throws OneWireException, OneWireIOException
writeDevice()
with this data to finalize
the change to the device.setTemperatureResolution
in interface TemperatureContainer
resolution
- temperature resolution in degrees Cstate
- device stateOneWireIOException
- Error writting dataOneWireException
- Could not find devicepublic byte[] readDevice() throws OneWireIOException, OneWireException
writeDevice()
to finalize the one or more change. With the
DS2760, there are no CRC checks on data. To ensure the integrity
of this data, call twice and make sure only fields expected to change
have changed. This method returns bytes 0 to 31 of the memory.
Many applications will not need to worry about the lack of CRC checks.readDevice
in interface OneWireSensor
OneWireIOException
- Error reading dataOneWireException
- Could not find devicepublic void writeDevice(byte[] state) throws OneWireIOException, OneWireException
writeDevice
in interface OneWireSensor
state
- device stateOneWireIOException
- Error writting dataOneWireException
- Could not find device
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |