mirror of
https://github.com/thelsing/knx.git
synced 2025-08-13 13:46:20 +02:00
Add cEMI server support for medium TP
This commit is contained in:
parent
90f157d2f9
commit
371f58a5a6
@ -8,8 +8,16 @@ using namespace std;
|
||||
Bau07B0::Bau07B0(Platform& platform)
|
||||
: BauSystemB(platform),
|
||||
_dlLayer(_deviceObj, _addrTable, _netLayer, _platform)
|
||||
#ifdef USE_CEMI_SERVER
|
||||
, _cemiServer(*this)
|
||||
#endif
|
||||
{
|
||||
_netLayer.dataLinkLayer(_dlLayer);
|
||||
#ifdef USE_CEMI_SERVER
|
||||
_cemiServer.dataLinkLayer(_dlLayer);
|
||||
_dlLayer.cemiServer(_cemiServer);
|
||||
_memory.addSaveRestore(&_cemiServerObject);
|
||||
#endif
|
||||
|
||||
// Set Mask Version in Device Object depending on the BAU
|
||||
uint16_t maskVersion;
|
||||
@ -38,6 +46,37 @@ InterfaceObject* Bau07B0::getInterfaceObject(uint8_t idx)
|
||||
return &_appProgram;
|
||||
case 5: // would be app_program 2
|
||||
return nullptr;
|
||||
#ifdef USE_CEMI_SERVER
|
||||
case 6:
|
||||
return &_cemiServerObject;
|
||||
#endif
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
InterfaceObject* Bau07B0::getInterfaceObject(ObjectType objectType, uint8_t objectInstance)
|
||||
{
|
||||
// We do not use it right now.
|
||||
// Required for coupler mode as there are multiple router objects for example
|
||||
(void) objectInstance;
|
||||
|
||||
switch (objectType)
|
||||
{
|
||||
case OT_DEVICE:
|
||||
return &_deviceObj;
|
||||
case OT_ADDR_TABLE:
|
||||
return &_addrTable;
|
||||
case OT_ASSOC_TABLE:
|
||||
return &_assocTable;
|
||||
case OT_GRP_OBJ_TABLE:
|
||||
return &_groupObjTable;
|
||||
case OT_APPLICATION_PROG:
|
||||
return &_appProgram;
|
||||
#ifdef USE_CEMI_SERVER
|
||||
case OT_CEMI_SERVER:
|
||||
return &_cemiServerObject;
|
||||
#endif
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
@ -52,3 +91,11 @@ DataLinkLayer& Bau07B0::dataLinkLayer()
|
||||
{
|
||||
return _dlLayer;
|
||||
}
|
||||
|
||||
void Bau07B0::loop()
|
||||
{
|
||||
::BauSystemB::loop();
|
||||
#ifdef USE_CEMI_SERVER
|
||||
_cemiServer.loop();
|
||||
#endif
|
||||
}
|
@ -2,20 +2,34 @@
|
||||
|
||||
#include "bau_systemB.h"
|
||||
#include "tpuart_data_link_layer.h"
|
||||
#include "cemi_server.h"
|
||||
#include "cemi_server_object.h"
|
||||
|
||||
class Bau07B0 : public BauSystemB
|
||||
{
|
||||
public:
|
||||
Bau07B0(Platform& platform);
|
||||
|
||||
void loop();
|
||||
|
||||
protected:
|
||||
InterfaceObject* getInterfaceObject(uint8_t idx);
|
||||
InterfaceObject* getInterfaceObject(ObjectType objectType, uint8_t objectInstance);
|
||||
uint8_t* descriptor();
|
||||
DataLinkLayer& dataLinkLayer();
|
||||
|
||||
private:
|
||||
TpUartDataLinkLayer _dlLayer;
|
||||
#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
|
||||
const uint32_t _ifObjs[6] = { 5, // length
|
||||
OT_DEVICE, OT_ADDR_TABLE, OT_ASSOC_TABLE, OT_GRP_OBJ_TABLE, OT_APPLICATION_PROG};
|
||||
#endif
|
||||
};
|
Loading…
Reference in New Issue
Block a user