Remove wrong dependency in the systemd service file
[platform/core/connectivity/bluetooth-frwk.git] / include / bluetooth-ipsp-api.h
1 /*
2  * Copyright (c) 2015 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 #ifndef __BLUETOOTH_LE_IPSP_API_H
19 #define __BLUETOOTH_LE_IPSP_API_H
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25
26 #define IPSP_ADDRESS_LENGTH 6
27
28 #define IPSP_ERROR_NONE                 ((int)0)
29
30 #define IPSP_ERROR_BASE                 ((int)0)
31 #define IPSP_ERROR_ALREADY_INITIALIZED  ((int)IPSP_ERROR_BASE - 0x01)
32 #define IPSP_ERROR_NOT_INITIALIZED      ((int)IPSP_ERROR_BASE - 0x01)
33 #define IPSP_ERROR_NOT_PAIRED           ((int)IPSP_ERROR_BASE - 0x02)
34 #define IPSP_ERROR_INTERNAL             ((int)IPSP_ERROR_BASE - 0x03)
35 #define IPSP_ERROR_INVALID_PARAM                ((int)IPSP_ERROR_BASE - 0x04)
36 #define IPSP_ERROR_NOT_ENABLED          ((int)IPSP_ERROR_BASE - 0x05)
37 #define IPSP_ERROR_CONNECTION_FAILED    ((int)IPSP_ERROR_BASE - 0x06)
38 #define IPSP_ERROR_PERMISSION_DEINED    ((int)BLUETOOTH_ERROR_BASE - 0x07)
39
40 typedef struct {
41         int event;
42         int result;
43         void *param_data;
44         void *user_data;
45 } ipsp_event_param_t;
46
47 typedef void (*ipsp_cb_func_ptr)(int, ipsp_event_param_t *, void *);
48
49 typedef struct {
50         unsigned char addr[IPSP_ADDRESS_LENGTH];
51 } ipsp_device_address_t;
52
53 /**
54  * @fn int bluetooth_ipsp_init(void)
55  *
56  * @brief Initializes IPSP service and register the service to Bluez
57  *
58  * This function is a synchronous call.
59  * The IPSP Initialize request is responded by BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED event.
60  *
61  * @return  IPSP_ERROR_NONE  - Success \n
62  *              IPSP_ERROR_ALREADY_INITIALIZED - Aready Initialized \n
63  *              IPSP_ERROR_INTERNAL - Internal Error \n
64  *              IPSP_ERROR_NOT_ENABLED - Not enabled \n
65  *
66  * @exception   None
67  * @param[in]   None
68  * @remark      None
69  *
70  */
71 int bluetooth_ipsp_init(void);
72
73 /**
74  * @fn int bluetooth_ipsp_deinit(void)
75  *
76  * @brief De-Initialize IPSP service and un-register the callback
77  * The IPSP De-Initialize request is responded by BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED event.
78  *
79  * This function is a synchronous call.
80  *
81  * @return  IPSP_ERROR_NONE  - Success \n
82  *              IPSP_ERROR_NOTY_INITIALIZED - Aready Initialized \n
83  *              IPSP_ERROR_INTERNAL - Internal Error \n
84  *              IPSP_ERROR_NOT_ENABLED - Not enabled \n
85  *
86  * @remark      None
87  *
88  */
89 int bluetooth_ipsp_deinit(void);
90
91 /**
92  * @fn int bluetooth_ipsp_connect(const ipsp_device_address_t *device_address);
93  *
94  * @brief Connects to IPSP Router device. It establishes connection for 6Lowpan over LE.
95  *
96  * This function is a asynchronous call.
97  *
98  * @return       IPSP_ERROR_NONE  - Success \n
99  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
100  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth Not enabled \n
101  *
102  * @exception   None
103  * @param[in]   device_address - remote device address.
104  *
105  * @remark      None
106  * @see bluetooth_ipsp_disconnect()
107  */
108 int bluetooth_ipsp_connect(const ipsp_device_address_t *device_address);
109
110 /**
111  * @fn int bluetooth_ipsp_disconnect(const ipsp_device_address_t *device_address);
112  *
113  * @brief Disconnects to IPSP Router device. It disconnects connection for 6Lowpan over LE.
114  *
115  * This function is a asynchronous call.
116  *
117  * @return       IPSP_ERROR_NONE  - Success \n
118  *              BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
119  *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth Not enabled \n
120  *
121  * @exception   None
122  * @param[in]   device_address - remote device address.
123  *
124  * @remark      None
125  * @see bluetooth_ipsp_disconnect()
126  */
127 int bluetooth_ipsp_disconnect(const ipsp_device_address_t *device_address);
128
129
130 #ifdef __cplusplus
131 }
132 #endif
133 #endif /* __BLUETOOTH_LE_IPSP_API_H */
134