edb42b4badaeb8aaff104f275331298d5e6ee522
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-util.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_SERVICE_UTIL_H_
20 #define _BT_SERVICE_UTIL_H_
21
22 #include <sys/types.h>
23 #include <gio/gio.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 #define BT_NODE_NAME_LEN 50
30
31 typedef struct {
32         int req_id;
33         int service_function;
34         char name[BT_NODE_NAME_LEN];
35         GDBusMethodInvocation *context;
36 } request_info_t;
37
38
39 void _bt_init_request_id(void);
40
41 int _bt_assign_request_id(void);
42
43 void _bt_delete_request_id(int request_id);
44
45
46 void _bt_init_request_list(void);
47
48 int _bt_insert_request_list(int req_id, int service_function,
49                         char *name, GDBusMethodInvocation *context);
50
51 int _bt_delete_request_list(int req_id);
52
53 request_info_t *_bt_get_request_info(int req_id);
54
55 void _bt_clear_request_list(void);
56
57 #ifdef __cplusplus
58 }
59 #endif /* __cplusplus */
60 #endif /*_BT_SERVICE_UTIL_H_*/
61