EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoGPChannelInfo Class Reference

Generic Profile Channel. More...

#include <eoGPChannelInfo.h>

Inheritance diagram for eoGPChannelInfo:
Collaboration diagram for eoGPChannelInfo:

Public Member Functions

 eoGPChannelInfo ()
 
 eoGPChannelInfo (CHANNEL_TYPE type, GP_RESOLUTION resolution, int8_t engMaximum, int8_t engMinimum, GP_SCALING scaleMaximum, GP_SCALING scaleMinimum)
 
GP_CHANNELTYPE GetGPChannelType () const
 Get the channel type - signal, flag etc.
 
GP_RESOLUTION GetResolution () const
 Get the resolution of the channel type.
 
int8_t GetEngMax () const
 Get the enginnering maximum - without scale.
 
eoReturn Scale (int8_t engMaximum)
 
int8_t GetEngMin () const
 Get the the enginnering minimum - without scale.
 
GP_SCALING GetScaleMax () const
 Get the GP_SCALING of engineering maximum.
 
GP_SCALING GetScaleMin () const
 Get the GP_SCALING of engineering minimum.
 
void SetRejected (uint8_t rejected)
 Set the rejected flag of the channel.
 
uint8_t GetRejected ()
 Get the rejected flag of the channel.
 
uint8_t Serialize (eoArchive &a)
 
virtual uint8_t GetSubIndex ()
 
uint8_t SetSubIndex (uint8_t u8Subindex)
 
- Public Member Functions inherited from eoChannelInfo
const char * ToString (uint8_t strType)
 
void SetName (const char *name)
 

Static Public Member Functions

static GP_CHANNELTYPE GetGPChannelType (CHANNEL_TYPE type)
 Get the channel type - signal, flag etc.
 
static float ScaleToFloat (GP_SCALING scale)
 

Public Attributes

uint16_t bitoffs
 Offset of the channel value in data legram in bits.
 
- Public Attributes inherited from eoChannelInfo
CHANNEL_TYPE type
 CHANNEL_TYPE
 
VALUE_TYPE signalType
 Current, Setpoint Absolute, Setpoint relative.
 
double min
 Min as clear value.
 
double max
 Max as clear value.
 

Detailed Description

Generic Profile Channel.

Implements the Generic Profile Channel as described in the GP specification, with the following differences:

CHANNEL_TYPE type contains all Signal,ENUM types. If you want to check the Generic Profile Channel Type use getGPChannelType();

After setting the resolution or the scaling or the engineering values, the real max and min value will be recalculated.

Examples:
genericProfile_examples.cpp.

Constructor & Destructor Documentation

◆ eoGPChannelInfo() [1/2]

eoGPChannelInfo::eoGPChannelInfo ( )

bitoffs is Calculated automatically and should not be changed!!

◆ eoGPChannelInfo() [2/2]

eoGPChannelInfo::eoGPChannelInfo ( CHANNEL_TYPE  type,
GP_RESOLUTION  resolution,
int8_t  engMaximum,
int8_t  engMinimum,
GP_SCALING  scaleMaximum,
GP_SCALING  scaleMinimum 
)

Creates an new Generic profil channel info with specific variables.

Parameters
typeType of the channel - signal, flag etc.
resolutionResolution of the new channel.
engMaximumEngineering maximum of the expected value.
engMinimumEngineering minimum of the expected value.
scaleMaximumScaling factor for engineering maximum of the expected value.
scaleMinimumScaling factor for engineering minimum of the expected value.

Member Function Documentation

◆ GetSubIndex()

virtual uint8_t eoGPChannelInfo::GetSubIndex ( )
inlinevirtual

If in a profile multiple Channels Exist with same type, this returns the "SubIndex" for this profile

Reimplemented from eoChannelInfo.

◆ Scale()

eoReturn eoGPChannelInfo::Scale ( int8_t  engMaximum)

Scale the value according a engineering maximum.

Parameters
engMaximum

◆ ScaleToFloat()

static float eoGPChannelInfo::ScaleToFloat ( GP_SCALING  scale)
static

Convert the GP_SCALING to a float multiplier.

Parameters
scalethe intended scale.

◆ Serialize()

uint8_t eoGPChannelInfo::Serialize ( eoArchive a)
virtual

Serialize to an acrchive.

Parameters
aIntended eoArchive.

Implements eoISerialize.