diff options
Diffstat (limited to 'btif/include')
| -rw-r--r-- | btif/include/bluetoothTrack.h | 42 | ||||
| -rw-r--r-- | btif/include/btif_api.h | 11 | ||||
| -rw-r--r-- | btif/include/btif_av.h | 81 | ||||
| -rw-r--r-- | btif/include/btif_gatt_multi_adv_util.h | 2 | ||||
| -rw-r--r-- | btif/include/btif_gatt_util.h | 2 | ||||
| -rw-r--r-- | btif/include/btif_hd.h | 50 | ||||
| -rw-r--r-- | btif/include/btif_hh.h | 11 | ||||
| -rw-r--r-- | btif/include/btif_media.h | 22 | ||||
| -rw-r--r-- | btif/include/btif_sm.h | 4 | ||||
| -rw-r--r-- | btif/include/btif_sock_rfc.h | 4 | ||||
| -rw-r--r-- | btif/include/btif_sock_sdp.h | 4 | ||||
| -rw-r--r-- | btif/include/btif_storage.h | 60 | ||||
| -rw-r--r-- | btif/include/btif_util.h | 3 |
13 files changed, 290 insertions, 6 deletions
diff --git a/btif/include/bluetoothTrack.h b/btif/include/bluetoothTrack.h new file mode 100644 index 000000000..d18b18354 --- /dev/null +++ b/btif/include/bluetoothTrack.h @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2013, The Linux Foundation. All rights reserved. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of The Linux Foundation nor +* the names of its contributors may be used to endorse or promote +* products derived from this software without specific prior written +* permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#if defined (__cplusplus) || (cplusplus) +extern "C" { +#endif + +int btCreateTrack(int trackFreq, int channelType); +void btDeleteTrack(); +void btStopTrack(); +void btStartTrack(); +void btPauseTrack(); +int btWriteData(void *audioBuffer, int bufferlen); + +#if defined (__cplusplus) || (cplusplus) +} +#endif diff --git a/btif/include/btif_api.h b/btif/include/btif_api.h index 6bb1d3978..fc1b67afe 100644 --- a/btif/include/btif_api.h +++ b/btif/include/btif_api.h @@ -366,6 +366,17 @@ bt_status_t btif_dut_mode_send(uint16_t opcode, uint8_t *buf, uint8_t len); /******************************************************************************* ** +** Function btif_hci_cmd_send +** +** Description Sends a HCI Raw command to the controller +** +** Returns BT_STATUS_SUCCESS on success +** +*******************************************************************************/ +bt_status_t btif_hci_cmd_send(uint16_t opcode, uint8_t *buf, uint8_t len); + +/******************************************************************************* +** ** Function btif_le_test_mode ** ** Description Sends a HCI BLE Test command to the Controller diff --git a/btif/include/btif_av.h b/btif/include/btif_av.h index cedc1b7fe..5d7ac0107 100644 --- a/btif/include/btif_av.h +++ b/btif/include/btif_av.h @@ -32,6 +32,7 @@ #include "btif_sm.h" #include "bta_av_api.h" +#define BTIF_RC_HANDLE_NONE 0xFF /******************************************************************************* ** Type definitions for callback functions @@ -45,6 +46,8 @@ typedef enum { BTIF_AV_STOP_STREAM_REQ_EVT, BTIF_AV_SUSPEND_STREAM_REQ_EVT, BTIF_AV_SINK_CONFIG_REQ_EVT, + BTIF_AV_CLEANUP_REQ_EVT, + BTIF_AV_SINK_FOCUS_REQ_EVT, } btif_av_sm_event_t; @@ -66,6 +69,18 @@ btif_sm_handle_t btif_av_get_sm_handle(void); /******************************************************************************* ** +** Function btif_av_get_addr +** +** Description Fetches current AV BD address +** +** Returns BD address +** +*******************************************************************************/ + +bt_bdaddr_t btif_av_get_addr(BD_ADDR address); + +/******************************************************************************* +** ** Function btif_av_stream_ready ** ** Description Checks whether AV is ready for starting a stream @@ -111,7 +126,7 @@ void btif_dispatch_sm_event(btif_av_sm_event_t event, void *p_data, int len); ** *******************************************************************************/ -bt_status_t btif_av_init(void); +bt_status_t btif_av_init(int service_id); /******************************************************************************* ** @@ -141,6 +156,20 @@ BOOLEAN btif_av_is_connected(void); BOOLEAN btif_av_is_peer_edr(void); +#ifdef USE_AUDIO_TRACK +/******************************************************************************* +** +** Function btif_queue_focus_rquest +** +** Description This is used to move context to btif and +** queue audio_focus_request +** +** Returns none +** +*******************************************************************************/ +void btif_queue_focus_rquest(void); +#endif + /****************************************************************************** ** ** Function btif_av_clear_remote_suspend_flag @@ -149,6 +178,56 @@ BOOLEAN btif_av_is_peer_edr(void); ** ** Returns Void ********************************************************************************/ + void btif_av_clear_remote_suspend_flag(void); +/******************************************************************************* +** +** Function btif_av_any_br_peer +** +** Description Check if the any of connected devices is BR device. +** +** Returns TRUE if connected to any BR device, FALSE otherwise. +** +*******************************************************************************/ + +BOOLEAN btif_av_any_br_peer(void); + +/******************************************************************************* +** +** Function btif_av_peer_supports_3mbps +** +** Description Check if the connected a2dp device supports +** 3mbps edr. Only when connected this function +** will accurately provide a true capability of +** remote peer. If not connected it will always be false. +** +** Returns TRUE if remote device is EDR and supports 3mbps +** +*******************************************************************************/ +BOOLEAN btif_av_peer_supports_3mbps(void); + +#ifdef BTA_AV_SPLIT_A2DP_ENABLED +/****************************************************************************** +** +** Function btif_av_get_streaming_channel_id +** +** Description Returns streaming channel id +** +** Returns channel id +********************************************************************************/ +UINT16 btif_av_get_streaming_channel_id(void); + +/****************************************************************************** +** +** Function btif_av_get_peer_addr +** +** Description Returns peer device address +** +** Returns peer address +********************************************************************************/ +void btif_av_get_peer_addr(bt_bdaddr_t *peer_bda); + +#endif + #endif /* BTIF_AV_H */ diff --git a/btif/include/btif_gatt_multi_adv_util.h b/btif/include/btif_gatt_multi_adv_util.h index f9d4a8db3..5abeda761 100644 --- a/btif/include/btif_gatt_multi_adv_util.h +++ b/btif/include/btif_gatt_multi_adv_util.h @@ -55,9 +55,11 @@ typedef struct BOOLEAN is_scan_rsp; UINT8 client_if; UINT16 service_uuid_len; +#if BLE_INCLUDED == TRUE tBTA_BLE_AD_MASK mask; tBTA_BLE_ADV_DATA data; tBTA_BLE_ADV_PARAMS param; +#endif TIMER_LIST_ENT tle_limited_timer; int timeout_s; }btgatt_multi_adv_inst_cb; diff --git a/btif/include/btif_gatt_util.h b/btif/include/btif_gatt_util.h index e080cd70b..59da0d2c8 100644 --- a/btif/include/btif_gatt_util.h +++ b/btif/include/btif_gatt_util.h @@ -26,7 +26,7 @@ void btif_to_bta_uuid(tBT_UUID *p_dest, bt_uuid_t *p_src); void btif_to_bta_gatt_id(tBTA_GATT_ID *p_dest, btgatt_gatt_id_t *p_src); void btif_to_bta_srvc_id(tBTA_GATT_SRVC_ID *p_dest, btgatt_srvc_id_t *p_src); void btif_to_bta_response(tBTA_GATTS_RSP *p_dest, btgatt_response_t* p_src); -void btif_to_bta_uuid_mask(tBTA_DM_BLE_PF_COND_MASK *p_mask, bt_uuid_t *p_src); +void btif_to_bta_uuid_mask(tBTA_DM_BLE_PF_COND_MASK *p_mask, bt_uuid_t *p_src, bt_uuid_t *svc_uuid); void bta_to_btif_uuid(bt_uuid_t *p_dest, tBT_UUID *p_src); void bta_to_btif_srvc_id(btgatt_srvc_id_t *p_dest, tBTA_GATT_SRVC_ID *p_src); diff --git a/btif/include/btif_hd.h b/btif/include/btif_hd.h new file mode 100644 index 000000000..6e2a67e1c --- /dev/null +++ b/btif/include/btif_hd.h @@ -0,0 +1,50 @@ +/****************************************************************************** + * + * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * Not a Contribution. + * Copyright (C) 2009-2012 Broadcom Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +#ifndef BTIF_HD_H +#define BTIF_HD_H + +#include <hardware/bluetooth.h> +#include <hardware/bt_hd.h> +#include <stdint.h> +#include "bta_hd_api.h" + +typedef enum +{ + BTIF_HD_DISABLED = 0, + BTIF_HD_ENABLED, + BTIF_HD_DISABLING +} BTIF_HD_STATUS; + +/** BTIF-HD control block */ +typedef struct +{ + BTIF_HD_STATUS status; + BOOLEAN app_registered; + BOOLEAN service_dereg_active; + BOOLEAN forced_disc; +} btif_hd_cb_t; + +extern btif_hd_cb_t btif_hd_cb; + +extern void btif_hd_remove_device(bt_bdaddr_t bd_addr); +extern void btif_hd_service_registration(); + +#endif diff --git a/btif/include/btif_hh.h b/btif/include/btif_hh.h index 1088c53bf..1e80b0664 100644 --- a/btif/include/btif_hh.h +++ b/btif/include/btif_hh.h @@ -31,7 +31,12 @@ ** Constants & Macros ********************************************************************************/ +#ifndef MAX_ACL_CONNECTIONS #define BTIF_HH_MAX_HID 8 +#else +#define BTIF_HH_MAX_HID MAX_ACL_CONNECTIONS +#endif + #define BTIF_HH_MAX_ADDED_DEV 32 #define BTIF_HH_MAX_KEYSTATES 3 @@ -68,6 +73,8 @@ typedef struct pthread_t hh_poll_thread_id; UINT8 hh_keep_polling; BOOLEAN vup_timer_active; + UINT8 set_rpt_snt; + UINT8 get_rpt_snt; TIMER_LIST_ENT vup_timer; BOOLEAN local_vup; // Indicated locally initiated VUP } btif_hh_device_t; @@ -91,6 +98,7 @@ typedef struct UINT32 device_num; btif_hh_added_device_t added_devices[BTIF_HH_MAX_ADDED_DEV]; btif_hh_device_t *p_curr_dev; + BOOLEAN service_dereg_active; } btif_hh_cb_t; @@ -107,6 +115,9 @@ extern bt_status_t btif_hh_virtual_unplug(bt_bdaddr_t *bd_addr); extern void btif_hh_disconnect(bt_bdaddr_t *bd_addr); extern void btif_hh_setreport(btif_hh_device_t *p_dev, bthh_report_type_t r_type, UINT16 size, UINT8* report); +extern void btif_hh_getreport(btif_hh_device_t *p_dev, bthh_report_type_t r_type, + UINT8 reportId, UINT16 bufferSize); +extern void btif_hh_service_registration(BOOLEAN enable); BOOLEAN btif_hh_add_added_dev(bt_bdaddr_t bd_addr, tBTA_HH_ATTR_MASK attr_mask); diff --git a/btif/include/btif_media.h b/btif/include/btif_media.h index 2ec19cbdf..a9323f066 100644 --- a/btif/include/btif_media.h +++ b/btif/include/btif_media.h @@ -99,6 +99,21 @@ typedef struct } tBTIF_MEDIA_SINK_CFG_UPDATE; #endif +#ifdef USE_AUDIO_TRACK +typedef enum { + BTIF_MEDIA_FOCUS_IDLE = 0, + BTIF_MEIDA_FOCUS_READY, + BTIF_MEIDA_FOCUS_REQUESTED, + BTIF_MEIDA_FOCUS_GRANTED +}btif_media_audio_focus_state; + +typedef struct +{ + BT_HDR hdr; + UINT8 focus_state; +} tBTIF_MEDIA_SINK_FOCUS_UPDATE; +#endif + /******************************************************************************* ** Public functions *******************************************************************************/ @@ -261,10 +276,11 @@ bool btif_a2dp_start_media_task(void); void btif_a2dp_stop_media_task(void); void btif_a2dp_on_init(void); -void btif_a2dp_setup_codec(void); +tBTIF_STATUS btif_a2dp_setup_codec(void); void btif_a2dp_on_idle(void); void btif_a2dp_on_open(void); BOOLEAN btif_a2dp_on_started(tBTA_AV_START *p_av, BOOLEAN pending_start); +void btif_media_on_stop_vendor_command(); void btif_a2dp_ack_fail(void); void btif_a2dp_on_stop_req(void); void btif_a2dp_on_stopped(tBTA_AV_SUSPEND *p_av); @@ -278,5 +294,7 @@ void btif_reset_decoder(UINT8 *p_av); int btif_a2dp_get_track_frequency(UINT8 frequency); int btif_a2dp_get_track_channel_count(UINT8 channeltype); void btif_a2dp_set_peer_sep(UINT8 sep); - +#ifdef USE_AUDIO_TRACK +void btif_a2dp_set_audio_focus_state(btif_media_audio_focus_state state); +#endif #endif diff --git a/btif/include/btif_sm.h b/btif/include/btif_sm.h index baad0d94d..7790318df 100644 --- a/btif/include/btif_sm.h +++ b/btif/include/btif_sm.h @@ -42,7 +42,7 @@ typedef UINT32 btif_sm_state_t; typedef UINT32 btif_sm_event_t; typedef void* btif_sm_handle_t; -typedef BOOLEAN(*btif_sm_handler_t)(btif_sm_event_t event, void *data); +typedef BOOLEAN(*btif_sm_handler_t)(btif_sm_event_t event, void *data, int index); /***************************************************************************** @@ -65,7 +65,7 @@ typedef BOOLEAN(*btif_sm_handler_t)(btif_sm_event_t event, void *data); ** ******************************************************************************/ btif_sm_handle_t btif_sm_init(const btif_sm_handler_t *p_handlers, - btif_sm_state_t initial_state); + btif_sm_state_t initial_state, int index); /***************************************************************************** ** diff --git a/btif/include/btif_sock_rfc.h b/btif/include/btif_sock_rfc.h index b36ec1f26..91cb95a35 100644 --- a/btif/include/btif_sock_rfc.h +++ b/btif/include/btif_sock_rfc.h @@ -33,6 +33,10 @@ bt_status_t btsock_rfc_listen(const char* name, const uint8_t* uuid, int channel int* sock_fd, int flags); bt_status_t btsock_rfc_connect(const bt_bdaddr_t *bd_addr, const uint8_t* uuid, int channel, int* sock_fd, int flags); +bt_status_t btsock_rfc_get_sockopt(int channel, btsock_option_type_t option_name, + void *option_value, int *option_len); +bt_status_t btsock_rfc_set_sockopt(int channel, btsock_option_type_t option_name, + void *option_value, int option_len); void btsock_rfc_signaled(int fd, int flags, uint32_t user_id); #endif diff --git a/btif/include/btif_sock_sdp.h b/btif/include/btif_sock_sdp.h index 9c09b0f39..e6a125a61 100644 --- a/btif/include/btif_sock_sdp.h +++ b/btif/include/btif_sock_sdp.h @@ -31,6 +31,10 @@ static const uint8_t UUID_SAP[] = {0x00, 0x00, 0x11, 0x2D, 0x00, 0 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}; static const uint8_t UUID_SPP[] = {0x00, 0x00, 0x11, 0x01, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}; +static const uint8_t UUID_FTP[] = {0x00, 0x00, 0x11, 0x06, 0x00, 0x00, 0x10, 0x00, + 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}; +static const uint8_t UUID_DUN[] = {0x00, 0x00, 0x11, 0x03, 0x00, 0x00, 0x10, 0x00, + 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}; static inline bool is_uuid_empty(const uint8_t* uuid) { diff --git a/btif/include/btif_storage.h b/btif/include/btif_storage.h index 26384e136..46e4ced94 100644 --- a/btif/include/btif_storage.h +++ b/btif/include/btif_storage.h @@ -1,5 +1,7 @@ /****************************************************************************** * + * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * Not a Contribution. * Copyright (C) 2009-2012 Broadcom Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -135,6 +137,18 @@ bt_status_t btif_storage_remove_bonded_device(bt_bdaddr_t *remote_bd_addr); /******************************************************************************* ** +** Function btif_storage_is_device_bonded +** +** Description BTIF storage API - checks if device present in bonded list +** +** Returns TRUE if the device is bonded, +** FALSE otherwise +** +*******************************************************************************/ +BOOLEAN btif_storage_is_device_bonded(bt_bdaddr_t *remote_bd_addr); + +/******************************************************************************* +** ** Function btif_storage_remove_bonded_device ** ** Description BTIF storage API - Deletes the bonded device from NVRAM @@ -321,6 +335,18 @@ BOOLEAN btif_storage_is_fixed_pin_zeros_keyboard(bt_bdaddr_t *remote_bd_addr); *******************************************************************************/ BOOLEAN btif_storage_is_restricted_device(const bt_bdaddr_t *remote_bd_addr); +/******************************************************************************* +** +** Function btif_storage_is_wiimote +** +** Description BTIF storage API - checks if this device is a wiimote +** +** Returns TRUE if the device is found in wiimote device list +** FALSE otherwise +** +*******************************************************************************/ +BOOLEAN btif_storage_is_wiimote(bt_bdaddr_t *remote_bd_addr, bt_bdname_t *remote_bd_name); + #if (BLE_INCLUDED == TRUE) bt_status_t btif_storage_add_ble_bonding_key( bt_bdaddr_t *remote_bd_addr, char *key, @@ -361,4 +387,38 @@ bt_status_t btif_storage_set_remote_addr_type(bt_bdaddr_t *remote_bd_addr, bt_status_t btif_storage_get_remote_version(const bt_bdaddr_t *remote_bd_addr, bt_remote_version_t *p_ver); +/******************************************************************************* +** Function btif_storage_load_hidd +** +** Description Loads hidd bonded device and "plugs" it into hidd +** +** Returns BT_STATUS_SUCCESS if successful, BT_STATUS_FAIL otherwise +** +*******************************************************************************/ +bt_status_t btif_storage_load_hidd(void); + +/******************************************************************************* +** +** Function btif_storage_set_hidd +** +** Description Stores hidd bonded device info in nvram. +** +** Returns BT_STATUS_SUCCESS +** +*******************************************************************************/ + +bt_status_t btif_storage_set_hidd(bt_bdaddr_t *remote_bd_addr); + +/******************************************************************************* +** +** Function btif_storage_remove_hidd +** +** Description Removes hidd bonded device info from nvram +** +** Returns BT_STATUS_SUCCESS +** +*******************************************************************************/ + +bt_status_t btif_storage_remove_hidd(bt_bdaddr_t *remote_bd_addr); + #endif /* BTIF_STORAGE_H */ diff --git a/btif/include/btif_util.h b/btif/include/btif_util.h index 2315523da..87fa01476 100644 --- a/btif/include/btif_util.h +++ b/btif/include/btif_util.h @@ -1,5 +1,7 @@ /****************************************************************************** * + * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * Not a Contribution. * Copyright (c) 2014 The Android Open Source Project * Copyright (C) 2009-2012 Broadcom Corporation * @@ -52,6 +54,7 @@ const char* dump_dm_event(UINT16 event); const char* dump_hf_event(UINT16 event); const char* dump_hf_client_event(UINT16 event); const char* dump_hh_event(UINT16 event); +const char* dump_hd_event(UINT16 event); const char* dump_hf_conn_state(UINT16 event); const char* dump_hf_call_state(bthf_call_state_t call_state); const char* dump_property_type(bt_property_type_t type); |
