7 Teleservice Application Framework
User Manual 133/374
7.3.3 D-Bus Utils
Header file: "dbus-utils.h"
What is D-Bus?
D-Bus is a message bus system that provides a simple way for applications to talk to one another. In addition to
interprocess communication, D-Bus helps coordinate the process life cycle. It makes it simple and reliable to
code a "single instance" application or daemon, and to launch applications and daemons on demand.
[freedesktop.org]
7.3.3.1 Introduction
The TAF library provides useful D-Bus functionality to use TAF functionality at runtime. Almost every TAF
function uses the structure T_DBUS_Util.
Input and output parameters of the structure T_DBUS_Util:
typedef struct
{
DBusConnection* pt_dbus_conn; // D-BUS connection instance
charn acn_myNameString[128]; // Name of the application, Don't use any
special
// characters, white spaces or new lines!
charn acn_myVersion[128]; // Additional value (for HELLO) signal (opt.)
charn acn_myStatus[128]; // Additional value (for HELLO) signal (opt.)
charn acn_myAddInfo[512]; // Additional value (for HELLO) signal (opt.)
sint32 s32_myTriginterval; // Time interval when the ysysd
// expects to be triggered
charn acn_myCMDOnWatchdog[2048]; // Bash cmd that must be executed
// by the ysysd in case no
// trigger signal occurred in time.
} T_DBUS_Util;
7.3.3.2 Initialize the D-Bus
How to initialize the D-Bus:
Before the D-Bus can be used it must be initialized.
Example on how to initialize the D-Bus
/* -- Module Global Variables --------------------------------------------- */
T_DBUS_Util mt_DBUS_util;
/* -- Implementation ------------------------------------------------------ */
int main(int argc, char** argv)
{
sint32 s32_Retval;
/* Basic initialization */
// Application information
sprintf(mt_DBUS_util.acn_myNameString, "TAF example");
sprintf(mt_DBUS_util.acn_myVersion, "vX.XXrX");