Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dis.SetDataPdu Usage #4

Closed
dragsu opened this issue Aug 3, 2019 · 7 comments
Closed

dis.SetDataPdu Usage #4

dragsu opened this issue Aug 3, 2019 · 7 comments
Labels

Comments

@dragsu
Copy link

dragsu commented Aug 3, 2019

Any chance you can provide an example of using dis.SetDataPdu with some variable data records.

@leif81 leif81 added the question label Aug 5, 2019
@leif81
Copy link
Member

leif81 commented Aug 5, 2019

@dragsu
Copy link
Author

dragsu commented Aug 5, 2019

Sorry I was looking at https://github.com/open-dis/DISWebGateway. Trying to use dis.SetDataPdu in dis.js to create a SetData pdu with a single variable data field with some text. Currently, I'm doing the below but Wireshark is not showing the variable message right.

var setDpdu = new dis.SetDataPdu();
setDpdu.numberOfVariableDatumRecords = 1;
var anX = new dis.VariableDatum();
anX.variableDatumID = 2;
anX.variableDatumLength = 32;

var charA = new dis.OneByteChunk();
charA.otherParameters[0]='t';
var charB = new dis.OneByteChunk();
charB.otherParameters[0]='e';
var charC = new dis.OneByteChunk();
charC.otherParameters[0]='s';
var charD = new dis.OneByteChunk();
charD.otherParameters[0]='t';

anX.variableData[0] = charA;
anX.variableData[1] = charB;
anX.variableData[2] = charC;
anX.variableData[3] = charD;

setDpdu.variableDatums.push(anX);

@leif81
Copy link
Member

leif81 commented Aug 13, 2019

What you're doing there seems reasonable...

I have this recollection that Wireshark doesn't display the variable data field properly. But it's been a while since I've done this so maybe I'm thinking about something else. Do you have a way to confirm if the issue is with Wireshark or your code?

@leif81
Copy link
Member

leif81 commented Aug 13, 2019

If it helps, here's a sample SetData pdu raw packet and the variable data contained in it should read "allunits".

https://github.com/open-dis/open-dis-java/blob/master/src/test/resources/edu/nps/moves/dis/SetDataPdu-vbs-script-cmd.raw

@quonn77
Copy link

quonn77 commented Jul 19, 2022

How to use in C++?

@leif81
Copy link
Member

leif81 commented Jul 28, 2022

How to use in C++?

@quonn77 I had a chance to reply to your question over in the cpp repository. Hopefully it helps somewhat. I'll link to that issue and thread here and we can continue a conversation over there. open-dis/open-dis-cpp#71

@quonn77
Copy link

quonn77 commented Jul 28, 2022

@leif81 Yes I agree

@dragsu dragsu closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants