EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects

EnOcean Common Commands class, enables an easy interface for the most common commands. More...

#include <eoSerialCommand.h>

Public Member Functions

 eoSerialCommand (eoGateway *gateway)
 
eoReturn GetFrequencyInfo (CO_RD_FREQUENY_RESPONSE &response)
 
eoReturn GetStepCode (CO_RD_STEPCODE_RESPONSE &response)
 
eoReturn Sleep (const uint32_t sleepPeriod)
 
eoReturn Reset ()
 
eoReturn ReadVersion (CO_RD_VERSION_RESPONSE &version)
 
eoReturn ReadMemory (CO_RD_MEMORY const &readMemory, CO_RD_MEMORY_RESPONSE &response)
 
eoReturn WriteMemory (CO_WR_MEMORY const &writeMemory)
 
eoReturn BIST ()
 
eoReturn WriteIDBase (const uint32_t baseID)
 
eoReturn ReadIDBase (CO_RD_IDBASE_RESPONSE &response)
 
eoReturn WriteRepeater (bool repEnable, const uint8_t repLevel)
 
eoReturn ReadRepeater (CO_RD_REPEATER_RESPONSE &response)
 
eoReturn AddFilter (const FILTER_TYPE filterType, const uint32_t filterValue, const FILTER_KIND filterKind)
 
eoReturn DeleteFilter (const FILTER_TYPE filterType, const uint32_t filterValue)
 
eoReturn DeleteAllFilter ()
 
eoReturn EnableFilter (const bool filterEnabled, const FILTER_OPERATOR filterOperator)
 
eoReturn ReadFilter (CO_RD_FILTER_RESPONSE *filter, uint8_t *filterCount, uint8_t maxFilterCount)
 
eoReturn WaitMaturity (const bool waitMaturity)
 
eoReturn SmartAckConfirmLearn (uint16_t responseTime, SA_CONFIRM_CODE confirmCode)
 
eoReturn SmartAckLearnAck (SA_LEARN_ACK_RESPONSE &response)
 
eoReturn Ready (CO_READY_RESPONSE &response)
 
eoReturn SmartAckWriteLearnMode (bool enable, SA_EXTENDED_LEARNMODE extended, uint32_t timeout)
 
eoReturn SmartAckReadLearnMode (SA_RD_LEARNMODE_RESPONSE &response)
 
eoReturn SmartAckLearnConfirm (uint16_t responseTime, SMARTACK_CONFIRM_CODE confirmCode, uint32_t postmasterID, uint32_t clientID)
 
eoReturn SmartAckSendLearnRequest (uint16_t manufacturerID, uint32_t EEP)
 
eoReturn SmartAckReset (uint32_t clientID)
 
eoReturn SmartAckLearnedClients (SA_RD_LEARNEDCLIENTS_RESPONSE *clients, uint8_t *learnedCount, uint8_t maxLearnedCount)
 
eoReturn SmartAckSetReclaimTries (uint8_t reclaimCount)
 
eoReturn SmartAckSetPostmaster (uint8_t mailboxCount)
 
eoReturn EventSmartAckConfirmLearn (SA_CONFIRM_LEARN_REQUEST &request)
 
eoReturn WriteMode (WR_MODE_CODE mode)
 
eoReturn DutyCycleReadLimit (CO_RD_DUTYCYCLE_RESPONSE &response)
 
eoReturn EventDutyCycleLimit (CO_DUTYCYCLE_LIMIT &request)
 
eoReturn DutyCycleLimit (CO_DUTYCYCLE_LIMIT limit)
 
eoReturn WriteStartupDelay (uint8_t delay)
 
eoReturn WriteRemanRepeating (bool enabled)
 
eoReturn ReadRemanRepeating (bool &isEnabled)
 
eoReturn SetNoiseTreshold (uint8_t rssiLevel)
 
eoReturn GetNoiseTreshold (uint8_t &rssiLevel)
 
