2 * Network Configuration Module
4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include <tzplatform_config.h>
27 #include "wifi-dump.h"
29 #define NETWORK_DUMP_SCRIPT tzplatform_mkpath(TZ_SYS_VAR, "/lib/net-config/network_dump.sh")
31 static int _start_dump(gchar *dump_path)
34 gchar *path = NETWORK_DUMP_SCRIPT;
35 char *const args[] = { path, dump_path, NULL };
36 char *const envs[] = { NULL };
38 rv = netconfig_execute_file(path, args, envs);
40 ERR("Fail to execute network_dump.sh");
47 static void _send_dump_signal(const gchar *sig_name)
50 GDBusConnection *connection = NULL;
53 connection = netdbus_get_connection();
54 if (connection == NULL) {
55 DBG("GDBusconnection is NULL");
59 reply = g_dbus_connection_emit_signal(connection,
61 DUMP_SERVICE_OBJECT_PATH,
62 DUMP_SERVICE_INTERFACE,
68 ERR("Failed to send signal [%s]", error->message);
75 int netconfig_dump_log(const char *path)
77 gchar *dump_path = NULL;
80 ERR("path is NULL. Dump Fail");
83 ERR("Dump is started");
84 _send_dump_signal(DUMP_START_SIGNAL);
86 dump_path = g_strdup(path);
87 _start_dump(dump_path);
90 _send_dump_signal(DUMP_FINISH_SIGNAL);
91 ERR("Dump is finished");