Fix #191 by initializing the platform pointer in all KnxFacade constructors (#198)

* Fix #191 by initializing the platform pointer in all KnxFacade constructors

* Revert "Fix #191 by initializing the platform pointer in all KnxFacade constructors"

This reverts commit adc05cfaf7.

* 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-19 09:51:36 +02:00 committed by GitHub
parent 01979174e3
commit 29702f69c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

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

View File

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

View File

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