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

handles TeachIn Messages More...

#include <eoTeachInModule.h>

Inheritance diagram for eoTeachInModule:
Collaboration diagram for eoTeachInModule:

Public Member Functions

 eoTeachInModule (eoDeviceManager *eoDevManager, eoSecurity *sec)
 
void SetRPS (uint8_t func, uint8_t type)
 
void Set1BS (uint8_t func, uint8_t type)
 
void Set4BS (uint8_t func, uint8_t type)
 
TEACH_RETURN TeachIN (eoMessage &m)
 handles Teach IN Message More...
 
TEACH_RETURN TeachIN (uint8_t rorg, uint8_t func, uint8_t type, uint32_t device_id)
 handles Teach IN Message More...
 
void SetAutoTeachOut (bool enable)
 
bool GetAutoTeachOut ()
 
void TeachOut (uint32_t id)
 
bool isTeachedIN (eoMessage &telegram)
 
bool isTeachedIN (eoDevice &dev)
 
bool isTeachedIN (uint32_t deviceID, uint8_t u8Rorg=0xFF)
 
 DEPRECATED (eoReturn ParseUTE(eoMessage &msg))
 
 DEPRECATED (eoReturn CreateUTEResponse(eoMessage &teachInUTE, eoMessage &responseUTE, UTE_RESPONSE type, UTE_DIRECTION direction))
 
eoReturn CreateGPResponse (eoMessage &msg, uint16_t manId, uint32_t destinationId, GP_RESPONSE_RESULT response, eoProfile *profile)
 
virtual uint8_t Serialize (eoArchive &arch)
 Serialization Function which will be called by the eoStorageManager. More...
 
UTE_EEP_TEACH_IN_QUERY GetUTEQuery ()
 

Static Public Member Functions

static bool isTeachIN (eoMessage &telegram)
 

Friends

class eoTeachMessageHandler
 

Detailed Description

handles TeachIn Messages

a helper class to handle different TeachIn Messages (GP_TI, UTE, RPS/4BS/1BS EEP Teach IN request and SEC_TI)

Constructor & Destructor Documentation

◆ eoTeachInModule()

eoTeachInModule::eoTeachInModule ( eoDeviceManager eoDevManager,
eoSecurity sec 
)

Standard constructor for the TeachInModule

Parameters
eoDevManagereoDeviceManager
secsecurity Module to use to handle security Messages

Member Function Documentation

◆ CreateGPResponse()

eoReturn eoTeachInModule::CreateGPResponse ( eoMessage msg,
uint16_t  manId,
uint32_t  destinationId,
GP_RESPONSE_RESULT  response,
eoProfile profile 
)

Creates GP teach in response for GP teach in

Parameters
msg
manIdmanufacturer ID
destinationId
responseGP_RESPONSE_RESULT
profile
Returns
EO_OK
Examples:
genericProfile_examples.cpp.
Here is the caller graph for this function:

◆ DEPRECATED() [1/2]

eoTeachInModule::DEPRECATED ( eoReturn   ParseUTEeoMessage &msg)
Deprecated:
This function is depracted, instead the eoUTEHelper::ParseUTE(eoMessage &msg, UTE_EEP_TEACH_IN_QUERY &uteQuery) should be used

Parse the message into UTE

Parameters
msg
Returns
EO_OK
Here is the caller graph for this function:

◆ DEPRECATED() [2/2]

eoTeachInModule::DEPRECATED ( eoReturn   CreateUTEResponseeoMessage &teachInUTE, eoMessage &responseUTE, UTE_RESPONSE type, UTE_DIRECTION direction)
Deprecated:
This function is depracted, instead the eoUTEHelper::CreateUTEResponseFromQuery(UTE_EEP_TEACH_IN_RESPONSE &uteQuery, eoMessage &responseMessage, UTE_RESPONSE type, UTE_DIRECTION direction)

Creates UTE teach in response from UTE teach in request

Parameters
teachInUTE
[out]responseUTE
typeUTE_RESPONSE
directionUTE_DIRECTION
Returns
EO_OK

◆ GetAutoTeachOut()

bool eoTeachInModule::GetAutoTeachOut ( )
inline

Get the autoTeachOut of the TeachInModule

Here is the call graph for this function:

◆ GetUTEQuery()

UTE_EEP_TEACH_IN_QUERY eoTeachInModule::GetUTEQuery ( )

If an UTE has been received, this returns a copy of the query information

Returns
copy of last UTE query information
Examples:
vld_example.cpp.
Here is the caller graph for this function:

