knx
ETS configurable knx-stack
property.h
Go to the documentation of this file.
1 /*
2  * property_types.h - BCU 2 property types of EIB objects.
3  *
4  * Copyright (c) 2014 Stefan Taferner <stefan.taferner@gmx.at>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 3 as
8  * published by the Free Software Foundation.
9  */
10 #pragma once
11 
12 #include <stdint.h>
13 #include "save_restore.h"
14 
17 {
18  PDT_CONTROL = 0x00,
19  PDT_CHAR = 0x01,
21  PDT_INT = 0x03,
23  PDT_KNX_FLOAT = 0x05,
24  PDT_DATE = 0x06,
25  PDT_TIME = 0x07,
26  PDT_LONG = 0x08,
28  PDT_FLOAT = 0x0a,
29  PDT_DOUBLE = 0x0b,
30  PDT_CHAR_BLOCK = 0x0c,
33  PDT_DATE_TIME = 0x0f,
35  PDT_GENERIC_01 = 0x11,
36  PDT_GENERIC_02 = 0x12,
37  PDT_GENERIC_03 = 0x13,
38  PDT_GENERIC_04 = 0x14,
39  PDT_GENERIC_05 = 0x15,
40  PDT_GENERIC_06 = 0x16,
41  PDT_GENERIC_07 = 0x17,
42  PDT_GENERIC_08 = 0x18,
43  PDT_GENERIC_09 = 0x19,
44  PDT_GENERIC_10 = 0x1a,
45  PDT_GENERIC_11 = 0x1b,
46  PDT_GENERIC_12 = 0x1c,
47  PDT_GENERIC_13 = 0x1d,
48  PDT_GENERIC_14 = 0x1e,
49  PDT_GENERIC_15 = 0x1f,
50  PDT_GENERIC_16 = 0x20,
51  PDT_GENERIC_17 = 0x21,
52  PDT_GENERIC_18 = 0x22,
53  PDT_GENERIC_19 = 0x23,
54  PDT_GENERIC_20 = 0x24,
55  PDT_UTF8 = 0x2f,
56  PDT_VERSION = 0x30,
57  PDT_ALARM_INFO = 0x31,
59  PDT_BITSET8 = 0x33,
60  PDT_BITSET16 = 0x34,
61  PDT_ENUM8 = 0x35,
62  PDT_SCALING = 0x36,
63  PDT_NE_VL = 0x3c,
64  PDT_NE_FL = 0x3d,
65  PDT_FUNCTION = 0x3e,
66  PDT_ESCAPE = 0x3f,
67 };
68 
70 {
85  PID_TABLE = 23,
91 
102 
113 
131  PID_TTL = 67,
142  PID_CUSTOM_RESERVED_TUNNELS_CTRL = 201, // custom propertiy to control the stacks behaviour for reserverd tunnels, not in Spec (PID >= 200)
143  PID_CUSTOM_RESERVED_TUNNELS_IP = 202, // custom propertiy to control the stacks behaviour for reserverd tunnels, not in Spec (PID >= 200)
144 
164 
166  PID_SECURITY_MODE = 51, // Enable and disable the Security Mode
167  PID_P2P_KEY_TABLE = 52, // Security keys used for securing point-to-point and broadcast communication
168  PID_GRP_KEY_TABLE = 53, // Security keys used for securing standard mode group communication
169  PID_SECURITY_INDIVIDUAL_ADDRESS_TABLE = 54, // IAs and last valid sequence numbers of communication partners with secure links
170  PID_SECURITY_FAILURES_LOG = 55, // Provides security failure information
171  PID_TOOL_KEY = 56, // Stores the security information for the central MaC in S-Mode and Ctrl-Mode
172  PID_SECURITY_REPORT = 57, // KNX Data Security-related status and diagnostic information
173  PID_SECURITY_REPORT_CONTROL = 58, // Control the spontaneous communication of the security report through DMP_InterfaceObject-InfoReport_RCl
174  PID_SEQUENCE_NUMBER_SENDING = 59, // Sequence Number used for the next outgoing secure communication
175  PID_ZONE_KEY_TABLE = 60, // Security keys used for securing zone addressing communication
176  PID_GO_SECURITY_FLAGS = 61, // Defines the required security requirements for each group object
177  PID_ROLE_TABLE = 62, // Role table
178  PID_TOOL_SEQUENCE_NUMBER_SENDING = 250, // Sequence Number used for the next outgoing secure communication (Tool Access only, non-standardized!)
179 
189  PID_L2_COUPLER_TYPE = 59, // Only interesting for mask 0x0912 (TP1/TP1 coupler)
190  PID_HOP_COUNT = 61, // Only interesting in primary if other medium(secondary) is open medium without hopcount
193  PID_RF_ENABLE_SBC = 112, // Exists only if medium for this router object is RF (PDT_FUNCTION)
194  PID_IP_ENABLE_SBC = 120, // Exists only if medium for this router object is IP (PDT_FUNCTION)
195 };
196 
198 {
202  LS_ERROR = 3,
205 };
206 
208 {
209  LE_NOOP = 0,
213  LE_UNLOAD = 4
214 };
215 
216 // 20.011 DPT_ErrorClass_System
218 {
237  E_GO_TYPE_TOO_BIG = 18
238 };
239 
242 {
243  ReadLv0 = 0x00,
244  ReadLv1 = 0x10,
245  ReadLv2 = 0x20,
246  ReadLv3 = 0x30,
247  WriteLv0 = 0x00,
248  WriteLv1 = 0x01,
249  WriteLv2 = 0x02,
250  WriteLv3 = 0x03,
251 };
252 
254 {
258  uint16_t MaxElements;
259  uint8_t Access;
260 };
261 
262 class Property : public SaveRestore
263 {
264  public:
265  Property(PropertyID id, bool writeEnable, PropertyDataType type, uint16_t maxElements, uint8_t access);
266  virtual ~Property();
267  PropertyID Id() const;
268  bool WriteEnable() const;
269  PropertyDataType Type() const;
270  uint16_t MaxElements() const;
271  uint8_t Access() const;
272  uint8_t ElementSize() const;
273  virtual uint8_t read(uint16_t start, uint8_t count, uint8_t* data) const = 0;
274  virtual uint8_t write(uint16_t start, uint8_t count, const uint8_t* data) = 0;
275  virtual void command(uint8_t* data, uint8_t length, uint8_t* resultData, uint8_t& resultLength);
276  virtual void state(uint8_t* data, uint8_t length, uint8_t* resultData, uint8_t& resultLength);
277  uint8_t read(uint8_t& value) const;
278  uint8_t read(uint16_t& value) const;
279  uint8_t read(uint32_t& value) const;
280  uint8_t read(uint8_t* value) const;
281  uint8_t write(uint8_t value);
282  uint8_t write(uint16_t value);
283  uint8_t write(uint16_t position, uint16_t value);
284  uint8_t write(uint32_t value);
285  uint8_t write(const uint8_t* value);
286  protected:
290  uint16_t _maxElements;
291  uint8_t _access;
292 };
virtual ~Property()
Definition: property.cpp:133
PropertyDataType _type
Definition: property.h:289
virtual uint8_t read(uint16_t start, uint8_t count, uint8_t *data) const =0
uint8_t ElementSize() const
Definition: property.cpp:31
virtual void state(uint8_t *data, uint8_t length, uint8_t *resultData, uint8_t &resultLength)
Definition: property.cpp:239
PropertyID _id
Definition: property.h:287
uint8_t Access() const
Definition: property.cpp:26
uint8_t _access
Definition: property.h:291
Property(PropertyID id, bool writeEnable, PropertyDataType type, uint16_t maxElements, uint8_t access)
Definition: property.cpp:128
uint16_t _maxElements
Definition: property.h:290
PropertyID Id() const
Definition: property.cpp:6
bool _writeEnable
Definition: property.h:288
virtual uint8_t write(uint16_t start, uint8_t count, const uint8_t *data)=0
uint16_t MaxElements() const
Definition: property.cpp:21
virtual void command(uint8_t *data, uint8_t length, uint8_t *resultData, uint8_t &resultLength)
Definition: property.cpp:231
bool WriteEnable() const
Definition: property.cpp:11
PropertyDataType Type() const
Definition: property.cpp:16
Interface for classes that can save and restore data from a buffer.
Definition: save_restore.h:8
LoadEvents
Definition: property.h:208
@ LE_START_LOADING
Definition: property.h:210
@ LE_LOAD_COMPLETED
Definition: property.h:211
@ LE_NOOP
Definition: property.h:209
@ LE_UNLOAD
Definition: property.h:213
@ LE_ADDITIONAL_LOAD_CONTROLS
Definition: property.h:212
PropertyID
Definition: property.h:70
@ PID_RF_FILTERING_MODE_SELECT_CEMI_SERVER
Definition: property.h:157
@ PID_MAC_ADDRESS
Definition: property.h:128
@ PID_FRIENDLY_NAME
Definition: property.h:140
@ PID_DOWNLOAD_COUNTER
Definition: property.h:90
@ PID_VERSION
Definition: property.h:86
@ PID_CURRENT_DEFAULT_GATEWAY
Definition: property.h:123
@ PID_RUN_STATE_CONTROL
Definition: property.h:74
@ PID_MAIN_LCCONFIG
Definition: property.h:182
@ PID_RF_DIAG_SA_FILTER_TABLE
Definition: property.h:110
@ PID_ERROR_CODE
Definition: property.h:88
@ PID_KNXNETIP_DEVICE_STATE
Definition: property.h:133
@ PID_SECURITY_FAILURES_LOG
Definition: property.h:170
@ PID_RF_BIDIR_TIMEOUT
Definition: property.h:109
@ PID_P2P_KEY_TABLE
Definition: property.h:167
@ PID_MSG_TRANSMIT_TO_KNX
Definition: property.h:139
@ PID_DEVICE_DESCRIPTOR
Definition: property.h:101
@ PID_PROJECT_INSTALLATION_ID
KNXnet/IP Parameter Object.
Definition: property.h:115
@ PID_ADD_INFO_TYPES
Definition: property.h:149
@ PID_TABLE_REFERENCE
Definition: property.h:75
@ PID_DEVICE_ADDR
Definition: property.h:97
@ PID_GO_SECURITY_FLAGS
Definition: property.h:176
@ PID_FILTERING_MODE_SELECT
Definition: property.h:161
@ PID_ADDITIONAL_INDIVIDUAL_ADDRESSES
Definition: property.h:117
@ PID_ROLE_TABLE
Definition: property.h:177
@ PID_DEVICE_CONTROL
Definition: property.h:81
@ PID_SUB_LCGRPCONFIG
Definition: property.h:185
@ PID_RF_DOMAIN_ADDRESS
Definition: property.h:105
@ PID_MAX_APDU_LENGTH
Definition: property.h:95
@ PID_SUB_LCCONFIG
Definition: property.h:183
@ PID_CLIENT_DEVICE_ADDRESS
Definition: property.h:153
@ PID_DEFAULT_GATEWAY
Definition: property.h:126
@ PID_SUBNET_MASK
Definition: property.h:125
@ PID_SERVICE_CONTROL
Definition: property.h:76
@ PID_CURRENT_IP_ASSIGNMENT_METHOD
Definition: property.h:118
@ PID_KNXNETIP_DEVICE_CAPABILITIES
Definition: property.h:132
@ PID_FILTERING_MODE_SUPPORT
Definition: property.h:160
@ PID_SUBNET_ADDR
Definition: property.h:96
@ PID_RF_ENABLE_SBC
Definition: property.h:193
@ PID_COMM_MODES_SUPPORTED
Definition: property.h:159
@ PID_MAX_LOCAL_APDU_LENGTH
Definition: property.h:163
@ PID_IP_ADDRESS
Definition: property.h:124
@ PID_CLIENT_SNA
Definition: property.h:152
@ PID_RF_DIAG_BUDGET_TABLE
Definition: property.h:111
@ PID_OBJECT_TYPE
Interface Object Type independent Properties.
Definition: property.h:72
@ PID_HARDWARE_TYPE
Definition: property.h:99
@ PID_SERIAL_NUMBER
Definition: property.h:78
@ PID_MSG_TRANSMIT_TO_IP
Definition: property.h:138
@ PID_RF_FILTERING_MODE_SUPPORT
Definition: property.h:107
@ PID_TTL
Definition: property.h:131
@ PID_ROUTETABLE_CONTROL
Definition: property.h:186
@ PID_RF_FILTERING_MODE_SUPPORT_CEMI_SERVER
Definition: property.h:158
@ PID_CURRENT_SUBNET_MASK
Definition: property.h:122
@ PID_SECURITY_INDIVIDUAL_ADDRESS_TABLE
Definition: property.h:169
@ PID_RF_FILTERING_MODE_SELECT
Definition: property.h:108
@ PID_SECURITY_REPORT_CONTROL
Definition: property.h:173
@ PID_ORDER_INFO
Definition: property.h:82
@ PID_TOOL_SEQUENCE_NUMBER_SENDING
Definition: property.h:178
@ PID_BIBAT_NEXTBLOCK
Definition: property.h:154
@ PID_SECURITY_MODE
Security Interface Object.
Definition: property.h:166
@ PID_TOOL_KEY
Definition: property.h:171
@ PID_CUSTOM_RESERVED_TUNNELS_IP
Definition: property.h:143
@ PID_LOAD_STATE_CONTROL
Definition: property.h:73
@ PID_HOP_COUNT
Definition: property.h:190
@ PID_PRIORITY_FIFO_ENABLED
Definition: property.h:135
@ PID_DHCP_BOOTP_SERVER
Definition: property.h:127
@ PID_TRANSP_ENABLE
Definition: property.h:151
@ PID_ROUTING_COUNT
Properties in the Device Object.
Definition: property.h:93
@ PID_MEDIUM_TYPE
cEMI Server Object
Definition: property.h:146
@ PID_OBJECT_INDEX
Definition: property.h:89
@ PID_SYSTEM_SETUP_MULTICAST_ADDRESS
Definition: property.h:129
@ PID_PEI_TYPE
Definition: property.h:83
@ PID_MEDIUM
Definition: property.h:191
@ PID_CURRENT_IP_ADDRESS
Definition: property.h:121
@ PID_PROG_VERSION
Definition: property.h:80
@ PID_RF_DIAG_PROBE
Definition: property.h:112
@ PID_ZONE_KEY_TABLE
Definition: property.h:175
@ PID_IO_LIST
Definition: property.h:98
@ PID_KNX_INDIVIDUAL_ADDRESS
Definition: property.h:116
@ PID_ROUTING_BUSY_WAIT_TIME
Definition: property.h:141
@ PID_CUSTOM_RESERVED_TUNNELS_CTRL
Definition: property.h:142
@ PID_RF_MODE_SELECT
Definition: property.h:155
@ PID_PORT_CONFIGURATION
Definition: property.h:84
@ PID_COMM_MODE
Definition: property.h:147
@ PID_KNXNETIP_ROUTING_CAPABILITIES
Definition: property.h:134
@ PID_PROG_MODE
Definition: property.h:94
@ PID_MAX_APDU_LENGTH_ROUTER
Definition: property.h:188
@ PID_RF_DOMAIN_ADDRESS_CEMI_SERVER
Definition: property.h:100
@ PID_MCB_TABLE
Definition: property.h:87
@ PID_ROUTING_MULTICAST_ADDRESS
Definition: property.h:130
@ PID_MAX_INTERFACE_APDU_LENGTH
Definition: property.h:162
@ PID_RF_MODE_SUPPORT
Definition: property.h:156
@ PID_QUEUE_OVERFLOW_TO_IP
Definition: property.h:136
@ PID_MEDIUM_AVAILABILITY
Definition: property.h:148
@ PID_IP_ENABLE_SBC
Definition: property.h:194
@ PID_TIME_BASE
Definition: property.h:150
@ PID_GRP_KEY_TABLE
Definition: property.h:168
@ PID_SEQUENCE_NUMBER_SENDING
Definition: property.h:174
@ PID_TABLE
Definition: property.h:85
@ PID_MAIN_LCGRPCONFIG
Definition: property.h:184
@ PID_QUEUE_OVERFLOW_TO_KNX
Definition: property.h:137
@ PID_RF_RETRANSMITTER
Definition: property.h:106
@ PID_MANUFACTURER_ID
Definition: property.h:79
@ PID_IP_ASSIGNMENT_METHOD
Definition: property.h:119
@ PID_FILTER_TABLE_USE
Definition: property.h:192
@ PID_L2_COUPLER_TYPE
Definition: property.h:189
@ PID_IP_CAPABILITIES
Definition: property.h:120
@ PID_MEDIUM_STATUS
Router Object.
Definition: property.h:181
@ PID_COUPLER_SERVICES_CONTROL
Definition: property.h:187
@ PID_FIRMWARE_REVISION
Definition: property.h:77
@ PID_SECURITY_REPORT
Definition: property.h:172
@ PID_RF_MULTI_TYPE
Properties in the RF Medium Object.
Definition: property.h:104
ErrorCode
Definition: property.h:218
@ E_NO_FAULT
Definition: property.h:219
@ E_WATCHDOG_RESET
Definition: property.h:229
@ E_SOFTWARE_FAULT
Definition: property.h:224
@ E_INSUFFICIENT_NON_VOLATILE_MEMORY
Definition: property.h:225
@ E_CRC_ERROR
Definition: property.h:228
@ E_GOT_UNDEF_LOAD_CMD
Definition: property.h:233
@ E_HARDWARE_FAULT
Definition: property.h:223
@ E_INVALID_GO_NUMBER
Definition: property.h:236
@ E_COMMUNICATION_FAULT
Definition: property.h:221
@ E_GO_TYPE_TOO_BIG
Definition: property.h:237
@ E_CONFIGURATION_FAULT
Definition: property.h:222
@ E_INSUFFICIENT_VOLATILE_MEMORY
Definition: property.h:226
@ E_GOT_MEM_ALLOC_ZERO
Definition: property.h:227
@ E_MAX_TABLE_LENGTH_EXEEDED
Definition: property.h:232
@ E_INVALID_CONNECTION_NUMBER
Definition: property.h:235
@ E_GENERAL_PROTECTION_FAULT
Definition: property.h:231
@ E_GAT_NOT_SORTED
Definition: property.h:234
@ E_GENERAL_DEVICE_FAULT
Definition: property.h:220
@ E_INVALID_OPCODE
Definition: property.h:230
PropertyDataType
The data type of a property.
Definition: property.h:17
@ PDT_GENERIC_12
length: 12
Definition: property.h:46
@ PDT_CONTROL
length: 1 read, 10 write
Definition: property.h:18
@ PDT_GENERIC_16
length: 16
Definition: property.h:50
@ PDT_INT
length: 2
Definition: property.h:21
@ PDT_BITSET16
length: 3
Definition: property.h:60
@ PDT_ESCAPE
length: 3
Definition: property.h:66
@ PDT_GENERIC_11
length: 11
Definition: property.h:45
@ PDT_GENERIC_08
length: 8
Definition: property.h:42
@ PDT_GENERIC_13
length: 13
Definition: property.h:47
@ PDT_DATE_TIME
length: 8
Definition: property.h:33
@ PDT_GENERIC_18
length: 18
Definition: property.h:52
@ PDT_POLL_GROUP_SETTING
length: 3
Definition: property.h:31
@ PDT_BINARY_INFORMATION
length: 3
Definition: property.h:58
@ PDT_GENERIC_17
length: 17
Definition: property.h:51
@ PDT_UNSIGNED_LONG
length: 4
Definition: property.h:27
@ PDT_TIME
length: 3
Definition: property.h:25
@ PDT_DATE
length: 3
Definition: property.h:24
@ PDT_FLOAT
length: 4
Definition: property.h:28
@ PDT_KNX_FLOAT
length: 2
Definition: property.h:23
@ PDT_CHAR
length: 1
Definition: property.h:19
@ PDT_GENERIC_06
length: 6
Definition: property.h:40
@ PDT_CHAR_BLOCK
length: 10
Definition: property.h:30
@ PDT_SCALING
length: 3
Definition: property.h:62
@ PDT_GENERIC_02
length: 2
Definition: property.h:36
@ PDT_GENERIC_03
length: 3
Definition: property.h:37
@ PDT_DOUBLE
length: 8
Definition: property.h:29
@ PDT_BITSET8
length: 3
Definition: property.h:59
@ PDT_ENUM8
length: 3
Definition: property.h:61
@ PDT_GENERIC_10
length: 10
Definition: property.h:44
@ PDT_GENERIC_14
length: 14
Definition: property.h:48
@ PDT_VARIABLE_LENGTH
Definition: property.h:34
@ PDT_NE_FL
length: 3
Definition: property.h:64
@ PDT_VERSION
length: 3
Definition: property.h:56
@ PDT_FUNCTION
length: 3
Definition: property.h:65
@ PDT_SHORT_CHAR_BLOCK
length: 5
Definition: property.h:32
@ PDT_GENERIC_19
length: 19
Definition: property.h:53
@ PDT_GENERIC_04
length: 4
Definition: property.h:38
@ PDT_NE_VL
length: 3
Definition: property.h:63
@ PDT_UTF8
length: 3
Definition: property.h:55
@ PDT_GENERIC_15
length: 15
Definition: property.h:49
@ PDT_LONG
length: 4
Definition: property.h:26
@ PDT_GENERIC_20
length: 20
Definition: property.h:54
@ PDT_UNSIGNED_INT
length: 2
Definition: property.h:22
@ PDT_GENERIC_05
length: 5
Definition: property.h:39
@ PDT_UNSIGNED_CHAR
length: 1
Definition: property.h:20
@ PDT_GENERIC_09
length: 9
Definition: property.h:43
@ PDT_GENERIC_01
length: 1
Definition: property.h:35
@ PDT_ALARM_INFO
length: 3
Definition: property.h:57
@ PDT_GENERIC_07
length: 7
Definition: property.h:41
AccessLevel
The access level necessary to read a property of an interface object.
Definition: property.h:242
@ WriteLv0
Definition: property.h:247
@ ReadLv2
Definition: property.h:245
@ ReadLv0
Definition: property.h:243
@ WriteLv3
Definition: property.h:250
@ ReadLv3
Definition: property.h:246
@ WriteLv1
Definition: property.h:248
@ ReadLv1
Definition: property.h:244
@ WriteLv2
Definition: property.h:249
LoadState
Definition: property.h:198
@ LS_LOADED
Definition: property.h:200
@ LS_UNLOADING
Definition: property.h:203
@ LS_UNLOADED
Definition: property.h:199
@ LS_LOADING
Definition: property.h:201
@ LS_LOADCOMPLETING
Definition: property.h:204
@ LS_ERROR
Definition: property.h:202
PropertyID Id
Definition: property.h:255
PropertyDataType Type
Definition: property.h:257
uint16_t MaxElements
Definition: property.h:258