congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RootNode
Code IndexAdd Tabnine to your IDE (free)

How to use
RootNode
in
org.bidib.jbidibc.core.node

Best Java code snippets using org.bidib.jbidibc.core.node.RootNode (Showing top 8 results out of 315)

origin: org.bidib.jbidib/jbidibc-serial

rootNode.sysDisable();
int magic = rootNode.getMagic(1500);
origin: org.bidib.jbidib/jbidibc-core

/**
 * Get the root node of the system. This is the node that represents the master. Creates a new instance of root node
 * if no root node is stored.
 * 
 * @return the root node
 */
public RootNode getRootNode() {
  // LOGGER.debug("Get the root node.");
  RootNode rootNode = null;
  synchronized (nodes) {
    // get the node from the registered nodes
    rootNode = (RootNode) nodes.get(ROOT_ADDRESS);
    if (rootNode == null) {
      // no root node registered, create and initialize the root node.
      // the root node has always the local address 0 and is the interface node.
      LOGGER.info("The root node is not available, create new root node.");
      rootNode = new RootNode(messageReceiver, ignoreWaitTimeout);
      // initialize the root node
      rootNode.setBidib(bidib);
      rootNode.setRequestFactory(requestFactory);
      rootNode.setResponseTimeout(bidib.getResponseTimeout());
      rootNode.setFirmwarePacketTimeout(bidib.getFirmwarePacketTimeout());
      nodes.put(ROOT_ADDRESS, rootNode);
    }
    LOGGER.debug("Root node: {}", rootNode);
  }
  return rootNode;
}
origin: org.bidib.jbidib/jbidibc-core

/**
 * Send the sys clock message.
 * 
 * @param date
 *            the current date
 * @param factor
 *            the time factor
 * @throws ProtocolException
 */
public void clock(Calendar date, int factor) throws ProtocolException {
  LOGGER.info("Send the clock message.");
  sendNoWait(new SysClockMessage(date, factor));
}
origin: org.bidib.jbidib/jbidibc-simulation

rootNode.reset();
getSimulationMessageReceiver().purgeReceivedDataInBuffer();
int magic = rootNode.getMagic(1500);
origin: org.bidib.jbidib/jbidibc-simulation

Assert.assertEquals(netBidib.getRootNode().getNodeMagic(), Integer.valueOf(BidibLibrary.BIDIB_SYS_MAGIC));
long uniqueId = netBidib.getRootNode().getUniqueId();
uniqueId = netBidib.getRootNode().getUniqueId(true);
netBidib.getRootNode().getNextFeature();
netBidib.getRootNode().getNextFeature();
netBidib.getRootNode().getNextFeature();
netBidib.getRootNode().getNextFeature();
origin: org.bidib.jbidib/jbidibc-core

/**
 * Get the magic from the node.
 * 
 * @param receiveTimeout
 *            the timeout in milliseconds used to wait for a response from the node. If null the default timeout is
 *            used.
 * @return the magic
 * @throws ProtocolException
 */
@Override
public int getMagic(Integer receiveTimeout) throws ProtocolException {
  LOGGER.trace("Get magic from root node!");
  int magic = super.getMagic(receiveTimeout);
  LOGGER.info("Get magic from root node returns: {}", magic);
  if (BIDIB_MAGIC_UNKNOWN == magic) {
    LOGGER.warn("The interface did not respond the get magic request!");
    StringBuilder sb = new StringBuilder("The interface did not respond the get magic request!");
    String errorInfo = getMessageReceiver().getErrorInformation();
    if (StringUtils.isNotBlank(errorInfo)) {
      LOGGER.warn("Found received data that was not identifed as BiDiB messages: {}", errorInfo);
      sb.append("\r\n");
      sb.append(errorInfo);
    }
    NoAnswerException ex = new NoAnswerException("Establish communication with interface failed.");
    ex.setDescription(sb.toString());
    LOGGER.warn("Prepared exception to throw:", ex);
    throw ex;
  }
  return magic;
}
origin: org.bidib.jbidib/jbidibc-simulation

@Override
public RootNode getRootNode() {
  RootNode rootNode = null;
  try {
    rootNode = delegateBidib.getRootNode();
  }
  catch (Exception ex) {
    LOGGER.warn("Get the root node failed.", ex);
  }
  if (rootNode != null) {
    String nodeAddress = NodeUtils.formatAddress(rootNode.getAddr());
    SimulatorNode simulator = SimulatorRegistry.getInstance().getSimulator(nodeAddress);
    if (simulator == null) {
      LOGGER.warn("No simulator configured for the root node.");
    }
  }
  else {
    LOGGER.error("The root node is not available.");
  }
  return rootNode;
}
origin: org.bidib.jbidib/jbidibc-simulation

Assert.assertEquals(netBidib.getRootNode().getNodeMagic(), Integer.valueOf(BidibLibrary.BIDIB_SYS_MAGIC));
org.bidib.jbidibc.core.nodeRootNode

Javadoc

This class represents a master (interface) node in the BiDiB system.

Most used methods

  • getMagic
    Get the magic from the node.
  • <init>
  • getAddr
  • getMessageReceiver
  • getNextFeature
  • getNodeMagic
  • getUniqueId
  • reset
    Send the system reset message to the node.
  • sendNoWait
  • setBidib
  • setFirmwarePacketTimeout
  • setNodeMagic
  • setFirmwarePacketTimeout,
  • setNodeMagic,
  • setRequestFactory,
  • setResponseTimeout,
  • setStartTime,
  • sysDisable

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
  • getSystemService (Context)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Reference (javax.naming)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now