Skip to content
Snippets Groups Projects
Commit 5832b38b authored by John Furr's avatar John Furr
Browse files

Draft files edited.

parent 3a3c1fa2
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,8 @@ public class FDCSendRecieve { ...@@ -26,6 +26,8 @@ public class FDCSendRecieve {
public static final int MULTICAST_PORT = 3000; public static final int MULTICAST_PORT = 3000;
public static final String MULTICAST_GROUP = "239.1.2.3"; public static final String MULTICAST_GROUP = "239.1.2.3";
public static final boolean USE_FAST_ESPDU = false; public static final boolean USE_FAST_ESPDU = false;
public FDCSendRecieve(int port, String multicast) { public FDCSendRecieve(int port, String multicast) {
try { try {
...@@ -184,8 +186,30 @@ public class FDCSendRecieve { ...@@ -184,8 +186,30 @@ public class FDCSendRecieve {
FDCSendRecieve sender = new FDCSendRecieve(DEFAULT_MULTICAST_PORT, DEFAULT_MULTICAST_ADDRESS); FDCSendRecieve sender = new FDCSendRecieve(DEFAULT_MULTICAST_PORT, DEFAULT_MULTICAST_ADDRESS);
// sender.run(); // sender.run();
} }
//
// Inital Hello world from entity:
//
FDCSendRecieve sender = new FDCSendRecieve(DEFAULT_MULTICAST_PORT, DEFAULT_MULTICAST_ADDRESS);
EntityStatePdu FDCespdu = new EntityStatePdu();
FDCespdu.setExerciseID((short)1);
EntityID entityID = FDCespdu.getEntityID();
entityID.setSite(1); // 0 is apparently not a valid site number, per the spec
entityID.setApplication(1);
entityID.setEntity(1); //change for each person I think??? - JMF
EntityType entityType = FDCespdu.getEntityType();
//
//Need to update the info below to match the unit type
//
entityType.setEntityKind((short) 1); // Platform (vs lifeform, munition, sensor, etc.)
entityType.setCountry(224); // UK
entityType.setDomain((short) 1); // Land (vs air, surface, subsurface, space)
entityType.setCategory((short) 1); // Tank
entityType.setSubcategory((short) 1); // M1 Abrams
entityType.setSpec((short) 4); // M1A1 w/ mine roller
sender.run(FDCespdu);
/* BELOW IS THE RECIEVE CODE // /* BELOW IS THE RECIEVE CODE //
// // // //
...@@ -199,7 +223,6 @@ public class FDCSendRecieve { ...@@ -199,7 +223,6 @@ public class FDCSendRecieve {
try { try {
FDCSendRecieve sender = new FDCSendRecieve(DEFAULT_MULTICAST_PORT, DEFAULT_MULTICAST_ADDRESS);
System.out.println("DisExamples.PduReceiver started..."); System.out.println("DisExamples.PduReceiver started...");
socket = new MulticastSocket(MULTICAST_PORT); socket = new MulticastSocket(MULTICAST_PORT);
address = InetAddress.getByName(MULTICAST_GROUP); address = InetAddress.getByName(MULTICAST_GROUP);
......
...@@ -50,6 +50,7 @@ public class FriscoFurrPduSender ...@@ -50,6 +50,7 @@ public class FriscoFurrPduSender
// Loop through all the enumerated PDU types, create a PDU for each type, // Loop through all the enumerated PDU types, create a PDU for each type,
// and add that PDU to a list. // and add that PDU to a list.
System.out.println("number of PDU types in pduType is " + PduType.values().length);
for (PduType pdu : PduType.values()) { for (PduType pdu : PduType.values()) {
Pdu aPdu = null; Pdu aPdu = null;
System.out.println(pdu); System.out.println(pdu);
...@@ -68,70 +69,70 @@ public class FriscoFurrPduSender ...@@ -68,70 +69,70 @@ public class FriscoFurrPduSender
espduLocation.setY(2.0); espduLocation.setY(2.0);
espduLocation.setZ(3.0); espduLocation.setZ(3.0);
break; break;
//
case COMMENT: // case COMMENT:
aPdu = new CommentPdu(); // aPdu = new CommentPdu();
break; // break;
//
case FIRE: // case FIRE:
aPdu = new FirePdu(); // aPdu = new FirePdu();
break; // break;
//
case DETONATION: // case DETONATION:
aPdu = new DetonationPdu(); // aPdu = new DetonationPdu();
break; // break;
//
case COLLISION: // case COLLISION:
aPdu = new CollisionPdu(); // aPdu = new CollisionPdu();
break; // break;
//
case SERVICE_REQUEST: // case SERVICE_REQUEST:
aPdu = new ServiceRequestPdu(); // aPdu = new ServiceRequestPdu();
break; // break;
//
case RESUPPLY_OFFER: // case RESUPPLY_OFFER:
aPdu = new ResupplyOfferPdu(); // aPdu = new ResupplyOfferPdu();
break; // break;
//
case RESUPPLY_RECEIVED: // case RESUPPLY_RECEIVED:
aPdu = new ResupplyReceivedPdu(); // aPdu = new ResupplyReceivedPdu();
break; // break;
//
case RESUPPLY_CANCEL: // case RESUPPLY_CANCEL:
aPdu = new ResupplyCancelPdu(); // aPdu = new ResupplyCancelPdu();
break; // break;
//
case REPAIR_COMPLETE: // case REPAIR_COMPLETE:
aPdu = new RepairCompletePdu(); // aPdu = new RepairCompletePdu();
break; // break;
//
case REPAIR_RESPONSE: // case REPAIR_RESPONSE:
aPdu = new RepairResponsePdu(); // aPdu = new RepairResponsePdu();
break; // break;
//
case CREATE_ENTITY: // case CREATE_ENTITY:
aPdu = new CreateEntityPdu(); // aPdu = new CreateEntityPdu();
break; // break;
//
case REMOVE_ENTITY: // case REMOVE_ENTITY:
aPdu = new RemoveEntityPdu(); // aPdu = new RemoveEntityPdu();
break; // break;
//
case START_RESUME: // case START_RESUME:
aPdu = new StartResumePdu(); // aPdu = new StartResumePdu();
break; // break;
//
case STOP_FREEZE: // case STOP_FREEZE:
aPdu = new StopFreezePdu(); // aPdu = new StopFreezePdu();
break; // break;
//
case ACKNOWLEDGE: // case ACKNOWLEDGE:
aPdu = new AcknowledgePdu(); // aPdu = new AcknowledgePdu();
break; // break;
//
case ACTION_REQUEST: // case ACTION_REQUEST:
aPdu = new ActionRequestPdu(); // aPdu = new ActionRequestPdu();
break; // break;
default: default:
System.out.print("PDU of type " + pdu + " not supported, created or sent "); System.out.print("PDU of type " + pdu + " not supported, created or sent ");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment