1-Wire API for .NET Version 4.00
|
Inherits com::dalsemi::onewire::container::OneWireContainer, com::dalsemi::onewire::container::PasswordContainer, com::dalsemi::onewire::container::MissionContainer, com::dalsemi::onewire::container::ClockContainer, com::dalsemi::onewire::container::TemperatureContainer, com::dalsemi::onewire::container::ADContainer, and com::dalsemi::onewire::container::HumidityContainer.
Public Member Functions | |
OneWireContainer41 () | |
Creates a new OneWireContainer for communication with a DS1922. | |
OneWireContainer41 (DSPortAdapter sourceAdapter, byte[] newAddress) | |
Creates a new OneWireContainer for communication with a DS1922. | |
OneWireContainer41 (DSPortAdapter sourceAdapter, long newAddress) | |
Creates a new OneWireContainer for communication with a DS1922. | |
OneWireContainer41 (DSPortAdapter sourceAdapter, String newAddress) | |
Creates a new OneWireContainer for communication with a DS1922. | |
void | setupContainer (DSPortAdapter sourceAdapter, byte[] newAddress) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device. | |
void | setupContainer (DSPortAdapter sourceAdapter, long newAddress) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device. | |
void | setupContainer (DSPortAdapter sourceAdapter, String newAddress) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device. | |
byte[] | readDevice () throws OneWireIOException, OneWireException |
Retrieves the 1-Wire device sensor state. | |
void | writeDevice (byte[] state) throws OneWireIOException, OneWireException |
Writes the 1-Wire device sensor state that have been changed by 'set' methods. | |
byte | readByte (int memAddr) throws OneWireIOException, OneWireException |
Reads a single byte from the DS1922. | |
boolean | getFlag (int register, byte bitMask) throws OneWireIOException, OneWireException |
boolean | getFlag (int register, byte bitMask, byte[] state) |
void | setFlag (int register, byte bitMask, boolean flagValue) throws OneWireIOException, OneWireException |
void | setFlag (int register, byte bitMask, boolean flagValue, byte[] state) |
Enumeration | getMemoryBanks () |
Gets an enumeration of memory bank instances that implement one or more of the following interfaces: MemoryBank, PagedMemoryBank, and OTPMemoryBank. | |
MemoryBankScratchCRCPW | getScratchpadMemoryBank () |
Returns instance of the memory bank representing this device's scratchpad. | |
MemoryBankNVCRCPW | getUserDataMemoryBank () |
Returns instance of the memory bank representing this device's general-purpose user data memory. | |
MemoryBankNVCRCPW | getDataLogMemoryBank () |
Returns instance of the memory bank representing this device's data log. | |
MemoryBankNVCRCPW | getRegisterMemoryBank () |
Returns instance of the memory bank representing this device's special function registers. | |
int | getMaxSpeed () |
Returns the maximum speed this iButton device can communicate at. | |
String | getName () |
Gets the Maxim Integrated Products part number of the iButton or 1-Wire Device as a java.lang.String . | |
String | getAlternateNames () |
Retrieves the alternate Maxim Integrated Products part numbers or names. | |
String | getDescription () |
Gets a short description of the function of this iButton or 1-Wire Device type. | |
byte | getDeviceConfigByte () throws OneWireIOException, OneWireException |
Returns the Device Configuration Byte, which specifies whether or not this device is a DS1922, DS1923, or DS2422. | |
synchronized void | setSpeedCheck (boolean doSpeedCheck) |
Directs the container to avoid the calls to doSpeed() in methods that communicate with the DS1922/DS2422. | |
void | stopMission () throws OneWireException, OneWireIOException |
Stops the currently running mission. | |
void | startMission () throws OneWireException, OneWireIOException |
Starts a new mission. | |
void | clearMemory () throws OneWireException, OneWireIOException |
Erases the log memory from this missioning device. | |
int | getReadOnlyPasswordLength () throws OneWireException |
Returns the length in bytes of the Read-Only password. | |
int | getReadWritePasswordLength () throws OneWireException |
Returns the length in bytes of the Read/Write password. | |
int | getWriteOnlyPasswordLength () throws OneWireException |
Returns the length in bytes of the Write-Only password. | |
int | getReadOnlyPasswordAddress () throws OneWireException |
Returns the absolute address of the memory location where the Read-Only password is written. | |
int | getReadWritePasswordAddress () throws OneWireException |
Returns the absolute address of the memory location where the Read/Write password is written. | |
int | getWriteOnlyPasswordAddress () throws OneWireException |
Returns the absolute address of the memory location where the Write-Only password is written. | |
boolean | hasReadOnlyPassword () |
Returns true if this device has a Read-Only password. | |
boolean | hasReadWritePassword () |
Returns true if this device has a Read/Write password. | |
boolean | hasWriteOnlyPassword () |
Returns true if this device has a Write-Only password. | |
boolean | getDeviceReadOnlyPasswordEnable () throws OneWireException |
Returns true if the device's Read-Only password has been enabled. | |
boolean | getDeviceReadWritePasswordEnable () throws OneWireException |
Returns true if the device's Read/Write password has been enabled. | |
boolean | getDeviceWriteOnlyPasswordEnable () throws OneWireException |
Returns true if the device's Write-Only password has been enabled. | |
boolean | hasSinglePasswordEnable () |
Returns true if this device has the capability to enable one type of password while leaving another type disabled. | |
void | setDevicePasswordEnable (boolean enableReadOnly, boolean enableReadWrite, boolean enableWriteOnly) throws OneWireException, OneWireIOException |
void | setDevicePasswordEnableAll (boolean enableAll) throws OneWireException, OneWireIOException |
void | setDeviceReadOnlyPassword (byte[] password, int offset) throws OneWireException, OneWireIOException |
void | setDeviceReadWritePassword (byte[] password, int offset) throws OneWireException, OneWireIOException |
void | setDeviceWriteOnlyPassword (byte[] password, int offset) throws OneWireException, OneWireIOException |
void | setContainerReadOnlyPassword (byte[] password, int offset) throws OneWireException |
Sets the Read-Only password used by the API when reading from the device's memory. | |
void | setContainerReadWritePassword (byte[] password, int offset) throws OneWireException |
Sets the Read/Write password used by the API when reading from or writing to the device's memory. | |
void | setContainerWriteOnlyPassword (byte[] password, int offset) throws OneWireException |
Sets the Write-Only password used by the API when writing to the device's memory. | |
boolean | isContainerReadOnlyPasswordSet () throws OneWireException |
Returns true if the password used by the API for reading from the device's memory has been set. | |
boolean | isContainerReadWritePasswordSet () throws OneWireException |
Returns true if the password used by the API for reading from or writing to the device's memory has been set. | |
boolean | isContainerWriteOnlyPasswordSet () throws OneWireException |
Returns true if the password used by the API for writing to the device's memory has been set. | |
void | getContainerReadOnlyPassword (byte[] password, int offset) throws OneWireException |
Gets the Read-Only password used by the API when reading from the device's memory. | |
void | getContainerReadWritePassword (byte[] password, int offset) throws OneWireException |
Gets the Read/Write password used by the API when reading from or writing to the device's memory. | |
void | getContainerWriteOnlyPassword (byte[] password, int offset) throws OneWireException |
Gets the Write-Only password used by the API when writing to the device's memory. | |
String | getMissionLabel (int channel) throws OneWireException, OneWireIOException |
Returns a default friendly label for each channel supported by this Missioning device. | |
void | setStartUponTemperatureAlarmEnable (boolean enable) throws OneWireException, OneWireIOException |
Sets the SUTA (Start Upon Temperature Alarm) bit in the Mission Control register. | |
void | setStartUponTemperatureAlarmEnable (boolean enable, byte[] state) throws OneWireException, OneWireIOException |
Sets the SUTA (Start Upon Temperature Alarm) bit in the Mission Control register. | |
boolean | isStartUponTemperatureAlarmEnabled () throws OneWireException, OneWireIOException |
Returns true if the SUTA (Start Upon Temperature Alarm) bit in the Mission Control register is set. | |
boolean | isStartUponTemperatureAlarmEnabled (byte[] state) throws OneWireException, OneWireIOException |
Returns true if the SUTA (Start Upon Temperature Alarm) bit in the Mission Control register is set. | |
boolean | isMissionSUTA () throws OneWireException, OneWireIOException |
Returns true if the currently loaded mission results indicate that this mission has the SUTA bit enabled. | |
boolean | isMissionWFTA () throws OneWireException, OneWireIOException |
Returns true if the currently loaded mission results indicate that this mission has the SUTA bit enabled and is still Waiting For Temperature Alarm (WFTA). | |
void | startNewMission (int sampleRate, int missionStartDelay, boolean rolloverEnabled, boolean syncClock, boolean[] channelEnabled) throws OneWireException, OneWireIOException |
Begins a new mission on this missioning device. | |
synchronized void | loadMissionResults () throws OneWireException, OneWireIOException |
Loads the results of the currently running mission. | |
boolean | isMissionLoaded () |
Returns true if the mission results have been loaded from the device. | |
int | getNumberMissionChannels () |
Gets the number of channels supported by this Missioning device. | |
void | setMissionChannelEnable (int channel, boolean enable) throws OneWireException, OneWireIOException |
Enables/disables the specified mission channel, indicating whether or not the channel's readings will be recorded in the mission log. | |
void | setMissionChannelEnable (int channel, boolean enable, byte[] state) throws OneWireException, OneWireIOException |
Enables/disables the specified mission channel, indicating whether or not the channel's readings will be recorded in the mission log. | |
boolean | getMissionChannelEnable (int channel) throws OneWireException, OneWireIOException |
Returns true if the specified mission channel is enabled, indicating that the channel's readings will be recorded in the mission log. | |
boolean | getMissionChannelEnable (int channel, byte[] state) throws OneWireException, OneWireIOException |
Returns true if the specified mission channel is enabled, indicating that the channel's readings will be recorded in the mission log. | |
int | getMissionSampleRate (int channel) throws OneWireException, OneWireIOException |
Returns the amount of time, in seconds, between samples taken by this missioning device. | |
int | getMissionSampleCount (int channel) throws OneWireException, OneWireIOException |
Returns the number of samples available for the specified channel during the current mission. | |
int | getDeviceSampleCount () throws OneWireException, OneWireIOException |
Reads the device and returns the total number of samples logged since the first power-on of this device. | |
int | getDeviceSampleCount (byte[] state) throws OneWireException, OneWireIOException |
Returns the total number of samples logged since the first power-on of this device. | |
int | getMissionSampleCountTotal (int channel) throws OneWireException, OneWireIOException |
Returns the total number of samples taken for the specified channel during the current mission. | |
double | getMissionSample (int channel, int sampleNum) throws OneWireException, OneWireIOException |
Returns the sample as degrees celsius if temperature channel is specified or as percent relative humidity if data channel is specified. | |
int | getMissionSampleAsInteger (int channel, int sampleNum) throws OneWireException, OneWireIOException |
Returns the sample as an integer value. | |
long | getMissionSampleTimeStamp (int channel, int sampleNum) throws OneWireException, OneWireIOException |
Returns the time, in milliseconds, that each sample was taken by the current mission. | |
boolean | isMissionRunning () throws OneWireException, OneWireIOException |
Returns true if a mission is currently running. | |
boolean | isMissionRolloverEnabled () throws OneWireException, OneWireIOException |
Returns true if a rollover is enabled. | |
boolean | hasMissionRolloverOccurred () throws OneWireException, OneWireIOException |
Returns true if a mission has rolled over. | |
void | clearMissionResults () throws OneWireException, OneWireIOException |
Clears the mission results and erases the log memory from this missioning device. | |
long | getMissionTimeStamp (int channel) throws OneWireException, OneWireIOException |
Returns the time, in milliseconds, that the mission began. | |
long | getFirstSampleOffset (int channel) throws OneWireException, OneWireIOException |
Returns the amount of time, in milliseconds, before the first sample occurred. | |
double[] | getMissionResolutions (int channel) throws OneWireException, OneWireIOException |
Returns all available resolutions for the specified mission channel. | |
double | getMissionResolution (int channel) throws OneWireException, OneWireIOException |
Returns the currently selected resolution for the specified channel. | |
void | setMissionResolution (int channel, double resolution) throws OneWireException, OneWireIOException |
Sets the selected resolution for the specified channel. | |
void | setTemperatureCalibrationRegisterUsage (boolean use) |
Enables/Disables the usage of calibration registers. | |
void | setHumidityCalibrationRegisterUsage (boolean use) |
Enables/Disables the usage of the humidity calibration registers. | |
void | setTemperatureCompensationUsage (boolean use) |
Enables/Disables the usage of temperature compensation. | |
void | setDefaultTemperatureCompensationValue (double temperatureValue, boolean override) |
Sets the default temperature value for temperature compensation. | |
boolean | hasMissionAlarms (int channel) |
Indicates whether or not the specified channel of this missioning device has mission alarm capabilities. | |
boolean | hasMissionAlarmed (int channel, int alarmType) throws OneWireException, OneWireIOException |
Returns true if the specified channel's alarm value of the specified type has been triggered during the mission. | |
boolean | getMissionAlarmEnable (int channel, int alarmType) throws OneWireException, OneWireIOException |
Returns true if the alarm of the specified type has been enabled for the specified channel. | |
void | setMissionAlarmEnable (int channel, int alarmType, boolean enable) throws OneWireException, OneWireIOException |
Enables/disables the alarm of the specified type for the specified channel. | |
double | getMissionAlarm (int channel, int alarmType) throws OneWireException, OneWireIOException |
Returns the threshold value which will trigger the alarm of the specified type on the specified channel. | |
void | setMissionAlarm (int channel, int alarmType, double threshold) throws OneWireException, OneWireIOException |
Sets the threshold value which will trigger the alarm of the specified type on the specified channel. | |
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 () |
Get 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. | |
double | getTemperature (byte[] state) |
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) |
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. | |
boolean | isRelative () |
Checks to see if humidity value given is a 'relative' humidity value. | |
boolean | hasHumidityAlarms () |
Checks to see if this Humidity measuring device has high/low trip alarms. | |
boolean | hasSelectableHumidityResolution () |
Checks to see if this device has selectable Humidity resolution. | |
double[] | getHumidityResolutions () |
Get an array of available Humidity resolutions in percent humidity (0 to 100). | |
double | getHumidityAlarmResolution () throws OneWireException |
Gets the Humidity alarm resolution in percent. | |
void | doHumidityConvert (byte[] state) throws OneWireIOException, OneWireException |
Performs a Humidity conversion. | |
double | getHumidity (byte[] state) |
Gets the humidity expressed as a percent value (0.0 to 100.0) of humidity. | |
double | getHumidityResolution (byte[] state) |
Gets the current Humidity resolution in percent from the state data retrieved from the readDevice() method. | |
double | getHumidityAlarm (int alarmType, byte[] state) throws OneWireException |
Gets the specified Humidity alarm value in percent from the state data retrieved from the readDevice() method. | |
void | setHumidityAlarm (int alarmType, double alarmValue, byte[] state) throws OneWireException |
Sets the Humidity alarm value in percent in the provided state data. | |
void | setHumidityResolution (double resolution, byte[] state) throws OneWireException |
Sets the current Humidity resolution in percent in the provided state data. | |
int | getNumberADChannels () |
Gets the number of channels supported by this A/D. | |
boolean | hasADAlarms () |
Checks to see if this A/D measuring device has high/low alarms. | |
double[] | getADRanges (int channel) |
Gets an array of available ranges for the specified A/D channel. | |
double[] | getADResolutions (int channel, double range) |
Gets an array of available resolutions based on the specified range on the specified A/D channel. | |
boolean | canADMultiChannelRead () |
Checks to see if this A/D supports doing multiple voltage conversions at the same time. | |
void | doADConvert (int channel, byte[] state) throws OneWireIOException, OneWireException |
Performs a voltage conversion on one specified channel. | |
void | doADConvert (boolean[] doConvert, byte[] state) throws OneWireIOException, OneWireException |
Performs voltage conversion on one or more specified channels. | |
double[] | getADVoltage (byte[] state) throws OneWireIOException, OneWireException |
Reads the value of the voltages after a doADConvert(boolean[],byte[]) method call. | |
double | getADVoltage (int channel, byte[] state) throws OneWireIOException, OneWireException |
Reads the value of the voltages after a doADConvert(int,byte[]) method call. | |
double | getADAlarm (int channel, int alarmType, byte[] state) throws OneWireException |
Reads the value of the specified A/D alarm on the specified channel. | |
boolean | getADAlarmEnable (int channel, int alarmType, byte[] state) throws OneWireException |
Checks to see if the specified alarm on the specified channel is enabled. | |
boolean | hasADAlarmed (int channel, int alarmType, byte[] state) throws OneWireException |
Checks the state of the specified alarm on the specified channel. | |
double | getADResolution (int channel, byte[] state) |
Returns the currently selected resolution for the specified channel. | |
double | getADRange (int channel, byte[] state) |
Returns the currently selected range for the specified channel. | |
void | setADAlarm (int channel, int alarmType, double alarm, byte[] state) throws OneWireException |
Sets the voltage value of the specified alarm on the specified channel. | |
void | setADAlarmEnable (int channel, int alarmType, boolean alarmEnable, byte[] state) throws OneWireException |
Enables or disables the specified alarm on the specified channel. | |
void | setADResolution (int channel, double resolution, byte[] state) |
Sets the conversion resolution value for the specified channel. | |
void | setADRange (int channel, double range, byte[] state) |
Sets the input range for the specified channel. | |
boolean | hasClockAlarm () |
Checks to see if the clock has an alarm feature. | |
boolean | canDisableClock () |
Checks to see if the clock can be disabled. | |
long | getClockResolution () |
Gets the clock resolution in milliseconds. | |
long | getClock (byte[] state) |
Extracts the Real-Time clock value in milliseconds. | |
long | getClockAlarm (byte[] state) throws OneWireException |
Extracts the clock alarm value for the Real-Time clock. | |
boolean | isClockAlarming (byte[] state) |
Checks if the clock alarm flag has been set. | |
boolean | isClockAlarmEnabled (byte[] state) |
Checks if the clock alarm is enabled. | |
boolean | isClockRunning (byte[] state) |
Checks if the device's oscillator is enabled. | |
void | setClock (long time, byte[] state) |
Sets the Real-Time clock. | |
void | setClockAlarm (long time, byte[] state) throws OneWireException |
Sets the clock alarm. | |
void | setClockRunEnable (boolean runEnable, byte[] state) |
Enables or disables the oscillator, turning the clock 'on' and 'off'. | |
void | setClockAlarmEnable (boolean alarmEnable, byte[] state) throws OneWireException |
Enables or disables the clock alarm. | |
Static Public Attributes | |
static final int | TEMPERATURE_CHANNEL = 0 |
Refers to the Temperature Channel for this device. | |
static final int | DATA_CHANNEL = 1 |
Refers to the Humidity/A-D Channel for this device. | |
static final byte | WRITE_SCRATCHPAD_COMMAND = (byte)0x0F |
1-Wire command for Write Scratchpad | |
static final byte | READ_SCRATCHPAD_COMMAND = (byte)0xAA |
1-Wire command for Read Scratchpad | |
static final byte | COPY_SCRATCHPAD_PW_COMMAND = (byte)0x99 |
1-Wire command for Copy Scratchpad With Password | |
static final byte | READ_MEMORY_CRC_PW_COMMAND = (byte)0x69 |
1-Wire command for Read Memory CRC With Password | |
static final byte | CLEAR_MEMORY_PW_COMMAND = (byte)0x96 |
1-Wire command for Clear Memory With Password | |
static final byte | START_MISSION_PW_COMMAND = (byte)0xCC |
1-Wire command for Start Mission With Password | |
static final byte | STOP_MISSION_PW_COMMAND = (byte)0x33 |
1-Wire command for Stop Mission With Password | |
static final byte | FORCED_CONVERSION = (byte)0x55 |
1-Wire command for Forced Conversion | |
static final int | RTC_TIME = 0x200 |
Address of the Real-time Clock Time value. | |
static final int | RTC_DATE = 0x203 |
Address of the Real-time Clock Date value. | |
static final int | SAMPLE_RATE = 0x206 |
Address of the Sample Rate Register. | |
static final int | TEMPERATURE_LOW_ALARM_THRESHOLD = 0x208 |
Address of the Temperature Low Alarm Register. | |
static final int | TEMPERATURE_HIGH_ALARM_THRESHOLD = 0x209 |
Address of the Temperature High Alarm Register. | |
static final int | DATA_LOW_ALARM_THRESHOLD = 0x20A |
Address of the Data Low Alarm Register. | |
static final int | DATA_HIGH_ALARM_THRESHOLD = 0x20B |
Address of the Data High Alarm Register. | |
static final int | LAST_TEMPERATURE_CONVERSION_LSB = 0x20C |
Address of the last temperature conversion's LSB. | |
static final int | LAST_TEMPERATURE_CONVERSION_MSB = 0x20D |
Address of the last temperature conversion's MSB. | |
static final int | LAST_DATA_CONVERSION_LSB = 0x20E |
Address of the last data conversion's LSB. | |
static final int | LAST_DATA_CONVERSION_MSB = 0x20F |
Address of the last data conversion's MSB. | |
static final int | TEMPERATURE_CONTROL_REGISTER = 0x210 |
Address of Temperature Control Register. | |
static final byte | TCR_BIT_ENABLE_TEMPERATURE_LOW_ALARM = (byte)0x01 |
Temperature Control Register Bit: Enable Data Low Alarm. | |
static final byte | TCR_BIT_ENABLE_TEMPERATURE_HIGH_ALARM = (byte)0x02 |
Temperature Control Register Bit: Enable Data Low Alarm. | |
static final int | DATA_CONTROL_REGISTER = 0x211 |
Address of Data Control Register. | |
static final byte | DCR_BIT_ENABLE_DATA_LOW_ALARM = (byte)0x01 |
Data Control Register Bit: Enable Data Low Alarm. | |
static final byte | DCR_BIT_ENABLE_DATA_HIGH_ALARM = (byte)0x02 |
Data Control Register Bit: Enable Data High Alarm. | |
static final int | RTC_CONTROL_REGISTER = 0x212 |
Address of Real-Time Clock Control Register. | |
static final byte | RCR_BIT_ENABLE_OSCILLATOR = (byte)0x01 |
Real-Time Clock Control Register Bit: Enable Oscillator. | |
static final byte | RCR_BIT_ENABLE_HIGH_SPEED_SAMPLE = (byte)0x02 |
Real-Time Clock Control Register Bit: Enable High Speed Sample. | |
static final int | MISSION_CONTROL_REGISTER = (byte)0x213 |
Address of Mission Control Register. | |
static final byte | MCR_BIT_ENABLE_TEMPERATURE_LOGGING = (byte)0x01 |
Mission Control Register Bit: Enable Temperature Logging. | |
static final byte | MCR_BIT_ENABLE_DATA_LOGGING = (byte)0x02 |
Mission Control Register Bit: Enable Data Logging. | |
static final byte | MCR_BIT_TEMPERATURE_RESOLUTION = (byte)0x04 |
Mission Control Register Bit: Set Temperature Resolution. | |
static final byte | MCR_BIT_DATA_RESOLUTION = (byte)0x08 |
Mission Control Register Bit: Set Data Resolution. | |
static final byte | MCR_BIT_ENABLE_ROLLOVER = (byte)0x10 |
Mission Control Register Bit: Enable Rollover. | |
static final byte | MCR_BIT_START_MISSION_ON_TEMPERATURE_ALARM = (byte)0x20 |
Mission Control Register Bit: Start Mission on Temperature Alarm. | |
static final int | ALARM_STATUS_REGISTER = 0x214 |
Address of Alarm Status Register. | |
static final byte | ASR_BIT_TEMPERATURE_LOW_ALARM = (byte)0x01 |
Alarm Status Register Bit: Temperature Low Alarm. | |
static final byte | ASR_BIT_TEMPERATURE_HIGH_ALARM = (byte)0x02 |
Alarm Status Register Bit: Temperature High Alarm. | |
static final byte | ASR_BIT_DATA_LOW_ALARM = (byte)0x04 |
Alarm Status Register Bit: Data Low Alarm. | |
static final byte | ASR_BIT_DATA_HIGH_ALARM = (byte)0x08 |
Alarm Status Register Bit: Data High Alarm. | |
static final byte | ASR_BIT_BATTERY_ON_RESET = (byte)0x80 |
Alarm Status Register Bit: Battery On Reset. | |
static final int | GENERAL_STATUS_REGISTER = 0x215 |
Address of General Status Register. | |
static final byte | GSR_BIT_SAMPLE_IN_PROGRESS = (byte)0x01 |
General Status Register Bit: Sample In Progress. | |
static final byte | GSR_BIT_MISSION_IN_PROGRESS = (byte)0x02 |
General Status Register Bit: Mission In Progress. | |
static final byte | GSR_BIT_CONVERSION_IN_PROGRESS = (byte)0x04 |
General Status Register Bit: Conversion In Progress. | |
static final byte | GSR_BIT_MEMORY_CLEARED = (byte)0x08 |
General Status Register Bit: Memory Cleared. | |
static final byte | GSR_BIT_WAITING_FOR_TEMPERATURE_ALARM = (byte)0x10 |
General Status Register Bit: Waiting for Temperature Alarm. | |
static final byte | GSR_BIT_FORCED_CONVERSION_IN_PROGRESS = (byte)0x20 |
General Status Register Bit: Forced Conversion In Progress. | |
static final int | MISSION_START_DELAY = 0x216 |
Address of the Mission Start Delay. | |
static final int | MISSION_TIMESTAMP_TIME = 0x219 |
Address of the Mission Timestamp Time value. | |
static final int | MISSION_TIMESTAMP_DATE = 0x21C |
Address of the Mission Timestamp Date value. | |
static final int | DEVICE_CONFIGURATION_BYTE = 0x226 |
Address of Device Configuration Register. | |
static final byte | DCB_DS2422 = 0x00 |
Value of Device Configuration Register for DS1922S. | |
static final byte | DCB_DS1923 = 0x20 |
Value of Device Configuration Register for DS1923. | |
static final byte | DCB_DS1922L = 0x40 |
Value of Device Configuration Register for DS1922L. | |
static final byte | DCB_DS1922T = 0x60 |
Value of Device Configuration Register for DS1922T. | |
static final byte | DCB_DS1922E = (byte)0x80 |
Value of Device Configuration Register for DS1922E. | |
static final byte | DCB_DS1922F = (byte)0xC0 |
Value of Device Configuration Register for DS1922F !!! | |
static final byte | DCB_DS1922S = (byte)0xA0 |
Value of Device Configuration Register for DS1922S. | |
static final int | PASSWORD_CONTROL_REGISTER = 0x227 |
Address of the Password Control Register. | |
static final int | READ_ACCESS_PASSWORD = 0x228 |
Address of Read Access Password. | |
static final int | READ_WRITE_ACCESS_PASSWORD = 0x230 |
Address of the Read Write Access Password. | |
static final int | MISSION_SAMPLE_COUNT = 0x220 |
Address of the Mission Sample Count. | |
static final int | DEVICE_SAMPLE_COUNT = 0x223 |
Address of the Device Sample Count. | |
static final int | MISSION_LOG_SIZE = 8192 |
maximum size of the mission log | |
static final int | ODD_MISSION_LOG_SIZE = 7680 |
mission log size for odd combination of resolutions (i.e. |
1-Wire® container for a Temperature and Humidity/A-D Logging iButton, DS1922. This container encapsulates the functionality of the 1-Wire family type 22 (hex).
The memory can be accessed through the objects that are returned from the getMemoryBanks method.
The following is a list of the MemoryBank instances that are returned:
The code below starts a mission with the following characteristics:
// "ID" is a byte array of size 8 with an address of a part we
// have already found with family code 22 hex
// "access" is a DSPortAdapter
OneWireContainer41 ds1922 = (OneWireContainer41)access.getDeviceContainer(ID);
ds1922.setupContainer(access,ID);
// stop the currently running mission, if there is one
ds1922.stopMission();
// clear the previous mission results
ds1922.clearMemory();
// set the high temperature alarm to 28 C
ds1922.setMissionAlarm(ds1922.TEMPERATURE_CHANNEL, ds1922.ALARM_HIGH, 28);
ds1922.setMissionAlarmEnable(ds1922.TEMPERATURE_CHANNEL,
ds1922.ALARM_HIGH, true);
// set the low temperature alarm to 23 C
ds1922.setMissionAlarm(ds1922.TEMPERATURE_CHANNEL, ds1922.ALARM_LOW, 23);
ds1922.setMissionAlarmEnable(ds1922.TEMPERATURE_CHANNEL,
ds1922.ALARM_LOW, true);
// set the high humidity alarm to 70RH
ds1922.setMissionAlarm(ds1922.DATA_CHANNEL, ds1922.ALARM_HIGH, 70);
ds1922.setMissionAlarmEnable(ds1922.DATA_CHANNEL,
ds1922.ALARM_HIGH, true);
// set the low humidity alarm to 20RH
ds1922.setMissionAlarm(ds1922.DATA_CHANNEL, ds1922.ALARM_LOW, 20);
ds1922.setMissionAlarmEnable(ds1922.DATA_CHANNEL,
ds1922.ALARM_LOW, true);
// set both channels to low resolution.
ds1922.setMissionResolution(ds1922.TEMPERATURE_CHANNEL,
ds1922.getMissionResolutions()[0]);
ds1922.setMissionResolution(ds1922.DATA_CHANNEL,
ds1922.getMissionResolutions()[0]);
// enable both channels
boolean[] enableChannel = new boolean[ds1922.getNumberMissionChannels()];
enableChannel[ds1922.TEMPERATURE_CHANNEL] = true;
enableChannel[ds1922.DATA_CHANNEL] = true;
// now start the mission with a sample rate of 1 minute
ds1922.startNewMission(90, 2, true, true, enableChannel);
The following code processes the mission log:
System.out.println("Temperature Readings"); if(ds1922.getMissionChannelEnable(owc.TEMPERATURE_CHANNEL)) { int dataCount = ds1922.getMissionSampleCount(ds1922.TEMPERATURE_CHANNEL); System.out.println("SampleCount = " + dataCount); for(int i=0; i<dataCount; i++) { System.out.println( ds1922.getMissionSample(ds1922.TEMPERATURE_CHANNEL, i)); } } System.out.println("Humidity Readings"); if(ds1922.getMissionChannelEnable(owc.DATA_CHANNEL)) { int dataCount = ds1922.getMissionSampleCount(ds1922.DATA_CHANNEL); System.out.println("SampleCount = " + dataCount); for(int i=0; i<dataCount; i++) { System.out.println( ds1922.getMissionSample(ds1922.DATA_CHANNEL, i)); } }
Also see the usage examples in the TemperatureContainer and ClockContainer and ADContainer interfaces.
For examples regarding memory operations,
DataSheet link is unavailable at time of publication. Please visit the website and search for DS1922 or DS2422 to find the current datasheet.
Creates a new OneWireContainer
for communication with a DS1922.
Note that the method setupContainer(DSPortAdapter,byte[])
must be called to set the correct DSPortAdapter
device address.
OneWireContainer41 | ( | DSPortAdapter | sourceAdapter, |
byte[] | newAddress | ||
) |
Creates a new OneWireContainer
for communication with a DS1922.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this DS1922 |
OneWireContainer41 | ( | DSPortAdapter | sourceAdapter, |
long | newAddress | ||
) |
Creates a new OneWireContainer
for communication with a DS1922.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this DS1922 |
OneWireContainer41 | ( | DSPortAdapter | sourceAdapter, |
String | newAddress | ||
) |
Creates a new OneWireContainer
for communication with a DS1922.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this DS1922 |
boolean canADMultiChannelRead | ( | ) |
Checks to see if this A/D supports doing multiple voltage conversions at the same time.
Implements ADContainer.
boolean canDisableClock | ( | ) |
Checks to see if the clock can be disabled.
Implements ClockContainer.
void doADConvert | ( | int | channel, |
byte[] | state | ||
) | throws OneWireIOException, OneWireException |
Performs a voltage conversion on one specified channel.
Use the method getADVoltage(int,byte[])
to read the result of this conversion, using the same channel
argument as this method uses.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
state | current state of the device returned from readDevice() |
OneWireIOException | on a 1-Wire communication error such as no 1-Wire device present. 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'. This is usually a recoverable error. |
OneWireException | on a communication or setup error with the 1-Wire adapter. This is usually a non-recoverable error. |
Implements ADContainer.
void doADConvert | ( | boolean[] | doConvert, |
byte[] | state | ||
) | throws OneWireIOException, OneWireException |
Performs voltage conversion on one or more specified channels.
The method getADVoltage(byte[])
can be used to read the result of the conversion(s). This A/D must support multi-channel read, reported by canADMultiChannelRead()
, if more then 1 channel is specified.
doConvert | array of size getNumberADChannels() representing which channels should perform conversions |
state | current state of the device returned from readDevice() |
OneWireIOException | on a 1-Wire communication error such as no 1-Wire device present. 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'. This is usually a recoverable error. |
OneWireException | on a communication or setup error with the 1-Wire adapter. This is usually a non-recoverable error. |
Implements ADContainer.
void doHumidityConvert | ( | byte[] | state | ) | throws OneWireIOException, OneWireException |
Performs a Humidity conversion.
state | byte array with device state information |
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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 HumidityContainer.
void doTemperatureConvert | ( | byte[] | state | ) | throws OneWireIOException, OneWireException |
Performs a temperature conversion.
Use the state
information to calculate the conversion time.
state | byte array with device state information |
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'. In the case of the DS1922 Thermocron, this could also be due to a currently running mission. |
OneWireException | on a communication or setup error with the 1-Wire adapter |
Implements TemperatureContainer.
double getADAlarm | ( | int | channel, |
int | alarmType, | ||
byte[] | state | ||
) | throws OneWireException |
Reads the value of the specified A/D alarm on the specified channel.
Not all A/D devices have alarms. Check to see if this device has alarms first by calling the hasADAlarms()
method.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
alarmType | the desired alarm, ALARM_HIGH or ALARM_LOW |
state | current state of the device returned from readDevice() |
OneWireException | if this device does not have A/D alarms |
Implements ADContainer.
boolean getADAlarmEnable | ( | int | channel, |
int | alarmType, | ||
byte[] | state | ||
) | throws OneWireException |
Checks to see if the specified alarm on the specified channel is enabled.
Not all A/D devices have alarms. Check to see if this device has alarms first by calling the hasADAlarms()
method.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
alarmType | the desired alarm, ALARM_HIGH or ALARM_LOW |
state | current state of the device returned from readDevice() |
OneWireException | if this device does not have A/D alarms |
Implements ADContainer.
double getADRange | ( | int | channel, |
byte[] | state | ||
) |
Returns the currently selected range for the specified channel.
This device may not have selectable ranges, though this method will return a valid value.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
state | current state of the device returned from readDevice() |
Implements ADContainer.
double [] getADRanges | ( | int | channel | ) |
Gets an array of available ranges for the specified A/D channel.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
Implements ADContainer.
double getADResolution | ( | int | channel, |
byte[] | state | ||
) |
Returns the currently selected resolution for the specified channel.
This device may not have selectable resolutions, though this method will return a valid value.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
state | current state of the device returned from readDevice() |
channel
in voltsImplements ADContainer.
double [] getADResolutions | ( | int | channel, |
double | range | ||
) |
Gets an array of available resolutions based on the specified range on the specified A/D channel.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
range | A/D range setting from the getADRanges(int) method |
channel
for this range
Implements ADContainer.
double getADVoltage | ( | int | channel, |
byte[] | state | ||
) | throws OneWireIOException, OneWireException |
Reads the value of the voltages after a doADConvert(int,byte[])
method call.
If more than one channel has been read it is more efficient to use the getADVoltage(byte[])
method that returns all channel voltage values.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
state | current state of the device returned from readDevice() |
OneWireIOException | on a 1-Wire communication error such as no 1-Wire device present. 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'. This is usually a recoverable error. |
OneWireException | on a communication or setup error with the 1-Wire adapter. This is usually a non-recoverable error. |
Implements ADContainer.
double [] getADVoltage | ( | byte[] | state | ) | throws OneWireIOException, OneWireException |
Reads the value of the voltages after a doADConvert(boolean[],byte[])
method call.
This A/D device must support multi-channel reading, reported by canADMultiChannelRead()
, if more than 1 channel conversion was attempted by doADConvert()
.
state | current state of the device returned from readDevice() |
OneWireIOException | on a 1-Wire communication error such as no 1-Wire device present. 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'. This is usually a recoverable error. |
OneWireException | on a communication or setup error with the 1-Wire adapter. This is usually a non-recoverable error. |
Implements ADContainer.
String getAlternateNames | ( | ) |
Retrieves the alternate Maxim Integrated Products part numbers or names.
A 'family' of MicroLAN devices may have more than one part number depending on packaging. There can also be nicknames such as "Crypto iButton".
Reimplemented from OneWireContainer.
long getClock | ( | byte[] | state | ) |
Extracts the Real-Time clock value in milliseconds.
state | current state of the device returned from readDevice() |
Implements ClockContainer.
long getClockAlarm | ( | byte[] | state | ) | throws OneWireException |
Extracts the clock alarm value for the Real-Time clock.
state | current state of the device returned from readDevice() |
Implements ClockContainer.
long getClockResolution | ( | ) |
Gets the clock resolution in milliseconds.
Implements ClockContainer.
void getContainerReadOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Gets the Read-Only password used by the API when reading from the device's memory.
This password is not read from the device's Read-Only password register. It is the password used by the software for interacting with the device only and must have been set using the setContainerReadOnlyPassword
method.
password | array for holding the password that is used by the API when reading from the device's memory. Length must be (offset + getWriteOnlyPasswordLength) |
offset | the starting point for copying into the given password array |
Implements PasswordContainer.
void getContainerReadWritePassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Gets the Read/Write password used by the API when reading from or writing to the device's memory.
This password is not read from the device's Read/Write password register. It is the password used by the software for interacting with the device only and must have been set using the setContainerReadWritePassword
method.
password | array for holding the password that is used by the API when reading from or writing to the device's memory. Length must be (offset + getReadWritePasswordLength) |
offset | the starting point for copying into the given password array |
Implements PasswordContainer.
void getContainerWriteOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Gets the Write-Only password used by the API when writing to the device's memory.
This password is not read from the device's Write-Only password register. It is the password used by the software for interacting with the device only and must have been set using the setContainerWriteOnlyPassword
method.
password | array for holding the password that is used by the API when writing to the device's memory. Length must be (offset + getWriteOnlyPasswordLength) |
offset | the starting point for copying into the given password array |
Implements PasswordContainer.
MemoryBankNVCRCPW getDataLogMemoryBank | ( | ) |
Returns instance of the memory bank representing this device's data log.
String getDescription | ( | ) |
Gets a short description of the function of this iButton or 1-Wire Device type.
Reimplemented from OneWireContainer.
byte getDeviceConfigByte | ( | ) | throws OneWireIOException, OneWireException |
Returns the Device Configuration Byte, which specifies whether or not this device is a DS1922, DS1923, or DS2422.
OneWireIOException | |
OneWireException |
boolean getDeviceReadOnlyPasswordEnable | ( | ) | throws OneWireException |
Returns true if the device's Read-Only password has been enabled.
true
if the device's Read-Only password has been enabled. Implements PasswordContainer.
boolean getDeviceReadWritePasswordEnable | ( | ) | throws OneWireException |
Returns true if the device's Read/Write password has been enabled.
true
if the device's Read/Write password has been enabled. Implements PasswordContainer.
int getDeviceSampleCount | ( | ) | throws OneWireException, OneWireIOException |
Reads the device and returns the total number of samples logged since the first power-on of this device.
int getDeviceSampleCount | ( | byte[] | state | ) | throws OneWireException, OneWireIOException |
Returns the total number of samples logged since the first power-on of this device.
state | The current state of the device as return from readDevice() |
boolean getDeviceWriteOnlyPasswordEnable | ( | ) | throws OneWireException |
Returns true if the device's Write-Only password has been enabled.
true
if the device's Write-Only password has been enabled. Implements PasswordContainer.
long getFirstSampleOffset | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the amount of time, in milliseconds, before the first sample occurred.
If rollover disabled, or datalog didn't fill up, this will be 0.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implements MissionContainer.
boolean getFlag | ( | int | register, |
byte | bitMask, | ||
byte[] | state | ||
) |
Gets the status of the specified flag from the specified register. This method is the preferred manner of reading the control and status flags.
For more information on valid values for the bitMask
parameter, see the getFlag(int,byte) method.
register | address of register containing the flag (see getFlag(int,byte) for available options) |
bitMask | the flag to read (see getFlag(int,byte) for available options) |
state | current state of the device returned from readDevice() |
true
signifies a "1" and false
signifies a "0"boolean getFlag | ( | int | register, |
byte | bitMask | ||
) | throws OneWireIOException, OneWireException |
Gets the status of the specified flag from the specified register. This method actually communicates with the DS1922. To improve performance if you intend to make multiple calls to this method, first call readDevice()
and use the getFlag(int, byte, byte[])
method instead.
The DS1922 has several sets of flags.
TEMPERATURE_CONTROL_REGISTER
TCR_BIT_ENABLE_TEMPERATURE_LOW_ALARM
TCR_BIT_ENABLE_TEMPERATURE_HIGH_ALARM
DATA_CONTROL_REGISTER
DCR_BIT_ENABLE_DATA_LOW_ALARM
DCR_BIT_ENABLE_DATA_HIGH_ALARM
RTC_CONTROL_REGISTER
RCR_BIT_ENABLE_OSCILLATOR
RCR_BIT_ENABLE_HIGH_SPEED_SAMPLE
MISSION_CONTROL_REGISTER
MCR_BIT_ENABLE_TEMPERATURE_LOGGING
MCR_BIT_ENABLE_DATA_LOGGING
MCR_BIT_TEMPERATURE_RESOLUTION
MCR_BIT_DATA_RESOLUTION
MCR_BIT_ENABLE_ROLLOVER
MCR_BIT_START_MISSION_UPON_TEMPERATURE_ALARM
ALARM_STATUS_REGISTER
ASR_BIT_TEMPERATURE_LOW_ALARM
ASR_BIT_TEMPERATURE_HIGH_ALARM
ASR_BIT_DATA_LOW_ALARM
ASR_BIT_DATA_HIGH_ALARM
ASR_BIT_BATTERY_ON_RESET
GENERAL_STATUS_REGISTER
GSR_BIT_SAMPLE_IN_PROGRESS
GSR_BIT_MISSION_IN_PROGRESS
GSR_BIT_MEMORY_CLEARED
GSR_BIT_WAITING_FOR_TEMPERATURE_ALARM
register | address of register containing the flag (see above for available options) |
bitMask | the flag to read (see above for available options) |
true
signifies a "1" and false
signifies a "0"OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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 |
double getHumidity | ( | byte[] | state | ) |
Gets the humidity expressed as a percent value (0.0 to 100.0) of humidity.
state | byte array with device state information |
Implements HumidityContainer.
double getHumidityAlarm | ( | int | alarmType, |
byte[] | state | ||
) | throws OneWireException |
Gets the specified Humidity alarm value in percent from the state
data retrieved from the readDevice()
method.
alarmType | valid value: ALARM_HIGH or ALARM_LOW |
state | byte array with device state information |
OneWireException | Device does not support Humidity alarms |
Implements HumidityContainer.
double getHumidityAlarmResolution | ( | ) | throws OneWireException |
Gets the Humidity alarm resolution in percent.
OneWireException | Device does not support Humidity alarms |
Implements HumidityContainer.
double getHumidityResolution | ( | byte[] | state | ) |
Gets the current Humidity resolution in percent from the state
data retrieved from the readDevice()
method.
state | byte array with device state information |
Implements HumidityContainer.
double [] getHumidityResolutions | ( | ) |
Get an array of available Humidity resolutions in percent humidity (0 to 100).
Implements HumidityContainer.
int getMaxSpeed | ( | ) |
Returns the maximum speed this iButton device can communicate at.
Reimplemented from OneWireContainer.
double getMaxTemperature | ( | ) |
Gets the maximum temperature in Celsius.
Implements TemperatureContainer.
Enumeration getMemoryBanks | ( | ) |
Gets an enumeration of memory bank instances that implement one or more of the following interfaces: MemoryBank, PagedMemoryBank, and OTPMemoryBank.
Enumeration
of memory banks Reimplemented from OneWireContainer.
double getMinTemperature | ( | ) |
Gets the minimum temperature in Celsius.
Implements TemperatureContainer.
double getMissionAlarm | ( | int | channel, |
int | alarmType | ||
) | throws OneWireException, OneWireIOException |
Returns the threshold value which will trigger the alarm of the specified type on the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
alarmType | valid value: ALARM_HIGH or ALARM_LOW |
Implements MissionContainer.
boolean getMissionAlarmEnable | ( | int | channel, |
int | alarmType | ||
) | throws OneWireException, OneWireIOException |
Returns true if the alarm of the specified type has been enabled for the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
alarmType | valid value: ALARM_HIGH or ALARM_LOW |
Implements MissionContainer.
boolean getMissionChannelEnable | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns true if the specified mission channel is enabled, indicating that the channel's readings will be recorded in the mission log.
channel | the channel to enable/disable |
enable | if true, the channel is enabled |
Implements MissionContainer.
boolean getMissionChannelEnable | ( | int | channel, |
byte[] | state | ||
) | throws OneWireException, OneWireIOException |
Returns true if the specified mission channel is enabled, indicating that the channel's readings will be recorded in the mission log.
channel | the channel to enable/disable |
enable | if true, the channel is enabled |
String getMissionLabel | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns a default friendly label for each channel supported by this Missioning device.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implements MissionContainer.
double getMissionResolution | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the currently selected resolution for the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implements MissionContainer.
double [] getMissionResolutions | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns all available resolutions for the specified mission channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implements MissionContainer.
double getMissionSample | ( | int | channel, |
int | sampleNum | ||
) | throws OneWireException, OneWireIOException |
Returns the sample as degrees celsius if temperature channel is specified or as percent relative humidity if data channel is specified.
If the device is a DS2422 configuration (or A-D results are forced on the DS1923), the data channel will return samples as the voltage measured.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
sampleNum | the sample number to return, between 0 and (getMissionSampleCount(channel)-1) |
Implements MissionContainer.
int getMissionSampleAsInteger | ( | int | channel, |
int | sampleNum | ||
) | throws OneWireException, OneWireIOException |
Returns the sample as an integer value.
This value is not converted to degrees Celsius for temperature or to percent RH for Humidity. It is simply the 8 or 16 bits of digital data written in the mission log for this sample entry. It is up to the user to mask off the unused bits and convert this value to it's proper units. This method is primarily for users of the DS2422 who are using an input device which is not an A-D or have an A-D wholly dissimilar to the one specified in the datasheet.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
sampleNum | the sample number to return, between 0 and (getMissionSampleCount(channel)-1) |
Implements MissionContainer.
int getMissionSampleCount | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the number of samples available for the specified channel during the current mission.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implements MissionContainer.
int getMissionSampleCountTotal | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the total number of samples taken for the specified channel during the current mission.
This number can be more than the actual sample count if rollover is enabled and the log has been filled.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implements MissionContainer.
int getMissionSampleRate | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the amount of time, in seconds, between samples taken by this missioning device.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implements MissionContainer.
long getMissionSampleTimeStamp | ( | int | channel, |
int | sampleNum | ||
) | throws OneWireException, OneWireIOException |
Returns the time, in milliseconds, that each sample was taken by the current mission.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
sampleNum | the sample number to return, between 0 and (getMissionSampleCount(channel)-1) |
Implements MissionContainer.
long getMissionTimeStamp | ( | int | channel | ) | throws OneWireException, OneWireIOException |
Returns the time, in milliseconds, that the mission began.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implements MissionContainer.
String getName | ( | ) |
Gets the Maxim Integrated Products part number of the iButton or 1-Wire Device as a java.lang.String
.
For example "DS1992".
Reimplemented from OneWireContainer.
int getNumberADChannels | ( | ) |
Gets the number of channels supported by this A/D.
Channel specific methods will use a channel number specified by an integer from [0 to (getNumberADChannels()
- 1)].
Implements ADContainer.
int getNumberMissionChannels | ( | ) |
Gets the number of channels supported by this Missioning device.
Channel specific methods will use a channel number specified by an integer from [0 to (getNumberOfMissionChannels()
- 1)].
Implements MissionContainer.
int getReadOnlyPasswordAddress | ( | ) | throws OneWireException |
Returns the absolute address of the memory location where the Read-Only password is written.
Implements PasswordContainer.
int getReadOnlyPasswordLength | ( | ) | throws OneWireException |
Returns the length in bytes of the Read-Only password.
Implements PasswordContainer.
int getReadWritePasswordAddress | ( | ) | throws OneWireException |
Returns the absolute address of the memory location where the Read/Write password is written.
Implements PasswordContainer.
int getReadWritePasswordLength | ( | ) | throws OneWireException |
Returns the length in bytes of the Read/Write password.
Implements PasswordContainer.
MemoryBankNVCRCPW getRegisterMemoryBank | ( | ) |
Returns instance of the memory bank representing this device's special function registers.
MemoryBankScratchCRCPW getScratchpadMemoryBank | ( | ) |
Returns instance of the memory bank representing this device's scratchpad.
double getTemperature | ( | byte[] | state | ) |
Gets the temperature value in Celsius from the state
data retrieved from the readDevice()
method.
state | byte array with device state information |
doTemperatureConvert()
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 |
Implements TemperatureContainer.
double getTemperatureAlarmResolution | ( | ) |
Gets the temperature alarm resolution in Celsius.
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 |
Implements TemperatureContainer.
double [] getTemperatureResolutions | ( | ) |
Get an array of available temperature resolutions in Celsius.
Implements TemperatureContainer.
MemoryBankNVCRCPW getUserDataMemoryBank | ( | ) |
Returns instance of the memory bank representing this device's general-purpose user data memory.
int getWriteOnlyPasswordAddress | ( | ) | throws OneWireException |
Returns the absolute address of the memory location where the Write-Only password is written.
Implements PasswordContainer.
int getWriteOnlyPasswordLength | ( | ) | throws OneWireException |
Returns the length in bytes of the Write-Only password.
Implements PasswordContainer.
boolean hasADAlarmed | ( | int | channel, |
int | alarmType, | ||
byte[] | state | ||
) | throws OneWireException |
Checks the state of the specified alarm on the specified channel.
Not all A/D devices have alarms. Check to see if this device has alarms first by calling the hasADAlarms()
method.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
alarmType | the desired alarm, ALARM_HIGH or ALARM_LOW |
state | current state of the device returned from readDevice() |
OneWireException | if this device does not have A/D alarms |
Implements ADContainer.
boolean hasADAlarms | ( | ) |
Checks to see if this A/D measuring device has high/low alarms.
Implements ADContainer.
boolean hasClockAlarm | ( | ) |
Checks to see if the clock has an alarm feature.
Implements ClockContainer.
boolean hasHumidityAlarms | ( | ) |
Checks to see if this Humidity measuring device has high/low trip alarms.
true
if this HumidityContainer
has high/low trip alarmsImplements HumidityContainer.
boolean hasMissionAlarmed | ( | int | channel, |
int | alarmType | ||
) | throws OneWireException, OneWireIOException |
Returns true if the specified channel's alarm value of the specified type has been triggered during the mission.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
alarmType | valid value: ALARM_HIGH or ALARM_LOW |
Implements MissionContainer.
boolean hasMissionAlarms | ( | int | channel | ) |
Indicates whether or not the specified channel of this missioning device has mission alarm capabilities.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
Implements MissionContainer.
boolean hasMissionRolloverOccurred | ( | ) | throws OneWireException, OneWireIOException |
Returns true
if a mission has rolled over.
true
if a mission has rolled over. Implements MissionContainer.
boolean hasReadOnlyPassword | ( | ) |
Returns true if this device has a Read-Only password.
If false, all other functions dealing with the Read-Only password will throw an exception if called.
true
always, since DS1922 has Read-Only password. Implements PasswordContainer.
boolean hasReadWritePassword | ( | ) |
Returns true if this device has a Read/Write password.
If false, all other functions dealing with the Read/Write password will throw an exception if called.
true
always, since DS1922 has Read/Write password. Implements PasswordContainer.
boolean hasSelectableHumidityResolution | ( | ) |
Checks to see if this device has selectable Humidity resolution.
true
if this HumidityContainer
has selectable Humidity resolutionImplements HumidityContainer.
boolean hasSelectableTemperatureResolution | ( | ) |
Checks to see if this device has selectable temperature resolution.
true
if this TemperatureContainer
has selectable temperature resolutionImplements TemperatureContainer.
boolean hasSinglePasswordEnable | ( | ) |
Returns true if this device has the capability to enable one type of password while leaving another type disabled.
i.e. if the device has Read-Only password protection and Write-Only password protection, this method indicates whether or not you can enable Read-Only protection while leaving the Write-Only protection disabled.
true
if the device has the capability to enable one type of password while leaving another type disabled. Implements PasswordContainer.
boolean hasTemperatureAlarms | ( | ) |
Checks to see if this temperature measuring device has high/low trip alarms.
true
if this TemperatureContainer
has high/low trip alarmsImplements TemperatureContainer.
boolean hasWriteOnlyPassword | ( | ) |
Returns true if this device has a Write-Only password.
If false, all other functions dealing with the Write-Only password will throw an exception if called.
false
always, since DS1922 has no Write-Only password. Implements PasswordContainer.
boolean isClockAlarmEnabled | ( | byte[] | state | ) |
Checks if the clock alarm is enabled.
state | current state of the device returned from readDevice() |
Implements ClockContainer.
boolean isClockAlarming | ( | byte[] | state | ) |
Checks if the clock alarm flag has been set.
This will occur when the value of the Real-Time clock equals the value of the clock alarm.
state | current state of the device returned from readDevice() |
Implements ClockContainer.
boolean isClockRunning | ( | byte[] | state | ) |
Checks if the device's oscillator is enabled.
The clock will not increment if the clock oscillator is not enabled.
state | current state of the device returned from readDevice() |
Implements ClockContainer.
boolean isContainerReadOnlyPasswordSet | ( | ) | throws OneWireException |
Returns true if the password used by the API for reading from the device's memory has been set.
The return value is not affected by whether or not the read password of the container actually matches the value in the device's password register
true
if the password used by the API for reading from the device's memory has been set. Implements PasswordContainer.
boolean isContainerReadWritePasswordSet | ( | ) | throws OneWireException |
Returns true if the password used by the API for reading from or writing to the device's memory has been set.
The return value is not affected by whether or not the read/write password of the container actually matches the value in the device's password register.
true
if the password used by the API for reading from or writing to the device's memory has been set. Implements PasswordContainer.
boolean isContainerWriteOnlyPasswordSet | ( | ) | throws OneWireException |
Returns true if the password used by the API for writing to the device's memory has been set.
The return value is not affected by whether or not the write password of the container actually matches the value in the device's password register.
true
if the password used by the API for writing to the device's memory has been set. Implements PasswordContainer.
boolean isMissionLoaded | ( | ) |
Returns true if the mission results have been loaded from the device.
true
if the mission results have been loaded. Implements MissionContainer.
boolean isMissionRolloverEnabled | ( | ) | throws OneWireException, OneWireIOException |
Returns true
if a rollover is enabled.
true
if a rollover is enabled. Implements MissionContainer.
boolean isMissionRunning | ( | ) | throws OneWireException, OneWireIOException |
Returns true
if a mission is currently running.
true
if a mission is currently running. Implements MissionContainer.
boolean isMissionSUTA | ( | ) | throws OneWireException, OneWireIOException |
Returns true if the currently loaded mission results indicate that this mission has the SUTA bit enabled.
true
if the currently loaded mission results indicate that this mission has the SUTA bit enabled. boolean isMissionWFTA | ( | ) | throws OneWireException, OneWireIOException |
Returns true if the currently loaded mission results indicate that this mission has the SUTA bit enabled and is still Waiting For Temperature Alarm (WFTA).
true
if the currently loaded mission results indicate that this mission has the SUTA bit enabled and is still Waiting For Temperature Alarm (WFTA). boolean isRelative | ( | ) |
Checks to see if humidity value given is a 'relative' humidity value.
true
if this HumidityContainer
provides a relative humidity readingImplements HumidityContainer.
boolean isStartUponTemperatureAlarmEnabled | ( | ) | throws OneWireException, OneWireIOException |
Returns true if the SUTA (Start Upon Temperature Alarm) bit in the Mission Control register is set.
This method will communicate with the device to read the status of the SUTA bit.
true
if the SUTA bit in the Mission Control register is set. boolean isStartUponTemperatureAlarmEnabled | ( | byte[] | state | ) | throws OneWireException, OneWireIOException |
Returns true if the SUTA (Start Upon Temperature Alarm) bit in the Mission Control register is set.
This method will check for the bit in the provided 'state' array, which should be acquired through a call to readDevice()
.
state | current state of the device returned from readDevice() |
true
if the SUTA bit in the Mission Control register is set. synchronized void loadMissionResults | ( | ) | throws OneWireException, OneWireIOException |
Loads the results of the currently running mission.
Must be called before all mission result/status methods.
Implements MissionContainer.
byte readByte | ( | int | memAddr | ) | throws OneWireIOException, OneWireException |
Reads a single byte from the DS1922.
Note that the preferred manner of reading from the DS1922 Thermocron is through the readDevice()
method or through the MemoryBank
objects returned in the getMemoryBanks()
method.
memAddr | the address to read from (in the range of 0x200-0x21F) |
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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 [] readDevice | ( | ) | throws OneWireIOException, OneWireException |
Retrieves the 1-Wire device sensor state.
This state 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.
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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 setADAlarm | ( | int | channel, |
int | alarmType, | ||
double | alarm, | ||
byte[] | state | ||
) | throws OneWireException |
Sets the voltage value of the specified alarm on the specified channel.
The method writeDevice()
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice()
. Also note that not all A/D devices have alarms. Check to see if this device has alarms first by calling the hasADAlarms()
method.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
alarmType | the desired alarm, ALARM_HIGH or ALARM_LOW |
alarm | new alarm value |
state | current state of the device returned from readDevice() |
OneWireException | if this device does not have A/D alarms |
Implements ADContainer.
void setADAlarmEnable | ( | int | channel, |
int | alarmType, | ||
boolean | alarmEnable, | ||
byte[] | state | ||
) | throws OneWireException |
Enables or disables the specified alarm on the specified channel.
The method writeDevice()
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice()
. Also note that not all A/D devices have alarms. Check to see if this device has alarms first by calling the hasADAlarms()
method.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
alarmType | the desired alarm, ALARM_HIGH or ALARM_LOW |
alarmEnable | true to enable the alarm, false to disable |
state | current state of the device returned from readDevice() |
OneWireException | if this device does not have A/D alarms |
Implements ADContainer.
void setADRange | ( | int | channel, |
double | range, | ||
byte[] | state | ||
) |
Sets the input range for the specified channel.
The method writeDevice()
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice()
. Also note that not all A/D devices have alarms. Check to see if this device has alarms first by calling the hasADAlarms()
method.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
range | one of the ranges returned by getADRanges(int) |
state | current state of the device returned from readDevice() |
Implements ADContainer.
void setADResolution | ( | int | channel, |
double | resolution, | ||
byte[] | state | ||
) |
Sets the conversion resolution value for the specified channel.
The method writeDevice()
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice()
. Also note that not all A/D devices have alarms. Check to see if this device has alarms first by calling the hasADAlarms()
method.
channel | channel number in the range [0 to (getNumberADChannels() - 1)] |
resolution | one of the resolutions returned by getADResolutions(int,double) |
state | current state of the device returned from readDevice() |
Implements ADContainer.
void setClock | ( | long | time, |
byte[] | state | ||
) |
Sets the Real-Time clock.
The method writeDevice()
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice()
.
time | new value for the Real-Time clock, in milliseconds since January 1, 1970 |
state | current state of the device returned from readDevice() |
Implements ClockContainer.
void setClockAlarm | ( | long | time, |
byte[] | state | ||
) | throws OneWireException |
Sets the clock alarm.
The method writeDevice()
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice()
. Also note that not all clock devices have alarms. Check to see if this device has alarms first by calling the hasClockAlarm()
method.
time | - new value for the Real-Time clock alarm, in milliseconds since January 1, 1970 |
state | current state of the device returned from readDevice() |
OneWireException | if this device does not have clock alarms |
Implements ClockContainer.
void setClockAlarmEnable | ( | boolean | alarmEnable, |
byte[] | state | ||
) | throws OneWireException |
Enables or disables the clock alarm.
The method writeDevice()
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice()
. Also note that not all clock devices have alarms. Check to see if this device has alarms first by calling the hasClockAlarm()
method.
alarmEnable | true to enable the clock alarm |
state | current state of the device returned from readDevice() |
Implements ClockContainer.
void setClockRunEnable | ( | boolean | runEnable, |
byte[] | state | ||
) |
Enables or disables the oscillator, turning the clock 'on' and 'off'.
The method writeDevice()
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice()
. Also note that not all clock devices can disable their oscillators. Check to see if this device can disable its oscillator first by calling the canDisableClock()
method.
runEnable | true to enable the clock oscillator |
state | current state of the device returned from readDevice() |
Implements ClockContainer.
void setContainerReadOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Sets the Read-Only password used by the API when reading from the device's memory.
This password is not written to the device's Read-Only password register. It is the password used by the software for interacting with the device only.
password | the new password to be used by the API when reading from the device's memory. Length must be (offset + getReadOnlyPasswordLength) |
offset | the starting point for copying from the given password array |
Implements PasswordContainer.
void setContainerReadWritePassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Sets the Read/Write password used by the API when reading from or writing to the device's memory.
This password is not written to the device's Read/Write password register. It is the password used by the software for interacting with the device only.
password | the new password to be used by the API when reading from or writing to the device's memory. Length must be (offset + getReadWritePasswordLength) |
offset | the starting point for copying from the given password array |
Implements PasswordContainer.
void setContainerWriteOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException |
Sets the Write-Only password used by the API when writing to the device's memory.
This password is not written to the device's Write-Only password register. It is the password used by the software for interacting with the device only.
password | the new password to be used by the API when writing to the device's memory. Length must be (offset + getWriteOnlyPasswordLength) |
offset | the starting point for copying from the given password array |
Implements PasswordContainer.
void setDefaultTemperatureCompensationValue | ( | double | temperatureValue, |
boolean | override | ||
) |
Sets the default temperature value for temperature compensation.
This value will be used if there is no temperature log data or if the override
parameter is true.
temperatureValue | the default temperature value for temperature compensation. |
override | if true , the default temperature value will always be used (instead of the temperature log data). |
void setDevicePasswordEnable | ( | boolean | enableReadOnly, |
boolean | enableReadWrite, | ||
boolean | enableWriteOnly | ||
) | throws OneWireException, OneWireIOException |
Enables/Disables passwords for this Device. This method allows you to individually enable the different types of passwords for a particular device. If hasSinglePasswordEnable()
returns true, you can selectively enable particular types of passwords. Otherwise, this method will throw an exception if all supported types are not enabled.
For this to be successful, either write-protect passwords must be disabled, or the write-protect password(s) for this container must be set and must match the value of the write-protect password(s) in the device's register.
WARNING: Enabling passwords requires that both the read password and the read/write password be re-written to the part. Before calling this method, you should set the container read password and read/write password values. This will ensure that the correct value is written into the part.
enableReadOnly | if true Read-Only passwords will be enabled. |
enableReadWrite | if true Read/Write passwords will be enabled. |
enableWriteOnly | if true Write-Only passwords will be enabled. |
Implements PasswordContainer.
void setDevicePasswordEnableAll | ( | boolean | enableAll | ) | throws OneWireException, OneWireIOException |
Enables/Disables passwords for this device. If the part has more than one type of password (Read-Only, Write-Only, or Read/Write), all passwords will be enabled. This function is equivalent to the following: owc41.setDevicePasswordEnable( owc41.hasReadOnlyPassword(), owc41.hasReadWritePassword(), owc41.hasWriteOnlyPassword() );
For this to be successful, either write-protect passwords must be disabled, or the write-protect password(s) for this container must be set and must match the value of the write-protect password(s) in the device's register.
WARNING: Enabling passwords requires that both the read password and the read/write password be re-written to the part. Before calling this method, you should set the container read password and read/write password values. This will ensure that the correct value is written into the part.
enableAll | if true , all passwords are enabled. Otherwise, all passwords are disabled. |
Implements PasswordContainer.
void setDeviceReadOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException, OneWireIOException |
Writes the given password to the device's Read-Only password register. Note that this function does not enable the password, just writes the value to the appropriate memory location.
For this to be successful, either write-protect passwords must be disabled, or the write-protect password(s) for this container must be set and must match the value of the write-protect password(s) in the device's register.
WARNING: Setting the read password requires that both the read password and the read/write password be written to the part. Before calling this method, you should set the container read/write password value. This will ensure that the correct value is written into the part.
password | the new password to be written to the device's Read-Only password register. Length must be (offset + getReadOnlyPasswordLength) |
offset | the starting point for copying from the given password array |
Implements PasswordContainer.
void setDeviceReadWritePassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException, OneWireIOException |
Writes the given password to the device's Read/Write password register. Note that this function does not enable the password, just writes the value to the appropriate memory location.
For this to be successful, either write-protect passwords must be disabled, or the write-protect password(s) for this container must be set and must match the value of the write-protect password(s) in the device's register.
password | the new password to be written to the device's Read-Write password register. Length must be (offset + getReadWritePasswordLength) |
offset | the starting point for copying from the given password array |
Implements PasswordContainer.
void setDeviceWriteOnlyPassword | ( | byte[] | password, |
int | offset | ||
) | throws OneWireException, OneWireIOException |
Writes the given password to the device's Write-Only password register. Note that this function does not enable the password, just writes the value to the appropriate memory location.
For this to be successful, either write-protect passwords must be disabled, or the write-protect password(s) for this container must be set and must match the value of the write-protect password(s) in the device's register.
password | the new password to be written to the device's Write-Only password register. Length must be (offset + getWriteOnlyPasswordLength) |
offset | the starting point for copying from the given password array |
Implements PasswordContainer.
void setFlag | ( | int | register, |
byte | bitMask, | ||
boolean | flagValue, | ||
byte[] | state | ||
) |
Sets the status of the specified flag in the specified register. If a mission is in progress a OneWireIOException
will be thrown (one cannot write to the registers while a mission is commencing). This method is the preferred manner of setting the DS1922 status and control flags. The method writeDevice()
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice()
.
For more information on valid values for the bitMask
parameter, see the getFlag(int,byte) method.
register | address of register containing the flag (see getFlag(int,byte) for available options) |
bitMask | the flag to read (see getFlag(int,byte) for available options) |
flagValue | new value for the flag (true is logic "1") |
state | current state of the device returned from readDevice() |
void setFlag | ( | int | register, |
byte | bitMask, | ||
boolean | flagValue | ||
) | throws OneWireIOException, OneWireException |
Sets the status of the specified flag in the specified register. If a mission is in progress a OneWireIOException
will be thrown (one cannot write to the registers while a mission is commencing). This method actually communicates with the DS1922. To improve performance if you intend to make multiple calls to this method, first call readDevice()
and use the setFlag(int,byte,boolean,byte[])
method instead.
For more information on valid values for the bitMask
parameter, see the getFlag(int,byte) method.
register | address of register containing the flag (see getFlag(int,byte) for available options) |
bitMask | the flag to read (see getFlag(int,byte) for available options) |
flagValue | new value for the flag (true is logic "1") |
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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'. In the case of the DS1922, this could also be due to a currently running mission. |
OneWireException | on a communication or setup error with the 1-Wire adapter |
void setHumidityAlarm | ( | int | alarmType, |
double | alarmValue, | ||
byte[] | state | ||
) | throws OneWireException |
Sets the Humidity alarm value in percent 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 percent |
state | byte array with device state information |
OneWireException | Device does not support Humidity alarms |
Implements HumidityContainer.
void setHumidityCalibrationRegisterUsage | ( | boolean | use | ) |
Enables/Disables the usage of the humidity calibration registers.
Only applies to the DS1923 configuration. The calibration depends on an average error at 3 known reference points. This average error is written to 3 registers on the DS1922. The container use these values to calibrate the recorded humidity values and improve the accuracy of the device. This method allows you to turn off calibration so that you may download the actual data recorded to the device's memory and perform a manual calibration.
use | if true , all humidity values read from device will be calibrated. |
void setHumidityResolution | ( | double | resolution, |
byte[] | state | ||
) | throws OneWireException |
Sets the current Humidity resolution in percent in the provided state
data.
Use the method writeDevice()
with this data to finalize the change to the device.
resolution | Humidity resolution in percent |
state | byte array with device state information |
OneWireException | Device does not support selectable Humidity resolution |
Implements HumidityContainer.
void setMissionAlarm | ( | int | channel, |
int | alarmType, | ||
double | threshold | ||
) | throws OneWireException, OneWireIOException |
Sets the threshold value which will trigger the alarm of the specified type on the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
alarmType | valid value: ALARM_HIGH or ALARM_LOW |
threshold | the threshold value which will trigger the alarm |
Implements MissionContainer.
void setMissionAlarmEnable | ( | int | channel, |
int | alarmType, | ||
boolean | enable | ||
) | throws OneWireException, OneWireIOException |
Enables/disables the alarm of the specified type for the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
alarmType | valid value: ALARM_HIGH or ALARM_LOW |
enable | if true, alarm is enabled. |
Implements MissionContainer.
void setMissionChannelEnable | ( | int | channel, |
boolean | enable | ||
) | throws OneWireException, OneWireIOException |
Enables/disables the specified mission channel, indicating whether or not the channel's readings will be recorded in the mission log.
channel | the channel to enable/disable |
enable | if true, the channel is enabled |
Implements MissionContainer.
void setMissionChannelEnable | ( | int | channel, |
boolean | enable, | ||
byte[] | state | ||
) | throws OneWireException, OneWireIOException |
Enables/disables the specified mission channel, indicating whether or not the channel's readings will be recorded in the mission log.
channel | the channel to enable/disable |
enable | if true, the channel is enabled |
state | the state as returned from readDevice, for cached writes |
void setMissionResolution | ( | int | channel, |
double | resolution | ||
) | throws OneWireException, OneWireIOException |
Sets the selected resolution for the specified channel.
channel | the mission channel, between 0 and (getNumberOfMissionChannels()-1) |
resolution | the new resolution for the specified channel. |
Implements MissionContainer.
synchronized void setSpeedCheck | ( | boolean | doSpeedCheck | ) |
Directs the container to avoid the calls to doSpeed() in methods that communicate with the DS1922/DS2422.
To ensure that all parts can talk to the 1-Wire bus at their desired speed, each method contains a call to doSpeed()
. However, this is an expensive operation. If a user manages the bus speed in an application, call this method with doSpeedCheck
as false
. The default behavior is to call doSpeed()
.
doSpeedCheck | true for doSpeed() to be called before every 1-Wire bus access, false to skip this expensive call |
void setStartUponTemperatureAlarmEnable | ( | boolean | enable | ) | throws OneWireException, OneWireIOException |
Sets the SUTA (Start Upon Temperature Alarm) bit in the Mission Control register.
This method will communicate with the device directly.
enable | sets/clears the SUTA bit in the Mission Control register. |
void setStartUponTemperatureAlarmEnable | ( | boolean | enable, |
byte[] | state | ||
) | throws OneWireException, OneWireIOException |
Sets the SUTA (Start Upon Temperature Alarm) bit in the Mission Control register.
This method will set the bit in the provided 'state' array, which should be acquired through a call to readDevice()
. After updating the 'state', the method writeDevice(byte[])
should be called to commit your changes.
enable | sets/clears the SUTA bit in the Mission Control register. |
state | current state of the device returned from readDevice() |
void setTemperatureAlarm | ( | int | alarmType, |
double | alarmValue, | ||
byte[] | state | ||
) |
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 setTemperatureCalibrationRegisterUsage | ( | boolean | use | ) |
Enables/Disables the usage of calibration registers.
Only applies to the DS1923 configuration. The calibration depends on an average error at 3 known reference points. This average error is written to 3 registers on the DS1922. The container use these values to calibrate the recorded humidity values and improve the accuracy of the device. This method allows you to turn off calibration so that you may download the actual data recorded to the device's memory and perform a manual calibration.
use | if true , all humidity values read from device will be calibrated. |
void setTemperatureCompensationUsage | ( | boolean | use | ) |
Enables/Disables the usage of temperature compensation.
Only applies to the DS1923 configuration. The temperature compensation adjusts the humidity values based on the known effects of temperature on the humidity sensor. If this is a joint humidity and temperature mission, the temperature values used could (should?) come from the temperature log itself. If, however, there is no temperature log the default temperature value can be set for the mission using the setDefaultTemperatureCompensationValue
method.
use | if true , all humidity values read from device will be compensated for temperature. |
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 |
state | byte array with device state information |
OneWireException | if the device does not support selectable temperature resolution |
Implements TemperatureContainer.
void setupContainer | ( | DSPortAdapter | sourceAdapter, |
long | newAddress | ||
) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this 1-Wire device |
Reimplemented from OneWireContainer.
void setupContainer | ( | DSPortAdapter | sourceAdapter, |
byte[] | newAddress | ||
) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this 1-Wire device |
Reimplemented from OneWireContainer.
void setupContainer | ( | DSPortAdapter | sourceAdapter, |
String | newAddress | ||
) |
Provides this container with the adapter object used to access this device and the address of the iButton or 1-Wire device.
sourceAdapter | adapter object required to communicate with this iButton |
newAddress | address of this 1-Wire device |
Reimplemented from OneWireContainer.
void startMission | ( | ) | throws OneWireException, OneWireIOException |
Starts a new mission.
Assumes all parameters have been set by either writing directly to the device registers, or by calling other setup methods.
void startNewMission | ( | int | sampleRate, |
int | missionStartDelay, | ||
boolean | rolloverEnabled, | ||
boolean | syncClock, | ||
boolean[] | channelEnabled | ||
) | throws OneWireException, OneWireIOException |
Begins a new mission on this missioning device.
sampleRate | indicates the sampling rate, in seconds, that this missioning device should log samples. |
missionStartDelay | indicates the amount of time, in minutes, that should pass before the mission begins. |
rolloverEnabled | if false , this device will stop recording new samples after the data log is full. Otherwise, it will replace samples starting at the beginning. |
syncClock | if true , the real-time clock of this missioning device will be synchronized with the current time according to this java.util.Date . |
Implements MissionContainer.
void writeDevice | ( | byte[] | state | ) | throws OneWireIOException, OneWireException |
Writes the 1-Wire device sensor state 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 | 1-Wire device sensor state |
OneWireIOException | on a 1-Wire communication error such as reading an incorrect CRC from a 1-Wire device. 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.
final int ODD_MISSION_LOG_SIZE = 7680 [static] |
mission log size for odd combination of resolutions (i.e.
8-bit temperature & 16-bit data or 16-bit temperature & 8-bit data
final int PASSWORD_CONTROL_REGISTER = 0x227 [static] |
Address of the Password Control Register.
final int READ_ACCESS_PASSWORD = 0x228 [static] |
Address of Read Access Password.
final int READ_WRITE_ACCESS_PASSWORD = 0x230 [static] |
Address of the Read Write Access Password.