2 * Open Adaptation Layer (OAL)
4 * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
6 * Contact: Atul Kumar Rai <a.rai@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.
26 #include <sys/types.h>
28 #include <oal-manager.h>
40 OAL_CHANNEL_TYPE_RELIABLE,
41 OAL_CHANNEL_TYPE_STREAMING,
46 * @brief Initialize Health Device Profile
48 * @return OAL_STATUS_SUCCESS on success, otherwise non-zero error value.
49 * @retval #OAL_STATUS_SUCCESS Successful
51 * @pre OAL API must be initialized with oal_bt_init().
55 oal_status_t hdp_init(void);
59 * @brief Cleanup Health Device Profile
61 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
62 * @retval #OAL_STATUS_SUCCESS Successful
64 * @pre HDP should be initialized with hdp_init().
68 oal_status_t hdp_cleanup(void);
71 * @brief Register HDP application
73 * @details Result will be notified through an OAL event
75 * @param[in] role: HDP application role (SOURCE/SINK)
76 * @param[in] channel_type: HDP application channel type (RELIABLE/STREAMMING/ANY)
77 * @param[in] name: Application name
78 * @param[in] data_type: Data type supported by HDP application
79 * @return Registered application app_id >= 0 on success, otherwise a negative value.
82 * @pre HDP should be initialized with hdp_init().
84 * @see OAL_EVENT_HDP_APP_REGISTERED
86 int hdp_register_application(oal_hdp_role_t role,
87 oal_channel_type_t channel_type, const char *name, int data_type);
90 * @brief Un-register HDP application
92 * @details Result will be notified through an OAL event
94 * @param[in] app_id: HDP application id to be unregistered
95 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
96 * @retval #OAL_STATUS_SUCCESS Successful
99 * @pre HDP should be initialized with hdp_init().
101 * @see OAL_EVENT_HDP_APP_UNREGISTERED
103 oal_status_t hdp_unregister_application(int app_id);
106 * @brief Connec HDP channel
108 * @details Result will be notified through an OAL event
110 * @pre HDP should be initialized with hdp_init().
112 * @param[in] app_id HDP application id for which channel to be connected
113 * @param[in] addresss Remote HDP device address
114 * @return Connected channel_id on success, otherwise a negative value.
117 * @see OAL_EVENT_HDP_CHANNEL_CONNECTED
119 int hdp_connect_channel(int app_id, bt_address_t *address);
122 * @brief Disconnect hdp channel
124 * @details Result will be notified through an OAL event
126 * @pre HDP should be initialized with hdp_init().
128 * @param[in] channel_id HDP channel id to be disconnected
129 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
130 * @retval #OAL_STATUS_SUCCESS Successful
133 * @see OAL_EVENT_HDP_CHANNEL_DESTROYED
135 oal_status_t hdp_disconnect_channel(int channel_id);
139 #endif /* __cplusplus */
140 #endif /* _OAL_HDP_H_ */