|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcontrol.comm.RS232
jcontrol.comm.FT1_2
Partial implementation of the FT1.2 protocol. E.g. for use with EIB BCUs.
For detailed information of the FT1.2 protocol refer to IEC 870-5-1 and IEC 870-5-2 (DIN 19244).
How to use:
sendUDAT()
reqSTATUS()
or reqCLASS1()
FT1_2EventListener
, you
have to reply for complete transmissions.
lib |
Field Summary | |
static int |
BAUDRATE
Default baudrate for communication |
static int |
CF_PRM_REQ_CLASS1
for use in the FT1_2 event loop |
static int |
CF_PRM_REQ_STATUS
for use in the FT1_2 event loop |
static int |
CF_PRM_SEND_UDAT
for use in the FT1_2 event loop |
static int |
EXCHANGE_TIMEOUT
Time-out for end of exchange in case of SEND/CONFIRM or REQUEST/RESPOND (510 bits at 19200 converted to 27 milliseconds) |
static int |
LINE_IDLE_TIMEOUT
Maximum time between two characters, minimum idle time berore error is detected (33 bits at 19200 converted to 2 milliseconds) |
static int |
REPEAT_LIMIT
Repeat limit the retransmissions due to transmission errors |
Fields inherited from class jcontrol.comm.RS232 |
ECHO, FLOWCONTROL_RTSCTS, FLOWCONTROL_XONXOFF, PARITY_EVEN, PARITY_ODD |
Fields inherited from interface jcontrol.comm.ConsoleOutputStream |
STD_LF |
Fields inherited from interface jcontrol.comm.ConsoleInputStream |
LF_CHARS |
Constructor Summary | |
FT1_2()
Constructs a new FT1_2 instance using the serial line. |
Method Summary | |
void |
close()
Closes the FT1_2 and the underlying RS232 connections. |
byte[] |
reqCLASS1()
Requests CLASS1 from the BCU and waits for RESPOND (with UDAT). |
boolean |
reqSTATUS()
Requests STATUS from the BCU and waits for RESPOND (just ACK). |
void |
run()
Used internally for the FT1_2 event loop. |
void |
sendACK(byte[] udat)
sends a ACK message (single byte) from within a FT1_2EventListener to generate confirm event |
boolean |
sendRESET()
Sends RESET to the BCU and waits for CONFIRM. |
void |
sendResponse(byte[] udat)
sends a respond message from within a FT1_2EventListener. |
boolean |
sendUDAT(byte[] udata)
Sends UDAT to the BCU and waits for CONFIRM. |
void |
setListener(FT1_2EventListener el)
sets a FT1_2EventListener |
Methods inherited from class jcontrol.comm.RS232 |
available, errorCode, print, println, println, read, read, readLine, readUTF8, setBaudrate, setParams, write, write, writeUTF8 |
Methods inherited from class java.lang.Object |
clone, equals, notifyAll, wait |
Field Detail |
public static final int BAUDRATE
public static final int CF_PRM_REQ_CLASS1
FT1_2EventListener.onIndication(byte[], int)
,
Constant Field Valuespublic static final int CF_PRM_REQ_STATUS
FT1_2EventListener.onIndication(byte[], int)
,
Constant Field Valuespublic static final int CF_PRM_SEND_UDAT
FT1_2EventListener.onIndication(byte[], int)
,
Constant Field Valuespublic static final int EXCHANGE_TIMEOUT
public static final int LINE_IDLE_TIMEOUT
public static final int REPEAT_LIMIT
Constructor Detail |
public FT1_2() throws java.io.IOException
Method Detail |
public void close()
close
in interface jcontrol.io.BasicInputStream
RS232.close()
public byte[] reqCLASS1()
public boolean reqSTATUS()
public void run()
run
in interface java.lang.Runnable
Runnable.run()
public void sendACK(byte[] udat)
udat
- buffer to confirm (use null to send a NACK)public boolean sendRESET()
public void sendResponse(byte[] udat) throws java.io.IOException
udat
- data to send with response, use null for STATUS responses
java.io.IOException
public boolean sendUDAT(byte[] udata)
udata
- user data to send (at least 1 byte)
public void setListener(FT1_2EventListener el)
el
- eventlistener to use (null for remove)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |