4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Paras Kumar <paras.kumar@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __BLUETOOTH_LE_IPSP_API_H
23 #define __BLUETOOTH_LE_IPSP_API_H
30 #define IPSP_ADDRESS_LENGTH 6
32 #define IPSP_ERROR_NONE ((int)0)
34 #define IPSP_ERROR_BASE ((int)0)
35 #define IPSP_ERROR_ALREADY_INITIALIZED ((int)IPSP_ERROR_BASE - 0x01)
36 #define IPSP_ERROR_NOT_INITIALIZED ((int)IPSP_ERROR_BASE - 0x01)
37 #define IPSP_ERROR_NOT_PAIRED ((int)IPSP_ERROR_BASE - 0x02)
38 #define IPSP_ERROR_INTERNAL ((int)IPSP_ERROR_BASE - 0x03)
39 #define IPSP_ERROR_INVALID_PARAM ((int)IPSP_ERROR_BASE - 0x04)
40 #define IPSP_ERROR_NOT_ENABLED ((int)IPSP_ERROR_BASE - 0x05)
41 #define IPSP_ERROR_CONNECTION_FAILED ((int)IPSP_ERROR_BASE - 0x06)
42 #define IPSP_ERROR_PERMISSION_DEINED ((int)BLUETOOTH_ERROR_BASE - 0x07)
51 typedef void (*ipsp_cb_func_ptr)(int, ipsp_event_param_t *, void *);
54 unsigned char addr[IPSP_ADDRESS_LENGTH];
55 } ipsp_device_address_t;
58 * @fn int bluetooth_le_ipsp_init(void)
60 * @brief Initializes IPSP service and register the service to Bluez
62 * This function is a synchronous call.
63 * The IPSP Initialize request is responded by BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED event.
65 * @return IPSP_ERROR_NONE - Success \n
66 * IPSP_ERROR_ALREADY_INITIALIZED - Aready Initialized \n
67 * IPSP_ERROR_INTERNAL - Internal Error \n
68 * IPSP_ERROR_NOT_ENABLED - Not enabled \n
75 int bluetooth_le_ipsp_init(void);
78 * @fn int bluetooth_le_ipsp_deinit(void)
80 * @brief De-Initialize IPSP service and un-register the callback
81 * The IPSP De-Initialize request is responded by BLUETOOTH_EVENT_IPSP_INIT_STATE_CHANGED event.
83 * This function is a synchronous call.
85 * @return IPSP_ERROR_NONE - Success \n
86 * IPSP_ERROR_NOTY_INITIALIZED - Aready Initialized \n
87 * IPSP_ERROR_INTERNAL - Internal Error \n
88 * IPSP_ERROR_NOT_ENABLED - Not enabled \n
93 int bluetooth_le_ipsp_deinit(void);
96 * @fn int bluetooth_le_ipsp_connect(const ipsp_device_address_t *device_address);
98 * @brief Connects to IPSP Router device. It establishes connection for 6Lowpan over LE.
100 * This function is a asynchronous call.
102 * @return IPSP_ERROR_NONE - Success \n
103 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
104 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth Not enabled \n
107 * @param[in] device_address - remote device address.
110 * @see bluetooth_le_ipsp_disconnect()
112 int bluetooth_le_ipsp_connect(const ipsp_device_address_t *device_address);
115 * @fn int bluetooth_le_ipsp_disconnect(const ipsp_device_address_t *device_address);
117 * @brief Disconnects to IPSP Router device. It disconnects connection for 6Lowpan over LE.
119 * This function is a asynchronous call.
121 * @return IPSP_ERROR_NONE - Success \n
122 * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n
123 * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Bluetooth Not enabled \n
126 * @param[in] device_address - remote device address.
129 * @see bluetooth_le_ipsp_disconnect()
131 int bluetooth_le_ipsp_disconnect(const ipsp_device_address_t *device_address);
137 #endif /* __BLUETOOTH_LE_IPSP_API_H */