diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp index 535113fd..a4e30448 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.cpp +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.cpp @@ -684,6 +684,11 @@ void DeviceHandlerBase::doGetWrite() { void DeviceHandlerBase::doSendRead() { ReturnValue_t result; + result = doSendReadHook(); + if (result != RETURN_OK){ + return; + } + size_t replyLen = 0; if(cookieInfo.pendingCommand != deviceCommandMap.end()) { replyLen = getNextReplyLength(cookieInfo.pendingCommand->first); @@ -950,6 +955,10 @@ void DeviceHandlerBase::commandSwitch(ReturnValue_t onOff) { } } +ReturnValue_t DeviceHandlerBase::doSendReadHook() { + return RETURN_OK; +} + ReturnValue_t DeviceHandlerBase::getSwitches(const uint8_t **switches, uint8_t *numberOfSwitches) { return DeviceHandlerBase::NO_SWITCH; diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.h b/src/fsfw/devicehandlers/DeviceHandlerBase.h index 4bc54ac4..1de70ad5 100644 --- a/src/fsfw/devicehandlers/DeviceHandlerBase.h +++ b/src/fsfw/devicehandlers/DeviceHandlerBase.h @@ -1094,6 +1094,12 @@ protected: */ void commandSwitch(ReturnValue_t onOff); + /** + * @brief This function can be used to insert device specific code during the do-send-read + * step. + */ + virtual ReturnValue_t doSendReadHook(); + private: /**