Im trying to send a signal PDU in DIS i got null on the receiving side.
while i got the EntityStatePdu perfectly.
need help in radio communication implementation in open-Dis (C++)
thanks :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Look in the source code for PduFactory.cpp or PduBank.cpp, depending on which
you are using. That contains a switch statement that peeks at the PDU type field
in the incoming packet, and makes a decision about what type of PDU to create
based on that. You should be able to just add a clause to the switch statement
and instantiate the correct PDU.
Im trying to send a signal PDU in DIS i got null on the receiving side.
while i got the EntityStatePdu perfectly.
need help in radio communication implementation in open-Dis (C++)
Look in the source code for PduFactory.cpp or PduBank.cpp, depending on which
you are using. That contains a switch statement that peeks at the PDU type field
in the incoming packet, and makes a decision about what type of PDU to create
based on that. You should be able to just add a clause to the switch statement
and instantiate the correct PDU.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i had added the case's in both files of signalpdu,receiverpdu,transmitterpdu
and also PDU types SignalPdu=26,TransmitterPdu=25,ReceiverPdu=27.
in MultiCastSocket class i got the buffer which contains the value like PDUtype,protocolVersion etc but when it jumps to the IPacketProcessor class it has a null pointer .
any guess whats the problem with it ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) Fire up wireshark and confirm that that packets you think are Signal PDUs are in fact Signal PDUs. Wireshark has a built-in decoder for DIS.
2) Take a look at the unmarshal() method in SignalPdu.cpp. This is where the packet is actually decoded. It makes a call to RadioCommunicationsFamilyPdu first, to decode anything in superclasses (included the PDUHeader) and then steps through the fields specific to SignalPdu, decoding as it goes. Looking at this in a debugger will probably identify the problem.
I don't believe I've used SignalPdu before myself, so I can't vouch for its correctness. In fact it looks like there is some special bit-level padding going on in the PDU, which it's likely that my automated code didn't capture correctly.
The fields (according to v7 of the standard) are
PDUHeader
RadioReferenceID
RadioNumber
EncodingScheme
DataLength (in bits)
Samples
Data (length must match the value in DataLength)
Padding (zero-fill to a 32 bit boundary)
I think there's a unit problem in the PDU--the data length is trying to read
bytes, while it should be trying to read bits, and it isn't reading the
padding field at all. This completely screws up the decoding process and
it just gives up and returns null. You can drop some custom code into the
unmarshal() method and fix this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Im trying to send a signal PDU in DIS i got null on the receiving side.
while i got the EntityStatePdu perfectly.
need help in radio communication implementation in open-Dis (C++)
thanks :)
Look in the source code for PduFactory.cpp or PduBank.cpp, depending on which
you are using. That contains a switch statement that peeks at the PDU type field
in the incoming packet, and makes a decision about what type of PDU to create
based on that. You should be able to just add a clause to the switch statement
and instantiate the correct PDU.
On Jun 11, 2015, at 2:28 AM, Aqeeb ur Rahman aqeeb@users.sf.net<mailto:aqeeb@users.sf.net> wrote:
Im trying to send a signal PDU in DIS i got null on the receiving side.
while i got the EntityStatePdu perfectly.
need help in radio communication implementation in open-Dis (C++)
thanks :)
Radio Communication in C++https://sourceforge.net/p/open-dis/discussion/general/thread/385b4405/?limit=25#71d7
Sent from sourceforge.nethttp://sourceforge.net because you indicated interest in https://sourceforge.net/p/open-dis/discussion/general/https://sourceforge.net/p/open-dis/discussion/general
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/https://sourceforge.net/auth/subscriptions
Look in the source code for PduFactory.cpp or PduBank.cpp, depending on which
you are using. That contains a switch statement that peeks at the PDU type field
in the incoming packet, and makes a decision about what type of PDU to create
based on that. You should be able to just add a clause to the switch statement
and instantiate the correct PDU.
i had added the case's in both files of signalpdu,receiverpdu,transmitterpdu
and also PDU types SignalPdu=26,TransmitterPdu=25,ReceiverPdu=27.
in MultiCastSocket class i got the buffer which contains the value like PDUtype,protocolVersion etc but when it jumps to the IPacketProcessor class it has a null pointer .
any guess whats the problem with it ?
Hmm. I'd probably:
1) Fire up wireshark and confirm that that packets you think are Signal PDUs are in fact Signal PDUs. Wireshark has a built-in decoder for DIS.
2) Take a look at the unmarshal() method in SignalPdu.cpp. This is where the packet is actually decoded. It makes a call to RadioCommunicationsFamilyPdu first, to decode anything in superclasses (included the PDUHeader) and then steps through the fields specific to SignalPdu, decoding as it goes. Looking at this in a debugger will probably identify the problem.
I don't believe I've used SignalPdu before myself, so I can't vouch for its correctness. In fact it looks like there is some special bit-level padding going on in the PDU, which it's likely that my automated code didn't capture correctly.
The fields (according to v7 of the standard) are
PDUHeader
RadioReferenceID
RadioNumber
EncodingScheme
DataLength (in bits)
Samples
Data (length must match the value in DataLength)
Padding (zero-fill to a 32 bit boundary)
I think there's a unit problem in the PDU--the data length is trying to read
bytes, while it should be trying to read bits, and it isn't reading the
padding field at all. This completely screws up the decoding process and
it just gives up and returns null. You can drop some custom code into the
unmarshal() method and fix this.
thanks for your time ..!
we just moved the files from the library to project files and its working perfect.