int main() { char error_name[40]; char error_msg[40]; long outgoing_size = 0 ; DBusConnection* connection; DBusError error; DBusMessage* msg; DBusMessage* reply = NULL; dbus_error_init(&error); connection = dbus_bus_get_private(DBUS_BUS_SESSION, &error); if(!connection) { std_log(LOG_FILENAME_LINE, "ERROR_name:%s",error.name); std_log(LOG_FILENAME_LINE, "Error_msg:%s",error.message); create_xml(1); return 1; } msg = dbus_message_new_method_call("Test.Method.Call1", "/Test/Method/Object", "test.Method.Call", "dbus_connection_get_outgoing_size0"); if(msg == NULL) { std_log(LOG_FILENAME_LINE, "Message error"); create_xml(1); return 1; } outgoing_size = dbus_connection_get_outgoing_size( connection ) ; std_log(LOG_FILENAME_LINE, "outgoing message size before sent %d",outgoing_size); dbus_connection_send(connection, msg, NULL); std_log(LOG_FILENAME_LINE, "Message sent"); outgoing_size = dbus_connection_get_outgoing_size( connection ) ; std_log(LOG_FILENAME_LINE, "outgoing message size %d",outgoing_size); create_xml(0); dbus_message_unref(msg); dbus_connection_close(connection); dbus_connection_unref(connection); dbus_shutdown(); std_log(LOG_FILENAME_LINE, "success"); return 0; }
TInt Cstif_3::stif_dbus_connection_get_outgoing_size0( CStifItemParser& aItem ) { TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); DBusConnection* connection; DBusError error; DBusMessage* msg; char error_name[40]; char error_msg[40]; dbus_error_init(&error); DBusMessage* reply = NULL; long outgoing_size = 0 ; connection = dbus_bus_get_private(DBUS_BUS_SESSION, &error); if(!connection) { sprintf(error_name, "Error_name : %s", error.name); iLog->Log(_L8(error_name)); sprintf(error_msg, "Error_msg : %s", error.message); iLog->Log(_L8(error_msg)); return 1; } msg = dbus_message_new_method_call("Test.Method.Call1", "/Test/Method/Object", "test.Method.Call", "dbus_connection_get_outgoing_size0"); if(msg == NULL) { iLog->Log(_L8("message error")); return 1; } outgoing_size = dbus_connection_get_outgoing_size( connection ) ; iLog->Log(_L8("out going message size before sent %d"),outgoing_size); dbus_connection_send(connection, msg, NULL); iLog->Log(_L8("Message sent")); outgoing_size = dbus_connection_get_outgoing_size( connection ) ; iLog->Log(_L8("out going message size %d"),outgoing_size); dbus_message_unref(msg); dbus_connection_close(connection); dbus_connection_unref(connection); dbus_shutdown(); iLog->Log( KSuccess ); return KErrNone; }
static int ldbus_connection_get_outgoing_size(lua_State *L) { DBusConnection *connection = check_DBusConnection(L, 1); lua_pushinteger(L, dbus_connection_get_outgoing_size(connection)); return 1; }