knx
ETS configurable knx-stack
router_object.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "config.h"
4 
5 #include "table_object.h"
6 #include "knx_types.h"
7 
8 class Memory;
9 
11 {
13  Model_20
14 };
15 
17 {
20  Single // Not used, just a placeholder for better readability for coupler model 1.x
21 };
22 
23 class RouterObject : public TableObject
24 {
25  public:
26  RouterObject(Memory& memory, uint32_t staticTableAdr = 0, uint32_t staticTableSize = 0);
27 
28  void initialize1x(DptMedium mediumType, uint16_t maxApduSize);
29  void initialize20(uint8_t objIndex, DptMedium mediumType, RouterObjectType rtType, uint16_t maxApduSize);
30  void initialize(CouplerModel model, uint8_t objIndex, DptMedium mediumType, RouterObjectType rtType, uint16_t maxApduSize);
31 
32  bool isGroupAddressInFilterTable(uint16_t groupAddress);
33 
34  bool isRfSbcRoutingEnabled();
35  bool isIpSbcRoutingEnabled();
36 
37  void masterReset(EraseCode eraseCode, uint8_t channel) override;
38 
39  const uint8_t* restore(const uint8_t* buffer) override;
40 
41  protected:
42  void beforeStateChange(LoadState& newState) override;
43 
44  private:
45  // Function properties
46  void functionRouteTableControl(bool isCommand, uint8_t* data, uint8_t length, uint8_t* resultData, uint8_t& resultLength);
47  void functionRfEnableSbc(bool isCommand, uint8_t* data, uint8_t length, uint8_t* resultData, uint8_t& resultLength);
48  void functionIpEnableSbc(bool isCommand, uint8_t* data, uint8_t length, uint8_t* resultData, uint8_t& resultLength);
49 
50  void commandClearSetRoutingTable(bool bitIsSet);
51  bool statusClearSetRoutingTable(bool bitIsSet);
52  void commandClearSetGroupAddress(uint16_t startAddress, uint16_t endAddress, bool bitIsSet);
53  bool statusClearSetGroupAddress(uint16_t startAddress, uint16_t endAddress, bool bitIsSet);
54 
55  bool _rfSbcRoutingEnabled = false;
56  bool _ipSbcRoutingEnabled = false;
58 };
Definition: memory.h:37
void masterReset(EraseCode eraseCode, uint8_t channel) override
void beforeStateChange(LoadState &newState) override
This method is called before the interface object enters a new LoadState.
bool isGroupAddressInFilterTable(uint16_t groupAddress)
bool isRfSbcRoutingEnabled()
void initialize1x(DptMedium mediumType, uint16_t maxApduSize)
const uint8_t * restore(const uint8_t *buffer) override
This method is called when the object should restore its state from the buffer.
RouterObject(Memory &memory, uint32_t staticTableAdr=0, uint32_t staticTableSize=0)
bool isIpSbcRoutingEnabled()
void initialize20(uint8_t objIndex, DptMedium mediumType, RouterObjectType rtType, uint16_t maxApduSize)
void initialize(CouplerModel model, uint8_t objIndex, DptMedium mediumType, RouterObjectType rtType, uint16_t maxApduSize)
This class provides common functionality for interface objects that are configured by ETS with MemorW...
Definition: table_object.h:13
uint8_t * data()
returns the internal data of the interface object.
EraseCode
Definition: knx_types.h:242
DptMedium
Definition: knx_types.h:254
LoadState
Definition: property.h:198
RouterObjectType
Definition: router_object.h:17
@ Primary
Definition: router_object.h:18
@ Single
Definition: router_object.h:20
@ Secondary
Definition: router_object.h:19
CouplerModel
Definition: router_object.h:11
@ Model_20
Definition: router_object.h:13
@ Model_1x
Definition: router_object.h:12