Package org.contikios.cooja

Examples of org.contikios.cooja.RadioPacket


     * May for example happen if watchdog triggers */
    if (isTransmitting()) {
      logger.warn("Turning off radio while transmitting, ending packet prematurely");

      /* Simulate end of packet */
      lastOutgoingPacket = new RadioPacket() {
        public byte[] getPacketData() {
          return new byte[0];
        }
      };

View Full Code Here


          len -= 4; /* preamble */
          len -= 1; /* synch */
          len -= radio.getFooterLength(); /* footer */
          final byte[] packetdata = new byte[len];
          System.arraycopy(buffer, 4+1, packetdata, 0, len);
          lastOutgoingPacket =  new RadioPacket() {
            public byte[] getPacketData() {
              return packetdata;
            }
          };

View Full Code Here

     * May for example happen if watchdog triggers */
    if (isTransmitting()) {
      logger.warn("Turning off radio while transmitting, ending packet prematurely");

      /* Simulate end of packet */
      lastOutgoingPacket = new RadioPacket() {
        public byte[] getPacketData() {
          return new byte[0];
        }
      };

View Full Code Here

        if (len == expLen) {
          /*logger.debug("----- CCC1120 CUSTOM DATA TRANSMITTED -----");*/

          final byte[] buf = new byte[expLen];
          System.arraycopy(buffer, 0, buf, 0, expLen);
          lastOutgoingPacket = new RadioPacket() {
            public byte[] getPacketData() {
              return buf;
            }
          };

View Full Code Here

     * May for example happen if watchdog triggers */
    if (isTransmitting()) {
      logger.warn("Turning off radio while transmitting, ending packet prematurely");

      /* Simulate end of packet */
      lastOutgoingPacket = new RadioPacket() {
        public byte[] getPacketData() {
          return new byte[0];
        }
      };

View Full Code Here

        if (len == expLen) {
          /*logger.debug("----- CC1101 CUSTOM DATA TRANSMITTED -----");*/

          final byte[] buf = new byte[expLen];
          System.arraycopy(buffer, 0, buf, 0, expLen);
          lastOutgoingPacket = new RadioPacket() {
            public byte[] getPacketData() {
              return buf;
            }
          };

View Full Code Here

     * May for example happen if watchdog triggers */
    if (isTransmitting()) {
      logger.warn("Turning off radio while transmitting, ending packet prematurely");

      /* Simulate end of packet */
      lastOutgoingPacket = new RadioPacket() {
        public byte[] getPacketData() {
          return new byte[0];
        }
      };

View Full Code Here

      }
      return brief.length() > 0;
  }

  private void prepareTooltipString(RadioConnectionLog conn) {
    RadioPacket packet = conn.packet;
    if (packet == null) {
      conn.tooltip = "";
      return;
    }

    if (packet instanceof ConvertedRadioPacket && packet.getPacketData().length > 0) {
      byte[] original = ((ConvertedRadioPacket)packet).getOriginalPacketData();
      byte[] converted = ((ConvertedRadioPacket)packet).getPacketData();
      conn.tooltip = "<html><font face=\"Monospaced\">" +
      "<b>Packet data (" + original.length + " bytes)</b><br>" +
      "<pre>" + StringUtils.hexDump(original) + "</pre>" +
      "</font><font face=\"Monospaced\">" +
      "<b>Cross-level packet data (" + converted.length + " bytes)</b><br>" +
      "<pre>" + StringUtils.hexDump(converted) + "</pre>" +
      "</font></html>";
    } else if (packet instanceof ConvertedRadioPacket) {
      byte[] original = ((ConvertedRadioPacket)packet).getOriginalPacketData();
      conn.tooltip = "<html><font face=\"Monospaced\">" +
      "<b>Packet data (" + original.length + " bytes)</b><br>" +
      "<pre>" + StringUtils.hexDump(original) + "</pre>" +
      "</font><font face=\"Monospaced\">" +
      "<b>No cross-level conversion available</b><br>" +
      "</font></html>";
    } else {
      byte[] data = packet.getPacketData();
      conn.tooltip = "<html><font face=\"Monospaced\">" +
      "<b>Packet data (" + data.length + " bytes)</b><br>" +
      "<pre>" + StringUtils.hexDump(data) + "</pre>" +
      "</font></html>";
    }
View Full Code Here

     * May for example happen if watchdog triggers */
    if (isTransmitting()) {
      logger.warn("Turning off radio while transmitting, ending packet prematurely");

      /* Simulate end of packet */
      lastOutgoingPacket = new RadioPacket() {
        public byte[] getPacketData() {
          return new byte[0];
        }
      };

View Full Code Here

    }
    return brief.length() > 0;
  }

  private void prepareTooltipString(RadioConnectionLog conn) {
    RadioPacket packet = conn.packet;
    if (packet == null) {
      conn.tooltip = "";
      return;
    }

    if (packet instanceof ConvertedRadioPacket && packet.getPacketData().length > 0) {
      byte[] original = ((ConvertedRadioPacket) packet).getOriginalPacketData();
      byte[] converted = ((ConvertedRadioPacket) packet).getPacketData();
      conn.tooltip = "<html><font face=\"Monospaced\">"
              + "<b>Packet data (" + original.length + " bytes)</b><br>"
              + "<pre>" + StringUtils.hexDump(original) + "</pre>"
              + "</font><font face=\"Monospaced\">"
              + "<b>Cross-level packet data (" + converted.length + " bytes)</b><br>"
              + "<pre>" + StringUtils.hexDump(converted) + "</pre>"
              + "</font></html>";
    } else if (packet instanceof ConvertedRadioPacket) {
      byte[] original = ((ConvertedRadioPacket) packet).getOriginalPacketData();
      conn.tooltip = "<html><font face=\"Monospaced\">"
              + "<b>Packet data (" + original.length + " bytes)</b><br>"
              + "<pre>" + StringUtils.hexDump(original) + "</pre>"
              + "</font><font face=\"Monospaced\">"
              + "<b>No cross-level conversion available</b><br>"
              + "</font></html>";
    } else {
      byte[] data = packet.getPacketData();
      conn.tooltip = "<html><font face=\"Monospaced\">"
              + "<b>Packet data (" + data.length + " bytes)</b><br>"
              + "<pre>" + StringUtils.hexDump(data) + "</pre>"
              + "</font></html>";
    }
View Full Code Here

TOP

Related Classes of org.contikios.cooja.RadioPacket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.