Instances of valid DSPortAdapter's are retrieved from methods in OneWireAccessProvider.
The DotNetAdapterx86 methods can be organized into the following categories:
Public Member Functions | |
DotNetAdapterx86 () throws ClassNotFoundException | |
Constructs a default adapter. | |
DotNetAdapterx86 (int newPortType) throws ClassNotFoundException | |
Constructs with a specified port type. | |
String | getAdapterName () |
Retrieve the name of the port adapter as a string. | |
String | getPortTypeDescription () |
Retrieve a description of the port required by this port adapter. | |
String | getClassVersion () |
Retrieve a version string for this class. | |
Enumeration | getPortNames () |
Retrieve a list of the platform appropriate port names for this adapter. | |
boolean | selectPort (String portName) throws OneWireIOException, OneWireException |
Specify a platform appropriate port name for this adapter. | |
void | freePort () throws OneWireException |
Free ownership of the selected port if it is currently owned back to the system. | |
String | getPortName () throws OneWireException |
Retrieve the name of the selected port as a String . | |
boolean | adapterDetected () throws OneWireIOException, OneWireException |
Detect adapter presence on the selected port. | |
String | getAdapterVersion () throws OneWireIOException, OneWireException |
Retrieve the version of the adapter. | |
String | getAdapterAddress () throws OneWireIOException, OneWireException |
Retrieve the address of the adapter if it has one. | |
boolean | canOverdrive () throws OneWireIOException, OneWireException |
Returns whether adapter can physically support overdrive mode. | |
boolean | canHyperdrive () throws OneWireIOException, OneWireException |
Returns whether the adapter can physically support hyperdrive mode. | |
boolean | canFlex () throws OneWireIOException, OneWireException |
Returns whether the adapter can physically support flex speed mode. | |
boolean | canProgram () throws OneWireIOException, OneWireException |
Returns whether adapter can physically support 12 volt power mode. | |
boolean | canDeliverPower () throws OneWireIOException, OneWireException |
Returns whether the adapter can physically support strong 5 volt power mode. | |
boolean | canDeliverSmartPower () throws OneWireIOException, OneWireException |
Returns whether the adapter can physically support "smart" strong 5 volt power mode. | |
boolean | canBreak () throws OneWireIOException, OneWireException |
Returns whether adapter can physically support 0 volt 'break' mode. | |
boolean | findFirstDevice () throws OneWireIOException, OneWireException |
Returns true if the first iButton or 1-Wire device is found on the 1-Wire Network. | |
boolean | findNextDevice () throws OneWireIOException, OneWireException |
Returns true if the next iButton or 1-Wire device is found. | |
void | getAddress (byte[] address) |
Copies the 'current' iButton address being used by the adapter into the array. | |
boolean | isPresent (byte[] address) throws OneWireIOException, OneWireException |
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network. | |
boolean | isAlarming (byte[] address) throws OneWireIOException, OneWireException |
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network and in an alarm state. | |
boolean | select (byte[] address) throws OneWireIOException, OneWireException |
Selects the specified iButton or 1-Wire device by broadcasting its address. | |
void | setSearchOnlyAlarmingDevices () |
Set the 1-Wire Network search to find only iButtons and 1-Wire devices that are in an 'Alarm' state that signals a need for attention. | |
void | setNoResetSearch () |
Set the 1-Wire Network search to not perform a 1-Wire reset before a search. | |
void | setSearchAllDevices () |
Set the 1-Wire Network search to find all iButtons and 1-Wire devices whether they are in an 'Alarm' state or not and restores the default setting of providing a 1-Wire reset command before each search. | |
boolean | beginExclusive (boolean blocking) throws OneWireException |
Gets exclusive use of the 1-Wire to communicate with an iButton or 1-Wire Device. | |
void | endExclusive () |
Relinquishes exclusive control of the 1-Wire Network. | |
void | putBit (boolean bitValue) throws OneWireIOException, OneWireException |
Sends a bit to the 1-Wire Network. | |
boolean | getBit () throws OneWireIOException, OneWireException |
Gets a bit from the 1-Wire Network. | |
void | putByte (int byteValue) throws OneWireIOException, OneWireException |
Sends a byte to the 1-Wire Network. | |
int | getByte () throws OneWireIOException, OneWireException |
Gets a byte from the 1-Wire Network. | |
byte[] | getBlock (int len) throws OneWireIOException, OneWireException |
Get a block of data from the 1-Wire Network. | |
void | getBlock (byte[] arr, int len) throws OneWireIOException, OneWireException |
Get a block of data from the 1-Wire Network and write it into the provided array. | |
void | getBlock (byte[] arr, int off, int len) throws OneWireIOException, OneWireException |
Get a block of data from the 1-Wire Network and write it into the provided array. | |
void | dataBlock (byte dataBlock[], int off, int len) throws OneWireIOException, OneWireException |
Sends a block of data and returns the data received in the same array. | |
int | reset () throws OneWireIOException, OneWireException |
Sends a Reset to the 1-Wire Network. | |
void | setPowerDuration (int timeFactor) throws OneWireIOException, OneWireException |
Sets the duration to supply power to the 1-Wire Network. | |
boolean | startPowerDelivery (int changeCondition) throws OneWireIOException, OneWireException |
Sets the 1-Wire Network voltage to supply power to an iButton device. | |
void | setProgramPulseDuration (int timeFactor) throws OneWireIOException, OneWireException |
Sets the duration for providing a program pulse on the 1-Wire Network. | |
boolean | startProgramPulse (int changeCondition) throws OneWireIOException, OneWireException |
Sets the 1-Wire Network voltage to eprom programming level. | |
void | startBreak () throws OneWireIOException, OneWireException |
Sets the 1-Wire Network voltage to 0 volts. | |
void | setPowerNormal () throws OneWireIOException, OneWireException |
Sets the 1-Wire Network voltage to normal level. | |
void | setSpeed (int desiredSpeed) throws OneWireIOException, OneWireException |
This method takes an int representing the new speed of data transfer on the 1-Wire Network. | |
int | getSpeed () |
This method returns the current data transfer speed through a port to a 1-Wire Network. | |
boolean | setTMEXPortType (int newPortType) |
Select the DotNet specified port type (0 to 15) Use this method if the constructor with the PortType cannot be used. | |
Static Public Member Functions | |
static void | CleanUpByThread (Thread thread) |
CleanUp the native state for classes owned by the provided thread. | |
static String | getDefaultAdapterName () |
Get the default Adapter Name. | |
static String | getDefaultPortName () |
Get the default Adapter Port name. | |
Protected Member Functions | |
void | finalize () |
Finalize to Cleanup native. | |
Protected Attributes | |
int | portType |
DotNet port type number (0-15). | |
byte[] | RomDta = new byte [8] |
Current 1-Wire Network Address. |
DotNetAdapterx86 | ( | ) | throws ClassNotFoundException |
Constructs a default adapter.
ClassNotFoundException |
DotNetAdapterx86 | ( | int | newPortType | ) | throws ClassNotFoundException |
Constructs with a specified port type.
newPortType |
ClassNotFoundException |
String getAdapterName | ( | ) | [virtual] |
Retrieve the name of the port adapter as a string.
The 'Adapter' is a device that connects to a 'port' that allows one to communicate with an iButton or other 1-Wire device. As example of this is 'DS9097U'.
String
representation of the port adapter. Implements DSPortAdapter.
String getPortTypeDescription | ( | ) | [virtual] |
Retrieve a description of the port required by this port adapter.
An example of a 'Port' would 'serial communication port'.
String
description of the port type required. Implements DSPortAdapter.
String getClassVersion | ( | ) | [virtual] |
Enumeration getPortNames | ( | ) | [virtual] |
Retrieve a list of the platform appropriate port names for this adapter.
A port must be selected with the method 'selectPort' before any other communication methods can be used. Using a communcation method before 'selectPort' will result in a OneWireException
exception.
String
that contains the port names Implements DSPortAdapter.
boolean selectPort | ( | String | portName | ) | throws OneWireIOException, OneWireException [virtual] |
Specify a platform appropriate port name for this adapter.
Note that even though the port has been selected, it's ownership may be relinquished if it is not currently held in a 'exclusive' block. This class will then try to re-aquire the port when needed. If the port cannot be re-aquired ehen the exception PortInUseException
will be thrown.
portName | name of the target port, retrieved from getPortNames() |
true
if the port was aquired, false
if the port is not available.OneWireIOException | If port does not exist, or unable to communicate with port. | |
OneWireException | If port does not exist |
Implements DSPortAdapter.
void freePort | ( | ) | throws OneWireException [virtual] |
Free ownership of the selected port if it is currently owned back to the system.
This should only be called if the recently selected port does not have an adapter or at the end of your application's use of the port.
OneWireException | If port does not exist |
Implements DSPortAdapter.
String getPortName | ( | ) | throws OneWireException [virtual] |
Retrieve the name of the selected port as a String
.
String
of selected portOneWireException | if valid port not yet selected |
Implements DSPortAdapter.
boolean adapterDetected | ( | ) | throws OneWireIOException, OneWireException [virtual] |
Detect adapter presence on the selected port.
true
if the adapter is confirmed to be connected to the selected port, false
if the adapter is not connected.OneWireIOException | ||
OneWireException |
Implements DSPortAdapter.
String getAdapterVersion | ( | ) | throws OneWireIOException, OneWireException |
Retrieve the version of the adapter.
String
of the adapter version. It will return "<na>" if the adapter version is not or cannot be known.OneWireIOException | on a 1-Wire communication error such as no device present. This could be caused by a physical interruption in the 1-Wire Network due to static native shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
String getAdapterAddress | ( | ) | throws OneWireIOException, OneWireException |
Retrieve the address of the adapter if it has one.
String
of the adapter address. It will return "<na>" if the adapter does not have an address. The address is a string representation of an 1-Wire address.OneWireIOException | on a 1-Wire communication error such as no device present. This could be caused by a physical interruption in the 1-Wire Network due to static native shorts or a newly arriving 1-Wire device issuing a 'presence pulse'. | |
OneWireException | on a communication or setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean canOverdrive | ( | ) | throws OneWireIOException, OneWireException |
Returns whether adapter can physically support overdrive mode.
true
if this port adapter can do OverDrive, false
otherwise.OneWireIOException | on a 1-Wire communication error with the adapter | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean canHyperdrive | ( | ) | throws OneWireIOException, OneWireException |
Returns whether the adapter can physically support hyperdrive mode.
true
if this port adapter can do HyperDrive, false
otherwise.OneWireIOException | on a 1-Wire communication error with the adapter | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean canFlex | ( | ) | throws OneWireIOException, OneWireException |
Returns whether the adapter can physically support flex speed mode.
true
if this port adapter can do flex speed, false
otherwise.OneWireIOException | on a 1-Wire communication error with the adapter | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean canProgram | ( | ) | throws OneWireIOException, OneWireException |
Returns whether adapter can physically support 12 volt power mode.
true
if this port adapter can do Program voltage, false
otherwise.OneWireIOException | on a 1-Wire communication error with the adapter | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean canDeliverPower | ( | ) | throws OneWireIOException, OneWireException |
Returns whether the adapter can physically support strong 5 volt power mode.
true
if this port adapter can do strong 5 volt mode, false
otherwise.OneWireIOException | on a 1-Wire communication error with the adapter | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean canDeliverSmartPower | ( | ) | throws OneWireIOException, OneWireException |
Returns whether the adapter can physically support "smart" strong 5 volt power mode.
"smart" power delivery is the ability to deliver power until it is no longer needed. The current drop it detected and power delivery is stopped.
true
if this port adapter can do "smart" strong 5 volt mode, false
otherwise.OneWireIOException | on a 1-Wire communication error with the adapter | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean canBreak | ( | ) | throws OneWireIOException, OneWireException |
Returns whether adapter can physically support 0 volt 'break' mode.
true
if this port adapter can do break, false
otherwise.OneWireIOException | on a 1-Wire communication error with the adapter | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean findFirstDevice | ( | ) | throws OneWireIOException, OneWireException [virtual] |
Returns true
if the first iButton or 1-Wire device is found on the 1-Wire Network.
If no devices are found, then false
will be returned.
true
if an iButton or 1-Wire device is found.OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
boolean findNextDevice | ( | ) | throws OneWireIOException, OneWireException [virtual] |
Returns true
if the next iButton or 1-Wire device is found.
The previous 1-Wire device found is used as a starting point in the search. If no more devices are found then false
will be returned.
true
if an iButton or 1-Wire device is found.OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
void getAddress | ( | byte[] | address | ) | [virtual] |
Copies the 'current' iButton address being used by the adapter into the array.
This address is the last iButton or 1-Wire device found in a search (findNextDevice()...). This method copies into a user generated array to allow the reuse of the buffer. When searching many iButtons on the one wire network, this will reduce the memory burn rate.
address | An array to be filled with the current iButton address. |
Implements DSPortAdapter.
boolean isPresent | ( | byte[] | address | ) | throws OneWireIOException, OneWireException |
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network.
This does not affect the 'current' device state information used in searches (findNextDevice...).
address | device address to verify is present |
true
if device is present else false
.OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean isAlarming | ( | byte[] | address | ) | throws OneWireIOException, OneWireException |
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network and in an alarm state.
This does not affect the 'current' device state information used in searches (findNextDevice...).
address | device address to verify is present and alarming |
true
if device is present and alarming else false
.OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean select | ( | byte[] | address | ) | throws OneWireIOException, OneWireException |
Selects the specified iButton or 1-Wire device by broadcasting its address.
This operation is refered to a 'MATCH ROM' operation in the iButton and 1-Wire device data sheets. This does not affect the 'current' device state information used in searches (findNextDevice...).
Warning, this does not verify that the device is currently present on the 1-Wire Network (See isPresent).
address | iButton to select |
true
if device address was sent,false
otherwise.OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Address
Reimplemented from DSPortAdapter.
void setSearchOnlyAlarmingDevices | ( | ) | [virtual] |
Set the 1-Wire Network search to find only iButtons and 1-Wire devices that are in an 'Alarm' state that signals a need for attention.
Not all iButton types have this feature. Some that do: DS1994, DS1920, DS2407. This selective searching can be canceled with the 'setSearchAllDevices()' method.
Implements DSPortAdapter.
void setNoResetSearch | ( | ) | [virtual] |
Set the 1-Wire Network search to not perform a 1-Wire reset before a search.
This feature is chiefly used with the DS2409 1-Wire coupler. The normal reset before each search can be restored with the 'setSearchAllDevices()' method.
Implements DSPortAdapter.
void setSearchAllDevices | ( | ) | [virtual] |
Set the 1-Wire Network search to find all iButtons and 1-Wire devices whether they are in an 'Alarm' state or not and restores the default setting of providing a 1-Wire reset command before each search.
(see setNoResetSearch() method).
Implements DSPortAdapter.
boolean beginExclusive | ( | boolean | blocking | ) | throws OneWireException [virtual] |
Gets exclusive use of the 1-Wire to communicate with an iButton or 1-Wire Device.
This method should be used for critical sections of code where a sequence of commands must not be interrupted by communication of threads with other iButtons, and it is permissible to sustain a delay in the special case that another thread has already been granted exclusive access and this access has not yet been relinquished.
It can be called through the OneWireContainer class by the end application if they want to ensure exclusive use. If it is not called around several methods then it will be called inside each method.
blocking | true if want to block waiting for an excluse access to the adapter |
true
if blocking was false and a exclusive session with the adapter was aquiredOneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
void endExclusive | ( | ) | [virtual] |
Relinquishes exclusive control of the 1-Wire Network.
This command dynamically marks the end of a critical section and should be used when exclusive control is no longer needed.
Implements DSPortAdapter.
void putBit | ( | boolean | bitValue | ) | throws OneWireIOException, OneWireException [virtual] |
Sends a bit to the 1-Wire Network.
bitValue | the bit value to send to the 1-Wire Network. |
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
boolean getBit | ( | ) | throws OneWireIOException, OneWireException [virtual] |
Gets a bit from the 1-Wire Network.
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
void putByte | ( | int | byteValue | ) | throws OneWireIOException, OneWireException [virtual] |
Sends a byte to the 1-Wire Network.
byteValue | the byte value to send to the 1-Wire Network. |
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
int getByte | ( | ) | throws OneWireIOException, OneWireException [virtual] |
Gets a byte from the 1-Wire Network.
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
byte [] getBlock | ( | int | len | ) | throws OneWireIOException, OneWireException [virtual] |
Get a block of data from the 1-Wire Network.
len | length of data bytes to receive |
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
void getBlock | ( | byte[] | arr, | |
int | len | |||
) | throws OneWireIOException, OneWireException [virtual] |
Get a block of data from the 1-Wire Network and write it into the provided array.
arr | array in which to write the received bytes | |
len | length of data bytes to receive |
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
void getBlock | ( | byte[] | arr, | |
int | off, | |||
int | len | |||
) | throws OneWireIOException, OneWireException [virtual] |
Get a block of data from the 1-Wire Network and write it into the provided array.
arr | array in which to write the received bytes | |
off | offset into the array to start | |
len | length of data bytes to receive |
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
void dataBlock | ( | byte | dataBlock[], | |
int | off, | |||
int | len | |||
) | throws OneWireIOException, OneWireException [virtual] |
Sends a block of data and returns the data received in the same array.
This method is used when sending a block that contains reads and writes. The 'read' portions of the data block need to be pre-loaded with 0xFF's. It starts sending data from the index at offset 'off' for length 'len'.
dataBlock | array of data to transfer to and from the 1-Wire Network. | |
off | offset into the array of data to start | |
len | length of data to send / receive starting at 'off' |
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
int reset | ( | ) | throws OneWireIOException, OneWireException [virtual] |
Sends a Reset to the 1-Wire Network.
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Implements DSPortAdapter.
void setPowerDuration | ( | int | timeFactor | ) | throws OneWireIOException, OneWireException |
Sets the duration to supply power to the 1-Wire Network.
This method takes a time parameter that indicates the program pulse length when the method startPowerDelivery().
Note: to avoid getting an exception, use the canDeliverPower() and canDeliverSmartPower() method to check it's availability.
timeFactor |
|
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean startPowerDelivery | ( | int | changeCondition | ) | throws OneWireIOException, OneWireException |
Sets the 1-Wire Network voltage to supply power to an iButton device.
This method takes a time parameter that indicates whether the power delivery should be done immediately, or after certain conditions have been met.
Note: to avoid getting an exception, use the canDeliverPower() and canDeliverSmartPower() method to check it's availability.
changeCondition |
|
true
if the voltage change was successful, false
otherwise.OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
void setProgramPulseDuration | ( | int | timeFactor | ) | throws OneWireIOException, OneWireException |
Sets the duration for providing a program pulse on the 1-Wire Network.
This method takes a time parameter that indicates the program pulse length when the method startProgramPulse().
Note: to avoid getting an exception, use the canDeliverPower() method to check it's availability.
timeFactor |
|
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter |
Reimplemented from DSPortAdapter.
boolean startProgramPulse | ( | int | changeCondition | ) | throws OneWireIOException, OneWireException |
Sets the 1-Wire Network voltage to eprom programming level.
This method takes a time parameter that indicates whether the power delivery should be done immediately, or after certain conditions have been met.
Note: to avoid getting an exception, use the canProgram() method to check it's availability.
changeCondition |
|
true
if the voltage change was successful, false
otherwise.OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter or the adapter does not support this operation |
Reimplemented from DSPortAdapter.
void startBreak | ( | ) | throws OneWireIOException, OneWireException |
Sets the 1-Wire Network voltage to 0 volts.
This method is used rob all 1-Wire Network devices of parasite power delivery to force them into a hard reset.
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter or the adapter does not support this operation |
Reimplemented from DSPortAdapter.
void setPowerNormal | ( | ) | throws OneWireIOException, OneWireException |
Sets the 1-Wire Network voltage to normal level.
This method is used to disable 1-Wire conditions created by startPowerDelivery and startProgramPulse. This method will automatically be called if a communication method is called while an outstanding power command is taking place.
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter or the adapter does not support this operation |
Reimplemented from DSPortAdapter.
void setSpeed | ( | int | desiredSpeed | ) | throws OneWireIOException, OneWireException |
This method takes an int representing the new speed of data transfer on the 1-Wire Network.
speed |
| |
desiredSpeed |
OneWireIOException | on a 1-Wire communication error | |
OneWireException | on a setup error with the 1-Wire adapter or the adapter does not support this operation |
Reimplemented from DSPortAdapter.
int getSpeed | ( | ) |
This method returns the current data transfer speed through a port to a 1-Wire Network.
Reimplemented from DSPortAdapter.
boolean setTMEXPortType | ( | int | newPortType | ) |
Select the DotNet specified port type (0 to 15) Use this method if the constructor with the PortType cannot be used.
newPortType |
static String getDefaultAdapterName | ( | ) | [static] |
Get the default Adapter Name.
static String getDefaultPortName | ( | ) | [static] |
Get the default Adapter Port name.