public class UartbusConnectionDistributor extends Object implements UartbusConnection
Modifier and Type | Class and Description |
---|---|
protected static class |
UartbusConnectionDistributor.PacketEndpointQueue |
Modifier and Type | Field and Description |
---|---|
protected static eu.javaexperience.log.Logger |
LOG |
protected eu.javaexperience.interfaces.simple.publish.SimplePublish1<byte[]> |
sendPacket |
protected String |
sessionKey |
protected Set<UartbusConnectionDistributor.PacketEndpointQueue> |
sessions |
Constructor and Description |
---|
UartbusConnectionDistributor(eu.javaexperience.interfaces.simple.publish.SimplePublish1<byte[]> sendPacket) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
feedPacketToDistribute(byte[] packet) |
String |
getAttribute(String key) |
byte[] |
getNextPacket() |
protected UartbusConnectionDistributor.PacketEndpointQueue |
getSessionQueue() |
void |
init() |
Map<String,String> |
listAttributes() |
void |
sendPacket(byte[] data) |
void |
setAttribute(String key,
String value) |
protected static final eu.javaexperience.log.Logger LOG
protected eu.javaexperience.interfaces.simple.publish.SimplePublish1<byte[]> sendPacket
protected String sessionKey
protected Set<UartbusConnectionDistributor.PacketEndpointQueue> sessions
public UartbusConnectionDistributor(eu.javaexperience.interfaces.simple.publish.SimplePublish1<byte[]> sendPacket)
public void feedPacketToDistribute(byte[] packet)
protected UartbusConnectionDistributor.PacketEndpointQueue getSessionQueue()
public void sendPacket(byte[] data) throws IOException
sendPacket
in interface UartbusConnection
IOException
public Map<String,String> listAttributes()
listAttributes
in interface UartbusConnection
public String getAttribute(String key)
getAttribute
in interface UartbusConnection
public void setAttribute(String key, String value)
setAttribute
in interface UartbusConnection
public byte[] getNextPacket() throws IOException
getNextPacket
in interface UartbusConnection
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void init()
init
in interface UartbusConnection
Copyright © 2020. All rights reserved.