diff options
author | Goehring <Thomas.Goehring@continental-corporation.com> | 2013-03-18 11:37:39 +0100 |
---|---|---|
committer | Christian Linke <christian.linke@bmw.de> | 2013-03-18 15:50:41 +0100 |
commit | dc67e14b676265b51d896dd0e7fbd63471eb93c1 (patch) | |
tree | 638935ceb2db55a0bac385f187a949e90debad62 /AudioManagerDaemon/include/CAmControlSender.h | |
parent | bffaebb2ae000e64daf82e67d1614883d9ab1da9 (diff) | |
download | audiomanager-dc67e14b676265b51d896dd0e7fbd63471eb93c1.tar.gz |
Audiomanagerhandling of signals in excalibur release incorrect
Signed-off-by: Goehring <Thomas.Goehring@continental-corporation.com>
Diffstat (limited to 'AudioManagerDaemon/include/CAmControlSender.h')
-rw-r--r-- | AudioManagerDaemon/include/CAmControlSender.h | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/AudioManagerDaemon/include/CAmControlSender.h b/AudioManagerDaemon/include/CAmControlSender.h index 2a9c0fa..495f5d8 100644 --- a/AudioManagerDaemon/include/CAmControlSender.h +++ b/AudioManagerDaemon/include/CAmControlSender.h @@ -27,6 +27,8 @@ #endif #include "control/IAmControlSend.h" +#include "shared/CAmSocketHandler.h" +#include "unistd.h" namespace am { @@ -37,7 +39,7 @@ namespace am class CAmControlSender { public: - CAmControlSender(std::string controlPluginFile); + CAmControlSender(std::string controlPluginFile,CAmSocketHandler* sockethandler); ~CAmControlSender(); am_Error_e startupController(IAmControlReceive* controlreceiveinterface) ; void setControllerReady() ; @@ -87,12 +89,46 @@ public: void confirmCommandRundown() ; void confirmRoutingRundown() ; + void receiverCallback(const pollfd pollfd, const sh_pollHandle_t handle, void* userData); + bool checkerCallback(const sh_pollHandle_t handle, void* userData); + bool dispatcherCallback(const sh_pollHandle_t handle, void* userData); + + void setControllerRundownSafe() + { + int16_t dummy(0); + write(mPipe[1], &dummy, sizeof(dummy)); + } + + TAmShPollFired<CAmControlSender> receiverCallbackT; + TAmShPollCheck<CAmControlSender> checkerCallbackT; + TAmShPollDispatch<CAmControlSender> dispatcherCallbackT; + + //we need this here to call the rundown from the signal handler. In case everything screwed up + static void CallsetControllerRundown() + { + if (mInstance) + { + mInstance->setControllerRundown(); + } + } + + //this static callback is used from the signal handler. It is used when a normal rundown is assumed and the mainloop is used to call rundown. + static void CallsetControllerRundownSafe() + { + if (mInstance) + { + mInstance->setControllerRundownSafe(); + } + } + #ifdef UNIT_TEST friend class IAmControlBackdoor; #endif private: + int mPipe[2]; void* mlibHandle; //!< pointer to the loaded control plugin interface IAmControlSend* mController; //!< pointer to the ControlSend interface + static CAmControlSender* mInstance; }; } |