📄 tet44m210usbbulklib.cpp
字号:
#include "TEt44m210UsbBulkLib.h"
DEFINE_GUID(GUID_USB_BULK_TESTER,
0xfa4c89a, 0x870c, 0x49a4, 0xa8, 0x5d, 0x50, 0x0, 0x38, 0xb2, 0xa1, 0x9b);
//---------------------------------------------------------------------------
/***************************************************
function: OpenDevice();
Try to connect usb by end point,
if bEp0 is set , the endpoint 0 will be connected.
****************************************************/
bool __fastcall TET44m210UsbBulk::openDevice(bool bEp0, bool bEp1, bool bEp2,bool bEp3)
{
bool bSuccess = TRUE;
if (bEp0)
{
m_hEndpoint0 = _getDevice(NULL);
if (!m_hEndpoint0)
bSuccess = FALSE;
}
if (bEp1)
{
m_hEndpoint1 = _getDevice(m_cEndpoint1);
if(!m_hEndpoint1)
bSuccess = FALSE;
}
if (bEp2)
{
m_hEndpoint2 = _getDevice(m_cEndpoint2);
if(!m_hEndpoint2)
bSuccess = FALSE;
}
if (bEp3)
{
m_hEndpoint3 = _getDevice(m_cEndpoint3);
if(!m_hEndpoint3)
bSuccess = FALSE;
}
return bSuccess;
}
//---------------------------------------------------------------------------
/***************************************************
function: OpenDevice();
Try to connect usb by end point,
if bEp0 is set , the endpoint 0 will be connected.
****************************************************/
void __fastcall TET44m210UsbBulk::closeDevice()
{
if (m_hEndpoint0)
{
CloseHandle (m_hEndpoint0);
m_hEndpoint0 = NULL;
}
if (m_hEndpoint1)
{
CloseHandle (m_hEndpoint1);
m_hEndpoint1 = NULL;
}
if (m_hEndpoint2)
{
CloseHandle (m_hEndpoint2);
m_hEndpoint2 = NULL;
}
if (m_hEndpoint3)
{
CloseHandle (m_hEndpoint3);
m_hEndpoint3 = NULL;
}
m_bbGetDevice = FALSE;
}
//---------------------------------------------------------------------------
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -