7 Teleservice Application Framework
User Manual
148/374
dbus_connection_flush(mt_dbus_util.pt_dbus_conn);
dbus_bus_add_match(mt_dbus_util.pt_dbus_conn, "type='signal',interface='stw.taf.ysmsd'",
NULL);
dbus_connection_flush(mt_dbus_util.pt_dbus_conn);
dbus_bus_add_match(mt_dbus_util.pt_dbus_conn,
"type='signal',interface='stw.taf.ynetworkd", NULL);
dbus_connection_flush(mt_dbus_util.pt_dbus_conn);
// Install the callback functions
dbus_initialize_request_callbacks (&mv_SMS_Callback, &mv_Hello_Callback,
&mv_NetworkNotification_Callback, &mv_Goodbye_Callback,
&mv_NRTI_Callback, &mv_WhoIsThere_Callback,
&mv_UserDBusMessage);
...
}
Example: UserMessageCallback
The example below shows how the UserMessageCallback is used by the ysignal daemon.
.
int main(int osn_argc, char** oppcn_argv)
{
...
// Initialize the global D-BUS structure T_DBUS_Util
(void)sprintf(mt_dbus_util.acn_myNameString , MY_DBUS_NAME);
(void)sprintf(mt_dbus_util.acn_myVersion , PROG_VERSION);
(void)sprintf(mt_dbus_util.acn_myStatus , "unknown");
(void)sprintf(mt_dbus_util.acn_myAddInfo , MY_DBUS_ADDINFO);
// Register with DBUS
if(dbus_get_on_the_bus(&mt_dbus_util) != 0)
{
(void)utils_log_print("Register ysignald on DBUS failed");
return(0);
}
// Add rules for which messages we want to see on the DBUS
dbus_bus_add_match (mt_dbus_util.pt_dbus_conn,
"type='signal',interface='stw.taf.ysignald'", NULL);
dbus_connection_flush (mt_dbus_util.pt_dbus_conn);
// Install the callback functions Hello_Callback, Goodbye_Callback, and
UserMessage_Callback
dbus_initialize_request_callbacks (NULL, &mv_Hello_Callback, NULL,
&mv_Goodbye_Callback, NULL, NULL,
&mv_UserMessage_Callback);
...
while(true)
{
...
// process D-BUS requests
s32_retval = dbus_process_requests(&mt_dbus_util);
if(s32_retval != C_NO_ERR)
{
(void)printf("dbus_process_request went wrong!\n");
mv_Exit();
}
...
}
}
.
.
static void mv_UserMessage_Callback(DBusMessage * const opt_msg)
{
Summary of Contents for TC1
Page 1: ...TC1 User Manual Version of this document V1 00r0 ...
Page 25: ...5 Hardware User Manual 25 374 5 2 2 Block Diagram Variant TC1 WIFI ...
Page 34: ...5 Hardware User Manual 34 374 5 6 Housing Connector Top view and side view Bottom View ...
Page 125: ...7 Teleservice Application Framework User Manual 125 374 TAF overview ...
Page 190: ...7 Teleservice Application Framework User Manual 190 374 How the logger mechanism works ...