|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.dalsemi.onewire.adapter.DSPortAdapter
com.dalsemi.onewire.adapter.TINIAdapter
com.dalsemi.onewire.adapter.TINIInternalAdapter
Port adapter for the TINI internal 1-Wire bus.
canDeliverPower method will return true,
but be aware that this only applies to single low current devices (single EEPROM,
temperature, or potentiometer).
| Field Summary | |
protected java.lang.String |
classVersion
Version string for this adapter class |
protected static int |
OW_EXTERNAL
|
protected static int |
OW_INTERNAL
|
protected static int |
OWDISPATCH_CANCELSTRONGPU
|
protected static int |
OWDISPATCH_CANPROGRAM
|
protected static int |
OWDISPATCH_DOPROGRAMPULSE
|
protected static int |
OWDISPATCH_GETSPEED
|
protected static int |
OWDISPATCH_GETVERSION
|
protected static int |
OWDISPATCH_ISPRESENT
|
protected static int |
OWDISPATCH_SETSPEED
|
protected boolean |
portSelected
|
protected int |
portType
|
| Fields inherited from class com.dalsemi.onewire.adapter.DSPortAdapter |
CONDITION_AFTER_BIT, CONDITION_AFTER_BYTE, CONDITION_NOW, DELIVERY_CURRENT_DETECT, DELIVERY_EPROM, DELIVERY_FOUR_SECONDS, DELIVERY_HALF_SECOND, DELIVERY_INFINITE, DELIVERY_ONE_SECOND, DELIVERY_SMART_DONE, DELIVERY_TWO_SECONDS, LEVEL_BREAK, LEVEL_NORMAL, LEVEL_POWER_DELIVERY, LEVEL_PROGRAM, RESET_ALARM, RESET_NOPRESENCE, RESET_PRESENCE, RESET_SHORT, SPEED_FLEX, SPEED_HYPERDRIVE, SPEED_OVERDRIVE, SPEED_REGULAR |
| Constructor Summary | |
TINIInternalAdapter()
Constructor TINIInternalAdapter |
|
| Method Summary | |
boolean |
adapterDetected()
Detect adapter presence on the selected port. |
boolean |
beginExclusive(boolean blocking)
Gets exclusive use of the 1-Wire to communicate with an iButton or 1-Wire Device. |
boolean |
canDeliverPower()
Returns whether the adapter can physically support strong 5 volt power mode. |
boolean |
canFlex()
Returns whether the adapter can physically support flex speed mode. |
boolean |
canHyperdrive()
Returns whether the adapter can physically support hyperdrive mode. |
boolean |
canOverdrive()
Returns whether adapter can physically support overdrive mode. |
boolean |
canProgram()
Returns whether adapter can physically support 12 volt power mode. |
void |
dataBlock(byte[] dataBlock,
int off,
int len)
Sends a block of data and returns the data received in the same array. |
void |
endExclusive()
Relinquishes exclusive control of the 1-Wire Network. |
boolean |
findFirstDevice()
Returns true if the first iButton or 1-Wire device
is found on the 1-Wire Network. |
boolean |
findNextDevice()
Returns true if the next iButton or 1-Wire device
is found. |
void |
freePort()
Free ownership of the selected port if it is currently owned back to the system. |
java.lang.String |
getAdapterName()
Retrieve the name of the port adapter as a string. |
java.lang.String |
getAdapterVersion()
Retrieves the version of the adapter. |
void |
getAddress(byte[] address)
Copies the 'current' iButton address being used by the adapter into the array. |
boolean |
getBit()
Gets a bit from the 1-Wire Network. |
void |
getBlock(byte[] arr,
int len)
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)
Get a block of data from the 1-Wire Network and write it into the provided array. |
byte[] |
getBlock(int len)
Get a block of data from the 1-Wire Network. |
int |
getByte()
Gets a byte from the 1-Wire Network. |
java.lang.String |
getClassVersion()
Retrieve a version string for this class |
java.lang.String |
getPortName()
Retrieve the name of the selected port as a String. |
java.util.Enumeration |
getPortNames()
Retrieve a list of the platform appropriate port names for this adapter. |
java.lang.String |
getPortTypeDescription()
Retrieve a description of the port required by this port adapter. |
int |
getSpeed()
This method returns the current data transfer speed through a port to a 1-Wire Network. |
boolean |
isAlarming(byte[] address)
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network and in an alarm state. |
boolean |
isPresent(byte[] address)
Verifies that the iButton or 1-Wire device specified is present on the 1-Wire Network. |
protected static int |
OWDispatchNative(int function,
int port,
int value)
|
void |
putBit(boolean bitValue)
Sends a bit to the 1-Wire Network. |
void |
putByte(int byteValue)
Sends a byte to the 1-Wire Network. |
int |
reset()
Sends a Reset to the 1-Wire Network. |
boolean |
select(byte[] address)
Selects the specified iButton or 1-Wire device by broadcasting its address. |
boolean |
selectPort(java.lang.String portName)
Specify a platform appropriate port name for this adapter. |
void |
setNoResetSearch()
Set the 1-Wire Network search to not perform a 1-Wire reset before a search. |
void |
setPowerDuration(int timeFactor)
Sets the duration to supply power to the 1-Wire Network. |
void |
setPowerNormal()
Sets the 1-Wire Network voltage to normal level. |
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. |
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 |
setSpeed(int speed)
This method takes an int representing the new speed of data transfer on the 1-Wire Network. |
boolean |
startPowerDelivery(int changeCondition)
Sets the 1-Wire Network voltage to supply power to an iButton device. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final int OW_EXTERNAL
protected static final int OW_INTERNAL
protected int portType
protected boolean portSelected
protected java.lang.String classVersion
protected static final int OWDISPATCH_SETSPEED
protected static final int OWDISPATCH_GETSPEED
protected static final int OWDISPATCH_CANPROGRAM
protected static final int OWDISPATCH_DOPROGRAMPULSE
protected static final int OWDISPATCH_CANCELSTRONGPU
protected static final int OWDISPATCH_GETVERSION
protected static final int OWDISPATCH_ISPRESENT
| Constructor Detail |
public TINIInternalAdapter()
| Method Detail |
public java.lang.String getAdapterName()
getAdapterName in class DSPortAdapterString representation of the port adapter.public java.lang.String getPortTypeDescription()
getPortTypeDescription in class DSPortAdapterString description of the port type required.public java.lang.String getClassVersion()
getClassVersion in class DSPortAdapterpublic java.util.Enumeration getPortNames()
OneWireException exception.
getPortNames in class DSPortAdapterString that contains the port
names
public boolean selectPort(java.lang.String portName)
throws OneWireIOException,
OneWireException
PortInUseException will be thrown.
selectPort in class DSPortAdapterportName - name of the target port, retrieved from
getPortNames()
true if the port was aquired, false
if the port is not available.
OneWireIOException
OneWireException
public java.lang.String getPortName()
throws OneWireException
String.
getPortName in class DSPortAdapterString of selected port
OneWireException
public boolean canOverdrive()
throws OneWireIOException,
OneWireException
canOverdrive in class DSPortAdaptertrue if this port adapter can do OverDrive,
false otherwise.
OneWireIOException
OneWireException
public boolean canHyperdrive()
throws OneWireIOException,
OneWireException
canHyperdrive in class DSPortAdaptertrue if this port adapter can do HyperDrive,
false otherwise.
OneWireIOException
OneWireException
public boolean canFlex()
throws OneWireIOException,
OneWireException
canFlex in class DSPortAdaptertrue if this port adapter can do flex speed,
false otherwise.
OneWireIOException
OneWireException
public boolean canDeliverPower()
throws OneWireIOException,
OneWireException
canDeliverPower in class DSPortAdaptertrue if this port adapter can do strong 5 volt
mode, false otherwise.
OneWireIOException
OneWireException
protected static int OWDispatchNative(int function,
int port,
int value)
public void freePort()
throws OneWireException
freePort in class DSPortAdapterOneWireException
public java.lang.String getAdapterVersion()
throws OneWireIOException,
OneWireException
getAdapterVersion in class DSPortAdapterString of the adapter version. It will return
"OneWireIOException
OneWireException
public boolean adapterDetected()
throws OneWireIOException,
OneWireException
adapterDetected in class DSPortAdaptertrue if the adapter is confirmed to be connected to
the selected port, false if the adapter is not connected.
OneWireIOException
OneWireException
public boolean canProgram()
throws OneWireIOException,
OneWireException
canProgram in class DSPortAdaptertrue if this port adapter can do Program voltage,
false otherwise.
OneWireIOException
OneWireException
public boolean findFirstDevice()
throws OneWireIOException,
OneWireException
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.
findFirstDevice in class DSPortAdaptertrue if an iButton or 1-Wire device is found.
OneWireIOException
OneWireException
public boolean findNextDevice()
throws OneWireIOException,
OneWireException
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.
findNextDevice in class DSPortAdaptertrue if an iButton or 1-Wire device is found.
OneWireIOException
OneWireExceptionpublic void getAddress(byte[] address)
getAddress in class DSPortAdapteraddress - An array to be filled with the current iButton address.Address
public boolean isPresent(byte[] address)
throws OneWireIOException,
OneWireException
isPresent in class DSPortAdapteraddress - device address to verify is present
true if device is present else
false.
OneWireIOException
OneWireExceptionAddress
public boolean isAlarming(byte[] address)
throws OneWireIOException,
OneWireException
isAlarming in class DSPortAdapteraddress - device address to verify is present and alarming
true if device is present and alarming else
false.
OneWireIOException
OneWireExceptionAddress
public boolean select(byte[] address)
throws OneWireIOException,
OneWireException
select in class DSPortAdapteraddress - device to select
true if device address was sent,false
otherwise.
OneWireIOException
OneWireExceptionDSPortAdapter.isPresent(byte[] address)public void setSearchOnlyAlarmingDevices()
setSearchOnlyAlarmingDevices in class DSPortAdapterDSPortAdapter.setNoResetSearch()public void setNoResetSearch()
setNoResetSearch in class DSPortAdapterpublic void setSearchAllDevices()
setSearchAllDevices in class DSPortAdapterDSPortAdapter.setNoResetSearch()
public boolean beginExclusive(boolean blocking)
throws OneWireException
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.
beginExclusive in class DSPortAdapterblocking - 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 aquired
OneWireExceptionpublic void endExclusive()
endExclusive in class DSPortAdapter
public void putBit(boolean bitValue)
throws OneWireIOException,
OneWireException
putBit in class DSPortAdapterbitValue - the bit value to send to the 1-Wire Network.
OneWireIOException
OneWireException
public boolean getBit()
throws OneWireIOException,
OneWireException
getBit in class DSPortAdapterOneWireIOException
OneWireException
public void putByte(int byteValue)
throws OneWireIOException,
OneWireException
putByte in class DSPortAdapterbyteValue - the byte value to send to the 1-Wire Network.
OneWireIOException
OneWireException
public int getByte()
throws OneWireIOException,
OneWireException
getByte in class DSPortAdapterOneWireIOException
OneWireException
public byte[] getBlock(int len)
throws OneWireIOException,
OneWireException
getBlock in class DSPortAdapterlen - length of data bytes to receive
OneWireIOException
OneWireException
public void getBlock(byte[] arr,
int len)
throws OneWireIOException,
OneWireException
getBlock in class DSPortAdapterarr - array in which to write the received byteslen - length of data bytes to receive
OneWireIOException
OneWireException
public void getBlock(byte[] arr,
int off,
int len)
throws OneWireIOException,
OneWireException
getBlock in class DSPortAdapterarr - array in which to write the received bytesoff - offset into the array to startlen - length of data bytes to receive
OneWireIOException
OneWireException
public void dataBlock(byte[] dataBlock,
int off,
int len)
throws OneWireIOException,
OneWireException
dataBlock in class DSPortAdapterdataBlock - array of data to transfer to and from the 1-Wire Network.off - offset into the array of data to startlen - length of data to send / receive starting at 'off'
OneWireIOException
OneWireException
public int reset()
throws OneWireIOException,
OneWireException
reset in class DSPortAdapterOneWireIOException
OneWireException
public void setPowerDuration(int timeFactor)
throws OneWireIOException,
OneWireException
Note: to avoid getting an exception, use the canDeliverPower() and canDeliverSmartPower() method to check it's availability.
setPowerDuration in class DSPortAdaptertimeFactor - OneWireIOException
OneWireException
public boolean startPowerDelivery(int changeCondition)
throws OneWireIOException,
OneWireException
Note: to avoid getting an exception, use the canDeliverPower() and canDeliverSmartPower() method to check it's availability.
startPowerDelivery in class DSPortAdapterchangeCondition - true if the voltage change was successful,
false otherwise.
OneWireIOException
OneWireException
public void setPowerNormal()
throws OneWireIOException,
OneWireException
setPowerNormal in class DSPortAdapterOneWireIOException
OneWireException
public void setSpeed(int speed)
throws OneWireIOException,
OneWireException
setSpeed in class DSPortAdapterspeed - OneWireIOException
OneWireExceptionpublic int getSpeed()
getSpeed in class DSPortAdapter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||