open-dis-cpp
IntercomSignalPdu.h
1 #pragma once
2 
3 #include "dis6/EntityID.h"
4 #include "dis6/RadioCommunicationsFamilyPdu.h"
5 #include "dis6/opendis6_export.h"
6 #include "dis6/utils/DataStream.h"
7 #include <cstdint>
8 #include <vector>
9 
10 namespace DIS {
11 // Section 5.3.8.4. Actual transmission of intercome voice data. COMPLETE
12 
13 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All
14 // rights reserved.
15 //
16 // @author DMcG, jkg
17 
18 class OPENDIS6_EXPORT IntercomSignalPdu : public RadioCommunicationsFamilyPdu {
19 protected:
22 
24  unsigned short _communicationsDeviceID;
25 
27  unsigned short _encodingScheme;
28 
30  unsigned short _tdlType;
31 
33  unsigned int _sampleRate;
34 
36  unsigned short _dataLength;
37 
39  unsigned short _samples;
40 
42  std::vector<uint8_t> _data;
43 
44 public:
46  virtual ~IntercomSignalPdu();
47 
48  virtual void marshal(DataStream &dataStream) const;
49  virtual void unmarshal(DataStream &dataStream);
50 
51  EntityID &getEntityID();
52  const EntityID &getEntityID() const;
53  void setEntityID(const EntityID &pX);
54 
55  unsigned short getCommunicationsDeviceID() const;
56  void setCommunicationsDeviceID(unsigned short pX);
57 
58  unsigned short getEncodingScheme() const;
59  void setEncodingScheme(unsigned short pX);
60 
61  unsigned short getTdlType() const;
62  void setTdlType(unsigned short pX);
63 
64  unsigned int getSampleRate() const;
65  void setSampleRate(unsigned int pX);
66 
67  unsigned short getDataLength() const;
68 
69  unsigned short getSamples() const;
70  void setSamples(unsigned short pX);
71 
72  std::vector<uint8_t> &getData();
73  const std::vector<uint8_t> &getData() const;
74  void setData(const std::vector<uint8_t> &pX);
75 
76  virtual int getMarshalledSize() const;
77 
78  bool operator==(const IntercomSignalPdu &rhs) const;
79 };
80 } // namespace DIS
81 
82 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
83 // Redistribution and use in source and binary forms, with or without
84 // modification, are permitted provided that the following conditions
85 // are met:
86 //
87 // * Redistributions of source code must retain the above copyright
88 // notice, this list of conditions and the following disclaimer.
89 // * Redistributions in binary form must reproduce the above copyright
90 // notice, this list of conditions and the following disclaimer
91 // in the documentation and/or other materials provided with the
92 // distribution.
93 // * Neither the names of the Naval Postgraduate School (NPS)
94 // Modeling Virtual Environments and Simulation (MOVES) Institute
95 // (http://www.nps.edu and http://www.MovesInstitute.org)
96 // nor the names of its contributors may be used to endorse or
97 // promote products derived from this software without specific
98 // prior written permission.
99 //
100 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
101 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
102 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
103 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
104 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
105 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
106 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
107 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
108 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
109 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
110 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
111 // POSSIBILITY OF SUCH DAMAGE.
unsigned short _tdlType
tactical data link type
Definition: IntercomSignalPdu.h:30
unsigned short _encodingScheme
encoding scheme
Definition: IntercomSignalPdu.h:27
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
Definition: RadioCommunicationsFamilyPdu.h:17
a class to support managing a network buffer.
Definition: DataStream.h:28
unsigned short _communicationsDeviceID
ID of communications device.
Definition: IntercomSignalPdu.h:24
std::vector< uint8_t > _data
data bytes
Definition: IntercomSignalPdu.h:42
Definition: EntityID.h:15
unsigned short _dataLength
data length
Definition: IntercomSignalPdu.h:36
unsigned short _samples
samples
Definition: IntercomSignalPdu.h:39
EntityID _entityID
entity ID
Definition: IntercomSignalPdu.h:21
unsigned int _sampleRate
sample rate
Definition: IntercomSignalPdu.h:33
Definition: IntercomSignalPdu.h:18