eoReturn WriteRssiTestMode (bool enable, uint16_t timeOut)
 
eoReturn ReadRssiTestMode (bool &isEnabled)
 
eoReturn WriteTransparentMode (bool enable)
 
eoReturn ReadTransparentMode (bool &isEnabled)
 
eoReturn WriteTXOnlyMode (CO_TX_ONLY_MODE txOnlyMode)
 
eoReturn ReadTXOnlyMode (CO_TX_ONLY_MODE &txOnlyMode)
 
eoPacket GetSerialPacket ()
 

Detailed Description

EnOcean Common Commands class, enables an easy interface for the most common commands.

The eoCommonCommand class, allows you to easily integrate the most common ESP commands into your program.

Examples:
commands_example.cpp, Security_example.cpp, tutorial5.cpp, and tutorial6.cpp.

Constructor & Destructor Documentation

◆ eoSerialCommand()

eoSerialCommand::eoSerialCommand ( eoGateway gateway)

Contructor

Parameters
gatewayGateway to be used for serial command.

Member Function Documentation

◆ AddFilter()

eoReturn eoSerialCommand::AddFilter ( const FILTER_TYPE  filterType,
const uint32_t  filterValue,
const FILTER_KIND  filterKind 
)

Add filter to filter list.

Parameters
filterTypeType of filter
filterValueValue of filter function compare
filterKindBlocking/Applying filter
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM or memory error
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ BIST()

eoReturn eoSerialCommand::BIST ( )

Read System Log from device databank.

Returns
EO_OK or NOT_SUPPORTED
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ DeleteAllFilter()

eoReturn eoSerialCommand::DeleteAllFilter ( )

Delete all filters from filter list.

Returns
EO_OK or NOT_SUPPORTED
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ DeleteFilter()

eoReturn eoSerialCommand::DeleteFilter ( const FILTER_TYPE  filterType,
const uint32_t  filterValue 
)

Delete filter from filter list.

Parameters
filterTypeType of filter
filterValueValue of filter function compare
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM or memory error
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ DutyCycleLimit()

eoReturn eoSerialCommand::DutyCycleLimit ( CO_DUTYCYCLE_LIMIT  limit)

Send Duty Cycle Limit telegram.

Parameters
limit::CO_DUTYCYCLE_LIMIT

◆ DutyCycleReadLimit()

eoReturn eoSerialCommand::DutyCycleReadLimit ( CO_RD_DUTYCYCLE_RESPONSE response)

Reads the actual duty cycle limit values.

Parameters
[out]responsePointer to the duty cycle read limit response structure
Returns
EO_OK or NOT_SUPPORTED

◆ EnableFilter()

eoReturn eoSerialCommand::EnableFilter ( const bool  filterEnabled,
const FILTER_OPERATOR  filterOperator 
)

Enable/Disable all supplied filters.

Parameters
filterEnabledFilter enable
filterOperatorFilter operator (AND or OR)
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ EventDutyCycleLimit()

eoReturn eoSerialCommand::EventDutyCycleLimit ( CO_DUTYCYCLE_LIMIT &  request)

Parse the Duty Cycle Limit event into enum

Parameters
request::CO_DUTYCYCLE_LIMIT

◆ EventSmartAckConfirmLearn()

eoReturn eoSerialCommand::EventSmartAckConfirmLearn ( SA_CONFIRM_LEARN_REQUEST request)

Parse the SmartACK confirm learn event packet into structure

Parameters
requestSA_CONFIRM_LEARN_REQUEST structure

◆ GetFrequencyInfo()

eoReturn eoSerialCommand::GetFrequencyInfo ( CO_RD_FREQUENY_RESPONSE &  response)

Queries the frequency info of the device

Parameters
responseRespons of the serial command
Returns
EO_OK or error code

◆ GetNoiseTreshold()

eoReturn eoSerialCommand::GetNoiseTreshold ( uint8_t &  rssiLevel)

