public class UartbusEscapedStreamPacketConnector extends Object implements UartbusPacketConnector
Modifier and Type | Field and Description |
---|---|
protected eu.javaexperience.binary.FramedPacketCutter |
cutter |
protected eu.javaexperience.io.IOStream |
io |
protected static eu.javaexperience.log.Logger |
LOG |
protected eu.javaexperience.interfaces.simple.SimpleCall |
onClosed |
protected eu.javaexperience.interfaces.simple.publish.SimplePublish1<byte[]> |
onPacketReceived |
protected byte |
packetEscape |
protected Thread |
receiver |
protected boolean |
run |
Constructor and Description |
---|
UartbusEscapedStreamPacketConnector(eu.javaexperience.io.IOStream io,
byte terminator) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected static void |
commProcessClosed() |
protected void |
dispatchPacket(byte[] data) |
void |
feedBytes(byte[] bs) |
protected InputStream |
getInputStream() |
protected OutputStream |
getOutputStream() |
static void |
main(String[] args) |
protected void |
manageClosedConnection(Exception caused,
String whileOp) |
void |
sendPacket(byte[] data) |
void |
sendWithCrc8(byte[] data) |
void |
setIoStream(eu.javaexperience.io.IOStream io) |
void |
setPacketHook(eu.javaexperience.interfaces.simple.publish.SimplePublish1<byte[]> onPacketReceived) |
void |
setSocketCloseListener(eu.javaexperience.interfaces.simple.SimpleCall onClosed) |
void |
startListen() |
void |
stop() |
protected static final eu.javaexperience.log.Logger LOG
protected eu.javaexperience.io.IOStream io
protected byte packetEscape
protected eu.javaexperience.interfaces.simple.publish.SimplePublish1<byte[]> onPacketReceived
protected eu.javaexperience.binary.FramedPacketCutter cutter
protected volatile boolean run
protected Thread receiver
protected eu.javaexperience.interfaces.simple.SimpleCall onClosed
public UartbusEscapedStreamPacketConnector(eu.javaexperience.io.IOStream io, byte terminator)
public void setPacketHook(eu.javaexperience.interfaces.simple.publish.SimplePublish1<byte[]> onPacketReceived)
setPacketHook
in interface UartbusPacketConnector
public void setSocketCloseListener(eu.javaexperience.interfaces.simple.SimpleCall onClosed)
protected static void commProcessClosed()
protected InputStream getInputStream()
protected OutputStream getOutputStream()
public void setIoStream(eu.javaexperience.io.IOStream io)
protected void dispatchPacket(byte[] data)
public void startListen()
startListen
in interface UartbusPacketConnector
public void sendPacket(byte[] data)
sendPacket
in interface UartbusPacketConnector
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void sendWithCrc8(byte[] data) throws IOException
IOException
public void stop()
public void feedBytes(byte[] bs)
Copyright © 2020. All rights reserved.