Package com.mattibal.meshnet.NetworkTree

Examples of com.mattibal.meshnet.NetworkTree.RootNode


      // Send assignAddress packet
      Layer3Packet.AssignAddress packet = new Layer3Packet.AssignAddress(
          unassigned.getChildNonce(),
          (short)unassigned.getAddress(), (short)unassigned.getMaxRoute(),
          tree.baseNonce, networkKey);
      RootNode rootNode;
      if(unassigned instanceof RootNode){
        rootNode = (RootNode) unassigned;
      } else {
        rootNode = tree.getRouteToNode(unassigned.getAddress());
      }
      rootNode.getNetInterface().sendLayer3Packet(packet.getRawBytes().array(), rootNode.getMacAddress());
    }
    return isSomebodyUnassigned;
  }
View Full Code Here


 
  public void sendDataToDevice(byte[] dataPayload, NetworkTree.Node destNode) throws IOException{
    int destinationAddress = destNode.getAddress();
    DataToDevice packet = new DataToDevice(destinationAddress, dataPayload);
    byte[] packetBytes = packet.getRawBytes().array();
    RootNode firstHop = destNode.getRouteToMyself();
    firstHop.getNetInterface().sendLayer3Packet(packetBytes, firstHop.getMacAddress());
  }
View Full Code Here

TOP

Related Classes of com.mattibal.meshnet.NetworkTree.RootNode

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.