CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
orangepi-xunlong

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: orangepi-xunlong/orangepi-build
Path: blob/next/external/cache/sources/hcitools/monitor/btsnoop.h
Views: 3959
1
/*
2
*
3
* BlueZ - Bluetooth protocol stack for Linux
4
*
5
* Copyright (C) 2011-2012 Intel Corporation
6
* Copyright (C) 2004-2010 Marcel Holtmann <[email protected]>
7
*
8
*
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
*
23
*/
24
25
#include <stdint.h>
26
#include <sys/time.h>
27
28
#define BTSNOOP_TYPE_HCI 1001
29
#define BTSNOOP_TYPE_UART 1002
30
#define BTSNOOP_TYPE_BCSP 1003
31
#define BTSNOOP_TYPE_3WIRE 1004
32
33
#define BTSNOOP_TYPE_EXTENDED_HCI 2001
34
#define BTSNOOP_TYPE_EXTENDED_PHY 2002
35
36
#define BTSNOOP_OPCODE_NEW_INDEX 0
37
#define BTSNOOP_OPCODE_DEL_INDEX 1
38
#define BTSNOOP_OPCODE_COMMAND_PKT 2
39
#define BTSNOOP_OPCODE_EVENT_PKT 3
40
#define BTSNOOP_OPCODE_ACL_TX_PKT 4
41
#define BTSNOOP_OPCODE_ACL_RX_PKT 5
42
#define BTSNOOP_OPCODE_SCO_TX_PKT 6
43
#define BTSNOOP_OPCODE_SCO_RX_PKT 7
44
45
void btsnoop_create(const char *path, uint32_t type);
46
void btsnoop_write(struct timeval *tv, uint32_t flags,
47
const void *data, uint16_t size);
48
void btsnoop_write_hci(struct timeval *tv, uint16_t index, uint16_t opcode,
49
const void *data, uint16_t size);
50
void btsnoop_write_phy(struct timeval *tv, uint16_t frequency,
51
const void *data, uint16_t size);
52
int btsnoop_open(const char *path, uint32_t *type);
53
int btsnoop_read_hci(struct timeval *tv, uint16_t *index, uint16_t *opcode,
54
void *data, uint16_t *size);
55
int btsnoop_read_phy(struct timeval *tv, uint16_t *frequency,
56
void *data, uint16_t *size);
57
void btsnoop_close(void);
58
59