Gets the RSSI noise rejection threshold level for telegram reception. Received Signals below this threshold will be filtered out.

Parameters
MinimumRSSI Level for data telegrams (positive offset from the theoretical noise minimum of-146 dBm)

◆ GetSerialPacket()

eoPacket eoSerialCommand::GetSerialPacket ( )

Get a copy of the last generated SerialPacket, mainly for debugging issues

Returns

◆ GetStepCode()

eoReturn eoSerialCommand::GetStepCode ( CO_RD_STEPCODE_RESPONSE &  response)

Gets the stepcode of the device

Parameters
responseResponse of the serial device
Returns
EO_OK or error code

◆ ReadFilter()

eoReturn eoSerialCommand::ReadFilter ( CO_RD_FILTER_RESPONSE filter,
uint8_t *  filterCount,
uint8_t  maxFilterCount 
)

Read supplied filters.

Parameters
[out]filterPointer to the CO_RD_FILTER_RESPONSE structure
[out]filterCountPointer to the variable where the number of filters stored in the devices is stored
[in]maxFilterCountThe size of the CO_RD_FILTER_RESPONSE array
Returns
EO_OK or NOT_SUPPORTED
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ ReadIDBase()

eoReturn eoSerialCommand::ReadIDBase ( CO_RD_IDBASE_RESPONSE response)

READ ID range base number.

Parameters
[out]responsePointer to CO_RD_IDBASE_RESPONSE structure
Returns
EO_OK or NOT_SUPPORTED
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ ReadMemory()

eoReturn eoSerialCommand::ReadMemory ( CO_RD_MEMORY const &  readMemory,
CO_RD_MEMORY_RESPONSE response 
)

Read x bytes of the Flash, RAM0, DATA, IDATA, XDATA.

Parameters
[in]readPointer to the CO_RD_MEMORY structure
[out]Pointerto the CO_RD_VERSION_RESPONSE structure
Returns
EO_OK or NOT_SUPPORTED

◆ ReadRemanRepeating()

eoReturn eoSerialCommand::ReadRemanRepeating ( bool &  isEnabled)

Select if REMAN telegrams originating from this transceiver can be repeated

Parameters
enabled,truefor enabled ; false for disabled

◆ ReadRepeater()

eoReturn eoSerialCommand::ReadRepeater ( CO_RD_REPEATER_RESPONSE response)

Read Repeater Level OFF, 1, 2.

Parameters
[out]responsePointer to the CO_RD_REPEATER_RESPONSE structure
Returns
EO_OK or NOT_SUPPORTED
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ ReadRssiTestMode()

eoReturn eoSerialCommand::ReadRssiTestMode ( bool &  isEnabled)

Gets if the RSSI testmode is enabled for this device

Note
this command is supported since TCM515 V1.3.0.0 is readRssiTestMode

◆ ReadTransparentMode()

eoReturn eoSerialCommand::ReadTransparentMode ( bool &  isEnabled)

Reads if the Transparent Mode of the TCM515 is enabled

Parameters
isthe transparent mode enabled
Note
this command is supported since TCM515 V1.3.0.0

◆ ReadTXOnlyMode()

eoReturn eoSerialCommand::ReadTXOnlyMode ( CO_TX_ONLY_MODE &  txOnlyMode)

Reads if the tx only mode.

Parameters
isthe transparent mode enabled
Note
this command is supported since TCM515 V1.3.0.0

◆ ReadVersion()

eoReturn eoSerialCommand::ReadVersion ( CO_RD_VERSION_RESPONSE version)

Read the device SW version / HW version, chip-ID, etc.

Parameters
[out]versionPointer to the CO_RD_VERSION_RESPONSE structure
Returns
EO_OK or NOT_SUPPORTED
Examples:
commands_example.cpp, HelloWorld.cpp, Security_example.cpp, tutorial5.cpp, tutorial6.cpp, and WatcherMain.cpp.

◆ Ready()

