EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoGPChannelInfo.h
Go to the documentation of this file.
1 /******************************************************************************
2  DISCLAIMER
3 
4  THIS SOFTWARE PRODUCT ("SOFTWARE") IS PROPRIETARY TO ENOCEAN GMBH, OBERHACHING,
5  GERMANY (THE "OWNER") AND IS PROTECTED BY COPYRIGHT AND INTERNATIONAL TREATIES OR
6  PROTECTED AS TRADE SECRET OR AS OTHER INTELLECTUAL PROPERTY RIGHT. ALL RIGHTS, TITLE AND
7  INTEREST IN AND TO THE SOFTWARE, INCLUDING ANY COPYRIGHT, TRADE SECRET OR ANY OTHER
8  INTELLECTUAL PROPERTY EMBODIED IN THE SOFTWARE, AND ANY RIGHTS TO REPRODUCE,
9  DISTRIBUTE, MODIFY, DISPLAY OR OTHERWISE USE THE SOFTWARE SHALL EXCLUSIVELY VEST IN THE
10  OWNER. ANY UNAUTHORIZED REPRODUCTION, DISTRIBUTION, MODIFICATION, DISPLAY OR OTHER
11  USE OF THE SOFTWARE WITHOUT THE EXPLICIT PERMISSION OF OWNER IS PROHIBITED AND WILL
12  CONSTITUTE AN INFRINGEMENT OF THE OWNER'S RIGHT AND MAY BE SUBJECT TO CIVIL OR
13  CRIMINAL SANCTION.
14 
15  THIS SOFTWARE IS PROVIDED BY THE OWNER "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
17  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN PARTICULAR, THE OWNER DOES NOT WARRANT
18  THAT THE SOFTWARE SHALL BE ERROR FREE AND WORKS WITHOUT INTERRUPTION.
19 
20  IN NO EVENT SHALL THE OWNER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  ******************************************************************************/
27 
35 #ifndef EOGPCHANNELINFO_H_
36 #define EOGPCHANNELINFO_H_
37 #include "eoChannelInfo.h"
38 #include "eoApiDef.h"
39 #include "eoISerialize.h"
44 typedef enum
45 {
48  GP_DATA,
50  GP_FLAG,
59 typedef enum
60 {
61  GP_RES_RES = 0,
62  GP_RES_1BIT = 1,
63  GP_RES_2BIT = 2,
64  GP_RES_3BIT = 3,
65  GP_RES_4BIT = 4,
66  GP_RES_5BIT = 5,
67  GP_RES_6BIT = 6,
68  GP_RES_8BIT = 8,
69  GP_RES_10BIT = 10,
70  GP_RES_12BIT = 12,
71  GP_RES_16BIT = 16,
72  GP_RES_20BIT = 20,
73  GP_RES_24BIT = 24,
74  GP_RES_32BIT = 32
80 typedef enum
81 {
82  GP_SCAL_RES = 0,
83  GP_SCAL_1,
84  GP_SCAL_10,
85  GP_SCAL_100,
86  GP_SCAL_1000,
87  GP_SCAL_10000,
88  GP_SCAL_100000,
89  GP_SCAL_1000000,
90  GP_SCAL_10000000,
91  GP_SCAL_0_1,
92  GP_SCAL_0_01,
93  GP_SCAL_0_001,
94  GP_SCAL_0_000001,
95  GP_SCAL_0_000000001
96 } GP_SCALING;
97 
109 {
110 
112  //uint16_t u2ChannelType;
114  //uint16_t u8SignalType:8; == signal type
116  //uint16_t u2ValueType:2; // = valueFormat
117 private:
118  void CalculateMin();
119  void CalculateMax();
121  GP_RESOLUTION res; //:4;
122 
124  GP_SCALING scaleMin; //:4;
126  GP_SCALING scaleMax; //:4;
127 
128  int8_t engMax;
129  int8_t engMin;
130  uint8_t rejected;
131  uint8_t u8Subindex;
132 public:
134  uint16_t bitoffs;
135 
139  eoGPChannelInfo();
149  eoGPChannelInfo(CHANNEL_TYPE type, GP_RESOLUTION resolution, int8_t engMaximum, int8_t engMinimum, GP_SCALING scaleMaximum, GP_SCALING scaleMinimum);
150 
153 
156 
159  //eoReturn SetResolution(GP_RESOLUTION resolution);
160 
162  int8_t GetEngMax() const;
167  eoReturn Scale(int8_t engMaximum);
168 
170  int8_t GetEngMin() const;
171  //eoReturn SetEngMin(int8_t engMinimum);
172 
174  GP_SCALING GetScaleMax() const;
175  //eoReturn SetScaleMax(GP_SCALING scaleMaximum);
176 
178  GP_SCALING GetScaleMin() const;
179 
181  void SetRejected(uint8_t rejected);
182 
184  uint8_t GetRejected();
185 
190  static float ScaleToFloat(GP_SCALING scale);
195  uint8_t Serialize(eoArchive &a);
196 
197  virtual uint8_t GetSubIndex()
198  {
199  return u8Subindex;
200  }
201 
202  uint8_t SetSubIndex(uint8_t u8Subindex)
203  {
204  return this->u8Subindex = u8Subindex;
205  }
206 };
207 
208 #endif /* EOGPCHANNELINFO_H_ */
contains Dolphin API Definitions
void SetRejected(uint8_t rejected)
Set the rejected flag of the channel.
GP_SCALING GetScaleMax() const
Get the GP_SCALING of engineering maximum.
Interface for storing.
Definition: eoISerialize.h:48
GP_SCALING
Generic Profile Channel Scaling.
Definition: eoGPChannelInfo.h:80
Single bit Values.
Definition: eoGPChannelInfo.h:51
Enumerated values.
Definition: eoGPChannelInfo.h:53
eoReturn Scale(int8_t engMaximum)
CHANNEL_TYPE type
CHANNEL_TYPE
Definition: eoChannelInfo.h:83
uint8_t GetRejected()
Get the rejected flag of the channel.
GP_RESOLUTION
Generic Profile Channel Resolution.
Definition: eoGPChannelInfo.h:59
Abstract class for channel information. Abstract class for channel information. From this class speci...
Definition: eoChannelInfo.h:77
virtual uint8_t GetSubIndex()
Definition: eoGPChannelInfo.h:197
uint16_t bitoffs
Offset of the channel value in data legram in bits.
Definition: eoGPChannelInfo.h:134
static float ScaleToFloat(GP_SCALING scale)
eoReturn
contains all the return values from different functions
Definition: eoApiDef.h:40
Generic Profile Channel.
Definition: eoGPChannelInfo.h:108
CHANNEL_TYPE
Definition: eoChannelEnums.h:169
GP_RESOLUTION GetResolution() const
Get the resolution of the channel type.
GP_CHANNELTYPE
Generic Profile ChannelTypes.
Definition: eoGPChannelInfo.h:44
GP_SCALING GetScaleMin() const
Get the GP_SCALING of engineering minimum.
uint8_t Serialize(eoArchive &a)
01 Complex bit values
Definition: eoGPChannelInfo.h:49
contains the eoChannelInfo Class
00 Teach-in Information
Definition: eoGPChannelInfo.h:47
int8_t GetEngMin() const
Get the the enginnering minimum - without scale.
int8_t GetEngMax() const
Get the enginnering maximum - without scale.
GP_CHANNELTYPE GetGPChannelType() const
Get the channel type - signal, flag etc.
the base Archive
Definition: eoArchive.h:46