Git Product home page Git Product logo

dis-description's Introduction

DISDescription

Central repository for machine-readable descriptions of the DIS protocol.

The files in this directory have been used with the XMLPG tool to auto-generate the source code found in the following github repositories; open-dis-java, open-dis-cpp, open-dis-python, open-dis-javascript. What was autogenerated for each language was an 80% starting point. A number of fixes, enhancements and other changes have been made directly to the source code of each language over the years that could not easily be captured in these schemas. And so at this point the umbilical cord has been cut between these schema files and the language implementations. Corrections are welcome to the schemas here, but please do not expect them to be automatically applied to the language repositories. Re-generating the source code from these schemas and re-applying the changes to those language repositories would be a messy job. Ideas are welcome, but at this point these schemas exist here primarily for historical purposes only.

The repository has a very general name of "DISDescriptions" to leave open the possibility of using a format other than XML, such as JSON or ASN.1.

DIS PDUs

The DIS Protocol Data Units (PDUs) are binary messages with a defined format. For example the Entity State PDU has the Entity ID field 12 bytes from the start, and consists of three unsigned short values: site, application, and entity. The combination of these three values together uniquely identifies an entity in the virtual world.

The IEEE DIS standard describes the PDUs in prose rather than in a machine-readable format. The files in this directory describe the format of the PDUs in a way that can be read by a computer and used to generate a language implementation. For example this fragment of XML:

<class name="EntityID" inheritsFrom="root" comment="more laconically named EntityIdentifier">

  <attribute name="siteID" comment="Site ID">
    <primitive type= "unsigned short"/>
  </attribute>
  
  <attribute name="applicationID" comment="application number ID">
    <primitive type= "unsigned short"/>
  </attribute>
  
  <attribute name="entityID" comment="Entity number ID">
    <primitive type= "unsigned short"/>
  </attribute>
  
</class>

Can be read by a program and compiled into a lanaguage implementation like the below. Note that we have enough information to marshal and unmarshall the PDU--to change it from a binary representation to a language representation, and from a Java object to a binary representation.

package edu.nps.moves.dis7;

import java.util.*;
import java.io.*;
import edu.nps.moves.disenum.*;
import edu.nps.moves.disutil.*;


/**
 * more laconically named EntityIdentifier
 *
 * Copyright (c) 2008-2016, MOVES Institute, Naval Postgraduate School. All rights reserved.
 * This work is licensed under the BSD open source license, available at https://www.movesinstitute.org/licenses/bsd.html
 *
 * @author DMcG
 */
public class EntityID extends Object implements Serializable
{
   /** Site ID */
   protected int  siteID;

   /** application number ID */
   protected int  applicationID;

   /** Entity number ID */
   protected int  entityID;


/** Constructor */
 public EntityID()
 {
 }

public int getMarshalledSize()
{
   int marshalSize = 0; 

   marshalSize = marshalSize + 2;  // siteID
   marshalSize = marshalSize + 2;  // applicationID
   marshalSize = marshalSize + 2;  // entityID

   return marshalSize;
}


public void setSiteID(int pSiteID)
{ siteID = pSiteID;
}

public int getSiteID()
{ return siteID; 
}

public void setApplicationID(int pApplicationID)
{ applicationID = pApplicationID;
}

public int getApplicationID()
{ return applicationID; 
}

public void setEntityID(int pEntityID)
{ entityID = pEntityID;
}

public int getEntityID()
{ return entityID; 
}


public void marshal(DataOutputStream dos)
{
    try 
    {
       dos.writeShort( (short)siteID);
       dos.writeShort( (short)applicationID);
       dos.writeShort( (short)entityID);
    } // end try 
    catch(Exception e)
    { 
      System.out.println(e);}
    } // end of marshal method

public void unmarshal(DataInputStream dis)
{
    try 
    {
       siteID = (int)dis.readUnsignedShort();
       applicationID = (int)dis.readUnsignedShort();
       entityID = (int)dis.readUnsignedShort();
    } // end try 
   catch(Exception e)
    { 
      System.out.println(e); 
    }
 } // end of unmarshal method 

} // end of class

dis-description's People

Contributors

delaneyj avatar kayarre avatar leif81 avatar mcgredonps avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dis-description's Issues

PduHeader has invalid length and status attributes

Per the 1278.1-2012 spec for PduHeader

Length. This field shall specify the length of the PDU, including the PDU Header, in octets and shall be represented by a 16-bit unsigned integer....
PDU Status...This record shall be defined as an 8-bit record....

The spec goes into further details on the fields. However the DIS7.xml and all generated code has incorrect sizing of these fields. Given this is the basis for all PDUs how do any of the generated implementations correctly generate or read any messages streams correctly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.