Merge the code from tizen_2.4
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / include / bt-request-sender.h
1 /*
2  * Bluetooth-frwk
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:  Hocheol Seo <hocheol.seo@samsung.com>
7  *               Girishashok Joshi <girish.joshi@samsung.com>
8  *               Chanyeol Park <chanyeol.park@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *              http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24 #ifndef _BT_REQUEST_SENDER_H_
25 #define _BT_REQUEST_SENDER_H_
26
27 #include <sys/types.h>
28 #include <glib.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 typedef struct {
35         int service_function;
36         GDBusProxy *proxy;
37         void *cb;
38         void *user_data;
39 } bt_req_info_t;
40
41 void _bt_gdbus_deinit_proxys(void);
42
43 int _bt_sync_send_request(int service_type, int service_function,
44                         GArray *in_param1, GArray *in_param2,
45                         GArray *in_param3, GArray *in_param4,
46                         GArray **out_param1);
47
48 #define _bt_send_request(a, b, format ...) ( \
49         { \
50         BT_INFO_C("Sync Request => type=%s, fn=%s(0x%x)", #a, #b, b); \
51         _bt_sync_send_request(a, b, format); \
52         } \
53         )
54
55 int _bt_async_send_request(int service_type, int service_function,
56                         GArray *in_param1, GArray *in_param2,
57                         GArray *in_param3, GArray *in_param4,
58                         void *callback, void *user_data);
59
60 #define _bt_send_request_async(a, b, format ...) ( \
61         { \
62         BT_INFO_C("Async Request => type=%s, fn=%s(0x%x)", #a, #b, b); \
63         _bt_async_send_request(a, b, format); \
64         } \
65         )
66
67 #ifdef __cplusplus
68 }
69 #endif
70
71 #endif /* _BT_REQUEST_SENDER_H_ */