EnOcean Link
1.14.0.0
Middleware to Connect EnOcean easily to other Projects
|
The class to handle Generic Profiles. More...
#include <eoGenericProfile.h>
Public Member Functions | |
eoGenericProfile (uint16_t msgLength) | |
void | AllowTeachIN () |
bool | operator== (const eoGenericProfile &othProfile) const |
bool | operator!= (const eoGenericProfile &othProfile) const |
eoReturn | CreateTeachIN (eoMessage &msg) |
creates Teach In Messsage More... | |
eoReturn | Create (eoMessage &m, std::vector< int > channelNumbers) |
creates Selective Data Message More... | |
eoReturn | ParseSelData (const eoMessage &msg) |
eoReturn | ParseTeachIN (const eoMessage &msg) |
eoReturn | Parse (const eoMessage &msg) |
eoReturn | GetValue (uint8_t u8ChannelNumber, float &value) |
eoReturn | GetValue (uint8_t u8ChannelNumber, uint8_t &value) |
eoReturn | GetValue (uint8_t u8ChannelNumber, uint32_t &value) |
eoReturn | GetValue (CHANNEL_TYPE type, float &value) |
Gets the Value as Floating Point. More... | |
eoReturn | GetValue (CHANNEL_TYPE type, uint8_t &value) |
Sets the Value using a unsigned integer. More... | |
eoReturn | GetValue (CHANNEL_TYPE type, uint32_t &value) |
eoReturn | GetValue (CHANNEL_TYPE type, uint8_t &value, uint8_t subFlag) |
Gets the Value as unsigned integer. More... | |
eoReturn | GetValue (CHANNEL_TYPE type, uint32_t &value, uint8_t subFlag) |
eoReturn | GetValue (CHANNEL_TYPE type, float &value, uint8_t subFlag) |
Gets the Value as Floating point. More... | |
eoReturn | SetValue (uint8_t u8ChannelNumber, float value) |
eoReturn | SetValue (uint8_t u8ChannelNumber, uint8_t value) |
eoReturn | SetValue (uint8_t u8ChannelNumber, uint32_t value) |
eoReturn | SetValue (CHANNEL_TYPE type, uint32_t value) |
eoReturn | SetValue (CHANNEL_TYPE type, float value) |
Sets the Value using a Floating Point. More... | |
eoReturn | SetValue (CHANNEL_TYPE type, uint8_t value) |
Sets the Value using a uint8_t. More... | |
eoReturn | SetValue (CHANNEL_TYPE type, uint8_t value, uint8_t subFlag) |
Gets the Value as unsigned integer. More... | |
eoReturn | SetValue (CHANNEL_TYPE type, uint32_t value, uint8_t subFlag) |
eoReturn | SetValue (CHANNEL_TYPE type, float value, uint8_t subFlag) |
Gets the Value as a float. More... | |
eoReturn | SetType (uint8_t type) |
eoReturn | AddChannel (CHANNEL_TYPE type, GP_RESOLUTION resolution, int8_t engMaximum, int8_t engMinimum, GP_SCALING scaleMaximum, GP_SCALING scaleMinimum, VALUE_TYPE valueType) |
eoReturn | AddChannelOut (CHANNEL_TYPE type, GP_RESOLUTION resolution, int8_t engMaximum, int8_t engMinimum, GP_SCALING scaleMaximum, GP_SCALING scaleMinimum, VALUE_TYPE valueType) |
eoReturn | AddChannel (CHANNEL_TYPE type, VALUE_TYPE valueType) |
eoReturn | AddChannelOut (CHANNEL_TYPE type, VALUE_TYPE valueType) |
eoReturn | AddChannel (CHANNEL_TYPE type, GP_RESOLUTION resolution, VALUE_TYPE valueType) |
eoReturn | AddChannelOut (CHANNEL_TYPE type, GP_RESOLUTION resolution, VALUE_TYPE valueType) |
eoChannelInfo * | GetChannel (CHANNEL_TYPE type) |
eoChannelInfo * | GetChannel (uint8_t channelNumber) |
eoChannelInfo * | GetChannelOut (CHANNEL_TYPE type) |
eoChannelInfo * | GetChannelOut (uint8_t channelNumber) |
eoChannelInfo * | GetChannel (CHANNEL_TYPE type, uint8_t subType) |
eoChannelInfo * | GetChannelOut (CHANNEL_TYPE type, uint8_t subType) |
uint8_t | GetChannelCount () const |
uint8_t | GetChannelCountOut () const |
void | ClearChannels () |
void | ClearChannelsOut () |
void | ClearValues () |
uint8_t | Serialize (eoArchive &a) |
Serialization Function which will be called by the eoStorageManager. More... | |
uint32_t | GetProductId () |
void | SetProductId (const uint32_t prodId) |
virtual eoReturn | Create (eoMessage &msg) |
Generates an EEP Message. More... | |
Public Member Functions inherited from eoProfile | |
eoProfile (uint16_t size=0) | |
virtual bool | operator== (const eoProfile &othProfile) const |
virtual bool | operator!= (const eoProfile &othProfile) const |
virtual bool | IsSecDData (const eoMessage &message) |
virtual eoReturn | GetValue (CHANNEL_TYPE type, uint64_t &value, uint8_t subFlag) |
virtual eoReturn | SetValue (CHANNEL_TYPE type, uint64_t value, uint8_t subFlag) |
Sets the Value as a 64-bit. More... | |
virtual eoReturn | GetSubTypeChannel (CHANNEL_TYPE type, std::vector< eoEEPChannelInfo *> &vector) |
eoReturn | SetManufacturer (uint16_t manufacturerID) |
Public Attributes | |
GP_HEADER_PURPOSE | purpose |
Teach-In Purpose. | |
GP_DATA_DIRECTION | dataDirection |
Data direction. | |
Public Attributes inherited from eoProfile | |
uint8_t | rorg |
R-ORG. | |
uint8_t | func |
Func. | |
uint8_t | type |
Type. | |
uint16_t | manufacturer |
Manufacturer. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from eoProfile | |
static float | ScaleFromRAW (uint32_t rawValue, uint32_t rangeMin, uint32_t rangeMax, double scaleMin, double scaleMax) |
Creates floating Point from Raw Value. More... | |
static uint32_t | ScaleToRAW (float value, uint32_t rangeMin, uint32_t rangeMax, double scaleMin, double scaleMax) |
Creates Raw Value from a floating Point. More... | |
static eoReturn | GetRawValue (const eoMessage &msg, uint32_t &value, uint16_t offset, uint8_t size) |
Gives raw data Value from a Message. More... | |
static eoReturn | SetRawValue (eoMessage &msg, uint32_t value, uint16_t offset, uint8_t size) |
Inserts raw data Value in a message. More... | |
Protected Attributes inherited from eoProfile | |
eoMessage | msg |
helper function to convert bits | |
Static Protected Attributes inherited from eoProfile | |
static const uint8_t | maskArray [8] |
Mask array. | |
The class to handle Generic Profiles.
The eoGenericProfile class allows the user to handle and teachIN genericProfils. Must Functions are the same as in the eoProfile class. For the user application the difference between a generic and an Enocean equipment profile is in most cases transparent.
The eoGenericProfile class adds some functions, to allow the user easy to create an own generic Profile and to manually parse external Teach IN Message.
eoGenericProfile::eoGenericProfile | ( | uint16_t | msgLength | ) |
Constructor
msgLength | Length of the generic profile message. |
eoReturn eoGenericProfile::AddChannel | ( | CHANNEL_TYPE | type, |
GP_RESOLUTION | resolution, | ||
int8_t | engMaximum, | ||
int8_t | engMinimum, | ||
GP_SCALING | scaleMaximum, | ||
GP_SCALING | scaleMinimum, | ||
VALUE_TYPE | valueType | ||
) |
Adds an inbound Generic Profile Channel to this Generic Profile with the specified Values.
type | |
resolution | |
engMaximum | |
engMinimum | |
scaleMaximum | |
scaleMinimum | |
valueType |
eoReturn eoGenericProfile::AddChannel | ( | CHANNEL_TYPE | type, |
VALUE_TYPE | valueType | ||
) |
Allows you to add an inbound Flag Type Generic Channel
type | |
valueType |
eoReturn eoGenericProfile::AddChannel | ( | CHANNEL_TYPE | type, |
GP_RESOLUTION | resolution, | ||
VALUE_TYPE | valueType | ||
) |
Allows you to add an inbound ENUM Type Generic Channel
type | Type of the channel - signal,flag etc. |
resolution | of the ENum |
valueType |
eoReturn eoGenericProfile::AddChannelOut | ( | CHANNEL_TYPE | type, |
GP_RESOLUTION | resolution, | ||
int8_t | engMaximum, | ||
int8_t | engMinimum, | ||
GP_SCALING | scaleMaximum, | ||
GP_SCALING | scaleMinimum, | ||
VALUE_TYPE | valueType | ||
) |
Adds an outband Generic Profile Channel to this Generic Profile with the specified Values.
type | |
resolution | |
engMaximum | |
engMinimum | |
scaleMaximum | |
scaleMinimum | |
valueType |
eoReturn eoGenericProfile::AddChannelOut | ( | CHANNEL_TYPE | type, |
VALUE_TYPE | valueType | ||
) |
Allows you to add an outbound Flag Type Generic Channel
type | |
valueType |
eoReturn eoGenericProfile::AddChannelOut | ( | CHANNEL_TYPE | type, |
GP_RESOLUTION | resolution, | ||
VALUE_TYPE | valueType | ||
) |
Allows you to add an outband ENUM Type Generic Channel
type | Type of the channel - signal,flag etc. |
resolution | of the ENum |
valueType |
void eoGenericProfile::AllowTeachIN | ( | ) |
This function will activate the parsing for one Teach IN Telegram! After a parsing of a teachIN message the teachIN function will be deactivated again.
void eoGenericProfile::ClearChannels | ( | ) |
Delete all channels and resets the genericProfile
void eoGenericProfile::ClearChannelsOut | ( | ) |
Delete all channels and resets the genericProfile
|
virtual |
All raw values of the internal Message will be set to zero.
Reimplemented from eoProfile.
creates Selective Data Message
This function will create a Selective Data message as defined in the GenericProfile spec.
msg | |
channelNumbers |
creates Teach In Messsage
This function will create a teach in message as defined in the GenericProfile spec. The outbound channels will be used as outbound channel. If inbound channels are set, the dataDirection will be set to bidirectional and the inbound channels will be added inside the "teach-in information"
msg |
Reimplemented from eoProfile.
|
virtual |
Returns the inbound channel for the selected type
type | CHANNEL_TYPE |
Reimplemented from eoProfile.
|
virtual |
Returns the inbound channel for the selected channelnumber
channelNumber | channelnumber |
Reimplemented from eoProfile.
|
virtual |
This function allows you to access different inbound Channels with he same Channel_type. It will return the corresponding Channel or NULL.
For example if you've a GP with 8 S_TEMP and you call GetChannel(S_TEMP,0) it will return the first corresponding Temperature channel. 3 will return the 4 channel and 8 will return NULL;
type | CHANNEL_TYPE |
subType | subType specifies which Channel with the same type you want to Select |
Reimplemented from eoProfile.
|
virtual |
Returns Number of inbound channels for this profile
Reimplemented from eoProfile.
uint8_t eoGenericProfile::GetChannelCountOut | ( | ) | const |
Returns Number of outbound channels for this profile
eoChannelInfo* eoGenericProfile::GetChannelOut | ( | CHANNEL_TYPE | type | ) |
Returns the outbound channel for the selected type
type | CHANNEL_TYPE |
eoChannelInfo* eoGenericProfile::GetChannelOut | ( | uint8_t | channelNumber | ) |
Returns the pointer to eoChannelInfo for the selected outbound channelNumber or NULL
channelNumber |
eoChannelInfo* eoGenericProfile::GetChannelOut | ( | CHANNEL_TYPE | type, |
uint8_t | subType | ||
) |
This function allows you to access different outband Channels with he same Channel_type. It will return the corresponding Channel or NULL.
type | CHANNEL_TYPE |
subType | subType specifies which Channel with the same type you want to Select |
uint32_t eoGenericProfile::GetProductId | ( | ) |
Returns the product ID for this profile
|
virtual |
Gets the Value as Floating Point.
Using the CHANNEL_TYPE type information, this information gets the floating point value accordingly, if the Profile does not support the requested CHANNEL_TYPE NOT_SUPPORTED is returned, if the functions is not implemented for the chosen profile, NOT_IMPLEMENTED is returned
type | CHANNEL_TYPE |
value | Reference to floating point |
Reimplemented from eoProfile.
|
virtual |
Sets the Value using a unsigned integer.
Using the CHANNEL_TYPE type information, this information sets the channel raw value, using the floating point value accordingly, if the Profile does not support the requested CHANNEL_TYPE NOT_SUPPORTED is returned, if the functions is not implemented for the chosen profile, NOT_IMPLEMENTED is returned
type | CHANNEL_TYPE |
value | Reference to floating point |
value | Reference to uint8_t |
Reimplemented from eoProfile.
|
virtual |
Gets the Value as unsigned integer.
Using the CHANNEL_TYPE type information, this information gets the unsigned integer value accordingly, if the Profile does not support the requested CHANNEL_TYPE NOT_SUPPORTED is returned, if the functions is not implemented for the chosen profile, NOT_IMPLEMENTED is returned
type | CHANNEL_TYPE |
value | Reference to value |
subFlag | Sub flag |
Reimplemented from eoProfile.
|
virtual |
Gets the Value as Floating point.
Using the CHANNEL_TYPE type information, this information gets the unsigned integer value accordingly, if the Profile does not support the requested CHANNEL_TYPE NOT_SUPPORTED is returned, if the functions is not implemented for the chosen profile, NOT_IMPLEMENTED is returned
type | CHANNEL_TYPE |
value | Reference to floating point |
subFlag | Sub flag |
Reimplemented from eoProfile.
bool eoGenericProfile::operator!= | ( | const eoGenericProfile & | othProfile | ) | const |
Overloading not equal operator.
othProfile | Profile to be compared with. |
bool eoGenericProfile::operator== | ( | const eoGenericProfile & | othProfile | ) | const |
Overloading equal operator.
othProfile | Profile to be compared with. |
Parses the Messages and will react if it is a Generic Profile Message. When you receive selective of a Full data Message, the internal data will be changed accordingly.
If AllowTeachIN() is activated, a TeachIN Message will be parsed accordingly to the GP SPEC(meaning teachIN or teachOUT are allowed) , and a response will be prepared for you. You can access it via Create(eoMessage &m).
msg |
Reimplemented from eoProfile.
Helper function to GP Selected DataChannel
msg | GP to parse |
Helper Function to parse TI Message, only works after calling AllowTeachIN()!
msg |
|
virtual |
Serialization Function which will be called by the eoStorageManager.
This function will be called by the eoArchive(inside of the eoStorageManager) and allows the class to be Serialized.
arch | archive where to Load or to Store. |
Reimplemented from eoProfile.
void eoGenericProfile::SetProductId | ( | const uint32_t | prodId | ) |
Sets the product ID for this profile
prodId | product Id |
|
virtual |
|
virtual |
Sets the Value using a Floating Point.
Using the CHANNEL_TYPE type information, this information sets the channel raw value, using the floating point value accordingly, if the Profile does not support the requested CHANNEL_TYPE NOT_SUPPORTED is returned, if the functions is not implemented for the chosen profile, NOT_IMPLEMENTED is returned
type | CHANNEL_TYPE |
value | Reference to floating point |
Reimplemented from eoProfile.
|
virtual |
Sets the Value using a uint8_t.
Using the CHANNEL_TYPE type information, this information sets the channel raw value, using the uint8_t value accordingly, if the Profile does not support the requested CHANNEL_TYPE NOT_SUPPORTED is returned, if the functions is not implemented for the chosen profile, NOT_IMPLEMENTED is returned
type | CHANNEL_TYPE |
value | Reference to floating point |
Reimplemented from eoProfile.
|
virtual |
Gets the Value as unsigned integer.
Using the CHANNEL_TYPE type information, this information gets the unsigned integer value accordingly, if the Profile does not support the requested CHANNEL_TYPE NOT_SUPPORTED is returned, if the functions is not implemented for the chosen profile, NOT_IMPLEMENTED is returned
type | CHANNEL_TYPE |
value | Reference to uint8_t |
subFlag | Sub flag |
Reimplemented from eoProfile.
|
virtual |
Gets the Value as a float.
Using the CHANNEL_TYPE type information, this information gets the unsigned integer value accordingly, if the Profile does not support the requested CHANNEL_TYPE NOT_SUPPORTED is returned, if the functions is not implemented for the chosen profile, NOT_IMPLEMENTED is returned
type | CHANNEL_TYPE |
value | Reference to floating point |
subFlag | Sub flag |
Reimplemented from eoProfile.