Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
3082a87a
Commit
3082a87a
authored
6 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
also report pdu family (from superclass)
parent
d7bdb7c1
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CourseExamples/src/DisExamples/PduReceiver.java
+8
-6
8 additions, 6 deletions
CourseExamples/src/DisExamples/PduReceiver.java
CourseExamples/src/DisExamples/PduReceiverTerminalLog.txt
+16
-16
16 additions, 16 deletions
CourseExamples/src/DisExamples/PduReceiverTerminalLog.txt
with
24 additions
and
22 deletions
CourseExamples/src/DisExamples/PduReceiver.java
+
8
−
6
View file @
3082a87a
...
@@ -41,17 +41,19 @@ public class PduReceiver
...
@@ -41,17 +41,19 @@ public class PduReceiver
Pdu
pdu
=
factory
.
createPdu
(
packet
.
getData
());
Pdu
pdu
=
factory
.
createPdu
(
packet
.
getData
());
if
(
pdu
!=
null
)
if
(
pdu
!=
null
)
{
{
short
pduType
=
pdu
.
getPduType
();
short
currentPduType
=
pdu
.
getPduType
();
String
pduTypeName
=
pdu
.
getClass
().
getName
();
String
currentPduTypeName
=
pdu
.
getClass
().
getName
();
short
protocolFamily
=
pdu
.
getProtocolFamily
();
// TODO get string enumeration
short
currentProtocolFamilyID
=
pdu
.
getProtocolFamily
();
String
currentPduFamilyName
=
pdu
.
getClass
().
getSuperclass
().
getSimpleName
();
StringBuilder
message
=
new
StringBuilder
();
StringBuilder
message
=
new
StringBuilder
();
message
.
append
(
"received DIS PDU: "
);
message
.
append
(
"received DIS PDU: "
);
message
.
append
(
"pduType "
);
message
.
append
(
"pduType "
);
if
(
p
duType
<
10
)
if
(
currentP
duType
<
10
)
message
.
append
(
" "
);
message
.
append
(
" "
);
message
.
append
(
pduType
).
append
(
" "
).
append
(
pduTypeName
);
message
.
append
(
currentPduType
).
append
(
" "
).
append
(
currentPduTypeName
);
message
.
append
(
", protocolFamily="
).
append
(
protocolFamily
);
message
.
append
(
", protocolFamily "
).
append
(
currentProtocolFamilyID
);
message
.
append
(
" "
).
append
(
currentPduFamilyName
);
System
.
out
.
println
(
message
.
toString
());
System
.
out
.
println
(
message
.
toString
());
}
}
else
System
.
out
.
println
(
"received packet but pdu is null, packet.getData().length="
+
packet
.
getData
().
length
+
", error..."
);
else
System
.
out
.
println
(
"received packet but pdu is null, packet.getData().length="
+
packet
.
getData
().
length
+
", error..."
);
...
...
This diff is collapsed.
Click to expand it.
CourseExamples/src/DisExamples/PduReceiverTerminalLog.txt
+
16
−
16
View file @
3082a87a
run:
run:
DisExamples.PduReceiver started...
DisExamples.PduReceiver started...
received DIS PDU: pduType 15 edu.nps.moves.dis.AcknowledgePdu, protocolFamily
=5
received DIS PDU: pduType 15 edu.nps.moves.dis.AcknowledgePdu, protocolFamily
5 SimulationManagementFamilyPdu
received DIS PDU: pduType 16 edu.nps.moves.dis.ActionRequestPdu, protocolFamily
=5
received DIS PDU: pduType 16 edu.nps.moves.dis.ActionRequestPdu, protocolFamily
5 SimulationManagementFamilyPdu
received DIS PDU: pduType 4 edu.nps.moves.dis.CollisionPdu, protocolFamily
=1
received DIS PDU: pduType 4 edu.nps.moves.dis.CollisionPdu, protocolFamily
1 EntityInformationFamilyPdu
received DIS PDU: pduType 22 edu.nps.moves.dis.CommentPdu, protocolFamily
=5
received DIS PDU: pduType 22 edu.nps.moves.dis.CommentPdu, protocolFamily
5 SimulationManagementFamilyPdu
received DIS PDU: pduType 11 edu.nps.moves.dis.CreateEntityPdu, protocolFamily
=5
received DIS PDU: pduType 11 edu.nps.moves.dis.CreateEntityPdu, protocolFamily
5 SimulationManagementFamilyPdu
received DIS PDU: pduType 3 edu.nps.moves.dis.DetonationPdu, protocolFamily
=2
received DIS PDU: pduType 3 edu.nps.moves.dis.DetonationPdu, protocolFamily
2 WarfareFamilyPdu
received DIS PDU: pduType 1 edu.nps.moves.dis.EntityStatePdu, protocolFamily
=1
received DIS PDU: pduType 1 edu.nps.moves.dis.EntityStatePdu, protocolFamily
1 EntityInformationFamilyPdu
received DIS PDU: pduType 2 edu.nps.moves.dis.FirePdu, protocolFamily
=2
received DIS PDU: pduType 2 edu.nps.moves.dis.FirePdu, protocolFamily
2 WarfareFamilyPdu
received DIS PDU: pduType 12 edu.nps.moves.dis.RemoveEntityPdu, protocolFamily
=5
received DIS PDU: pduType 12 edu.nps.moves.dis.RemoveEntityPdu, protocolFamily
5 SimulationManagementFamilyPdu
received DIS PDU: pduType 9 edu.nps.moves.dis.RepairCompletePdu, protocolFamily
=3
received DIS PDU: pduType 9 edu.nps.moves.dis.RepairCompletePdu, protocolFamily
3 LogisticsFamilyPdu
received DIS PDU: pduType 10 edu.nps.moves.dis.RepairResponsePdu, protocolFamily
=3
received DIS PDU: pduType 10 edu.nps.moves.dis.RepairResponsePdu, protocolFamily
3 LogisticsFamilyPdu
received DIS PDU: pduType 8 edu.nps.moves.dis.ResupplyCancelPdu, protocolFamily
=3
received DIS PDU: pduType 8 edu.nps.moves.dis.ResupplyCancelPdu, protocolFamily
3 LogisticsFamilyPdu
received DIS PDU: pduType 6 edu.nps.moves.dis.ResupplyOfferPdu, protocolFamily
=3
received DIS PDU: pduType 6 edu.nps.moves.dis.ResupplyOfferPdu, protocolFamily
3 LogisticsFamilyPdu
received packet but pdu is null, packet.getData().length=1500, error...
received packet but pdu is null, packet.getData().length=1500, error...
received DIS PDU: pduType 5 edu.nps.moves.dis.ServiceRequestPdu, protocolFamily
=3
received DIS PDU: pduType 5 edu.nps.moves.dis.ServiceRequestPdu, protocolFamily
3 LogisticsFamilyPdu
received DIS PDU: pduType 13 edu.nps.moves.dis.StartResumePdu, protocolFamily
=5
received DIS PDU: pduType 13 edu.nps.moves.dis.StartResumePdu, protocolFamily
5 SimulationManagementFamilyPdu
received DIS PDU: pduType 14 edu.nps.moves.dis.StopFreezePdu, protocolFamily
=5
received DIS PDU: pduType 14 edu.nps.moves.dis.StopFreezePdu, protocolFamily
5 SimulationManagementFamilyPdu
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment