Skip to content

Issue with Data Length #84

@crhowell3

Description

@crhowell3
void SignalPdu::marshal(DataStream &dataStream) const {
  RadioCommunicationsFamilyPdu::marshal(
      dataStream); // Marshal information in superclass first
  dataStream << _encodingScheme;
  dataStream << _tdlType;
  dataStream << _sampleRate;
  dataStream << (short)_data.size();  // ISSUE
  dataStream << _samples;
  for (auto byte : _data) {
    dataStream << byte;
  }
}

There is an issue related to the PDUs that inherit from the RadioCommunicationsFamilyPdu (the IntercomSignalPdu and SignalPdu classes) where the size of the data being marshaled into the datastream is incorrect and not compliant with the DIS Standard. The data length should be the size of the data in bits (as per the SISO-STD-001-2015 standard), whereas the size being marshaled in currently is in bytes. I will open a PR to fix this issue.

It is possible that this issue is present elsewhere in the code, so I will do a once-over before requesting merge.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions