2 * Network Configuration Module
4 * Copyright (c) 2015 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 * This file declares wifi direct dbus utility functions.
23 * @file wifi-direct-dbus.h
24 * @author Nishant Chaprana (n.chaprana@samsung.com)
28 #ifndef __WIFI_DIRECT_DBUS_H__
29 #define __WIFI_DIRECT_DBUS_H__
37 #define WFD_MANAGER_SERVICE "net.wifidirect"
38 #define WFD_MANAGER_PATH "/net/wifidirect"
39 #define WFD_MANAGER_MANAGE_INTERFACE WFD_MANAGER_SERVICE
40 #define WFD_MANAGER_GROUP_INTERFACE WFD_MANAGER_SERVICE ".group"
41 #define WFD_MANAGER_CONFIG_INTERFACE WFD_MANAGER_SERVICE ".config"
42 #define WFD_MANAGER_SERVICE_INTERFACE WFD_MANAGER_SERVICE ".service"
43 #define WFD_MANAGER_DISPLAY_INTERFACE WFD_MANAGER_SERVICE ".display"
44 #define DBUS_SERVICE "org.freedesktop.DBus"
45 #define DBUS_INTERFACE "org.freedesktop.DBus"
46 #define DBUS_PATH "/org/freedesktop/DBus"
47 #define WFD_MANAGER_ASP_INTERFACE WFD_MANAGER_SERVICE ".asp"
49 #define WFD_MANAGER_DBUS_REPLY_TIMEOUT 10 * 1000
50 #define WFD_MANAGER_DBUS_REPLY_TIMEOUT_SYNC 10 * 1000
51 #define DBUS_OBJECT_PATH_MAX 150
53 #define DBUS_DEBUG_VARIANT(parameters) \
55 gchar *parameters_debug_str = NULL;\
57 parameters_debug_str = g_variant_print(parameters, TRUE);\
58 WDS_LOGD("signal params [%s]", parameters_debug_str ? parameters_debug_str : "NULL");\
59 g_free(parameters_debug_str);\
62 gboolean wfd_manager_dbus_init(void);
64 void wfd_manager_dbus_deinit(void);
66 gboolean wfd_manager_dbus_iface_unregister(guint reg_id);
68 gboolean wfd_manager_dbus_emit_signal(const gchar *interface_name,
69 const gchar *signal_name,
70 GVariant *parameters);
71 void wfd_manager_dbus_return_err(int ret, GDBusMethodInvocation *invocation);
72 void wfd_manager_dbus_reply_error_none(GDBusMethodInvocation *invocation);
73 void wfd_manager_dbus_reply_params(GDBusMethodInvocation *invocation, GVariant *parameters);
74 GVariant* wfd_manager_dbus_pack_ay(const unsigned char *src, int size);
75 void wfd_manager_dbus_unregister_nameowner_signal(void);
76 void wfd_manager_dbus_unregister(void);
82 #endif /* __WIFI_DIRECT_DBUS_H__ */