2 * Open Adaptation Layer (OAL)
4 * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _OAL_DEVICE_MGR_H_
21 #define _OAL_DEVICE_MGR_H_
24 #include <sys/types.h>
26 #include <oal-manager.h>
33 * @brief Connection type
35 * @see device_create_bond
39 CONN_TYPE_DEFAULT = 0xFF, /* represents that connection type can both BR/EDR and LE */
40 CONN_TYPE_BREDR = 0x00,
45 * @brief Request remote device attributes
47 * @details Attibutes such as name, vidpid, bond state etc are requested. remote_device_t is provided
48 * with OAL_EVENT_DEVICE_PROPERTIES
50 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
51 * @retval #OAL_STATUS_SUCCESS Successful
53 * @pre Adapter must be enabled with adapter_enable() followed by OAL_EVENT_ADAPTER_ENABLED
55 * @see OAL_EVENT_DEVICE_PROPERTIES
56 * @see remote_device_t
58 oal_status_t device_query_attributes(bt_address_t * addr);
61 * @brief Set alias for remote device
63 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
64 * @retval #OAL_STATUS_SUCCESS Successful
66 * @pre Adapter must be enabled with adapter_enable() followed by OAL_EVENT_ADAPTER_ENABLED
68 * @see remote_device_t
70 oal_status_t device_set_alias(bt_address_t * addr, char * alias);
74 * @brief Initiate bonding with remote device
76 * @details Based on IO capabilties of 2 devices, different events can be generated
78 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
79 * @retval #OAL_STATUS_SUCCESS Successful
81 * @pre Adapter must be enabled with adapter_enable() followed by OAL_EVENT_ADAPTER_ENABLED
83 * @see OAL_EVENT_DEVICE_PIN_REQUEST
84 * @see OAL_EVENT_DEVICE_PASSKEY_ENTRY_REQUEST
85 * @see OAL_EVENT_DEVICE_PASSKEY_CONFIRMATION_REQUEST
86 * @see OAL_EVENT_DEVICE_PASSKEY_DISPLAY
87 * @see OAL_EVENT_DEVICE_SSP_CONSENT_REQUEST
88 * @see OAL_EVENT_DEVICE_BONDING_SUCCESS
89 * @see OAL_EVENT_DEVICE_BONDING_FAILED
91 oal_status_t device_create_bond(bt_address_t * addr, connection_type_e transport);
94 * @brief Cancel already in-progress bonding procedure
96 * @details Based on current progress different events can be recieved.
98 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
99 * @retval #OAL_STATUS_SUCCESS Successful
101 * @pre Bonding must be in progress by calling device_create_bond()
103 * @see OAL_EVENT_DEVICE_BONDING_SUCCESS
104 * @see OAL_EVENT_DEVICE_BONDING_FAILED
105 * @see OAL_EVENT_DEVICE_BONDING_REMOVED
107 oal_status_t device_stop_bond(bt_address_t * addr);
111 * @brief Remove the already created Bond with remote device
113 * @details Based on current progress different events can be recieved.
115 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
116 * @retval #OAL_STATUS_SUCCESS Successful
118 * @pre Bond should exist
120 * @see OAL_EVENT_DEVICE_BONDING_REMOVED
122 oal_status_t device_destroy_bond(bt_address_t * addr);
125 #endif /* __cplusplus */
126 #endif /*_OAL_DEVICE_MGR_H_*/