069a923f1c01d71d5b685ac2977ce753e3fb97a4
[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 #include <dbus/dbus-glib.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef struct {
36         int service_function;
37         DBusGProxy *proxy;
38         DBusGProxyCall *proxy_call;
39         void *cb;
40         void *user_data;
41 } bt_req_info_t;
42
43 void _bt_deinit_proxys(void);
44
45 int _bt_sync_send_request(int service_type, int service_function,
46                         GArray *in_param1, GArray *in_param2,
47                         GArray *in_param3, GArray *in_param4,
48                         GArray **out_param1);
49
50 #define _bt_send_request(a, b, format ...) ( \
51         { \
52         BT_INFO_C("Sync Request => type=%s, fn=%s(0x%x)", #a, #b, b); \
53         _bt_sync_send_request(a, b, format); \
54         } \
55         )
56
57 int _bt_async_send_request(int service_type, int service_function,
58                         GArray *in_param1, GArray *in_param2,
59                         GArray *in_param3, GArray *in_param4,
60                         void *callback, void *user_data);
61
62 #define _bt_send_request_async(a, b, format ...) ( \
63         { \
64         BT_INFO_C("Async Request => type=%s, fn=%s(0x%x)", #a, #b, b); \
65         _bt_async_send_request(a, b, format); \
66         } \
67         )
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif /* _BT_REQUEST_SENDER_H_ */