Alternative fix for #191 by initializing the platform pointer in KnxFacade(&bau) from the platform stored in bau

This commit is contained in:
Simon Billemont 2022-04-18 08:37:33 +02:00
parent 5d09670cf2
commit 4cad4de390
3 changed files with 7 additions and 0 deletions

View File

@ -31,6 +31,11 @@ void BauSystemB::writeMemory()
_memory.writeMemory();
}
Platform& BauSystemB::platform()
{
return _platform;
}
ApplicationProgramObject& BauSystemB::parameters()
{
return _appProgram;

View File

@ -21,6 +21,7 @@ class BauSystemB : protected BusAccessUnit
virtual bool enabled() = 0;
virtual void enabled(bool value) = 0;
Platform& platform();
ApplicationProgramObject& parameters();
DeviceObject& deviceObject();

View File

@ -73,6 +73,7 @@ template <class P, class B> class KnxFacade : private SaveRestore
KnxFacade(B& bau) : _bau(bau)
{
_platformPtr = static_cast<P*>(&bau.platform());
manufacturerId(0xfa);
bauNumber(platform().uniqueSerialNumber());
_bau.addSaveRestore(this);