KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ModulationType.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: ModulationType
32  created: 2008/10/21
33  author: Karl Jones
34 
35  purpose: Contains information about the type of modulation used for
36  a radio transmission.
37  size: 64 bits / 8 octets
38 *********************************************************************/
39 
40 #pragma once
41 
42 #include "./DataTypeBase.h"
43 
44 namespace KDIS {
45 namespace DATA_TYPE {
46 
48 {
49 protected:
50 
51  union
52  {
53  struct
54  {
55  KUINT16 m_ui16FreqHop : 1;
56  KUINT16 m_ui16PseudoNoise : 1;
57  KUINT16 m_ui16TimeHop : 1;
58  // Bits 3 - 15 TBD
59  };
61  };
62 
64 
66 
68 
69 public:
70 
71  static const KUINT16 MODULATION_TYPE_SIZE = 8;
72 
74 
75  ModulationType( KDataStream & stream )throw( KException );
76 
77  ModulationType( KBOOL FreqHop, KBOOL PseudoNoise, KBOOL TimeHop,
78  KUINT16 MajorModulation, KUINT16 Detail,
79  KUINT16 System );
80 
81  virtual ~ModulationType();
82 
83  //************************************
84  // FullName: KDIS::DATA_TYPE::ModulationType::SetSpreadSpectrum
85  // KDIS::DATA_TYPE::ModulationType::GetSpreadSpectrum
86  //!Description: Spread Spectrum Boolean array.
87  // Parameter: KUINT16 SS, void
88  //************************************
89  void SetSpreadSpectrum( KUINT16 SS );
90  KUINT16 GetSpreadSpectrum() const;
91 
92  //************************************
93  // FullName: KDIS::DATA_TYPE::ModulationType::SetFrequencyHop
94  // KDIS::DATA_TYPE::ModulationType::GetFrequencyHop
95  //!Description: Spread Spectrum Boolean array value 0.
96  // Parameter: KBOOL FH, void
97  //************************************
98  void SetFrequencyHop( KBOOL FH );
99  KBOOL GetFrequencyHop() const;
100 
101  //************************************
102  // FullName: KDIS::DATA_TYPE::ModulationType::SetPseudoNoise
103  // KDIS::DATA_TYPE::ModulationType::GetPseudoNoise
104  //!Description: Spread Spectrum Boolean array value 1.
105  // Parameter: KBOOL PN, void
106  //************************************
107  void SetPseudoNoise( KBOOL PN );
108  KBOOL GetPseudoNoise() const;
109 
110  //************************************
111  // FullName: KDIS::DATA_TYPE::ModulationType::SetTimeHop
112  // KDIS::DATA_TYPE::ModulationType::GetTimeHop
113  //!Description: Spread Spectrum Boolean array value 2.
114  // Parameter: KBOOL TH, void
115  //************************************
116  void SetTimeHop( KBOOL TH );
117  KBOOL GetTimeHop() const;
118 
119  //************************************
120  // FullName: KDIS::DATA_TYPE::ModulationType::GetMajorModulation
121  //!Description: Major classification of the modulation type.
122  //! Note: This value is set automatically from the SetDetails function.
123  //************************************
124  KDIS::DATA_TYPE::ENUMS::RadioMajorModulation GetMajorModulation() const;
125 
126  //************************************
127  // FullName: KDIS::DATA_TYPE::ModulationType::GetMajorModulation
128  //!Description: Determines major modulation param.
129  //! Provides details information.
130  // Parameter: <various>
131  //************************************
132  void SetDetail( KDIS::DATA_TYPE::ENUMS::DetailAmplitude A );
134  void SetDetail( KDIS::DATA_TYPE::ENUMS::DetailAngle A );
135  void SetDetail( KDIS::DATA_TYPE::ENUMS::DetailCombination C );
136  void SetDetail( KDIS::DATA_TYPE::ENUMS::DetailPulse P );
137  void SetDetail( KDIS::DATA_TYPE::ENUMS::DetailUnmodulated U );
139  KUINT16 GetDetail() const;
140 
141  //************************************
142  // FullName: KDIS::DATA_TYPE::ModulationType::SetSystem
143  // KDIS::DATA_TYPE::ModulationType::GetSystem
144  //!Description: Specifies the interpretation of the
145  //! modulation parameter field(s).
146  // Parameter: ModulationSystem S
147  //************************************
148  void SetSystem( KDIS::DATA_TYPE::ENUMS::ModulationSystem S );
150 
151  //************************************
152  // FullName: KDIS::DATA_TYPE::ModulationType::GetAsString
153  //!Description: Returns a string representation
154  //************************************
155  virtual KString GetAsString() const;
156 
157  //************************************
158  // FullName: KDIS::DATA_TYPE::ModulationType::Decode
159  //!Description: Convert From Network Data.
160  // Parameter: KDataStream & stream
161  //************************************
162  virtual void Decode( KDataStream & stream ) throw( KException );
163 
164  //************************************
165  // FullName: KDIS::DATA_TYPE::ModulationType::Encode
166  //!Description: Convert To Network Data.
167  // Parameter: KDataStream & stream
168  //************************************
169  virtual KDataStream Encode() const;
170  virtual void Encode( KDataStream & stream ) const;
171 
172  KBOOL operator == ( const ModulationType & Value ) const;
173  KBOOL operator != ( const ModulationType & Value ) const;
174 };
175 
176 } // END namespace DATA_TYPES
177 } // END namespace KDIS
KUINT16 m_ui16MajorModulationType
Definition: ModulationType.h:63
DetailAngle
Definition: EnumRadio.h:174
KUINT16 m_ui16Detail
Definition: ModulationType.h:65
unsigned short int KUINT16
Definition: KDefines.h:101
DetailUnmodulated
Definition: EnumRadio.h:211
DetailAmplitude
Definition: EnumRadio.h:143
Definition: KDefines.h:182
Definition: KDataStream.h:48
KUINT16 m_ui16SpreadSpectrum
Definition: ModulationType.h:60
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
std::string KString
Definition: KDefines.h:116
DetailAmplitudeAndAngle
Definition: EnumRadio.h:163
ModulationSystem
Definition: EnumRadio.h:239
DetailCombination
Definition: EnumRadio.h:187
DetailPulse
Definition: EnumRadio.h:198
DetailCarrierPhaseShift
Definition: EnumRadio.h:222
KUINT16 m_ui16System
Definition: ModulationType.h:67
RadioMajorModulation
Definition: EnumRadio.h:119
#define KDIS_EXPORT
Definition: KDefines.h:82
Definition: ModulationType.h:47