21 #ifndef DBUSWRAPPER_H_ 22 #define DBUSWRAPPER_H_ 24 #include <dbus/dbus.h> 28 #include "audiomanagerconfig.h" 41 const std::string& prefix = DBUS_SERVICE_PREFIX,
const std::string& objectPath = DBUS_SERVICE_OBJECT_PATH);
44 void registerCallback(
const DBusObjectPathVTable* vtable,
const std::string& path,
void* userdata,
const std::string& prefix = DBUS_SERVICE_OBJECT_PATH);
45 void registerSignalWatch(DBusHandleMessageFunction handler,
const std::string& rule,
void* userdata);
48 static dbus_bool_t
addWatch(DBusWatch *watch,
void *userData);
49 static void removeWatch(DBusWatch *watch,
void *userData);
50 static void toogleWatch(DBusWatch *watch,
void *userData);
52 static dbus_bool_t
addTimeout(DBusTimeout *timeout,
void* userData);
53 static void removeTimeout(DBusTimeout *timeout,
void* userData);
54 static void toggleTimeout(DBusTimeout *timeout,
void* userData);
73 static DBusHandlerResult cbRootIntrospection(DBusConnection *conn, DBusMessage *msg,
void *reference);
74 dbus_bool_t addWatchDelegate(DBusWatch * watch,
void* userData);
75 void removeWatchDelegate(DBusWatch *watch,
void *userData);
76 void toogleWatchDelegate(DBusWatch *watch,
void *userData);
77 dbus_bool_t addTimeoutDelegate(DBusTimeout *timeout,
void* userData);
78 void removeTimeoutDelegate(DBusTimeout *timeout,
void* userData);
79 void toggleTimeoutDelegate(DBusTimeout *timeout,
void* userData);
80 DBusObjectPathVTable mObjectPathVTable;
81 DBusConnection* mpDbusConnection;
83 std::vector<std::string> mListNodes;
84 std::vector<sh_timerHandle_t*> mpListTimerhandles;
86 std::map<DBusWatch*, sh_pollHandle_t> mMapHandleWatch;
87 DBusBusType mDbusType;
void registerCallback(const DBusObjectPathVTable *vtable, const std::string &path, void *userdata, const std::string &prefix=DBUS_SERVICE_OBJECT_PATH)
registers a callback that is entered as path below the main path.
A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects...
TAmShTimerCallBack< CAmDbusWrapper > pDbusTimerCallback
bool dbusDispatchCallback(const sh_pollHandle_t handle, void *userData)
void dbusTimerCallback(sh_timerHandle_t handle, void *userData)
make private, not public template for a callback
TAmShPollFired< CAmDbusWrapper > pDbusFireCallback
The am::CAmSocketHandler implements a mainloop for the AudioManager.
static void toggleTimeout(DBusTimeout *timeout, void *userData)
TAmShPollPrepare< CAmDbusWrapper > pDbusPrepareCallback
uint16_t sh_pollHandle_t
this is a handle for a filedescriptor to be used with the SocketHandler
static void toogleWatch(DBusWatch *watch, void *userData)
CAmDbusWrapper(CAmSocketHandler *socketHandler, DBusBusType type=DBUS_BUS_SESSION, const std::string &prefix=DBUS_SERVICE_PREFIX, const std::string &objectPath=DBUS_SERVICE_OBJECT_PATH)
void registerSignalWatch(DBusHandleMessageFunction handler, const std::string &rule, void *userdata)
register signal watch callback to matching rule
TAmShPollDispatch< CAmDbusWrapper > pDbusDispatchCallback
SPDX license identifier: MPL-2.0.
bool dbusCheckCallback(const sh_pollHandle_t handle, void *userData)
virtual ~CAmDbusWrapper()
static void removeWatch(DBusWatch *watch, void *userData)
This wraps dbus and provides everything needed to anyone who wants to use dbus (including plugins)...
static dbus_bool_t addTimeout(DBusTimeout *timeout, void *userData)
static dbus_bool_t addWatch(DBusWatch *watch, void *userData)
void dbusFireCallback(const pollfd pollfd, const sh_pollHandle_t handle, void *userData)
static void removeTimeout(DBusTimeout *timeout, void *userData)
void getDBusConnection(DBusConnection *&connection) const
returns the dbus connection
TAmShPollCheck< CAmDbusWrapper > pDbusCheckCallback
void dbusPrepareCallback(const sh_pollHandle_t handle, void *userData)
sh_pollHandle_t sh_timerHandle_t
this is a handle for a timer to be used with the SocketHandler
template to create the functor for a class