Add the sender name in signal subscribe function
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / services / include / bt-request-handler.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
18
19 #ifndef _BT_REQUEST_HANDLER_H_
20 #define _BT_REQUEST_HANDLER_H_
21
22 #include <sys/types.h>
23 #include <glib.h>
24 #include <glib-object.h>
25
26 #include "bt-internal-types.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #define BT_SERVICE_NAME "org.projectx.bt"
33 #define BT_SERVICE_PATH "/org/projectx/bt_service"
34
35 /* Invocation information structure for API's
36 +   expecting replies from bluetooth service */
37 typedef struct {
38         char * sender;
39         int service_function;
40         GDBusMethodInvocation *context;
41         int result;
42         gpointer user_data;
43 } invocation_info_t;
44
45 GSList *_bt_get_invocation_list(void);
46
47 void _bt_save_invocation_context(GDBusMethodInvocation *invocation, int result,
48                 char *sender, int service_function,
49                 gpointer invocation_data);
50
51 void _bt_free_info_from_invocation_list(invocation_info_t *req_info);
52
53 void _bt_service_unref_connection(void);
54
55 int _bt_service_register(void);
56
57 void _bt_service_unregister(void);
58
59 int _bt_service_cynara_init(void);
60
61 void _bt_service_cynara_deinit(void);
62
63 void _bt_service_method_return(GDBusMethodInvocation *invocation,
64                 GArray *out_param, int result);
65
66 void _bt_service_method_return_with_unix_fd_list(GDBusMethodInvocation *invocation,
67                 GArray *out_param, int result, GUnixFDList *fd_list);
68
69 gboolean _is_name_acquired(void);
70
71 #ifdef __cplusplus
72 }
73 #endif /* __cplusplus */
74 #endif /*_BT_REQUEST_HANDLER_H_*/
75