EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoReCom.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 
33 #ifndef EO_REMOTE_COMISSIONING_H_
34 #define EO_REMOTE_COMISSIONING_H_
35 #include "eoGateway.h"
36 #include "eoGenericProfile.h"
45 typedef enum
46 {
48  RECOM_OK = 0x00,
82 
87 typedef enum
88 {
90  FN_RECOM_ACK = 0x240, //Remote Commissioning Acknowledge
92  FN_RECOM_GET_METADATA = 0x210, //Get Link Table Metadata Query
94  FN_RECOM_GET_METADATA_RESPONSE = 0x810, //Get Link Table Metadata Response
96  FN_RECOM_GET_TABLE = 0x211, //Get Link Table Query
98  FN_RECOM_GET_TABLE_RESPONSE = 0x811, //Get Link Table Response
100  FN_RECOM_SET_TABLE = 0x212, //Set Link Table Query
102  FN_RECOM_GET_GP_TABLE = 0x213, //Get Link Table GP Entry Query
104  FN_RECOM_GET_GP_TABLE_RESPONSE = 0x813, //Get Link Table GP Entry Response
106  FN_RECOM_SET_GP_TABLE = 0x214, //Set Link Table GP Entry Query
108  FN_RECOM_SET_LEARN_MODE = 0x220, //Remote Set Learn Mode
110  FN_RECOM_TRIG_OUTBOUND_TEACH_REQ = 0x221, //Trigger Outbound Remote Teach Request
112  FN_RECOM_GET_DEVICE_CONFIG = 0x230, //Get Device Configuration Query
114  FN_RECOM_GET_DEVICE_CONFIG_RESPONSE = 0x830, //Get Device Configuration Response
116  FN_RECOM_SET_DEVICE_CONFIG = 0x231, //Set Device Configuration Query
118  FN_RECOM_GET_LINK_BASED_CONFIG = 0x232, //Get Link Based Configuration Query
120  FN_RECOM_GET_LINK_BASED_CONFIG_RESPONSE = 0x832, //Get Link Based Configuration Response
122  FN_RECOM_SET_LINK_BASED_CONFIG = 0x233, //Set Link Based Configuration Query
124  FN_RECOM_APPLY_CHANGES = 0x226, //Apply Changes Command
126  FN_RECOM_RESET_TO_DEFAULTS = 0x224, //Reset to Defaults
128  FN_RECOM_RADIO_LINK_TEST_CONTROL = 0x225, //Radio Link Test Control
130  FN_RECOM_GET_PRODUCT_ID = 0x227, //Get Product ID Query
132  FN_RECOM_GET_PRODUCT_RESPONSE = 0x827, //Get Product ID Response
134  FN_RECOM_GET_REPEATER_FUNCTIONS = 0x250, //Get Repeater Functions Query
136  FN_RECOM_GET_REPEATER_FUNCTIONS_RESPONSE = 0x850, //Get Repeater Functions Response
138  FN_RECOM_SET_REPEATER_FUNCTIONS = 0x251, //Set Repeater Functions Query
140  FN_RECOM_SET_REPEATER_FILTER = 0x252 //Set Repeater Filter Query
141 } FN_RECOM_CODE;
142 
144 typedef enum
145 {
150 } RECOM_SUPPORT;
151 
153 typedef enum
154 {
160 
162 typedef enum
163 {
168 } RECOM_CHANGES;
169 
171 typedef enum
172 {
180 
182 typedef enum
183 {
188 } RECOM_RESET;
189 
191 typedef enum
192 {
200 
202 typedef enum
203 {
209 
211 typedef enum
212 {
218 
220 typedef enum
221 {
231 
233 typedef enum
234 {
244 
249 typedef struct
250 {
262  uint8_t maxOfOutbound;
266  uint8_t maxOfInbound;
268 
273 typedef struct
274 {
278  uint8_t startIndex;
280  uint8_t endIndex;
282 
287 typedef struct gplinkTable
288 {
290  RECOM_TABLE_DIR tableDir;
292  uint8_t index;
294  uint8_t length;
296  uint8_t * gp_ti;
298  gplinkTable() : tableDir(RECOM_INBOUND_TABLE),index(0),length(0),gp_ti(NULL) {};
299 } GP_LINK_TABLE;
300 
305 typedef struct
306 {
308  uint8_t index;
310  uint32_t ID;
312  uint8_t EEP_RORG;
314  uint8_t EEP_FUNC;
316  uint8_t EEP_TYPE;
318  uint8_t channel;
319 } LINK_TABLE;
320 
325 typedef struct
326 {
330  uint8_t inboundIndex;
332 
337 typedef struct
338 {
340  uint16_t startIndex;
342  uint16_t endIndex;
344  uint8_t length;
346 
351 typedef struct
352 {
354  uint16_t index;
356  uint8_t length;
358  uint32_t rawValue;
359 } DEVICE_CONFIG;
360 
365 typedef struct
366 {
370  uint16_t tableIndex;
372  uint16_t startIndex;
374  uint16_t endIndex;
376  uint8_t length;
382 typedef struct
383 {
385  RECOM_TABLE_DIR tableDir;
387  uint8_t tableIndex;
389  uint16_t index;
391  uint8_t length;
393  uint32_t rawValue;
394 } LINK_BASED_CONFIG;
395 
396 
401 typedef struct
402 {
408 
413 typedef struct
414 {
422 
427 typedef struct
428 {
430  bool isEnabled;
432  uint8_t numOfRLT;
434 
439 typedef struct
440 {
442  uint16_t manufacturerId;
446 
451 typedef struct
452 {
454  RECOM_REPEATER_FUNC repeaterFunc;
456  RECOM_REPEATER_LEVEL repeaterLevel;
458  RECOM_REPEATER_FILTER repeaterFilter;
459 } REPEATER_FUNCTIONS;
460 
465 typedef struct
466 {
472  uint32_t value;
474 
484 class eoReCom
485 {
486 private:
487  bool shallBeRepeated;
488  eoGateway *gateway;
489  eoReManMessage reManMessage;
490  eoReturn initPacket(FN_RECOM_CODE const fnCode, uint8_t const length);
491 
492  eoReturn GetRawValue(uint8_t length,uint8_t offset,eoReManMessage const &reManMessage,uint32_t &value) const;
493 
494  eoReturn SetRawValue(uint8_t length,uint8_t offset,eoReManMessage &reManMessage,uint32_t const &value) const;
495 
496  uint8_t keyToUse;
497 
498  eoReturn sendMessage()
499  {
500  return gateway->Send(reManMessage, shallBeRepeated, keyToUse);
501  }
502 
503 public:
508  eoReCom(eoGateway *gateway);
509  ~eoReCom();
513  bool GetShallBeRepeated() const
514  {
515  return shallBeRepeated;
516  };
520  void SetShallBeRepeated(bool repeat)
521  {
522  shallBeRepeated = repeat;
523  };
524 
528  bool GetKeyToUse() const
529  {
530  return keyToUse;
531  };
535  void SetKeyToUse(uint8_t key)
536  {
537  keyToUse = key;
538  };
546  eoReturn GetMetadata(uint32_t destinationID);
554  eoReturn ParseGetMetadataResponse(QUERY_METADATA_RESPONSE &response) const;
563  eoReturn GetLinkTable(QUERY_LINK_TABLE const &query, uint32_t const destinationID);
572  eoReturn ParseGetLinkTableResponse(std::vector<LINK_TABLE> &response, RECOM_TABLE_DIR &tableDir) const;
582  eoReturn SetLinkTable(std::vector<LINK_TABLE> const &query, RECOM_TABLE_DIR tableDir, uint32_t destinationID);
591  eoReturn GetGPLinkTable(GP_LINK_TABLE const &query, uint32_t destinationID);
598  eoReturn ParseGetGPLinkTableResponse(GP_LINK_TABLE &query) const;
608  eoReturn SetGPLinkTable(GP_LINK_TABLE const &query, uint32_t destinationID);
609 
618  eoReturn RemoteSetLearnMode(QUERY_SET_LEARN_MODE const &learnMode, uint32_t destinationID);
627  eoReturn TriggerOutboundTeachRequest(uint8_t channel, uint32_t destinationID);
636  eoReturn GetDeviceConfig(QUERY_DEVICE_CONFIG const &deviceConf, uint32_t destinationID);
642  eoReturn ParseDeviceConfigResponse(std::vector<DEVICE_CONFIG> &deviceConf) const;
652  eoReturn SetDeviceConfig(std::vector<DEVICE_CONFIG> const &deviceConf, uint32_t destinationID);
661  eoReturn GetLinkBasedConfig(QUERY_LINK_BASED_CONFIG const &linkConfig, uint32_t destinationID);
673  eoReturn SetLinkBasedConfig(std::vector<LINK_BASED_CONFIG> const &linkConfig, uint32_t destinationID);
679  eoReturn ParseLinkBasedConfigResponse(std::vector<LINK_BASED_CONFIG> &linkConfig) const;
688  eoReturn ApplyChanges(QUERY_APPLY_CHANGES const &changes, uint32_t destinationID);
697  eoReturn ResetDefaults(QUERY_RESET_DEFAULTS const &defaults, uint32_t destinationID);
706  eoReturn RadioLinkTest(QUERY_RADIO_LINK_TEST const &radioLink, uint32_t destinationID);
714  eoReturn GetProductID(uint32_t destinationID = BROADCAST_ID);
725  eoReturn ParseGetProductIDResponse(QUERY_PRODUCT_ID_RESPONSE &response) const;
735  eoReturn GetRepeater(uint32_t destinationID);
743  eoReturn ParseGetRepeaterResponse(REPEATER_FUNCTIONS &response) const;
752  eoReturn SetRepeater(REPEATER_FUNCTIONS const &repeaterFunc, uint32_t destinationID);
761  eoReturn SetRepeaterFilter(QUERY_SET_REPEATER_FILTER const &repeaterFunc, uint32_t destinationID);
762 
763 };
767 #endif // !defined(EA_4BFBF49B_3520_48f7_BACB_B62331BA4509__INCLUDED_)
Query gp teach in link table structure.
Apply changes.
Definition: eoReCom.h:167
Repeater filter Block.
Definition: eoReCom.h:223
Query reset structure.
Definition: eoReCom.h:413
Entry for get/set link table.
Definition: eoReCom.h:305
Query link table structure.
Definition: eoReCom.h:273
RECOM_CHANGES linkTableChanges
Link table changes.
Definition: eoReCom.h:404
FN_RECOM_CODE
Function codes for Remote Commissioning.
Definition: eoReCom.h:87
Do not reset default.
Definition: eoReCom.h:185
RECOM_RESET outboundTable
Outbound link table.
Definition: eoReCom.h:420
Do not apply changes.
Definition: eoReCom.h:165
Repeater filter delete all filter.
Definition: eoReCom.h:229
Remote Commissioning Acknowledge.
Definition: eoReCom.h:90
RECOM_REPEATER_FILTER
Enums for repeater filter.
Definition: eoReCom.h:211
Query metadata response structure.
Definition: eoReCom.h:249
Repeater level 2.
Definition: eoReCom.h:207
Get Link Table Response.
Definition: eoReCom.h:98
Repeater filter destination ID.
Definition: eoReCom.h:242
Message time out.
Definition: eoReCom.h:66
Wrong data.
Definition: eoReCom.h:78
RECOM_LEARN_MODE mode
Learn mode.
Definition: eoReCom.h:328
RECOM_SUPPORT remoteTeachInbound
Remote teach inbound supported.
Definition: eoReCom.h:254
Wrong data size.
Definition: eoReCom.h:58
Learn out mode.
Definition: eoReCom.h:176
Get Device Configuration Response.
Definition: eoReCom.h:114
RECOM_RESET inboundTable
Inbound link table.
Definition: eoReCom.h:418
Remote Commissioning interface class.
Definition: eoReCom.h:484
Get Link Table GP Entry Response.
Definition: eoReCom.h:104
uint16_t tableIndex
Link table index.
Definition: eoReCom.h:370
Message part not received.
Definition: eoReCom.h:72
uint16_t endIndex
End index.
Definition: eoReCom.h:374
Set Repeater Functions Query.
Definition: eoReCom.h:138
uint32_t ID
ID.
Definition: eoReCom.h:310
uint8_t endIndex
Ending index.
Definition: eoReCom.h:280
uint8_t maxOfOutbound
Max length of outbound table.
Definition: eoReCom.h:262
RECOM_LEARN_MODE
Enums for learn modes.
Definition: eoReCom.h:171
uint8_t maxOfInbound
Max length of inbound table.
Definition: eoReCom.h:266
Not send.
Definition: eoReCom.h:62
Set Link Based Configuration Query.
Definition: eoReCom.h:122
Get Link Based Configuration Response.
Definition: eoReCom.h:120
#define BROADCAST_ID
Destination broadcast ID.
Definition: eoApiDef.h:218
Get Product ID Response.
Definition: eoReCom.h:132
RECOM_REPEATER_FILTER_TYPE repeaterLevel
Filter type.
Definition: eoReCom.h:470
Repeater filter Apply.
Definition: eoReCom.h:225
Reset to Defaults.
Definition: eoReCom.h:126
Wrong unlock code.
Definition: eoReCom.h:52
Dvice configuration response.
Definition: eoReCom.h:351
Code data size exceeded.
Definition: eoReCom.h:76
Set Link Table Query.
Definition: eoReCom.h:100
RECOM_TABLE_DIR tableDir
Table direction.
Definition: eoReCom.h:368
Repeater off.
Definition: eoReCom.h:194
Get Link Table GP Entry Query.
Definition: eoReCom.h:102
eoGateway
uint32_t value
Filter value.
Definition: eoReCom.h:472
bool isEnabled
Enable/disable.
Definition: eoReCom.h:430
Set learn mode structure.
Definition: eoReCom.h:325
uint16_t startIndex
Start index.
Definition: eoReCom.h:372
RECOM_RESET configParam
Configuration parameters.
Definition: eoReCom.h:416
Not supported.
Definition: eoReCom.h:147
Get Link Table Query.
Definition: eoReCom.h:96
Wrong data.
Definition: eoReCom.h:80
RECOM_SUPPORT inboundLinkTable
Inbound link table supported.
Definition: eoReCom.h:258
Set Repeater Filter Query.
Definition: eoReCom.h:140
Supported.
Definition: eoReCom.h:149
Apply Changes Command.
Definition: eoReCom.h:124
uint32_t productReference
Product reference.
Definition: eoReCom.h:444
uint32_t rawValue
the RawValue
Definition: eoReCom.h:358
Remote Set Learn Mode.
Definition: eoReCom.h:108
Too long message.
Definition: eoReCom.h:68
Address out of range.
Definition: eoReCom.h:74
Learn in mode.
Definition: eoReCom.h:174
RECOM_REPEATER_LEVEL
Enums for repeater level.
Definition: eoReCom.h:202
Repeater filter dBm.
Definition: eoReCom.h:240
uint16_t startIndex
Starting index.
Definition: eoReCom.h:340
eoReturn
contains all the return values from different functions
Definition: eoApiDef.h:40
uint8_t index
Index.
Definition: eoReCom.h:308
EnOcean Gateway class, for handling a gateway Module.
Definition: eoGateway.h:139
Wrong manufacturer ID.
Definition: eoReCom.h:56
RECOM_RESET
Enums for configuration.
Definition: eoReCom.h:182
RECOM_CHANGES
Enums for changes.
Definition: eoReCom.h:162
Apply changes struct.
Definition: eoReCom.h:401
uint8_t length
Byte-Length of the rawValue.
Definition: eoReCom.h:356
No code set.
Definition: eoReCom.h:60
Filtered repeating on.
Definition: eoReCom.h:198
Get Link Table Metadata Response.
Definition: eoReCom.h:94
virtual eoReturn Send(const eoPacket &p)
uint16_t manufacturerId
Manufacturer ID.
Definition: eoReCom.h:442
RECOM_CHANGES configChanges
Configuration changes.
Definition: eoReCom.h:406
Repeater filter source ID.
Definition: eoReCom.h:236
Repeater filter RORG.
Definition: eoReCom.h:238
RPC failed.
Definition: eoReCom.h:64
Get Link Based Configuration Query.
Definition: eoReCom.h:118
Wrong EEP.
Definition: eoReCom.h:54
Wrong target ID.
Definition: eoReCom.h:50
uint8_t EEP_FUNC
EEP FUNC.
Definition: eoReCom.h:314
Radio link test control.
Definition: eoReCom.h:427
Set Device Configuration Query.
Definition: eoReCom.h:116
uint8_t lengthOfInbound
Current length of inbound table.
Definition: eoReCom.h:264
Exit any learn mode.
Definition: eoReCom.h:178
Repeater level 1.
Definition: eoReCom.h:205
Query link based configuration.
Definition: eoReCom.h:365
uint16_t endIndex
Ending index.
Definition: eoReCom.h:342
void SetShallBeRepeated(bool repeat)
Definition: eoReCom.h:520
Query device configuration.
Definition: eoReCom.h:337
Repeater on.
Definition: eoReCom.h:196
uint8_t lengthOfOutbound
Current length of outbound table.
Definition: eoReCom.h:260
RECOM_REPEATER_FILTER_CONTROL
Enums for repeater filter control.
Definition: eoReCom.h:220
Get Repeater Functions Response.
Definition: eoReCom.h:136
Get product ID response.
Definition: eoReCom.h:439
void SetKeyToUse(uint8_t key)
Definition: eoReCom.h:535
RECOM_TABLE_DIR
Enums for table direction.
Definition: eoReCom.h:153
Get Repeater Functions Query.
Definition: eoReCom.h:134
RECOM_SUPPORT outboundLinkTable
Outbound link table supported.
Definition: eoReCom.h:256
OK.
Definition: eoReCom.h:48
bool GetShallBeRepeated() const
Definition: eoReCom.h:513
Radio Link Test Control.
Definition: eoReCom.h:128
uint8_t EEP_RORG
EEP RORG.
Definition: eoReCom.h:312
#define NULL
NULL definition.
Definition: eoHalTypes.h:54
Definition: eoReManMessage.h:43
Repeater filter OR.
Definition: eoReCom.h:216
Get Product ID Query.
Definition: eoReCom.h:130
uint8_t length
Length.
Definition: eoReCom.h:376
RECOM_SUPPORT
Enums for supported flags.
Definition: eoReCom.h:144
Set Link Table GP Entry Query.
Definition: eoReCom.h:106
Inbound.
Definition: eoReCom.h:156
uint8_t length
Length.
Definition: eoReCom.h:344
uint8_t numOfRLT
Number of RLT slave.
Definition: eoReCom.h:432
uint16_t index
Starting index.
Definition: eoReCom.h:354
uint8_t inboundIndex
Inbound index.
Definition: eoReCom.h:330
Get Device Configuration Query.
Definition: eoReCom.h:112
Get Link Table Metadata Query.
Definition: eoReCom.h:92
Set repeater filter.
Definition: eoReCom.h:465
Reset default.
Definition: eoReCom.h:187
RECOM_REPEATER_FUNC
Enums for repeater function.
Definition: eoReCom.h:191
RECOM_REPEATER_FILTER_CONTROL repeaterFunc
Filter control.
Definition: eoReCom.h:468
Repeater filter delete specified.
Definition: eoReCom.h:227
RECOM_REPEATER_FILTER_TYPE
Enums for repeater filter type.
Definition: eoReCom.h:233
uint8_t startIndex
Starting index.
Definition: eoReCom.h:278
uint8_t channel
Channel.
Definition: eoReCom.h:318
Trigger Outbound Remote Teach Request.
Definition: eoReCom.h:110
RECOM_TABLE_DIR tableDir
Table direction.
Definition: eoReCom.h:276
RECOM_SUPPORT remoteTeachOutbound
Remote teach outbound supported.
Definition: eoReCom.h:252
bool GetKeyToUse() const
Definition: eoReCom.h:528
Message part already received.
Definition: eoReCom.h:70
eoReComReturn
Contains all the return values from ReCom functions.
Definition: eoReCom.h:45
Repeater filter AND.
Definition: eoReCom.h:214
Outbound.
Definition: eoReCom.h:158
uint8_t EEP_TYPE
EEP TYPE.
Definition: eoReCom.h:316