knx
ETS configurable knx-stack
rf_medium_object.cpp
Go to the documentation of this file.
1 #include "config.h"
2 #ifdef USE_RF
3 
4 #include <cstring>
5 #include "rf_medium_object.h"
6 #include "bits.h"
7 #include "data_property.h"
8 #include "function_property.h"
9 
11 {
12  uint8_t rfDomainAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; // see KNX RF S-Mode AN160 p.11
13  Property* properties[] =
14  {
16  new DataProperty(PID_RF_MULTI_TYPE, true, PDT_GENERIC_01, 1, ReadLv3 | WriteLv2, (uint8_t)0x00),
17  new DataProperty(PID_RF_RETRANSMITTER, false, PDT_GENERIC_01, 1, ReadLv3 | WriteLv0, (uint8_t)0x00),
20  [](RfMediumObject * io, uint8_t* data, uint8_t length, uint8_t* resultData, uint8_t& resultLength)
21  {
22  resultData[0] = 0x00; // success
23  resultData[1] = 0xFF; // permanent bidirectional device
24  resultData[2] = 0xFF; // permanent bidirectional device
25  resultLength = 3;
26  },
27  [](RfMediumObject * io, uint8_t* data, uint8_t length, uint8_t* resultData, uint8_t& resultLength)
28  {
29  resultData[0] = 0x00; // success
30  resultData[1] = 0xFF; // permanent bidirectional device
31  resultData[2] = 0xFF; // permanent bidirectional device
32  resultLength = 3;
33  }),
34  /* These properties are used in NMP_LinkBudget_Measure to diagnose the Link Budget of the communication.
35  This in not implemented yet.
36  new DataProperty(PID_RF_DIAG_SA_FILTER_TABLE, true, PDT_GENERIC_03, 8, ReadLv3 | WriteLv3),
37  new DataProperty(PID_RF_DIAG_BUDGET_TABLE, false, PDT_GENERIC_03, 8, ReadLv3 | WriteLv0),
38  new FunctionProperty<RfMediumObject>(this, PID_RF_DIAG_PROBE,
39  [](RfMediumObject* io, uint8_t* data, uint8_t length, uint8_t* resultData, uint8_t& resultLength)
40  {
41  },
42  [](RfMediumObject* io, uint8_t* data, uint8_t length, uint8_t* resultData, uint8_t& resultLength)
43  {
44  }), */
45  };
46  initializeProperties(sizeof(properties), properties);
47 }
48 
50 {
52  return prop->data();
53 }
54 
55 void RfMediumObject::rfDomainAddress(const uint8_t* value)
56 {
58  prop->write(value);
59 }
60 #endif
const uint8_t * data()
virtual void initializeProperties(size_t propertiesSize, Property **properties)
Intializes the Property-array the the supplied values.
Property * property(PropertyID id)
Gets property with PropertyID id if it exists and nullptr otherwise.
virtual uint8_t write(uint16_t start, uint8_t count, const uint8_t *data)=0
const uint8_t * rfDomainAddress()
@ OT_RF_MEDIUM
RF Medium Object.
@ PID_RF_BIDIR_TIMEOUT
Definition: property.h:109
@ PID_RF_DOMAIN_ADDRESS
Definition: property.h:105
@ PID_OBJECT_TYPE
Interface Object Type independent Properties.
Definition: property.h:72
@ PID_RF_RETRANSMITTER
Definition: property.h:106
@ PID_RF_MULTI_TYPE
Properties in the RF Medium Object.
Definition: property.h:104
@ PDT_GENERIC_06
length: 6
Definition: property.h:40
@ PDT_UNSIGNED_INT
length: 2
Definition: property.h:22
@ PDT_GENERIC_01
length: 1
Definition: property.h:35
@ WriteLv0
Definition: property.h:247
@ ReadLv3
Definition: property.h:246
@ WriteLv2
Definition: property.h:249