diff --git a/src/knx/address_table_object.h b/src/knx/address_table_object.h index 138c580..b610036 100644 --- a/src/knx/address_table_object.h +++ b/src/knx/address_table_object.h @@ -20,7 +20,6 @@ class AddressTableObject : public TableObject AddressTableObject(Memory& memory); void readProperty(PropertyID id, uint16_t start, uint8_t& count, uint8_t* data) override; uint8_t* restore(uint8_t* buffer) override; - ObjectType objectType() override { return OT_ADDR_TABLE; } /** * returns the number of group addresses of the object. diff --git a/src/knx/application_program_object.h b/src/knx/application_program_object.h index 444e55d..463f55e 100644 --- a/src/knx/application_program_object.h +++ b/src/knx/application_program_object.h @@ -9,7 +9,6 @@ class ApplicationProgramObject : public TableObject void readProperty(PropertyID id, uint16_t start, uint8_t& count, uint8_t* data) override; void writeProperty(PropertyID id, uint16_t start, uint8_t* data, uint8_t& count) override; uint8_t propertySize(PropertyID id) override; - ObjectType objectType() override { return OT_APPLICATION_PROG; } uint8_t* data(uint32_t addr); uint8_t getByte(uint32_t addr); uint16_t getWord(uint32_t addr); diff --git a/src/knx/association_table_object.h b/src/knx/association_table_object.h index b13750f..43a6e75 100644 --- a/src/knx/association_table_object.h +++ b/src/knx/association_table_object.h @@ -7,7 +7,6 @@ class AssociationTableObject : public TableObject public: AssociationTableObject(Memory& memory); void readProperty(PropertyID id, uint16_t start, uint8_t& count, uint8_t* data) override; - ObjectType objectType() override { return OT_ASSOC_TABLE; } uint8_t* restore(uint8_t* buffer) override; diff --git a/src/knx/bau07B0.cpp b/src/knx/bau07B0.cpp index 0c2a877..c7e613e 100644 --- a/src/knx/bau07B0.cpp +++ b/src/knx/bau07B0.cpp @@ -22,9 +22,7 @@ Bau07B0::Bau07B0(Platform& platform) #endif // Set Mask Version in Device Object depending on the BAU - uint16_t maskVersion; - popWord(maskVersion, _descriptor); - _deviceObj.maskVersion(maskVersion); + _deviceObj.maskVersion(0x07B0); // Set which interface objects are available in the device object // This differs from BAU to BAU with different medium types. @@ -84,11 +82,6 @@ InterfaceObject* Bau07B0::getInterfaceObject(ObjectType objectType, uint8_t obje } } -uint8_t* Bau07B0::descriptor() -{ - return _descriptor; -} - DataLinkLayer& Bau07B0::dataLinkLayer() { return _dlLayer; diff --git a/src/knx/bau07B0.h b/src/knx/bau07B0.h index d5099e1..17230bc 100644 --- a/src/knx/bau07B0.h +++ b/src/knx/bau07B0.h @@ -17,7 +17,6 @@ class Bau07B0 : public BauSystemB protected: InterfaceObject* getInterfaceObject(uint8_t idx); InterfaceObject* getInterfaceObject(ObjectType objectType, uint8_t objectInstance); - uint8_t* descriptor(); DataLinkLayer& dataLinkLayer(); private: @@ -25,10 +24,7 @@ class Bau07B0 : public BauSystemB #ifdef USE_CEMI_SERVER CemiServer _cemiServer; CemiServerObject _cemiServerObject; -#endif - uint8_t _descriptor[2] = {0x07, 0xb0}; -#ifdef USE_CEMI_SERVER const uint32_t _ifObjs[7] = { 6, // length OT_DEVICE, OT_ADDR_TABLE, OT_ASSOC_TABLE, OT_GRP_OBJ_TABLE, OT_APPLICATION_PROG, OT_CEMI_SERVER}; #else diff --git a/src/knx/bau27B0.cpp b/src/knx/bau27B0.cpp index 4f2d753..3366c2e 100644 --- a/src/knx/bau27B0.cpp +++ b/src/knx/bau27B0.cpp @@ -1,6 +1,5 @@ -#if MEDIUM_TYPE == 2 - #include "bau27B0.h" +#ifdef USE_RF #include "bits.h" #include #include @@ -23,9 +22,7 @@ Bau27B0::Bau27B0(Platform& platform) #endif // Set Mask Version in Device Object depending on the BAU - uint16_t maskVersion; - popWord(maskVersion, _descriptor); - _deviceObj.maskVersion(maskVersion); + _deviceObj.maskVersion(0x27B0); // Set the maximum APDU length // ETS will consider this value while programming the device @@ -97,11 +94,6 @@ InterfaceObject* Bau27B0::getInterfaceObject(ObjectType objectType, uint8_t obje } } -uint8_t* Bau27B0::descriptor() -{ - return _descriptor; -} - DataLinkLayer& Bau27B0::dataLinkLayer() { return _dlLayer; diff --git a/src/knx/bau27B0.h b/src/knx/bau27B0.h index d76d329..16824eb 100644 --- a/src/knx/bau27B0.h +++ b/src/knx/bau27B0.h @@ -18,7 +18,6 @@ class Bau27B0 : public BauSystemB protected: InterfaceObject* getInterfaceObject(uint8_t idx); InterfaceObject* getInterfaceObject(ObjectType objectType, uint8_t objectInstance); - uint8_t* descriptor(); DataLinkLayer& dataLinkLayer(); private: @@ -27,10 +26,6 @@ class Bau27B0 : public BauSystemB #ifdef USE_CEMI_SERVER CemiServer _cemiServer; CemiServerObject _cemiServerObject; -#endif - - uint8_t _descriptor[2] = {0x27, 0xB0}; -#ifdef USE_CEMI_SERVER const uint32_t _ifObjs[8] = { 7, // length OT_DEVICE, OT_ADDR_TABLE, OT_ASSOC_TABLE, OT_GRP_OBJ_TABLE, OT_APPLICATION_PROG, OT_RF_MEDIUM, OT_CEMI_SERVER}; #else diff --git a/src/knx/bau57B0.cpp b/src/knx/bau57B0.cpp index 1165e53..65bd06e 100644 --- a/src/knx/bau57B0.cpp +++ b/src/knx/bau57B0.cpp @@ -26,9 +26,7 @@ Bau57B0::Bau57B0(Platform& platform) _memory.addSaveRestore(&_ipParameters); // Set Mask Version in Device Object depending on the BAU - uint16_t maskVersion; - popWord(maskVersion, _descriptor); - _deviceObj.maskVersion(maskVersion); + _deviceObj.maskVersion(0x57B0); // Set which interface objects are available in the device object // This differs from BAU to BAU with different medium types. @@ -84,11 +82,6 @@ InterfaceObject* Bau57B0::getInterfaceObject(ObjectType objectType, uint8_t obje } } -uint8_t* Bau57B0::descriptor() -{ - return _descriptor; -} - DataLinkLayer& Bau57B0::dataLinkLayer() { return _dlLayer; diff --git a/src/knx/bau57B0.h b/src/knx/bau57B0.h index 635ccbc..300b185 100644 --- a/src/knx/bau57B0.h +++ b/src/knx/bau57B0.h @@ -15,7 +15,6 @@ class Bau57B0 : public BauSystemB protected: InterfaceObject* getInterfaceObject(uint8_t idx); InterfaceObject* getInterfaceObject(ObjectType objectType, uint8_t objectInstance); - uint8_t* descriptor(); DataLinkLayer& dataLinkLayer(); private: @@ -24,9 +23,12 @@ class Bau57B0 : public BauSystemB #ifdef USE_CEMI_SERVER CemiServer _cemiServer; CemiServerObject _cemiServerObject; + + const uint32_t _ifObjs[8] = { 8, // length + OT_DEVICE, OT_ADDR_TABLE, OT_ASSOC_TABLE, OT_GRP_OBJ_TABLE, OT_APPLICATION_PROG, OT_IP_PARAMETER, OT_CEMI_SERVER}; +#else + const uint32_t _ifObjs[7] = {7, // length + OT_DEVICE, OT_ADDR_TABLE, OT_ASSOC_TABLE, OT_GRP_OBJ_TABLE, OT_APPLICATION_PROG, OT_IP_PARAMETER}; #endif - uint8_t _descriptor[2] = {0x57, 0xb0}; - const uint32_t _ifObjs[7] = { 6, // length - OT_DEVICE, OT_ADDR_TABLE, OT_ASSOC_TABLE, OT_GRP_OBJ_TABLE, OT_APPLICATION_PROG, OT_IP_PARAMETER}; }; #endif \ No newline at end of file diff --git a/src/knx/bau_systemB.cpp b/src/knx/bau_systemB.cpp index 321529d..7cfc22e 100644 --- a/src/knx/bau_systemB.cpp +++ b/src/knx/bau_systemB.cpp @@ -142,8 +142,10 @@ void BauSystemB::deviceDescriptorReadIndication(Priority priority, HopCountType { if (descriptorType != 0) descriptorType = 0x3f; - - _appLayer.deviceDescriptorReadResponse(AckRequested, priority, hopType, asap, descriptorType, descriptor()); + + uint8_t data[2]; + pushWord(_deviceObj.maskVersion(), data); + _appLayer.deviceDescriptorReadResponse(AckRequested, priority, hopType, asap, descriptorType, data); } void BauSystemB::memoryWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t number, diff --git a/src/knx/bau_systemB.h b/src/knx/bau_systemB.h index 50d51cc..b651150 100644 --- a/src/knx/bau_systemB.h +++ b/src/knx/bau_systemB.h @@ -40,7 +40,6 @@ class BauSystemB : protected BusAccessUnit protected: virtual DataLinkLayer& dataLinkLayer() = 0; - virtual uint8_t* descriptor() = 0; void memoryWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t number, uint16_t memoryAddress, uint8_t* data) override; void memoryReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t number, diff --git a/src/knx/cemi_server_object.h b/src/knx/cemi_server_object.h index d0dc764..82a5e21 100644 --- a/src/knx/cemi_server_object.h +++ b/src/knx/cemi_server_object.h @@ -13,7 +13,6 @@ public: uint8_t propertySize(PropertyID id) override; uint8_t* save(uint8_t* buffer) override; uint8_t* restore(uint8_t* buffer) override; - ObjectType objectType() override { return OT_CEMI_SERVER; } protected: uint8_t propertyDescriptionCount() override; diff --git a/src/knx/device_object.h b/src/knx/device_object.h index b3aecc1..c80f047 100644 --- a/src/knx/device_object.h +++ b/src/knx/device_object.h @@ -14,7 +14,6 @@ public: uint8_t* restore(uint8_t* buffer) override; uint16_t saveSize() override; void readPropertyDescription(uint8_t propertyId, uint8_t& propertyIndex, bool& writeEnable, uint8_t& type, uint16_t& numberOfElements, uint8_t& access); - ObjectType objectType() override { return OT_DEVICE; } uint16_t induvidualAddress(); void induvidualAddress(uint16_t value); diff --git a/src/knx/group_object_table_object.h b/src/knx/group_object_table_object.h index 6155bd4..127dba7 100644 --- a/src/knx/group_object_table_object.h +++ b/src/knx/group_object_table_object.h @@ -11,7 +11,6 @@ class GroupObjectTableObject : public TableObject GroupObjectTableObject(Memory& memory); virtual ~GroupObjectTableObject(); void readProperty(PropertyID id, uint16_t start, uint8_t& count, uint8_t* data) override; - ObjectType objectType() override { return OT_GRP_OBJ_TABLE; } uint16_t entryCount(); GroupObject& get(uint16_t asap); GroupObject& nextUpdatedObject(bool& valid); diff --git a/src/knx/interface_object.h b/src/knx/interface_object.h index f3f2507..40a28e7 100644 --- a/src/knx/interface_object.h +++ b/src/knx/interface_object.h @@ -119,12 +119,6 @@ class InterfaceObject : public SaveRestore // TODO: remove first version after complete property refactoring void readPropertyDescription(uint8_t& propertyId, uint8_t& propertyIndex, bool& writeEnable, uint8_t& type, uint16_t& numberOfElements, uint8_t& access); void readPropertyDescription2(uint8_t& propertyId, uint8_t& propertyIndex, bool& writeEnable, uint8_t& type, uint16_t& numberOfElements, uint8_t& access); - /** - * Gets object type. - * - * @returns object type - */ - virtual ObjectType objectType() = 0; /** * Gets property with PropertyID id if it exists and nullptr otherwise. diff --git a/src/knx/ip_parameter_object.h b/src/knx/ip_parameter_object.h index 7cd53ab..17f527a 100644 --- a/src/knx/ip_parameter_object.h +++ b/src/knx/ip_parameter_object.h @@ -10,12 +10,6 @@ class IpParameterObject : public InterfaceObject { public: IpParameterObject(DeviceObject& deviceObject, Platform& platform); - - ObjectType objectType() override - { - return OT_IP_PARAMETER; - } - uint32_t multicastAddress() const; uint8_t ttl() const; diff --git a/src/knx/rf_medium_object.h b/src/knx/rf_medium_object.h index 6611862..a2a22e9 100644 --- a/src/knx/rf_medium_object.h +++ b/src/knx/rf_medium_object.h @@ -13,7 +13,6 @@ public: uint8_t* save(uint8_t* buffer) override; uint8_t* restore(uint8_t* buffer) override; uint16_t saveSize() override; - ObjectType objectType() override { return OT_RF_MEDIUM; } uint8_t* rfDomainAddress(); void rfDomainAddress(uint8_t* value);