Menu

Radio Communication in C++

2015-06-11
2015-08-03
  • Don McGregor

    Don McGregor - 2015-06-11

    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.

     
    • Aqeeb ur Rahman

      Aqeeb ur Rahman - 2015-06-12

      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 ?

       
  • Don McGregor

    Don McGregor - 2015-06-14

    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.

     
  • Aqeeb ur Rahman

    Aqeeb ur Rahman - 2015-08-03

    thanks for your time ..!
    we just moved the files from the library to project files and its working perfect.