Skip to content
Snippets Groups Projects
Commit cc523d3b authored by tobia's avatar tobia
Browse files

No commit message

No commit message
parent ac3d4d0f
No related branches found
No related tags found
No related merge requests found
......@@ -57,10 +57,6 @@ public class AllPduSender
Pdu aPdu = null; // edu.​nps.​moves7.​dis.PDU superclass for all PDUs, in preparation for custom assignment
//***************************************************************************
CommentPdu newCommentPdu = new CommentPdu();
ArrayList<VariableDatum> payloadList = new ArrayList<VariableDatum>();
......@@ -68,17 +64,11 @@ public class AllPduSender
ArrayList<String> commentsList = new ArrayList<>();
commentsList.add("Hello CommentPDU");
commentsList.add("Chuck Norris is comming to town from IP-Adress " + DEFAULT_MULTICAST_ADDRESS + " with Port " + DEFAULT_MULTICAST_PORT);
if (!commentsList.isEmpty())
System.out.println("Preparing CommentPDU:");
for (String comment : commentsList)
{
VariableDatum newVariableDatum = new VariableDatum();
newVariableDatum.setVariableDatumValue (comment.getBytes()); // conversion
//newVariableDatum.setVariableDatumLength(comment.getBytes().length * 8); // bits, not bytes, see spec and javadoc
// alternatively, you do not need to set this and the marshaller will figure it out from the byte array
// (see javadoc for VariableDatum.setVariableDatumLength())
newVariableDatum.setVariableDatumValue (comment.getBytes());
payloadList.add(newVariableDatum);
System.out.println(" \"" + comment + "\"");
}
......
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