NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
btif_util.h
1/******************************************************************************
2 *
3 * Copyright (C) 2009-2012 Broadcom Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18
19#ifndef BTIF_UTIL_H
20#define BTIF_UTIL_H
21
22#include <hardware/bluetooth.h>
23#include <hardware/bt_hf.h>
24#include <utils/Log.h>
25
26#include "data_types.h"
27#include "bt_types.h"
28
29/*******************************************************************************
30** Constants & Macros
31********************************************************************************/
32
33#define CASE_RETURN_STR(const) case const: return #const;
34
35
36/*******************************************************************************
37** Type definitions for callback functions
38********************************************************************************/
39
40typedef char bdstr_t[18];
41
42
43/*******************************************************************************
44** Functions
45********************************************************************************/
46
47const char* dump_bt_status(bt_status_t status);
48const char* dump_dm_search_event(UINT16 event);
49const char* dump_dm_event(UINT16 event);
50const char* dump_hf_event(UINT16 event);
51const char* dump_hh_event(UINT16 event);
52const char* dump_hf_conn_state(UINT16 event);
53const char* dump_hf_call_state(bthf_call_state_t call_state);
54const char* dump_property_type(bt_property_type_t type);
55const char* dump_hf_audio_state(UINT16 event);
56const char* dump_adapter_scan_mode(bt_scan_mode_t mode);
57const char* dump_thread_evt(bt_cb_thread_evt evt);
58
59const char* dump_av_conn_state(UINT16 event);
60const char* dump_av_audio_state(UINT16 event);
61
62int str2bd(char *str, bt_bdaddr_t *addr);
63char *bd2str(bt_bdaddr_t *addr, bdstr_t *bdstr);
64
65UINT32 devclass2uint(DEV_CLASS dev_class);
66void uint2devclass(UINT32 dev, DEV_CLASS dev_class);
67void uuid16_to_uuid128(uint16_t uuid16, bt_uuid_t* uuid128);
68
69void uuid_to_string(bt_uuid_t *p_uuid, char *str);
70void string_to_uuid(char *str, bt_uuid_t *p_uuid);
71int ascii_2_hex (char *p_ascii, int len, UINT8 *p_hex);
72
73#endif /* BTIF_UTIL_H */