eoReturn eoSerialCommand::Ready ( CO_READY_RESPONSE response)

Parse the last received gateway.packet into ready response structure.

Parameters
[out]responsePointer to the CO_READY_RESPONSE structure
Returns
EO_OK or NOT_SUPPORTED

◆ Reset()

eoReturn eoSerialCommand::Reset ( )

Order to reset the Device

Returns
EO_OK or NOT_SUPPORTED

◆ SetNoiseTreshold()

eoReturn eoSerialCommand::SetNoiseTreshold ( uint8_t  rssiLevel)

Sets the RSSI noise rejection threshold level for telegram reception. Received Signals below this threshold will be filtered out.

Parameters
MinimumRSSI Level for data telegrams (positive offset from the theoretical noise minimum of-146 dBm)

◆ Sleep()

eoReturn eoSerialCommand::Sleep ( const uint32_t  sleepPeriod)

Order to enter the energy saving mode.

Parameters
sleepPeriodThe value of deep sleep period in 10 ms units
Returns
EO_OK or NOT_SUPPORTED

◆ SmartAckConfirmLearn()

eoReturn eoSerialCommand::SmartAckConfirmLearn ( uint16_t  responseTime,
SA_CONFIRM_CODE  confirmCode 
)

Response from backbone controller how to handle the received learn request.

Parameters
[in]responseTimeResponse time for client in ms
[in]confirmCodeConfirmation code
Returns
EO_OK or NOT_SUPPORTED

◆ SmartAckLearnAck()

eoReturn eoSerialCommand::SmartAckLearnAck ( SA_LEARN_ACK_RESPONSE response)

Parse the last received gateway.packet into LearnAck response structure

Parameters
[out]responsePointer to the SA_LEARN_ACK_RESPONSE structure
Returns
EO_OK or NOT_SUPPORTED

◆ SmartAckLearnConfirm()

eoReturn eoSerialCommand::SmartAckLearnConfirm ( uint16_t  responseTime,
SMARTACK_CONFIRM_CODE  confirmCode,
uint32_t  postmasterID,
uint32_t  clientID 
)

Send smart ack learn answer to modify mailbox at postmaster.

Parameters
responseTimeResponse time for sensor in ms
confirmCodeLearn IN/OUT
postmasterIDDevice ID of the used Post master
clientIDDevice ID of the learned IN/OUT client
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM

◆ SmartAckLearnedClients()

eoReturn eoSerialCommand::SmartAckLearnedClients ( SA_RD_LEARNEDCLIENTS_RESPONSE clients,
uint8_t *  learnedCount,
uint8_t  maxLearnedCount 
)

Read mailbox information at the Post Master device, about all learned Smart Ack clients.

Parameters
[out]*clientsPointer to the Learned clients response structure
[out]*learnedCountNumber of Learned clients
[in]maxLearnedCountThe size of the Learned clients response array
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM

◆ SmartAckReadLearnMode()

eoReturn eoSerialCommand::SmartAckReadLearnMode ( SA_RD_LEARNMODE_RESPONSE response)

Reads the learnmode state of Smart Ack Controller.

Parameters
[out]responsePointer to the learnmode response structure
Returns
EO_OK or NOT_SUPPORTED

◆ SmartAckReset()

eoReturn eoSerialCommand::SmartAckReset ( uint32_t  clientID)

Send reset command to a Smart Ack Client.

Parameters
clientIDDevice ID of the client
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM

◆ SmartAckSendLearnRequest()

eoReturn eoSerialCommand::SmartAckSendLearnRequest ( uint16_t  manufacturerID,
uint32_t  EEP 
)

Sends Smart Ack Learn Request telegram to Smart Ack Controller. This function will only be used in a Smart Ack Client.

Parameters
manufacturerID
EEP
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM

◆ SmartAckSetPostmaster()

eoReturn eoSerialCommand::SmartAckSetPostmaster ( uint8_t  mailboxCount)

Set the amount of reclaim tries in Smart Ack Client.

