Add session module for ASP 2.0
[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 #define SERVICE_DBUS_ERROR_NAME "net.asp.service.Error.Failed"
23 #define SESSION_DBUS_ERROR_NAME "net.asp.session.Error.Failed"
24
25 #define DEBUG_PARAMS(parameters) \
26         do {\
27                 gchar *parameters_debug_str = NULL;\
28                 if (parameters)\
29                         parameters_debug_str = g_variant_print((GVariant *)parameters, TRUE);\
30                 ASP_LOGD("signal params [%s]", parameters_debug_str ? parameters_debug_str : "NULL");\
31                 g_free(parameters_debug_str);\
32         } while (0)
33
34 void asp_manager_gdbus_init(gpointer asp_manager);
35 void asp_manager_gdbus_deinit(gpointer asp_manager);
36 void asp_manager_gdbus_notify_advertise_status(guint32 adv_id, guint8 status, gint32 reason);
37
38 void asp_manager_gdbus_notify_search_result(guint32 search_id,
39                                                                                 const gchar *service_mac,
40                                                                                 const gchar *service_device_name,
41                                                                                 guint32 adv_id,
42                                                                                 const gchar *instance_name,
43                                                                                 GHashTable *service_info_map,
44                                                                                 guint8 service_status);
45
46 void asp_manager_gdbus_notify_session_request(gint32 error_code,
47                 gchar *session_mac, guint32 session_id, guint32 adv_id,
48                 gchar *device_name, guint8 *session_info,
49                 gboolean get_pin, gchar *pin);
50
51 void asp_manager_gdbus_notify_session_config_request(guint32 sessoin_id,
52                 gboolean get_pin, gchar *pin);
53
54 void asp_manager_gdbus_notify_connect_status(gchar *session_mac,
55                 guint32 session_id, gint32 status, gchar *deferred);
56
57 void asp_manager_gdbus_notify_session_status(gchar *session_mac,
58                 guint32 session_id, gint32 state, gint32 status, const gchar *info);
59
60 void asp_manager_gdbus_notify_port_status(gchar *session_mac,
61                 guint32 session_id, const gchar *ip, gint32 port, gint32 protocol,
62                 gint32 status);
63
64 #endif /* __ASP_MANAGER_GDBUS_H__ */