Class BiDiBMessageReceiver

java.lang.Object
jmri.jmrix.bidib.tcpserver.BiDiBMessageReceiver
All Implemented Interfaces:
org.bidib.jbidibc.messages.base.RawMessageListener

public class BiDiBMessageReceiver extends Object implements org.bidib.jbidibc.messages.base.RawMessageListener
This class is to be registered as a raw listener for all BiDiB messages to and from the BiDiB connection. We are only interested in data received from the connection here. The data is then forwarded to to server message handler, which will send it back to the all connected clients.
  • Constructor Details

    • BiDiBMessageReceiver

      public BiDiBMessageReceiver(org.bidib.jbidibc.net.serialovertcp.NetMessageHandler netServerMessageHandler, org.bidib.jbidibc.net.serialovertcp.NetBidibPort netPort)
  • Method Details

    • notifyReceived

      public void notifyReceived(byte[] data)
      Process data received from BiDiB connection. Send to network port. Currently we split possible multi-message packets into a sequence of single messages. TODO: forward multi-message packets.
      Specified by:
      notifyReceived in interface org.bidib.jbidibc.messages.base.RawMessageListener
      Parameters:
      data - from BiDiB connection
    • notifySend

      public void notifySend(byte[] data)
      Specified by:
      notifySend in interface org.bidib.jbidibc.messages.base.RawMessageListener