The New 1-Wire API for JavaTM


With the 2.0 release of iB-IDE, the API for communicating with Java Powered iButtons has changed. Dallas Semiconductor has released the 1-Wire API for communicating with all 1-Wire devices, including not only the Java Powered iButton but also other devices such as the DS1996 Memory iButton and the DS2890 Digital Potentiometer. See the 1-Wire API information page for more information about this API.


Classes removed from the API

Several classes from the old API no longer exist. Most applications are probably not using these classes. These classes are:


Deprecated classes in the API

The following classes are likely to be used in legacy applications built by iB-IDE versions 1.10 and prior. These classes are now deprecated, and can be found in the jar file deprecated_jibapi.jar. Applications built by older versions of iB-IDE will probably function with the new drivers with little or no change, though it is recommended that host programs be updated to use either the new 1-Wire API code or pure OpenCard code. The old file jibapi.jar should be removed from your classpath in favor of the OneWire.jar and deprecated_jibapi.jar.

Changes to the opencard.properties file

The opencard.properties file is used by the OpenCard API to select a port for communication with iButtons. iB-IDE 1.10 and previous versions created this file with entries that looked like the following:
#Only the last uncommented line will be used to search for iButtons.
#  Uncomment the next line to search COM1 using pure java code
#OpenCard.terminals=com.ibutton.oc.terminal.jib.iButtonCardTerminalFactory|iButtonAdapter|iBUTTON_PORT_TYPE_SERIAL|COM1
#  Uncomment the next line to search COM2 using pure java code
#OpenCard.terminals=com.ibutton.oc.terminal.jib.iButtonCardTerminalFactory|iButtonAdapter|iBUTTON_PORT_TYPE_SERIAL|COM2
#  Uncomment the next line to search COM1 using native code
#OpenCard.terminals=com.ibutton.oc.terminal.jib.iButtonCardTerminalFactory|iButtonAdapter|iBUTTON_PORT_TYPE_LEGACY_SERIAL|COM1
#  This line will search the COM2 for iButtons.
OpenCard.terminals=com.ibutton.oc.terminal.jib.iButtonCardTerminalFactory|iButtonAdapter|iBUTTON_PORT_TYPE_LEGACY_SERIAL|COM2
#  Uncomment the next line to search LPT1 using native code
#OpenCard.terminals=com.ibutton.oc.terminal.jib.iButtonCardTerminalFactory|iButtonAdapter|iBUTTON_PORT_TYPE_LEGACY_PARALLEL|LPT1
#  Uncomment the next line to search LPT2 using native code
#OpenCard.terminals=com.ibutton.oc.terminal.jib.iButtonCardTerminalFactory|iButtonAdapter|iBUTTON_PORT_TYPE_LEGACY_PARALLEL|LPT2
While properties files of this style will still be supported, they are supported through the deprecated API (note that the class com.ibutton.oc.terminal.jib.iButtonCardTerminalFactory is deprecated). The new, preferred format of the opencard.properties file is:
#Only the last uncommented line will be used to search for iButtons.
#  Uncomment the next line to search COM1 using pure java code
#OpenCard.terminals=com.dalsemi.onewire.jib.terminal.JiBCardTerminalFactory|OneWireAdapter|ONEWIRE_PORT_TYPE_SERIAL|COM1
#  Uncomment the next line to search COM2 using pure java code
OpenCard.terminals=com.dalsemi.onewire.jib.terminal.JiBCardTerminalFactory|OneWireAdapter|ONEWIRE_PORT_TYPE_SERIAL|COM2
#  Uncomment the next line to search COM1 using native code
#OpenCard.terminals=com.dalsemi.onewire.jib.terminal.JiBCardTerminalFactory|OneWireAdapter|ONEWIRE_PORT_TYPE_LEGACY_SERIAL|COM1
#  Uncomment the next line to search COM2 using native code
#OpenCard.terminals=com.dalsemi.onewire.jib.terminal.JiBCardTerminalFactory|OneWireAdapter|ONEWIRE_PORT_TYPE_LEGACY_SERIAL|COM2
#  This line will search the LPT1 for iButtons.
#OpenCard.terminals=com.dalsemi.onewire.jib.terminal.JiBCardTerminalFactory|OneWireAdapter|ONEWIRE_PORT_TYPE_LEGACY_PARALLEL|LPT1
#  Uncomment the next line to search LPT2 using native code
#OpenCard.terminals=com.dalsemi.onewire.jib.terminal.JiBCardTerminalFactory|OneWireAdapter|ONEWIRE_PORT_TYPE_LEGACY_PARALLEL|LPT2
Note that with the addition of USB support, the following lines would be recognized to select USB communications with the iButton:

#  This line will search USB slot 1 for iButtons.
#OpenCard.terminals=com.dalsemi.onewire.jib.terminal.JiBCardTerminalFactory|OneWireAdapter|ONEWIRE_PORT_TYPE_LEGACY_USB|USB1
#  This line will search USB slot 2 for iButtons.
#OpenCard.terminals=com.dalsemi.onewire.jib.terminal.JiBCardTerminalFactory|OneWireAdapter|ONEWIRE_PORT_TYPE_LEGACY_USB|USB2

iButton Homepage: http://www.ibutton.com/