1 /* 2 * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __BTC_UTIL_H__ 8 #define __BTC_UTIL_H__ 9 10 #include <stdbool.h> 11 #include "stack/bt_types.h" 12 #include "common/bt_defs.h" 13 #include "esp_bt_defs.h" 14 #include "esp_hf_defs.h" 15 16 /******************************************************************************* 17 ** Constants & Macros 18 ********************************************************************************/ 19 #define CASE_RETURN_STR(const) case const: return #const; 20 21 /******************************************************************************* 22 ** Type definitions for callback functions 23 ********************************************************************************/ 24 typedef char bdstr_t[18]; 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 /******************************************************************************* 30 ** Functions 31 ********************************************************************************/ 32 #if(BTA_AV_INCLUDED == TRUE) 33 const char *dump_rc_event(UINT8 event); 34 const char *dump_rc_notification_event_id(UINT8 event_id); 35 const char *dump_rc_pdu(UINT8 pdu); 36 #endif 37 38 #if(BTA_AG_INCLUDED == TRUE) 39 const char *dump_hf_conn_state(UINT16 event); 40 const char *dump_hf_event(UINT16 event); 41 const char *dump_hf_call_state(esp_hf_call_status_t call_state); 42 const char* dump_hf_call_setup_state(esp_hf_call_setup_status_t call_setup_state); 43 #endif 44 45 #if(BTA_HD_INCLUDED == TRUE) 46 const char* dump_hd_event(uint16_t event); 47 #endif 48 49 #if(BTA_HH_INCLUDED == TRUE) 50 const char* dump_hh_event(uint16_t event); 51 #endif 52 53 UINT32 devclass2uint(DEV_CLASS dev_class); 54 void uint2devclass(UINT32 dev, DEV_CLASS dev_class); 55 void uuid128_be_to_esp_uuid(esp_bt_uuid_t *u, uint8_t* uuid128); 56 57 void uuid_to_string_legacy(bt_uuid_t *p_uuid, char *str); 58 59 esp_bt_status_t btc_hci_to_esp_status(uint8_t hci_status); 60 esp_bt_status_t btc_btm_status_to_esp_status (uint8_t btm_status); 61 esp_bt_status_t btc_bta_status_to_esp_status (uint8_t bta_status); 62 63 #ifdef __cplusplus 64 } 65 #endif 66 67 #endif /* __BTC_UTIL_H__ */ 68