◆ isTeachedIN() [1/3]

bool eoTeachInModule::isTeachedIN ( eoMessage telegram)

Checks if the device belonging to the Message is teached IN

Parameters
telegram
Returns
true or false
Here is the caller graph for this function:

◆ isTeachedIN() [2/3]

bool eoTeachInModule::isTeachedIN ( eoDevice dev)

Checkes if the device is Teached IN

Parameters
devdevice to check
Returns
true or false

◆ isTeachedIN() [3/3]

bool eoTeachInModule::isTeachedIN ( uint32_t  deviceID,
uint8_t  u8Rorg = 0xFF 
)

Checkes if the device is Teached IN

Parameters
devdeviceID to check
Returns
true or false

◆ isTeachIN()

static bool eoTeachInModule::isTeachIN ( eoMessage telegram)
static

Returns True if it is a teach IN telegram for 4BS or 1BS

Parameters
telegramto check
Returns
true or false
Here is the caller graph for this function:

◆ Serialize()

virtual uint8_t eoTeachInModule::Serialize ( eoArchive arch)
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.

Parameters
archarchive where to Load or to Store.

Implements eoISerialize.

Here is the caller graph for this function:

◆ Set1BS()

void eoTeachInModule::Set1BS ( uint8_t  func,
uint8_t  type 
)

Allows you to set the manual 1BS EEP to use

Parameters
func
type
Examples:
tutorial4.cpp.

◆ Set4BS()

void eoTeachInModule::Set4BS ( uint8_t  func,
uint8_t  type 
)

Allows you to set the manual 4BS EEP to use

Parameters
func
type

◆ SetAutoTeachOut()

void eoTeachInModule::SetAutoTeachOut ( bool  enable)
inline

Enables or Disables the autoTeachOut of the TeachInModule

Parameters
enableenable or disable autoteachout

◆ SetRPS()

void eoTeachInModule::SetRPS ( uint8_t  func,
uint8_t  type 
)

Allows you to set the manual RPS EEP to use

Parameters
func
type
Examples:
Gateway_example.cpp, Gateway_SubtypeExample.cpp, GatewayFiltered_example.cpp, tutorial1.cpp, tutorial4.cpp, and WatcherMain.cpp.

◆ TeachIN() [1/2]

TEACH_RETURN eoTeachInModule::TeachIN ( eoMessage m)

handles Teach IN Message

This function uses the information passed in the message to teach in a new device. If the device is already teached in and the message is not a teach out request, a SECOND_TEACH_IN will be returned and the device will not be teached in. If the message is a security teach in, the security parameters will be set and saved in the device manager, if the security teach Information is from a ptm device, a ptm profile will be generated.

EEP teach in messages and generic teach in messages will be parsed accordingly to spec, and a profile will be created if it is supported.

For profiles which do not support teach in information (e.g. rps), the information has to be set before using the SetRPS,Set1Bs,.. function

If a profile has been set the return value will be either EEP_TEACH_IN,NEW_DEVICE_AND_EPP or GENERIC_TEACH_IN.

If the message is a teach out request, or the request type is set not specified/toogle a REQUEST_FOR_TEACH_OUT is generated

Parameters
m
Returns
TEACH_RETURN NO_TEACH_IN,NEW_DEVICE , SECOND_TEACH_IN, NEW_DEVICE_AND_EPP, EEP_TEACH_IN, REQUEST_FOR_TEACH_OUT
Examples:
tutorial4.cpp.

◆ TeachIN() [2/2]

TEACH_RETURN eoTeachInModule::TeachIN ( uint8_t  rorg,
uint8_t  func,
uint8_t  type,
uint32_t  device_id 
)

handles Teach IN Message

This function uses the information passed to manually teach in a new device. If the device is already teached in SECOND_TEACH_IN will be returned and the device will not be teached in.

If a profile has been set the return value will be either EEP_TEACH_IN,NEW_DEVICE_AND_EPP

Parameters
rorg
func
type
deviceIDId of the device to teach in
Returns
TEACH_RETURN NO_TEACH_IN,NEW_DEVICE , SECOND_TEACH_IN, NEW_DEVICE_AND_EPP, EEP_TEACH_IN

◆ TeachOut()

void eoTeachInModule::TeachOut ( uint32_t  id)

Removes all saved information about a device

Parameters
idDevice ID
Examples:
tutorial4.cpp, and tutorial6.cpp.
Here is the caller graph for this function: