KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Mode5TransponderSupplementalData.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: Mode5TransponderSupplementalData
32  DIS: (7) 1278.1 - 2012
33  created: 23/05/2014
34  author: Karl Jones
35 
36  purpose: Provides supplemental data related to a Mode 5 transponder.
37 
38  Size: 8 bits / 1 octet
39 *********************************************************************/
40 
41 #pragma once
42 
43 #include "./DataTypeBase.h"
44 
45 namespace KDIS {
46 namespace DATA_TYPE {
47 
49 {
50 protected:
51 
52  union
53  {
54  struct
55  {
56  KUINT8 m_ui8SquitterStatus : 1;
57  KUINT8 m_ui8Lvl2SquitterStatus : 1;
58  KUINT8 m_ui8IFFMission : 3;
59  KUINT8 m_ui8Padding : 3;
60 
61  };
63  } m_SupplementalDataUnion;
64 
65 public:
66 
67  static const KUINT16 MODE_5_TRANSPONDER_SUPPLEMENTAL_DATA_SIZE = 1;
68 
70 
71  Mode5TransponderSupplementalData( KBOOL Squitter, KBOOL Lvl2Squitter, KUINT8 IFFMission ) throw( KException );
72 
74 
76 
77  //************************************
78  // FullName: KDIS::DATA_TYPE::Mode5TransponderSupplementalData::SetSquitter
79  // KDIS::DATA_TYPE::Mode5TransponderSupplementalData::GetHasAntiHandlingDevice
80  //!Description: Indicates if the Mode 5 squitter is On(true) or Off(false).
81  // Parameter: KBOOL S
82  //************************************
83  void SetSquitter( KBOOL S );
84  KBOOL GetSquitter() const;
85 
86  //************************************
87  // FullName: KDIS::DATA_TYPE::Mode5TransponderSupplementalData::vel2Squitter(
88  // KDIS::DATA_TYPE::Mode5TransponderSupplementalData::GetLevel2Squitter
89  //!Description: Indicates if the Level 2 Mode 5 squitter Enabled(true) or Disabled(false).
90  // Parameter: KBOOL L2S
91  //************************************
92  void SetLevel2Squitter( KBOOL L2S );
93  KBOOL GetLevel2Squitter() const;
94 
95  //************************************
96  // FullName: KDIS::DATA_TYPE::Mode5TransponderSupplementalData::SetIFFMission
97  // KDIS::DATA_TYPE::Mode5TransponderSupplementalData::GetIFFMission
98  //!Description: Identifies the IFF mission of this Mode 5 transponder.
99  //! Throws DATA_TYPE_TOO_LARGE exception if value is greater than 7.
100  // Parameter: KUINT8 IFFM
101  //************************************
102  void SetIFFMission( KUINT8 IFFM ) throw( KException );
103  KUINT8 GetIFFMission() const;
104 
105  //************************************
106  // FullName: KDIS::DATA_TYPE::Mode5TransponderSupplementalData::GetAsString
107  //!Description: Returns a string representation
108  //************************************
109  virtual KString GetAsString() const;
110 
111  //************************************
112  // FullName: KDIS::DATA_TYPE::Mode5TransponderSupplementalData::Decode
113  //!Description: Convert From Network Data.
114  // Parameter: KDataStream & stream
115  //************************************
116  virtual void Decode( KDataStream & stream ) throw( KException );
117 
118  //************************************
119  // FullName: KDIS::DATA_TYPE::Mode5TransponderSupplementalData::Encode
120  //!Description: Convert To Network Data.
121  // Parameter: KDataStream & stream
122  //************************************
123  virtual KDataStream Encode() const;
124  virtual void Encode( KDataStream & stream ) const;
125 
126  KBOOL operator == ( const Mode5TransponderSupplementalData & Value ) const;
127  KBOOL operator != ( const Mode5TransponderSupplementalData & Value ) const;
128 };
129 
130 } // END namespace DATA_TYPE
131 } // END namespace KDIS
Definition: Mode5TransponderSupplementalData.h:48
unsigned short int KUINT16
Definition: KDefines.h:101
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
unsigned char KUINT8
Definition: KDefines.h:99
#define KDIS_EXPORT
Definition: KDefines.h:82
KUINT8 m_ui8SupplementalData
Definition: Mode5TransponderSupplementalData.h:62