hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __BLUEZ_CTRL_P__
#define __BLUEZ_CTRL_P__
 
#include "avrcpctrl.h"
#include "gatt_config.h"
#include "a2dp_source/a2dp_masterctrl.h"
#include "a2dp_source/shell.h"
#include "DeviceIo.h"
#include "RkBtSource.h"
#include "RkBtSink.h"
 
#define HOSTNAME_MAX_LEN    250    /* 255 - 3 (FQDN) - 2 (DNS enc) */
 
typedef struct {
   pthread_t tid;
   bool is_bt_open;
   bool is_ble_open;
   bool is_ble_client_open;
   bool is_a2dp_sink_open;
   bool is_a2dp_source_open;
   bool is_hfp_open;
} bt_control_t;
 
bool bt_is_open();
bool ble_is_open();
bool ble_client_is_open();
bool bt_source_is_open(void);
bool bt_sink_is_open(void);
bool bt_hfp_is_open(void);
int bt_interface(enum BtControl type, void *data);
void bt_close_ble(bool disconnect);
int bt_close_sink(bool disconnect);
int bt_close_source(bool disconnect);
int bt_control_cmd_send(enum BtControl bt_ctrl_cmd);
int bt_gethostname(char *hostname_buf, const size_t size);
int rk_bt_control(enum BtControl cmd, void *data, int len);
 
//#define msleep(x) usleep(x * 1000)
 
#endif /* __BLUEZ_CTRL_P__ */