1 /****************************************************************************** 2 * 3 * Copyright 2016 The Android Open Source Project 4 * Copyright 2009-2012 Broadcom Corporation 5 * 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: 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 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. 17 * 18 ******************************************************************************/ 19 20 #ifndef BTIF_HD_H 21 #define BTIF_HD_H 22 23 #include <bluetooth/log.h> 24 #include <hardware/bluetooth.h> 25 #include <hardware/bt_hd.h> 26 #include <stdint.h> 27 28 #include "bta/include/bta_hd_api.h" 29 #include "types/raw_address.h" 30 31 typedef enum { BTIF_HD_DISABLED = 0, BTIF_HD_ENABLED, BTIF_HD_DISABLING } BTIF_HD_STATUS; 32 33 /* BTIF-HD control block */ 34 typedef struct { 35 BTIF_HD_STATUS status; 36 bool app_registered; 37 bool service_dereg_active; 38 bool forced_disc; 39 } btif_hd_cb_t; 40 41 extern btif_hd_cb_t btif_hd_cb; 42 43 const bthd_interface_t* btif_hd_get_interface(); 44 bt_status_t btif_hd_execute_service(bool b_enable); 45 void btif_hd_remove_device(RawAddress bd_addr); 46 void btif_hd_service_registration(); 47 48 namespace std { 49 template <> 50 struct formatter<BTIF_HD_STATUS> : enum_formatter<BTIF_HD_STATUS> {}; 51 } // namespace std 52 53 #endif 54