KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Receiver_PDU.h
Go to the documentation of this file.
1 /*********************************************************************
2 Copyright 2013 Karl Jones
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7 
8 1. Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation
12  and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 For Further Information Please Contact me at
26 Karljj1@yahoo.com
27 http://p.sf.net/kdis/UserGuide
28 *********************************************************************/
29 
30 /********************************************************************
31  class: Receiver_PDU
32  DIS: (5) 1278.1 - 1995
33  created: 22/10/2008
34  author: Karl Jones
35 
36  purpose: The Receiver PDU may be used to communicate the state of a particular
37  radio receiver.
38  Its primary application is in communicating state information to radio
39  network monitors, data loggers, and similar applications for use in debugging,
40  supervision, and after-action review.
41 
42  size: 288 bits / 36
43 *********************************************************************/
44 
45 #pragma once
46 
48 #include "./../../DataTypes/EntityIdentifier.h"
49 
50 namespace KDIS {
51 namespace PDU {
52 
54 {
55 protected:
56 
58 
60 
62 
64 
66 
67 public:
68 
69  static const KUINT16 RECEIVER_PDU_SIZE = 36;
70 
71  Receiver_PDU();
72 
73  Receiver_PDU( KDataStream & stream ) throw( KException );
74 
75  Receiver_PDU( const Header & H, KDataStream & stream ) throw( KException );
76 
78  KFLOAT32 ReceivingPower, const KDIS::DATA_TYPE::EntityIdentifier & TransmitterID,
79  KUINT16 TransmitterRadioID );
80 
81  virtual ~Receiver_PDU();
82 
83  //************************************
84  // FullName: KDIS::PDU::Receiver_PDU::SetReceiverState
85  // KDIS::PDU::Receiver_PDU::GetReceiverState
86  //!Description: Radio Receiver State, on or off.
87  // Parameter: TransmitState TS
88  //************************************
89  void SetReceiverState( KDIS::DATA_TYPE::ENUMS::TransmitState TS );
90  KDIS::DATA_TYPE::ENUMS::TransmitState GetReceiverState() const;
91 
92  //************************************
93  // FullName: KDIS::PDU::Receiver_PDU::SetReceiverPower
94  // KDIS::PDU::Receiver_PDU::GetReceiverPower
95  //!Description: Radio Receiver power received, after applying
96  //! any propagation loss and antenna gain.
97  //! In decibel milliwatts.
98  // Parameter: KFLOAT32 RP
99  //************************************
100  void SetReceiverPower( KFLOAT32 RP );
101  KFLOAT32 GetReceiverPower() const;
102 
103  //************************************
104  // FullName: KDIS::PDU::Receiver_PDU::SetTransmitterEntityID
105  // KDIS::PDU::Receiver_PDU::GetTransmitterEntityID
106  //!Description: The source of the transmission.
107  // Parameter: const EntityIdentifier & ID
108  //************************************
109  void SetTransmitterEntityID( const KDIS::DATA_TYPE::EntityIdentifier & ID );
110  const KDIS::DATA_TYPE::EntityIdentifier & GetTransmitterEntityID() const;
111  KDIS::DATA_TYPE::EntityIdentifier & GetTransmitterEntityID();
112 
113  //************************************
114  // FullName: KDIS::PDU::Receiver_PDU::SetTransmitterRadioID
115  // KDIS::PDU::Receiver_PDU::GetTransmitterRadioID
116  //!Description: Identifies the particular radio within the transmitting
117  //! entity.
118  // Parameter: KUINT16 ID
119  //************************************
120  void SetTransmitterRadioID( KUINT16 ID );
121  KUINT16 GetTransmitterRadioID() const;
122 
123  //************************************
124  // FullName: KDIS::PDU::Receiver_PDU::GetAsString
125  //!Description: Returns a string representation of the PDU.
126  //************************************
127  virtual KString GetAsString() const;
128 
129  //************************************
130  // FullName: KDIS::PDU::Receiver_PDU::Decode
131  //!Description: Convert From Network Data.
132  // Parameter: KDataStream & stream
133  // Parameter: bool ignoreHeader = false - Decode the header from the stream?
134  //************************************
135  virtual void Decode( KDataStream & stream, bool ignoreHeader = false ) throw( KException );
136 
137  //************************************
138  // FullName: KDIS::PDU::Receiver_PDU::Encode
139  //!Description: Convert To Network Data.
140  // Parameter: KDataStream & stream
141  //************************************
142  virtual KDataStream Encode() const;
143  virtual void Encode( KDataStream & stream ) const;
144 
145  KBOOL operator == ( const Receiver_PDU & Value ) const;
146  KBOOL operator != ( const Receiver_PDU & Value ) const;
147 };
148 
149 } // END namespace PDU
150 } // END namespace KDIS
151 
KUINT16 m_ui16Padding1
Definition: Receiver_PDU.h:59
Definition: Radio_Communications_Header.h:48
KDIS::DATA_TYPE::EntityIdentifier m_TransmitterEntityID
Definition: Receiver_PDU.h:63
unsigned short int KUINT16
Definition: KDefines.h:101
float KFLOAT32
Definition: KDefines.h:113
KUINT16 m_ui16ReceiverState
Definition: Receiver_PDU.h:57
KFLOAT32 m_f32RecPwr
Definition: Receiver_PDU.h:61
TransmitState
Definition: EnumRadio.h:53
Definition: KDefines.h:182
Definition: KDataStream.h:48
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
Definition: Receiver_PDU.h:53
Definition: EntityIdentifier.h:49
Definition: Header7.h:142
KUINT16 m_ui16TransmitterRadioID
Definition: Receiver_PDU.h:65
#define KDIS_EXPORT
Definition: KDefines.h:82