open-dis-cpp
IntercomControlPdu.h
1 #pragma once
2 
3 #include <dis6/EntityID.h>
4 #include <dis6/EntityID.h>
5 #include <dis6/IntercomCommunicationsParameters.h>
6 #include <vector>
7 #include <dis6/RadioCommunicationsFamilyPdu.h>
8 #include <dis6/utils/DataStream.h>
9 #include <dis6/opendis6_export.h>
10 
11 
12 namespace DIS
13 {
14 // Section 5.3.8.5. Detailed inofrmation about the state of an intercom device and the actions it is requestion of another intercom device, or the response to a requested action. Required manual intervention to fix the intercom parameters, which can be of varialbe length. UNFINSISHED
15 
16 // Copyright (c) 2007-2009, MOVES Institute, Naval Postgraduate School. All rights reserved.
17 //
18 // @author DMcG, jkg
19 
20 class OPENDIS6_EXPORT IntercomControlPdu : public RadioCommunicationsFamilyPdu
21 {
22 protected:
24  unsigned char _controlType;
25 
28 
31 
34 
36  unsigned char _sourceLineID;
37 
39  unsigned char _transmitPriority;
40 
42  unsigned char _transmitLineState;
43 
45  unsigned char _command;
46 
49 
52 
55 
57  std::vector<IntercomCommunicationsParameters> _intercomParameters;
58 
59 
60  public:
62  virtual ~IntercomControlPdu();
63 
64  virtual void marshal(DataStream& dataStream) const;
65  virtual void unmarshal(DataStream& dataStream);
66 
67  unsigned char getControlType() const;
68  void setControlType(unsigned char pX);
69 
70  unsigned char getCommunicationsChannelType() const;
71  void setCommunicationsChannelType(unsigned char pX);
72 
73  EntityID& getSourceEntityID();
74  const EntityID& getSourceEntityID() const;
75  void setSourceEntityID(const EntityID &pX);
76 
77  unsigned char getSourceCommunicationsDeviceID() const;
78  void setSourceCommunicationsDeviceID(unsigned char pX);
79 
80  unsigned char getSourceLineID() const;
81  void setSourceLineID(unsigned char pX);
82 
83  unsigned char getTransmitPriority() const;
84  void setTransmitPriority(unsigned char pX);
85 
86  unsigned char getTransmitLineState() const;
87  void setTransmitLineState(unsigned char pX);
88 
89  unsigned char getCommand() const;
90  void setCommand(unsigned char pX);
91 
92  EntityID& getMasterEntityID();
93  const EntityID& getMasterEntityID() const;
94  void setMasterEntityID(const EntityID &pX);
95 
96  unsigned short getMasterCommunicationsDeviceID() const;
97  void setMasterCommunicationsDeviceID(unsigned short pX);
98 
99  unsigned int getIntercomParametersLength() const;
100 
101  std::vector<IntercomCommunicationsParameters>& getIntercomParameters();
102  const std::vector<IntercomCommunicationsParameters>& getIntercomParameters() const;
103  void setIntercomParameters(const std::vector<IntercomCommunicationsParameters>& pX);
104 
105 
106 virtual int getMarshalledSize() const;
107 
108  bool operator ==(const IntercomControlPdu& rhs) const;
109 };
110 }
111 
112 // Copyright (c) 1995-2009 held by the author(s). All rights reserved.
113 // Redistribution and use in source and binary forms, with or without
114 // modification, are permitted provided that the following conditions
115 // are met:
116 //
117 // * Redistributions of source code must retain the above copyright
118 // notice, this list of conditions and the following disclaimer.
119 // * Redistributions in binary form must reproduce the above copyright
120 // notice, this list of conditions and the following disclaimer
121 // in the documentation and/or other materials provided with the
122 // distribution.
123 // * Neither the names of the Naval Postgraduate School (NPS)
124 // Modeling Virtual Environments and Simulation (MOVES) Institute
125 // (http://www.nps.edu and http://www.MovesInstitute.org)
126 // nor the names of its contributors may be used to endorse or
127 // promote products derived from this software without specific
128 // prior written permission.
129 //
130 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
131 // AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
132 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
133 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
134 // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
135 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
136 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
137 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
138 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
139 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
140 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
141 // POSSIBILITY OF SUCH DAMAGE.
unsigned char _command
detailed type requested.
Definition: IntercomControlPdu.h:45
std::vector< IntercomCommunicationsParameters > _intercomParameters
^^^This is wrong–the length of the data field is variable.
Definition: IntercomControlPdu.h:57
unsigned char _transmitPriority
priority of this message relative to transmissons from other intercom devices
Definition: IntercomControlPdu.h:39
Symbolic names as defined in 5.1.4.
Definition: AcknowledgePdu.h:8
Definition: RadioCommunicationsFamilyPdu.h:17
unsigned int _intercomParametersLength
number of intercom parameters
Definition: IntercomControlPdu.h:54
unsigned char _sourceLineID
Line number to which the intercom control refers.
Definition: IntercomControlPdu.h:36
a class to support managing a network buffer.
Definition: DataStream.h:28
unsigned char _controlType
control type
Definition: IntercomControlPdu.h:24
unsigned char _sourceCommunicationsDeviceID
The specific intercom device being simulated within an entity.
Definition: IntercomControlPdu.h:33
unsigned char _transmitLineState
current transmit state of the line
Definition: IntercomControlPdu.h:42
Definition: EntityID.h:15
unsigned short _masterCommunicationsDeviceID
specific intercom device that has created this intercom channel
Definition: IntercomControlPdu.h:51
EntityID _masterEntityID
eid of the entity that has created this intercom channel.
Definition: IntercomControlPdu.h:48
unsigned char _communicationsChannelType
control type
Definition: IntercomControlPdu.h:27
Definition: IntercomControlPdu.h:20
EntityID _sourceEntityID
Source entity ID.
Definition: IntercomControlPdu.h:30