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 {
public static final int MULTICAST_PORT = 3000;
public static final String MULTICAST_GROUP = "239.1.2.3";
public static final boolean USE_FAST_ESPDU = false;
public FDCSendRecieve(int port, String multicast) {
try {
......@@ -184,8 +186,30 @@ public class FDCSendRecieve {
FDCSendRecieve sender = new FDCSendRecieve(DEFAULT_MULTICAST_PORT, DEFAULT_MULTICAST_ADDRESS);
// 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 //
// //
......@@ -199,7 +223,6 @@ public class FDCSendRecieve {
try {
FDCSendRecieve sender = new FDCSendRecieve(DEFAULT_MULTICAST_PORT, DEFAULT_MULTICAST_ADDRESS);
System.out.println("DisExamples.PduReceiver started...");
socket = new MulticastSocket(MULTICAST_PORT);
address = InetAddress.getByName(MULTICAST_GROUP);
......
......@@ -50,6 +50,7 @@ public class FriscoFurrPduSender
// Loop through all the enumerated PDU types, create a PDU for each type,
// 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()) {
Pdu aPdu = null;
System.out.println(pdu);
......@@ -68,70 +69,70 @@ public class FriscoFurrPduSender
espduLocation.setY(2.0);
espduLocation.setZ(3.0);
break;
case COMMENT:
aPdu = new CommentPdu();
break;
case FIRE:
aPdu = new FirePdu();
break;
case DETONATION:
aPdu = new DetonationPdu();
break;
case COLLISION:
aPdu = new CollisionPdu();
break;
case SERVICE_REQUEST:
aPdu = new ServiceRequestPdu();
break;
case RESUPPLY_OFFER:
aPdu = new ResupplyOfferPdu();
break;
case RESUPPLY_RECEIVED:
aPdu = new ResupplyReceivedPdu();
break;
case RESUPPLY_CANCEL:
aPdu = new ResupplyCancelPdu();
break;
case REPAIR_COMPLETE:
aPdu = new RepairCompletePdu();
break;
case REPAIR_RESPONSE:
aPdu = new RepairResponsePdu();
break;
case CREATE_ENTITY:
aPdu = new CreateEntityPdu();
break;
case REMOVE_ENTITY:
aPdu = new RemoveEntityPdu();
break;
case START_RESUME:
aPdu = new StartResumePdu();
break;
case STOP_FREEZE:
aPdu = new StopFreezePdu();
break;
case ACKNOWLEDGE:
aPdu = new AcknowledgePdu();
break;
case ACTION_REQUEST:
aPdu = new ActionRequestPdu();
break;
//
// case COMMENT:
// aPdu = new CommentPdu();
// break;
//
// case FIRE:
// aPdu = new FirePdu();
// break;
//
// case DETONATION:
// aPdu = new DetonationPdu();
// break;
//
// case COLLISION:
// aPdu = new CollisionPdu();
// break;
//
// case SERVICE_REQUEST:
// aPdu = new ServiceRequestPdu();
// break;
//
// case RESUPPLY_OFFER:
// aPdu = new ResupplyOfferPdu();
// break;
//
// case RESUPPLY_RECEIVED:
// aPdu = new ResupplyReceivedPdu();
// break;
//
// case RESUPPLY_CANCEL:
// aPdu = new ResupplyCancelPdu();
// break;
//
// case REPAIR_COMPLETE:
// aPdu = new RepairCompletePdu();
// break;
//
// case REPAIR_RESPONSE:
// aPdu = new RepairResponsePdu();
// break;
//
// case CREATE_ENTITY:
// aPdu = new CreateEntityPdu();
// break;
//
// case REMOVE_ENTITY:
// aPdu = new RemoveEntityPdu();
// break;
//
// case START_RESUME:
// aPdu = new StartResumePdu();
// break;
//
// case STOP_FREEZE:
// aPdu = new StopFreezePdu();
// break;
//
// case ACKNOWLEDGE:
// aPdu = new AcknowledgePdu();
// break;
//
// case ACTION_REQUEST:
// aPdu = new ActionRequestPdu();
// break;
default:
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