From e18331e64352b881268ca6f8db1d127113dd1519 Mon Sep 17 00:00:00 2001 From: Christian Linke Date: Mon, 1 Jul 2013 19:06:58 +0200 Subject: * added possibilty to ask for routing ready state Signed-off-by: Christian Linke --- .../include/IAmRoutingReceiverShadow.h | 2 ++ PluginRoutingInterfaceDbus/include/RoutingReceiver.xml | 5 ++++- PluginRoutingInterfaceDbus/include/RoutingSender.xml | 3 ++- .../src/IAmRoutingReceiverShadow.cpp | 16 +++++++++++++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h b/PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h index bc0cb5e..4a1d781 100644 --- a/PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h +++ b/PluginRoutingInterfaceDbus/include/IAmRoutingReceiverShadow.h @@ -82,6 +82,7 @@ public: void ackSourceNotificationConfiguration(DBusConnection *conn, DBusMessage *msg); void hookSinkNotificationDataChange(DBusConnection *conn, DBusMessage *msg); void hookSourceNotificationDataChange(DBusConnection *conn, DBusMessage *msg); + void getRoutingReadyStatus(DBusConnection* conn, DBusMessage* msg); /** * sets the pointer to the CommandReceiveInterface and registers Callback @@ -103,6 +104,7 @@ private: CAmRoutingDbusMessageHandler mDBUSMessageHandler; int16_t mNumberDomains; uint16_t mHandle; + bool mRoutingReady; /** * receives a callback whenever the path of the plugin is called diff --git a/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml b/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml index e9ac700..61073df 100644 --- a/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml +++ b/PluginRoutingInterfaceDbus/include/RoutingReceiver.xml @@ -208,7 +208,10 @@ - + + + + diff --git a/PluginRoutingInterfaceDbus/include/RoutingSender.xml b/PluginRoutingInterfaceDbus/include/RoutingSender.xml index 40ec984..133a6fe 100644 --- a/PluginRoutingInterfaceDbus/include/RoutingSender.xml +++ b/PluginRoutingInterfaceDbus/include/RoutingSender.xml @@ -70,6 +70,7 @@ - + + diff --git a/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp b/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp index 5f600be..435abf1 100644 --- a/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp +++ b/PluginRoutingInterfaceDbus/src/IAmRoutingReceiverShadow.cpp @@ -45,7 +45,8 @@ IAmRoutingReceiverShadowDbus::IAmRoutingReceiverShadowDbus(CAmRoutingSenderDbus* mFunctionMap(createMap()), // mDBUSMessageHandler(), // mNumberDomains(0), // - mHandle(0) + mHandle(0), // + mRoutingReady(false) { log(&routingDbus, DLT_LOG_INFO, "IAmRoutingReceiverShadow constructed"); } @@ -602,6 +603,16 @@ DBusHandlerResult IAmRoutingReceiverShadowDbus::receiveCallback(DBusConnection* return (reference->receiveCallbackDelegate(conn, msg)); } +void IAmRoutingReceiverShadowDbus::getRoutingReadyStatus(DBusConnection* conn, DBusMessage* msg) +{ + (void) ((conn)); + assert(mRoutingReceiveInterface != NULL); + mDBUSMessageHandler.initReply(msg); + mDBUSMessageHandler.append(mRoutingReady); + mDBUSMessageHandler.sendMessage(); +} + + void IAmRoutingReceiverShadowDbus::sendIntrospection(DBusConnection* conn, DBusMessage* msg) { assert(conn != NULL); @@ -714,11 +725,13 @@ void IAmRoutingReceiverShadowDbus::confirmRoutingRundown(DBusConnection* conn, D void IAmRoutingReceiverShadowDbus::gotReady(int16_t numberDomains, uint16_t handle) { + mRoutingReady=true; mNumberDomains=numberDomains; mHandle=handle; } void IAmRoutingReceiverShadowDbus::gotRundown(int16_t numberDomains, uint16_t handle) { + mRoutingReady=false; mNumberDomains=numberDomains; mHandle=handle; } @@ -903,6 +916,7 @@ IAmRoutingReceiverShadowDbus::functionMap_t IAmRoutingReceiverShadowDbus::create m["ackSourceNotificationConfiguration"] = &IAmRoutingReceiverShadowDbus::ackSourceNotificationConfiguration; m["hookSinkNotificationDataChange"] = &IAmRoutingReceiverShadowDbus::hookSinkNotificationDataChange; m["hookSourceNotificationDataChange"] = &IAmRoutingReceiverShadowDbus::hookSourceNotificationDataChange; + m["getRoutingReadyState"] = &IAmRoutingReceiverShadowDbus::getRoutingReadyStatus; return (m); } } -- cgit v1.2.1