Parameters
mailboxCountAmount of mailboxes available
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM

◆ SmartAckSetReclaimTries()

eoReturn eoSerialCommand::SmartAckSetReclaimTries ( uint8_t  reclaimCount)

Set the amount of reclaim tries in Smart Ack Client.

Parameters
reclaimCountPreseting for the number of required reclaim tries
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM

◆ SmartAckWriteLearnMode()

eoReturn eoSerialCommand::SmartAckWriteLearnMode ( bool  enable,
SA_EXTENDED_LEARNMODE  extended,
uint32_t  timeout 
)

Enables or disables learn mode of Smart Ack Controller.

Parameters
enableStart/End Learnmode
extendedSimple/Advanced Learnmode
timeoutTime-out of learnmode in ms
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM

◆ WaitMaturity()

eoReturn eoSerialCommand::WaitMaturity ( const bool  waitMaturity)

Waiting till end of maturity time before received radio telegrams will transmit.

Parameters
waitMaturityBool value
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ WriteIDBase()

eoReturn eoSerialCommand::WriteIDBase ( const uint32_t  baseID)

Write ID range base number.

Parameters
baseIDBase ID
Returns
EO_OK or NOT_SUPPORTED

◆ WriteMemory()

eoReturn eoSerialCommand::WriteMemory ( CO_WR_MEMORY const &  writeMemory)

Write x bytes of the Flash, RAM0, DATA, IDATA, XDATA.

Parameters
[in]writememory
Returns
EO_OK,RET_NOT_SUPPORTED,RET_WRONG_PARAM , or RET_OPERATION_DENIED

◆ WriteMode()

eoReturn eoSerialCommand::WriteMode ( WR_MODE_CODE  mode)

Change the mode between Advanced and Compatible mode (default)

Parameters
modeWR_MODE_CODE enum

◆ WriteRemanRepeating()

eoReturn eoSerialCommand::WriteRemanRepeating ( bool  enabled)

Select if REMAN telegrams originating from this transceiver can be repeated

Parameters
enabled,truefor enabling ; false for disabling

◆ WriteRepeater()

eoReturn eoSerialCommand::WriteRepeater ( bool  repEnable,
const uint8_t  repLevel 
)

Write Repeater Level OFF, 1, 2.

Parameters
repEnableRepeater Enable
repLevelRepeater Level
Returns
EO_OK or NOT_SUPPORTED or WRONG_PARAM
Examples:
commands_example.cpp, and tutorial5.cpp.

◆ WriteRssiTestMode()

eoReturn eoSerialCommand::WriteRssiTestMode ( bool  enable,
uint16_t  timeOut 
)

The connected device will enter a state, where it sends an "RSSI" strength Signal for each received telegram

Parameters
settrue to enable rssitestmode, false to disable it
timeoutin seconds. After x seconds the rssi testmode will disable. 0 = no timeout
Note
this command is supported since TCM515 V1.3.0.0

◆ WriteStartupDelay()

eoReturn eoSerialCommand::WriteStartupDelay ( uint8_t  delay)

Sets the Start up Delay

Parameters
delayas multiple of 10 ms

◆ WriteTransparentMode()

eoReturn eoSerialCommand::WriteTransparentMode ( bool  enable)

Enables or disables the Transparent Mode of the TCM515. It's recommended to enable the transparent mode with TCM515, as otherwise TCM515 will do chaining/dechaning of telegrams, or execute security functions. EoLink is able to handle more then one chain and is more powerful then the TCM515.

Parameters
enable=true enable transparent mode
Note
this command is supported since TCM515 V1.3.0.0

◆ WriteTXOnlyMode()

eoReturn eoSerialCommand::WriteTXOnlyMode ( CO_TX_ONLY_MODE  txOnlyMode)

Enables or disables the TX Only Mode of the TCM515.

Parameters
enable=true enable transparent mode
Note
this command is supported since TCM515 V1.3.0.0