blob: aa5c7e52a3fce6e390422c378cd89ad3e6245738 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/*
2 *
3 * Copyright (C) 2023
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
14 *
15 * FileName : log_usb.h
16 * This program Capture module's trace log.
17 */
18
19#ifndef __LOG_USB_H__
20#define __LOG_USB_H__
21
22#include <fcntl.h>
23#include <termios.h>
24#include <poll.h>
25#include "../zlog_com.h"
26
27#define ZLOG_BUF_SIZE (512)
28#define ZLOG_SHELL_CMD_SIZE (64)
29
30#define MAX_USBFS_BULK_IN_SIZE (4 * 1024)
31#define MAX_USBFS_BULK_OUT_SIZE (4 * 1024)
32#define USB_TTY_DEV "/dev/ttyUSB0"
33
34//common define
35#define MIN(X, Y) ((X)<(Y))? (X):(Y)
36
37typedef struct
38{
39 char *portname;
40 int ttyfd;
41} usbdev_t;
42
43int zLogAgt_Usb_Write(usbdev_t *udev, char *pbuf, int size);
44int zLogAgt_Usb_Read(usbdev_t *udev, char *pbuf, int size);
45int zLogAgt_Usb_Close(usbdev_t *udev);
46
47#endif
48