public class FCOCIPI2CSubDevice extends FCOCDevice
m_aInterfacesInfo
Constructor and Description |
---|
FCOCIPI2CSubDevice(int nNumberOfRegisters,
byte cI2CAddress)
Create a FiveCo device based on legacy TCP communication protocol with access through I2C bus
|
FCOCIPI2CSubDevice(int nNumberOfRegisters,
byte cI2CAddress,
int nBufferSize,
long lThreadSleep)
Create a FiveCo device based on legacy TCP communication protocol with access through I2C bus
|
Modifier and Type | Method and Description |
---|---|
FCOCDevice |
addSubDevice(java.lang.String szSubDevName,
int nAddress,
int nNumberOfRegisters,
int nInterface) |
void |
delete()
Ask device object to stop its communication thread.
|
void |
fireDataEvent(FCOCRegisterBase Register,
java.lang.Object data,
FCOEDataEventType eState,
java.lang.Object CallbackParameter)
Call this function to fire a Data Event.
|
byte |
getAddress() |
int |
getInterface() |
com.fivecolibs.devices.FCOCDevice.CQueueElement[] |
getRequestQueue(boolean isAutoreadRegAdded)
Return the elements of the ReadQueue in an array.
|
static java.lang.String |
getStringAddress(int nAddress)
Return a string of the address in parameter in this format : "0x55 (85)"
|
void |
removeSubDevice(java.lang.String szSubDevName) |
void |
run()
Main communication thread loop (threadLoop() in dot net lib)
|
addDeviceListener, addRegister, addRegister, askGetInterfaceInfo, call, getBufferSize, getDeviceListeners, getLastValueRead, getLastValueWritten, getRegisterAddress, getThisInterfaceInfo, getThreadLoopTime, getValue, getValue, receivedGetInterfacesInfo, removeDeviceListener, removeRegister, setAutoreadState, setAutoreadSupended, setBufferSize, setDebugLogEnabled, setInterfaceComSupendedState, setMaxParentBufferSize, setThreadLoopTime, setValue, setValue
public FCOCIPI2CSubDevice(int nNumberOfRegisters, byte cI2CAddress)
nNumberOfRegisters
- Max number of registers of this devicecI2CAddress
- I2C address of the I2C sub devicepublic FCOCIPI2CSubDevice(int nNumberOfRegisters, byte cI2CAddress, int nBufferSize, long lThreadSleep)
nNumberOfRegisters
- Max number of registers of this devicecI2CAddress
- I2C address of the I2C sub devicenBufferSize
- Size of buffer for FiveCo packets (default is 180 bytes)lThreadSleep
- Sleep time in milliseconds (not used)public FCOCDevice addSubDevice(java.lang.String szSubDevName, int nAddress, int nNumberOfRegisters, int nInterface) throws java.io.IOException
addSubDevice
in class FCOCDevice
szSubDevName
- Name of the sub device to addnAddress
- New sub device addressnNumberOfRegisters
- Maximum registers count of the sub devicenInterface
- Interface number of the sub devicejava.io.IOException
- Exception thrown if a parameter is invalidpublic void removeSubDevice(java.lang.String szSubDevName)
removeSubDevice
in class FCOCDevice
szSubDevName
- Name of the sub device to removepublic void delete()
FCOCDevice
Ask device object to stop its communication thread.
delete
in class FCOCDevice
public com.fivecolibs.devices.FCOCDevice.CQueueElement[] getRequestQueue(boolean isAutoreadRegAdded)
isAutoreadRegAdded
- Do autoread registers have to be added in array ?FCOCDevice.CQueueElement
arraypublic void fireDataEvent(FCOCRegisterBase Register, java.lang.Object data, FCOEDataEventType eState, java.lang.Object CallbackParameter)
Register
- The FCOCRegisterBase
associated with the event.data
- The data of the FCOCRegisterBase
eState
- The FCOEDataEventType
of the event.CallbackParameter
- The parameter to pass to the event.public static java.lang.String getStringAddress(int nAddress)
nAddress
- The address to return in string.public byte getAddress()
public int getInterface()
getInterface
in class FCOCDevice
public void run()
FCOCDevice
run
in interface java.lang.Runnable
run
in class FCOCDevice