hc
2024-03-26 e0728245c89800c2038c23308f2d88969d5b41c8
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
41
42
43
44
/*
 * Copyright (C) 2015 Spreadtrum Communications Inc.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
 
#ifndef __DUMP_H
#define __DUMP_H
#include <linux/time.h>
#include <linux/rtc.h>
 
#define BT_MAX_DUMP_FRAME_LEN 2
#define BT_MAX_DUMP_DATA_LEN 20
#define BT_DATA_OUT 0
#define BT_DATA_IN 1
#define HCI_COMMAND 0x01
#define HCI_EVENT 0x04
#define HCI_COMMAND_STATUS 0x0f
#define HCI_COMMAND_COMPELET 0x0e
 
typedef struct bt_host_time {
   struct rtc_time rtc_t;
   //struct timeval tv;
   struct timespec64 tv;
} bt_host_time;
 
typedef struct bt_host_data_dump {
   unsigned char tx[BT_MAX_DUMP_FRAME_LEN][BT_MAX_DUMP_DATA_LEN];
   bt_host_time txtime_t[BT_MAX_DUMP_FRAME_LEN];
   unsigned char rx[BT_MAX_DUMP_FRAME_LEN][BT_MAX_DUMP_DATA_LEN];
   bt_host_time rxtime_t[BT_MAX_DUMP_FRAME_LEN];
} bt_host_data_dump;
 
void bt_host_data_save(const unsigned char *buf, int count, unsigned char data_inout);
void bt_host_data_printf(void);
 
#endif