-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsbBulk.h
More file actions
44 lines (35 loc) · 1.15 KB
/
UsbBulk.h
File metadata and controls
44 lines (35 loc) · 1.15 KB
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
#ifndef __USB_BULK_CLASS__
#define __USB_BULK_CLASS__
#include "DeviceIo.h"
#include "lusb0_usb.h"
typedef struct {
CString strDeviceName;
int nInterface;
int nEpIn;
int nEpInSize;
int nEpOut;
int nEpOutSize;
} ENDPOINT_PARAM;
class CUsbBulk : public CDeviceIo
{
#define USB_DEVICE struct usb_device
#define USB_HANDLE struct usb_dev_handle *
private :
struct usb_dev_handle *m_hUsbDevice;
ENDPOINT_PARAM m_EndPoint;
BYTE m_nInterface;
static UINT CallBackThread (LPVOID pParam );
VOID ReleaseDevice(USB_HANDLE UsbHandle);
USB_DEVICE *FindDevice(CString &DeviceName, int Interface);
public :
CUsbBulk ( void );
~CUsbBulk ( void );
// Public operations
BOOL IoOpen ( CWnd *pWnd, TCHAR *pCfgStr);
int IoWrite ( BYTE *Buffer , int nNumberOfBytesToWrite );
int IoRead ( BYTE *Buffer , int nNumberOfBytesToRead );
void IoClose ( void );
void IoReset ( void );
BOOL IoIsValid ( void );
};
#endif