removed ifdef and fixed missing references

This commit is contained in:
thewhobox 2023-03-18 16:55:32 +01:00
parent a8cc3cf5b4
commit 434f619b63
4 changed files with 19 additions and 19 deletions

View File

@ -347,3 +347,21 @@ BeforeRestartCallback BusAccessUnit::beforeRestartCallback()
{
return 0;
}
void BusAccessUnit::functionPropertyCallback(FunctionPropertyCallback func)
{
}
FunctionPropertyCallback BusAccessUnit::functionPropertyCallback()
{
return 0;
}
void BusAccessUnit::functionPropertyStateCallback(FunctionPropertyCallback func)
{
}
FunctionPropertyCallback BusAccessUnit::functionPropertyStateCallback()
{
return 0;
}

View File

@ -4,9 +4,7 @@
#include "interface_object.h"
typedef void (*BeforeRestartCallback)(void);
#ifdef USE_FUNCTIONPROPERTYCALLBACK
typedef void (*FunctionPropertyCallback)(uint8_t objectIndex, uint8_t propertyId, uint8_t length, uint8_t *data, uint8_t *resultData, uint8_t &resultLength);
#endif
class BusAccessUnit
{
@ -168,10 +166,8 @@ class BusAccessUnit
uint8_t* data, uint32_t length);
virtual void beforeRestartCallback(BeforeRestartCallback func);
virtual BeforeRestartCallback beforeRestartCallback();
#ifdef USE_FUNCTIONPROPERTYCALLBACK
virtual void functionPropertyCallback(FunctionPropertyCallback func);
virtual FunctionPropertyCallback functionPropertyCallback();
virtual void functionPropertyStateCallback(FunctionPropertyCallback func);
virtual FunctionPropertyCallback functionPropertyStateCallback();
#endif
};

View File

@ -312,14 +312,10 @@ void BauSystemB::functionPropertyCommandIndication(Priority priority, HopCountTy
}
else
{
#ifdef USE_FUNCTIONPROPERTYCALLBACK
if(_functionProperty != 0)
_functionProperty(objectIndex, propertyId, length, data, resultData, resultLength);
else
resultLength = 0;
#else
resultLength = 0; // We must not send a return code or any data fields
#endif
}
}
@ -341,14 +337,10 @@ void BauSystemB::functionPropertyStateIndication(Priority priority, HopCountType
}
else
{
#ifdef USE_FUNCTIONPROPERTYCALLBACK
if(_functionPropertyState != 0)
_functionPropertyState(objectIndex, propertyId, length, data, resultData, resultLength);
else
resultLength = 0;
#else
resultLength = 0; // We must not send a return code or any data fields
#endif
}
}
@ -653,7 +645,6 @@ BeforeRestartCallback BauSystemB::beforeRestartCallback()
return _beforeRestart;
}
#ifdef USE_FUNCTIONPROPERTYCALLBACK
void BauSystemB::functionPropertyCallback(FunctionPropertyCallback func)
{
_functionProperty = func;
@ -672,4 +663,3 @@ FunctionPropertyCallback BauSystemB::functionPropertyStateCallback()
{
return _functionPropertyState;
}
#endif

View File

@ -43,12 +43,10 @@ class BauSystemB : protected BusAccessUnit
VersionCheckCallback versionCheckCallback();
void beforeRestartCallback(BeforeRestartCallback func);
BeforeRestartCallback beforeRestartCallback();
#ifdef USE_FUNCTIONPROPERTYCALLBACK
void functionPropertyCallback(FunctionPropertyCallback func);
FunctionPropertyCallback functionPropertyCallback();
void functionPropertyStateCallback(FunctionPropertyCallback func);
FunctionPropertyCallback functionPropertyStateCallback();
#endif
protected:
virtual ApplicationLayer& applicationLayer() = 0;
@ -119,8 +117,6 @@ class BauSystemB : protected BusAccessUnit
SecurityControl _restartSecurity;
uint32_t _restartDelay = 0;
BeforeRestartCallback _beforeRestart = 0;
#ifdef USE_FUNCTIONPROPERTYCALLBACK
FunctionPropertyCallback _functionProperty = 0;
FunctionPropertyCallback _functionPropertyState = 0;
#endif
};