Inherited by OneWireContainer27.
This iButton is used as a portable real-time-clock.
The clock methods can be organized into the following categories. Note that methods that are implemented for the ClockContainer interface are marked with (*):
Public Member Functions | |
OneWireContainer24 () | |
Create an empty container that is not complete until after a call to setupContainer . | |
OneWireContainer24 (DSPortAdapter sourceAdapter, byte[] newAddress) | |
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device. | |
OneWireContainer24 (DSPortAdapter sourceAdapter, long newAddress) | |
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device. | |
OneWireContainer24 (DSPortAdapter sourceAdapter, String newAddress) | |
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device. | |
String | getName () |
Get the Maxim Integrated Products part number of the iButton or 1-Wire Device as a string. | |
String | getAlternateNames () |
Get the alternate Maxim Integrated Products part numbers or names. | |
String | getDescription () |
Get a short description of the function of this iButton or 1-Wire Device type. | |
boolean | hasClockAlarm () |
Query to see if the clock has an alarm feature. | |
boolean | canDisableClock () |
Query to see if the clock can be disabled. | |
long | getClockResolution () |
Query to get the clock resolution in milliseconds. | |
byte[] | readDevice () throws OneWireIOException, OneWireException |
Retrieves the five byte state over the 1-Wire bus. | |
void | writeDevice (byte[] state) throws OneWireIOException, OneWireException |
Writes the 1-Wire device sensor state that have been changed by 'set' methods. | |
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 | setClockAlarmEnable (boolean alarmEnable, byte[] state) throws OneWireException |
Enables or disables the clock alarm. | |
void | setClockRunEnable (boolean runEnable, byte[] state) |
Enables or disables the oscillator, turning the clock 'on' and 'off'. |
Create an empty container that is not complete until after a call to setupContainer
.
This is one of the methods to construct a container. The others are through creating a OneWireContainer with parameters.
OneWireContainer24 | ( | DSPortAdapter | sourceAdapter, | |
byte[] | newAddress | |||
) |
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.
This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.
sourceAdapter | adapter instance used to communicate with this iButton | |
newAddress | Address of this 1-Wire device |
OneWireContainer24 | ( | DSPortAdapter | sourceAdapter, | |
long | newAddress | |||
) |
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.
This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.
sourceAdapter | adapter instance used to communicate with this 1-Wire device | |
newAddress | Address of this 1-Wire device |
OneWireContainer24 | ( | DSPortAdapter | sourceAdapter, | |
String | newAddress | |||
) |
Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.
This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.
sourceAdapter | adapter instance used to communicate with this 1-Wire device | |
newAddress | Address of this 1-Wire device |
String getName | ( | ) |
Get the Maxim Integrated Products part number of the iButton or 1-Wire Device as a string.
For example 'DS1992'.
Reimplemented from OneWireContainer.
Reimplemented in OneWireContainer27.
String getAlternateNames | ( | ) |
Get the alternate Maxim Integrated Products part numbers or names.
A 'family' of 1-Wire Network devices may have more than one part number depending on packaging. There can also be nicknames such as 'Crypto iButton'.
Reimplemented from OneWireContainer.
Reimplemented in OneWireContainer27.
String getDescription | ( | ) |
Get a short description of the function of this iButton or 1-Wire Device type.
Reimplemented from OneWireContainer.
Reimplemented in OneWireContainer27.
boolean hasClockAlarm | ( | ) |
Query to see if the clock has an alarm feature.
isClockAlarmEnabled(byte[])
isClockAlarming(byte[])
setClockAlarm(long,byte[])
setClockAlarmEnable(boolean,byte[])
Implements ClockContainer.
boolean canDisableClock | ( | ) |
Query to see if the clock can be disabled.
setClockRunEnable(boolean,byte[])
Implements ClockContainer.
long getClockResolution | ( | ) |
Query to get the clock resolution in milliseconds.
Implements ClockContainer.
byte [] readDevice | ( | ) | throws OneWireIOException, OneWireException |
Retrieves the five byte state over the 1-Wire bus.
This state array must be passed to the Get/Set methods as well as the WriteDevice method.
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 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.
long getClock | ( | byte[] | state | ) |
Extracts the Real-Time clock value in milliseconds.
state | current state of the device returned from readDevice() |
setClock(long,byte[])
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() |
OneWireException | if this device does not have clock alarms |
isClockAlarmEnabled(byte[])
isClockAlarming(byte[])
setClockAlarm(long,byte[])
setClockAlarmEnable(boolean,byte[])
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() |
isClockAlarmEnabled(byte[])
getClockAlarm(byte[])
setClockAlarm(long,byte[])
setClockAlarmEnable(boolean,byte[])
Implements ClockContainer.
boolean isClockAlarmEnabled | ( | byte[] | state | ) |
Checks if the clock alarm is enabled.
state | current state of the device returned from readDevice() |
isClockAlarming(byte[])
getClockAlarm(byte[])
setClockAlarm(long,byte[])
setClockAlarmEnable(boolean,byte[])
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() |
setClockRunEnable(boolean,byte[])
Implements ClockContainer.
void setClock | ( | long | time, | |
byte[] | state | |||
) |
Sets the Real-Time clock.
The method writeDevice(byte[])
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice(byte[])
.
time | new value for the Real-Time clock, in milliseconds since some reference time (ie. 12:00am, January 1st, 1970) | |
state | current state of the device returned from readDevice() |
getClock(byte[])
Implements ClockContainer.
void setClockAlarm | ( | long | time, | |
byte[] | state | |||
) | throws OneWireException |
Sets the clock alarm.
The method writeDevice(byte[])
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice(byte[])
. 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 |
isClockAlarmEnabled(byte[])
getClockAlarm(byte[])
isClockAlarming(byte[])
setClockAlarmEnable(boolean,byte[])
Implements ClockContainer.
void setClockAlarmEnable | ( | boolean | alarmEnable, | |
byte[] | state | |||
) | throws OneWireException |
Enables or disables the clock alarm.
The method writeDevice(byte[])
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice(byte[])
. 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() |
OneWireException | if this device does not have clock alarms |
isClockAlarmEnabled(byte[])
getClockAlarm(byte[])
setClockAlarm(long,byte[])
isClockAlarming(byte[])
Implements ClockContainer.
void setClockRunEnable | ( | boolean | runEnable, | |
byte[] | state | |||
) |
Enables or disables the oscillator, turning the clock 'on' and 'off'.
The method writeDevice(byte[])
must be called to finalize changes to the device. Note that multiple 'set' methods can be called before one call to writeDevice(byte[])
. 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() |
isClockRunning(byte[])
Implements ClockContainer.