mirror of
https://github.com/thelsing/knx.git
synced 2025-02-23 00:15:35 +01:00
add class diagram, protect constuctors of *PDU
This commit is contained in:
parent
1975d8ac55
commit
cb840c2201
@ -34,8 +34,8 @@ before_install:
|
|||||||
- if [ "$MODE" = "ARDUINO" ]; then sed -i 's#compiler.warning_level=all#compiler.warning_level=default#' ~/.arduino15/preferences.txt; fi
|
- if [ "$MODE" = "ARDUINO" ]; then sed -i 's#compiler.warning_level=all#compiler.warning_level=default#' ~/.arduino15/preferences.txt; fi
|
||||||
# changes for bsec lib
|
# changes for bsec lib
|
||||||
# samd
|
# samd
|
||||||
- if [ "$MODE" = "ARDUINO" ]; then sed -ri 's#(recipe.c.combine.pattern=[^$]*\{archive_file\}")( -Wl,--end-group)#\1 {compiler.libraries.ldflags}\2#' ~/.arduino15/packages/arduino/hardware/samd/1.6.21/platform.txt; fi
|
- if [ "$MODE" = "ARDUINO" ]; then sed -ri 's#(recipe.c.combine.pattern=[^$]*\{archive_file\}")( -Wl,--end-group)#\1 {compiler.libraries.ldflags}\2#' ~/.arduino15/packages/arduino/hardware/samd/1.8.1/platform.txt; fi
|
||||||
- if [ "$MODE" = "ARDUINO" ]; then sed -i 's#compiler.elf2hex.extra_flags=#compiler.elf2hex.extra_flags=\ncompiler.libraries.ldflags=#' ~/.arduino15/packages/arduino/hardware/samd/1.6.21/platform.txt; fi
|
- if [ "$MODE" = "ARDUINO" ]; then sed -i 's#compiler.elf2hex.extra_flags=#compiler.elf2hex.extra_flags=\ncompiler.libraries.ldflags=#' ~/.arduino15/packages/arduino/hardware/samd/1.8.1/platform.txt; fi
|
||||||
# esp8266
|
# esp8266
|
||||||
- if [ "$MODE" = "ARDUINO" ]; then sed -ri 's#(recipe.c.combine.pattern=[^$]*\{compiler.c.elf.libs\})( -Wl,--end-group "-L\{build.path\}")#\1 {compiler.libraries.ldflags}\2#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/platform.txt; fi
|
- if [ "$MODE" = "ARDUINO" ]; then sed -ri 's#(recipe.c.combine.pattern=[^$]*\{compiler.c.elf.libs\})( -Wl,--end-group "-L\{build.path\}")#\1 {compiler.libraries.ldflags}\2#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/platform.txt; fi
|
||||||
- if [ "$MODE" = "ARDUINO" ]; then sed -i 's#compiler.elf2hex.extra_flags=#compiler.elf2hex.extra_flags=\ncompiler.libraries.ldflags=#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/platform.txt; fi
|
- if [ "$MODE" = "ARDUINO" ]; then sed -i 's#compiler.elf2hex.extra_flags=#compiler.elf2hex.extra_flags=\ncompiler.libraries.ldflags=#' ~/.arduino15/packages/esp8266/hardware/esp8266/2.5.2/platform.txt; fi
|
||||||
|
83
src/knx.h
83
src/knx.h
@ -1,3 +1,86 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
/** \page Classdiagramm
|
||||||
|
* This diagramm shows the most important classes.
|
||||||
|
|
||||||
|
@startuml
|
||||||
|
skinparam monochrome true
|
||||||
|
skinparam componentStyle uml2
|
||||||
|
package knx {
|
||||||
|
class BusAccessUnit [[class_bus_access_unit.html]]
|
||||||
|
class DeviceObject [[class_device_object.html]]
|
||||||
|
class BauSystemB [[class_bau_system_b.html]]
|
||||||
|
BusAccessUnit<|--BauSystemB
|
||||||
|
class ApplicationProgramObject [[class_application_program_object.html]]
|
||||||
|
BauSystemB*--ApplicationProgramObject
|
||||||
|
DeviceObject--*BauSystemB
|
||||||
|
class AddressTableObject [[class_address_table_object.html]]
|
||||||
|
BauSystemB*--AddressTableObject
|
||||||
|
class AssociationTableObject [[class_association_table_object.html]]
|
||||||
|
BauSystemB*--AssociationTableObject
|
||||||
|
class GroupObjectTableObject [[class_group_object_table_object.html]]
|
||||||
|
BauSystemB*--GroupObjectTableObject
|
||||||
|
class GroupObject [[class_group_object.html]]
|
||||||
|
GroupObject<--GroupObjectTableObject
|
||||||
|
GroupObjectTableObject<--GroupObject
|
||||||
|
class ApplicationLayer [[class_application_layer.html]]
|
||||||
|
ApplicationLayer--*BauSystemB
|
||||||
|
class TransportLayer [[class_transport_layer.html]]
|
||||||
|
TransportLayer--*BauSystemB
|
||||||
|
class NetworkLayer [[class_network_layer.html]]
|
||||||
|
NetworkLayer--*BauSystemB
|
||||||
|
class DataLinkLayer [[class_data_link_layer.html]]
|
||||||
|
DataLinkLayer--*BauSystemB
|
||||||
|
ApplicationLayer-->BusAccessUnit
|
||||||
|
ApplicationLayer-->TransportLayer
|
||||||
|
TransportLayer-->ApplicationLayer
|
||||||
|
TransportLayer-->NetworkLayer
|
||||||
|
NetworkLayer-->TransportLayer
|
||||||
|
NetworkLayer-->DataLinkLayer
|
||||||
|
DataLinkLayer-->NetworkLayer
|
||||||
|
TransportLayer-->AddressTableObject
|
||||||
|
DataLinkLayer-->AddressTableObject
|
||||||
|
DataLinkLayer-->DeviceObject
|
||||||
|
ApplicationLayer-->AssociationTableObject
|
||||||
|
class Dpt [[class_dpt.html]]
|
||||||
|
GroupObject->Dpt
|
||||||
|
package knx-ip
|
||||||
|
{
|
||||||
|
class IpDataLinkLayer [[class_ip_data_link_layer.html]]
|
||||||
|
IpDataLinkLayer--|>DataLinkLayer
|
||||||
|
class Bau57B0 [[class_bau57_b0.html]]
|
||||||
|
Bau57B0--|>BauSystemB
|
||||||
|
Bau57B0*--IpDataLinkLayer
|
||||||
|
class IpParameterObject [[class_ip_parameter_object.html]]
|
||||||
|
IpParameterObject-->DeviceObject
|
||||||
|
Bau57B0*--IpParameterObject
|
||||||
|
IpDataLinkLayer-->IpParameterObject
|
||||||
|
}
|
||||||
|
package knx-tp
|
||||||
|
{
|
||||||
|
class TpUartDataLinkLayer [[class_tp_uart_data_link_layer.html]]
|
||||||
|
TpUartDataLinkLayer--|>DataLinkLayer
|
||||||
|
class Bau07B0 [[class_bau07_b0.html]]
|
||||||
|
Bau07B0*--TpUartDataLinkLayer
|
||||||
|
Bau07B0--|>BauSystemB
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
package platfom
|
||||||
|
{
|
||||||
|
class Platform [[class_platform.html]]
|
||||||
|
class SamdPlatform [[class_samd_platform.html]]
|
||||||
|
Platform<|--SamdPlatform
|
||||||
|
class EspPlatform [[class_esp_platform.html]]
|
||||||
|
Platform<|--EspPlatform
|
||||||
|
class LinuxPlatform [[class_linux_platform.html]]
|
||||||
|
LinuxPlatform--|>Platform
|
||||||
|
}
|
||||||
|
package frontend
|
||||||
|
{
|
||||||
|
class KnxFacade [[class_knx_facade.html]]
|
||||||
|
BauSystemB<--KnxFacade
|
||||||
|
}
|
||||||
|
knx-->Platform
|
||||||
|
@enduml
|
||||||
|
*/
|
||||||
#include "knx_facade.h"
|
#include "knx_facade.h"
|
||||||
|
@ -11,14 +11,8 @@ class CemiFrame;
|
|||||||
class APDU
|
class APDU
|
||||||
{
|
{
|
||||||
friend class CemiFrame;
|
friend class CemiFrame;
|
||||||
public:
|
|
||||||
/**
|
public:
|
||||||
* The constructor.
|
|
||||||
* @param data The data of the APDU. Encoding depends on the ::ApduType. The class doesn't
|
|
||||||
* take possession of this pointer.
|
|
||||||
* @param frame The CemiFrame this APDU is part of.
|
|
||||||
*/
|
|
||||||
APDU(uint8_t* data, CemiFrame& frame);
|
|
||||||
/**
|
/**
|
||||||
* Get the type of the APDU.
|
* Get the type of the APDU.
|
||||||
*/
|
*/
|
||||||
@ -43,7 +37,17 @@ public:
|
|||||||
* Print the contents of the APDU to console.
|
* Print the contents of the APDU to console.
|
||||||
*/
|
*/
|
||||||
void printPDU();
|
void printPDU();
|
||||||
private:
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
* The constructor.
|
||||||
|
* @param data The data of the APDU. Encoding depends on the ::ApduType. The class doesn't
|
||||||
|
* take possession of this pointer.
|
||||||
|
* @param frame The CemiFrame this APDU is part of.
|
||||||
|
*/
|
||||||
|
APDU(uint8_t* data, CemiFrame& frame);
|
||||||
|
|
||||||
|
private:
|
||||||
uint8_t* _data;
|
uint8_t* _data;
|
||||||
CemiFrame& _frame;
|
CemiFrame& _frame;
|
||||||
};
|
};
|
@ -35,28 +35,28 @@ protected:
|
|||||||
uint16_t memoryAddress, uint8_t* data) override;
|
uint16_t memoryAddress, uint8_t* data) override;
|
||||||
void memoryReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t number,
|
void memoryReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t number,
|
||||||
uint16_t memoryAddress) override;
|
uint16_t memoryAddress) override;
|
||||||
void deviceDescriptorReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t descriptorType);
|
void deviceDescriptorReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t descriptorType) override;
|
||||||
void restartRequestIndication(Priority priority, HopCountType hopType, uint16_t asap);
|
void restartRequestIndication(Priority priority, HopCountType hopType, uint16_t asap) override;
|
||||||
void authorizeIndication(Priority priority, HopCountType hopType, uint16_t asap, uint32_t key);
|
void authorizeIndication(Priority priority, HopCountType hopType, uint16_t asap, uint32_t key) override;
|
||||||
void userMemoryReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t number, uint32_t memoryAddress);
|
void userMemoryReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t number, uint32_t memoryAddress) override;
|
||||||
void userMemoryWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t number,
|
void userMemoryWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t number,
|
||||||
uint32_t memoryAddress, uint8_t* memoryData);
|
uint32_t memoryAddress, uint8_t* memoryData) override;
|
||||||
void propertyDescriptionReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t objectIndex,
|
void propertyDescriptionReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t objectIndex,
|
||||||
uint8_t propertyId, uint8_t propertyIndex);
|
uint8_t propertyId, uint8_t propertyIndex) override;
|
||||||
void propertyValueWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t objectIndex,
|
void propertyValueWriteIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t objectIndex,
|
||||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length);
|
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex, uint8_t* data, uint8_t length) override;
|
||||||
void propertyValueReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t objectIndex,
|
void propertyValueReadIndication(Priority priority, HopCountType hopType, uint16_t asap, uint8_t objectIndex,
|
||||||
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex);
|
uint8_t propertyId, uint8_t numberOfElements, uint16_t startIndex) override;
|
||||||
void individualAddressReadIndication(HopCountType hopType);
|
void individualAddressReadIndication(HopCountType hopType) override;
|
||||||
void individualAddressWriteIndication(HopCountType hopType, uint16_t newaddress);
|
void individualAddressWriteIndication(HopCountType hopType, uint16_t newaddress) override;
|
||||||
void groupValueWriteLocalConfirm(AckType ack, uint16_t asap, Priority priority, HopCountType hopType,
|
void groupValueWriteLocalConfirm(AckType ack, uint16_t asap, Priority priority, HopCountType hopType,
|
||||||
uint8_t* data, uint8_t dataLength, bool status);
|
uint8_t* data, uint8_t dataLength, bool status) override;
|
||||||
void groupValueReadLocalConfirm(AckType ack, uint16_t asap, Priority priority, HopCountType hopType, bool status);
|
void groupValueReadLocalConfirm(AckType ack, uint16_t asap, Priority priority, HopCountType hopType, bool status) override;
|
||||||
void groupValueReadIndication(uint16_t asap, Priority priority, HopCountType hopType);
|
void groupValueReadIndication(uint16_t asap, Priority priority, HopCountType hopType) override;
|
||||||
void groupValueReadAppLayerConfirm(uint16_t asap, Priority priority, HopCountType hopType,
|
void groupValueReadAppLayerConfirm(uint16_t asap, Priority priority, HopCountType hopType,
|
||||||
uint8_t* data, uint8_t dataLength);
|
uint8_t* data, uint8_t dataLength) override;
|
||||||
void groupValueWriteIndication(uint16_t asap, Priority priority, HopCountType hopType,
|
void groupValueWriteIndication(uint16_t asap, Priority priority, HopCountType hopType,
|
||||||
uint8_t* data, uint8_t dataLength);
|
uint8_t* data, uint8_t dataLength) override;
|
||||||
|
|
||||||
|
|
||||||
virtual InterfaceObject* getInterfaceObject(uint8_t idx) = 0;
|
virtual InterfaceObject* getInterfaceObject(uint8_t idx) = 0;
|
||||||
|
@ -83,7 +83,7 @@ public:
|
|||||||
ComFlag commFlag();
|
ComFlag commFlag();
|
||||||
/**
|
/**
|
||||||
* Set the current state of the group object. Application code should only use this to set the state to ::Ok after
|
* Set the current state of the group object. Application code should only use this to set the state to ::Ok after
|
||||||
* reading a ::Update to mark the changed group object as processed. This is optional.
|
* reading a ::Updated to mark the changed group object as processed. This is optional.
|
||||||
*/
|
*/
|
||||||
void commFlag(ComFlag value);
|
void commFlag(ComFlag value);
|
||||||
|
|
||||||
|
@ -8,9 +8,8 @@ class TPDU;
|
|||||||
class NPDU
|
class NPDU
|
||||||
{
|
{
|
||||||
friend class CemiFrame;
|
friend class CemiFrame;
|
||||||
public:
|
|
||||||
NPDU(uint8_t* data, CemiFrame& frame);
|
|
||||||
|
|
||||||
|
public:
|
||||||
uint8_t octetCount() const;
|
uint8_t octetCount() const;
|
||||||
void octetCount(uint8_t value);
|
void octetCount(uint8_t value);
|
||||||
uint8_t length() const;
|
uint8_t length() const;
|
||||||
@ -18,7 +17,11 @@ public:
|
|||||||
void hopCount(uint8_t value);
|
void hopCount(uint8_t value);
|
||||||
CemiFrame& frame();
|
CemiFrame& frame();
|
||||||
TPDU& tpdu();
|
TPDU& tpdu();
|
||||||
private:
|
|
||||||
|
protected:
|
||||||
|
NPDU(uint8_t* data, CemiFrame& frame);
|
||||||
|
|
||||||
|
private:
|
||||||
uint8_t* _data;
|
uint8_t* _data;
|
||||||
CemiFrame& _frame;
|
CemiFrame& _frame;
|
||||||
};
|
};
|
@ -8,8 +8,8 @@ class APDU;
|
|||||||
class TPDU
|
class TPDU
|
||||||
{
|
{
|
||||||
friend class CemiFrame;
|
friend class CemiFrame;
|
||||||
public:
|
|
||||||
TPDU(uint8_t* data, CemiFrame& frame);
|
public:
|
||||||
TpduType type() const;
|
TpduType type() const;
|
||||||
void type(TpduType type);
|
void type(TpduType type);
|
||||||
|
|
||||||
@ -26,7 +26,11 @@ public:
|
|||||||
|
|
||||||
CemiFrame& frame();
|
CemiFrame& frame();
|
||||||
void printPDU();
|
void printPDU();
|
||||||
private:
|
|
||||||
|
protected:
|
||||||
|
TPDU(uint8_t* data, CemiFrame& frame);
|
||||||
|
|
||||||
|
private:
|
||||||
uint8_t* _data;
|
uint8_t* _data;
|
||||||
CemiFrame& _frame;
|
CemiFrame& _frame;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user