6e2810fea60660ad7c593da27a3a3824264d494b
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-adaptation / services / 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 #define BT_UUID_LENGTH_MAX 16
31 #define BT_UUID_STRING_SIZE 37
32 #define BT_NAME_LENGTH_MAX 248
33
34 static const char BT_SERVICE_BASE_UUID[] = {
35         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
36         0x80, 0x00, 0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb
37 };
38
39 #if defined(TIZEN_FEATURE_BT_OBEX) || defined(TIZEN_FEATURE_BT_PAN_NAP)
40 typedef struct {
41         int req_id;
42         int service_function;
43         char name[BT_NODE_NAME_LEN];
44         GDBusMethodInvocation *context;
45 } request_info_t;
46
47 request_info_t *_bt_get_request_info(int req_id);
48
49 int _bt_delete_request_list(int req_id);
50
51 #endif
52
53 #ifdef TIZEN_FEATURE_BT_OBEX
54
55 void _bt_init_request_id(void);
56
57 int _bt_assign_request_id(void);
58
59 void _bt_delete_request_id(int request_id);
60
61
62 void _bt_init_request_list(void);
63
64 int _bt_insert_request_list(int req_id, int service_function,
65                         char *name, GDBusMethodInvocation *context);
66
67
68 void _bt_clear_request_list(void);
69 #endif
70
71 void _bt_service_convert_uuid_type_to_string(char *str, const unsigned char *uuid);
72 void _bt_service_convert_uuid_string_to_type(unsigned char *uuid, const char *str);
73
74 char * _bt_service_convert_hex_to_string(unsigned char *hex, int len);
75
76 #ifdef __cplusplus
77 }
78 #endif /* __cplusplus */
79 #endif /*_BT_SERVICE_UTIL_H_*/
80