2 * Open Adaptation Layer (OAL)
4 * Copyright (c) 2014-2015 Samsung Electronics Co., Ltd.
6 * Contact: Anupam Roy <anupam.r@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 _OAL_HID_HOST_H_
23 #define _OAL_HID_HOST_H_
26 #include <sys/types.h>
28 #include <oal-manager.h>
34 #define OAL_SMART_RC_FEATURE_REPORT_ID 0x03
37 * @brief HID Vendor specific report callback
39 typedef void (*hid_report_callback)(bt_address_t *address, uint8_t* rpt_data, int rpt_size);
42 * @brief Enable HID Host Feature
44 * @remarks HID mouse/keyboard/RC will be able to connect.
46 * @return OAL_STATUS_SUCCESS on success, otherwise non-zero error value.
47 * @retval #OAL_STATUS_SUCCESS Successful
49 * @pre OAL API must be initialized with oal_bt_init().
53 oal_status_t hid_enable(void);
57 * @brief Disable HID Host Feature
59 * @remarks HID mouse/keyboard/RC will not be able to connect.
61 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
62 * @retval #OAL_STATUS_SUCCESS Successful
64 * @pre HID host should be enabled with hid_enable().
68 oal_status_t hid_disable(void);
71 * @brief Initiate connection with an HID device
73 * @details Result will be notified through an OAL event
75 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
76 * @retval #OAL_STATUS_SUCCESS Successful
78 * @pre HID host should be enabled with hid_enable().
80 * @see OAL_EVENT_HID_CONNECTED
82 oal_status_t hid_connect(bt_address_t *address);
85 * @brief Remove a connection with an HID device
87 * @details Result will be notified through an OAL event
89 * @return OAL_STATUS_SUCCESS on success, otherwise a non-zero error value.
90 * @retval #OAL_STATUS_SUCCESS Successful
92 * @pre HID host should be connected with a device.
94 * @see OAL_EVENT_HID_DISCONNECTED
96 oal_status_t hid_disconnect(bt_address_t * address);
100 #endif /* __cplusplus */
101 #endif /* _OAL_HID_HOST_H_ */