KDIS  2-8-x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
EntityDestinationRecord.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: EntityDestinationRecord
32  created: 2009/02/05
33  author: Karl Jones
34 
35  purpose: Used to send an Intercom Control PDU directly to a specific entity.
36  size: 96 bits / 12 octets
37 *********************************************************************/
38 
39 #pragma once
40 
41 #include "./DataTypeBase.h"
42 #include "./EntityIdentifier.h"
43 
44 namespace KDIS {
45 namespace DATA_TYPE {
46 
48 {
49 protected:
50 
52 
54 
56 
58 
60 
62 
63 public:
64 
65  static const KUINT16 ENTITY_DESTINATION_RECORD_SIZE = 12;
66 
68 
70 
71  EntityDestinationRecord( const EntityIdentifier & ID, KUINT16 CommDeviceID, KUINT8 LineID,
73 
74  virtual ~EntityDestinationRecord();
75 
76  //************************************
77  // FullName: KDIS::DATA_TYPE::EntityDestinationRecord::SetDestinationEntityID
78  // KDIS::DATA_TYPE::EntityDestinationRecord::GetDestinationEntityID
79  //!Description: Entity that is the recipient of the PDU.
80  // Parameter: const EntityIdentifier & ID, void
81  //************************************
82  void SetDestinationEntityID( const EntityIdentifier & ID );
83  const EntityIdentifier & GetDestinationEntityID() const;
84  EntityIdentifier & GetDestinationEntityID();
85 
86  //************************************
87  // FullName: KDIS::DATA_TYPE::EntityDestinationRecord::SetDestinationCommDeviceID
88  // KDIS::DATA_TYPE::EntityDestinationRecord::GetDestinationCommDeviceID
89  //!Description: Identifies the specific intercom device being interfaced
90  //! and/or simulated within an entity.
91  //! All devices on an entity must have a unique ID.
92  //! Set to 0 if the entity does not have a simulated device.
93  // Parameter: KUINT16 ID, void
94  //************************************
95  void SetDestinationCommDeviceID( KUINT16 ID );
96  KUINT16 GetDestinationCommDeviceID() const;
97 
98  //************************************
99  // FullName: KDIS::DATA_TYPE::EntityDestinationRecord::SetDestinationLineID
100  // KDIS::DATA_TYPE::EntityDestinationRecord::GetDestinationLineID
101  //!Description: Identifies the line number to which this intercom control refers.
102  //! E.G. For a intercom device with a single line the value would be 1.
103  // Parameter: KUINT8 ID, void
104  //************************************
105  void SetDestinationLineID( KUINT8 ID );
106  KUINT8 GetDestinationLineID() const;
107 
108  //************************************
109  // FullName: KDIS::DATA_TYPE::EntityDestinationRecord::SetDestinationPriority
110  // KDIS::DATA_TYPE::EntityDestinationRecord::GetDestinationPriority
111  //!Description: Identifies the priority of this message relative to transmissions
112  //! from other intercom devices on the same channel.
113  //! The value 0 is reserved.
114  //! 1 = highest priority, 255 = lowest priority.
115  // Parameter: KUINT8 TP, void
116  //************************************
117  void SetDestinationPriority( KUINT8 TP );
118  KUINT8 GetDestinationPriority() const;
119 
120  //************************************
121  // FullName: KDIS::DATA_TYPE::EntityDestinationRecord::SetLineStateCommand
122  // KDIS::DATA_TYPE::EntityDestinationRecord::GetLineStateCommand
123  //!Description: When the Control Type of the Intercom Control PDU is
124  //! request or acknowledge, this field shall specify the
125  //! detailed type requested. Otherwise set to 0.
126  // Parameter: LineStateCommand LSC, void
127  //************************************
128  void SetLineStateCommand( KDIS::DATA_TYPE::ENUMS::LineStateCommand LSC );
129  KDIS::DATA_TYPE::ENUMS::LineStateCommand GetLineStateCommand() const;
130 
131  //************************************
132  // FullName: KDIS::DATA_TYPE::EntityDestinationRecord::GetAsString
133  //!Description: Returns a string representation
134  //************************************
135  virtual KString GetAsString() const;
136 
137  //************************************
138  // FullName: KDIS::DATA_TYPE::EntityDestinationRecord::Decode
139  //!Description: Convert From Network Data.
140  // Parameter: KDataStream & stream
141  //************************************
142  virtual void Decode( KDataStream & stream ) throw( KException );
143 
144  //************************************
145  // FullName: KDIS::DATA_TYPE::EntityDestinationRecord::Encode
146  //!Description: Convert To Network Data.
147  // Parameter: KDataStream & stream
148  //************************************
149  virtual KDataStream Encode() const;
150  virtual void Encode( KDataStream & stream ) const;
151 
152  KBOOL operator == ( const EntityDestinationRecord & Value ) const;
153  KBOOL operator != ( const EntityDestinationRecord & Value ) const;
154 };
155 
156 } // END namespace DATA_TYPES
157 } // END namespace KDIS
KUINT8 m_uiPadding1
Definition: EntityDestinationRecord.h:61
KUINT8 m_ui8LnStCmd
Definition: EntityDestinationRecord.h:59
EntityIdentifier m_Entity
Definition: EntityDestinationRecord.h:51
unsigned short int KUINT16
Definition: KDefines.h:101
KUINT8 m_ui8DstPriority
Definition: EntityDestinationRecord.h:57
Definition: KDefines.h:182
Definition: KDataStream.h:48
Definition: DataTypeBase.h:49
bool KBOOL
Definition: KDefines.h:119
KUINT16 m_ui16DstCommsDvcID
Definition: EntityDestinationRecord.h:53
std::string KString
Definition: KDefines.h:116
Definition: EntityDestinationRecord.h:47
Definition: EntityIdentifier.h:49
LineStateCommand
Definition: EnumRadio.h:517
unsigned char KUINT8
Definition: KDefines.h:99
KUINT8 m_ui8DstLineID
Definition: EntityDestinationRecord.h:55
#define KDIS_EXPORT
Definition: KDefines.h:82