Revise directory structure
[platform/core/connectivity/asp-manager.git] / include / asp-manager-gdbus.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __ASP_MANAGER_GDBUS_H__
18 #define __ASP_MANAGER_GDBUS_H__
19
20 #include "asp-manager.h"
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #define SERVICE_DBUS_ERROR_NAME "net.asp.service.Error.Failed"
27 #define SESSION_DBUS_ERROR_NAME "net.asp.session.Error.Failed"
28
29 #define DEBUG_PARAMS(parameters) \
30         do {\
31                 gchar *parameters_debug_str = NULL;\
32                 if (parameters)\
33                         parameters_debug_str = g_variant_print((GVariant *)parameters, TRUE);\
34                 ASP_LOGD("signal params [%s]", parameters_debug_str ? parameters_debug_str : "NULL");\
35                 g_free(parameters_debug_str);\
36         } while (0)
37
38 void asp_manager_gdbus_init(gpointer asp_manager);
39 void asp_manager_gdbus_deinit(gpointer asp_manager);
40 void asp_manager_gdbus_notify_advertise_status(guint32 adv_id, guint8 status, gint32 reason);
41
42 void asp_manager_gdbus_notify_search_result(guint32 search_id,
43                                                                                 const gchar *service_mac,
44                                                                                 const gchar *service_device_name,
45                                                                                 guint32 adv_id,
46                                                                                 const gchar *instance_name,
47                                                                                 GHashTable *service_info_map,
48                                                                                 guint8 service_status);
49
50 void asp_manager_gdbus_notify_session_request(gint32 error_code,
51                 gchar *session_mac, guint32 session_id, guint32 adv_id,
52                 gchar *device_name, gchar *session_info,
53                 gboolean get_pin, gchar *pin);
54
55 void asp_manager_gdbus_notify_session_config_request(gchar * session_mac,
56                 guint32 sessoin_id, gboolean get_pin, gchar *pin);
57
58 void asp_manager_gdbus_notify_connect_status(gchar *session_mac,
59                 guint32 session_id, gint32 status, gchar *deferred);
60
61 void asp_manager_gdbus_notify_session_status(gchar *session_mac,
62                 guint32 session_id, gint32 state, gint32 status, const gchar *info);
63
64 void asp_manager_gdbus_notify_port_status(gchar *session_mac,
65                 guint32 session_id, const gchar *ip, gint32 port, gint32 protocol,
66                 gint32 status);
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif /* __ASP_MANAGER_GDBUS_H__ */