2012-03-02 08:56:59 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* BlueZ - Bluetooth protocol stack for Linux
|
|
|
|
*
|
2014-02-12 02:59:14 +08:00
|
|
|
* Copyright (C) 2011-2014 Intel Corporation
|
|
|
|
* Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
|
2012-03-02 08:56:59 +08:00
|
|
|
*
|
|
|
|
*
|
2014-02-12 02:59:14 +08:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2012-03-02 08:56:59 +08:00
|
|
|
*
|
2014-02-12 02:59:14 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2012-03-02 08:56:59 +08:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2014-02-12 02:59:14 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2012-03-02 08:56:59 +08:00
|
|
|
*
|
2014-02-12 02:59:14 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2012-03-02 08:56:59 +08:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-08-21 07:53:18 +08:00
|
|
|
#include <stdint.h>
|
2012-03-02 08:56:59 +08:00
|
|
|
#include <sys/time.h>
|
|
|
|
|
2013-08-21 06:45:49 +08:00
|
|
|
#define BTSNOOP_TYPE_HCI 1001
|
|
|
|
#define BTSNOOP_TYPE_UART 1002
|
|
|
|
#define BTSNOOP_TYPE_BCSP 1003
|
|
|
|
#define BTSNOOP_TYPE_3WIRE 1004
|
2014-02-12 03:13:59 +08:00
|
|
|
#define BTSNOOP_TYPE_MONITOR 2001
|
|
|
|
#define BTSNOOP_TYPE_SIMULATOR 2002
|
2013-08-21 06:45:49 +08:00
|
|
|
|
2013-08-21 07:31:54 +08:00
|
|
|
#define BTSNOOP_OPCODE_NEW_INDEX 0
|
|
|
|
#define BTSNOOP_OPCODE_DEL_INDEX 1
|
|
|
|
#define BTSNOOP_OPCODE_COMMAND_PKT 2
|
|
|
|
#define BTSNOOP_OPCODE_EVENT_PKT 3
|
|
|
|
#define BTSNOOP_OPCODE_ACL_TX_PKT 4
|
|
|
|
#define BTSNOOP_OPCODE_ACL_RX_PKT 5
|
|
|
|
#define BTSNOOP_OPCODE_SCO_TX_PKT 6
|
|
|
|
#define BTSNOOP_OPCODE_SCO_RX_PKT 7
|
|
|
|
|
2014-01-07 03:50:58 +08:00
|
|
|
struct btsnoop_opcode_new_index {
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t bus;
|
|
|
|
uint8_t bdaddr[6];
|
|
|
|
char name[8];
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
2013-08-21 06:58:53 +08:00
|
|
|
void btsnoop_create(const char *path, uint32_t type);
|
2013-08-21 07:17:08 +08:00
|
|
|
void btsnoop_write(struct timeval *tv, uint32_t flags,
|
|
|
|
const void *data, uint16_t size);
|
2013-08-21 07:10:17 +08:00
|
|
|
void btsnoop_write_hci(struct timeval *tv, uint16_t index, uint16_t opcode,
|
2012-03-02 08:56:59 +08:00
|
|
|
const void *data, uint16_t size);
|
2013-08-21 10:43:25 +08:00
|
|
|
void btsnoop_write_phy(struct timeval *tv, uint16_t frequency,
|
|
|
|
const void *data, uint16_t size);
|
2013-08-20 14:11:16 +08:00
|
|
|
int btsnoop_open(const char *path, uint32_t *type);
|
2013-08-21 07:10:17 +08:00
|
|
|
int btsnoop_read_hci(struct timeval *tv, uint16_t *index, uint16_t *opcode,
|
2012-11-01 09:28:41 +08:00
|
|
|
void *data, uint16_t *size);
|
2013-08-21 10:43:25 +08:00
|
|
|
int btsnoop_read_phy(struct timeval *tv, uint16_t *frequency,
|
|
|
|
void *data, uint16_t *size);
|
2012-03-02 08:56:59 +08:00
|
|
|
void btsnoop_close(void);
|