32 #include <dbus/dbus.h> 41 static
char dbus_message_buffer[DBUS_MAXIMUM_MESSAGE_LENGTH];
43 static DBusHandlerResult
44 filter_func (DBusConnection *con,
53 buf = (
char**)&dbus_message_buffer;
54 if (!dbus_message_marshal(message,
58 fprintf (stderr,
"Failed to serialize DBus message!\n");
59 return DBUS_HANDLER_RESULT_HANDLED;
67 if (dbus_message_is_signal (message,
81 return DBUS_HANDLER_RESULT_HANDLED;
84 int main (
int argc,
char *argv[])
89 DBusConnection *connection;
97 fprintf(stderr,
"Failed to read command line!\n");
103 fprintf(stderr,
"Failed to read configuration file!\n");
118 dbus_error_init (&error);
122 type = (DBusBusType) atoi(options.
BusType);
127 connection = dbus_bus_get (type, &error);
136 if (
NULL == connection)
138 fprintf (stderr,
"Failed to open connection to %d: %s\n",
141 dbus_error_free (&error);
147 dbus_bus_add_match (connection,
152 if (dbus_error_is_set (&error))
156 if (!dbus_connection_add_filter (connection, filter_func,
NULL,
NULL)) {
157 fprintf (stderr,
"Couldn't add filter!\n");
161 while (dbus_connection_read_write_dispatch(connection, -1))
172 fprintf (stderr,
"Error: %s\n", error.message);
#define DLT_UNREGISTER_APP()
char * FilterMatch[DLT_DBUS_FILTER_MAX]
DLT_DECLARE_CONTEXT(dbusLog)
char * ConfigurationFileName
static char data[kDataSize]
int read_configuration_file(DltDBusConfiguration *config, char *file_name)
#define DLT_REGISTER_APP(APPID, DESCRIPTION)
#define DLT_REGISTER_CONTEXT(CONTEXT, CONTEXTID, DESCRIPTION)
#define DLT_TRACE_NETWORK_SEGMENTED(CONTEXT, TYPE, HEADERLEN, HEADER, PAYLOADLEN, PAYLOAD)
#define DLT_UNREGISTER_CONTEXT(CONTEXT)
#define DLT_REGISTER_CONTEXT_LL_TS(CONTEXT, CONTEXTID, DESCRIPTION, LOGLEVEL, TRACESTATUS)
#define DLT_LOG(CONTEXT, LOGLEVEL, ARGS...)
#define DLT_UINT(UINT_VAR)
int read_command_line(DltDBusCliOptions *options, int argc, char *argv[])
int main(int argc, char *argv[])