Package com.ed.edcom
Class Client
java.lang.Object
com.ed.edcom.Client
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Comparable<Client>
,Runnable
Client implementation.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionClient
(InetAddress devAddress, InetAddress hostAddress, int startDelay) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activate clientvoid
Add variablevoid
Add list of variablesvoid
close()
Close this client.int
boolean
byte
Get accessFeedb (from package 8)long
int
Get BLOBS countint
BLOB statusint
getClientId
(int ix) Get connected clientslong
Get connected clients list refresh timeint[]
Get device descriptorlong
Get timestamp of last authenticationbyte[]
byte[]
int
Deprecated.int
Get user password set by setUserKeyint
Deprecated.Only use this with inver versions older than 8.0.int
hashCode()
boolean
Connection statusboolean
Check if ID is accepted by inverterboolean
Get status of registered dsp variablesboolean
Check if user password is accepted by inverterboolean
Visibility status (hy-sys specific option)void
Restart current connectionvoid
Remove all BLOBs.void
Remove all registered variablesvoid
Remove variablevoid
removeDspVarByKey
(int key) Remove variablevoid
run()
Run implementation.void
Send BLOBvoid
sendBlobList
(List<DspBlob> blobs) Send list of BLOBsvoid
setDesc
(ByteBuffer buf) Set descriptorvoid
setUserKey
(int key) Deprecated.void
setUserKey
(String key) Deprecated.void
setUserPass
(int key) Set password as integervoid
setUserPass
(String key) Set user passwordvoid
start()
Start communicationtoString()
toString implementation
-
Field Details
-
PIC_REFRESH_PERIOD
public static final int PIC_REFRESH_PERIOD- See Also:
-
-
Constructor Details
-
Client
Constructor- Parameters:
devAddress
- inverter IP addresshostAddress
- local host IP address related to desired network interfacestartDelay
- communication start delay in milliseconds- Throws:
Exception
- wrong parameters or resources, etc.
-
-
Method Details
-
setUserPass
Set user password- Parameters:
key
- user password
-
setUserPass
public void setUserPass(int key) Set password as integer- Parameters:
key
- user password
-
setUserKey
Deprecated. -
setUserKey
Deprecated. -
getUserPass
public int getUserPass()Get user password set by setUserKey- Returns:
- user password
-
getUserKey
Deprecated. -
getUserStatus
Deprecated.Only use this with inver versions older than 8.0.Use
Read current permission (up to package 7)- Returns:
- -1 - not read (wait for server response) 0 - access denied 1 - no password required 2 - password accepted 3 - energy depot
-
getAccessFeedb
public byte getAccessFeedb()Get accessFeedb (from package 8)- Returns:
- access feedback bitfield: Bit0 = Bootloader active; Bit1 = identKey accepted; Bit2 = userKey accepted
-
isIdAccepted
public boolean isIdAccepted()Check if ID is accepted by inverter- Returns:
- true - ID accepted, false - ID not accpeted.
-
isPasswordAccepted
public boolean isPasswordAccepted()Check if user password is accepted by inverter- Returns:
- true - ID accepted, false - ID not accpeted.
-
getLastAuthentication
public long getLastAuthentication()Get timestamp of last authentication- Returns:
- Authentication timestamp
-
start
Start communication- Throws:
IllegalThreadStateException
-
close
Close this client. Once a client has been closed, it is not available for further use. A new client needs to be created.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- according to interface definition
-
getDescriptor
Get device descriptor- Returns:
- ip address or device serial number
-
isConnected
public boolean isConnected()Connection status- Returns:
- connection status
-
isVisible
public boolean isVisible()Visibility status (hy-sys specific option)- Returns:
- visibility status
-
reconnect
public void reconnect()Restart current connection -
addDspVar
Add variable- Parameters:
dv
- dsp variable to add
-
addDspVar
Add list of variables- Parameters:
dvLst
- list of variables to add
-
removeDspVarByKey
public void removeDspVarByKey(int key) Remove variable- Parameters:
key
- remove all variables with selected key
-
removeDspVar
Remove variable- Parameters:
d
- dsp variable to remove
-
removeAllDspVar
public void removeAllDspVar()Remove all registered variables -
activate
public void activate()Activate client -
isParamChanged
public boolean isParamChanged()Get status of registered dsp variables- Returns:
- true if was changed
-
setDesc
Set descriptor- Parameters:
buf
- new descriptor
-
toString
toString implementation -
equals
-
hashCode
public int hashCode() -
sendBlob
Send BLOB- Parameters:
blob
- to send
-
sendBlobList
Send list of BLOBs- Parameters:
blobs
- to send
-
getBlobsCnt
public int getBlobsCnt()Get BLOBS count- Returns:
- blobs count
-
getBlobsState
public int getBlobsState()BLOB status- Returns:
- '0' - wait for upload, '1' - upload started, '2' - all complete, '-1' - upload error
-
removeAllBlobs
public void removeAllBlobs()Remove all BLOBs. -
run
public void run()Run implementation. -
getClientId
Get connected clients- Parameters:
ix
- client index [0..3]- Returns:
- client id
- Throws:
RuntimeException
-
getClientIdListRefreshTime
public long getClientIdListRefreshTime()Get connected clients list refresh time- Returns:
- time [ms]
-
getPicVersion
public byte[] getPicVersion() -
getRandomKey
public byte[] getRandomKey() -
getAccessFeedbRefreshTime
public long getAccessFeedbRefreshTime() -
getComVersion
public int[] getComVersion() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Client>
-