Push layered Qt host source files
This commit is contained in:
@@ -1,42 +1,31 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "MID/Mid_Def.h"
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QString>
|
||||
#include <Windows.h>
|
||||
#include "DRI/Dri_Hid.h"
|
||||
|
||||
/*
|
||||
* DRI Vendor 层:读写固件的 Vendor/NKRO HID 接口,支撑逻辑层功能诊断。
|
||||
*
|
||||
*/
|
||||
// USB vendor reader plus three write routes: vendor, command, and NKRO.
|
||||
struct Dri_Vendor_Struct_Port
|
||||
{
|
||||
/* 读写句柄:Vendor 写、NKRO 写与通用读各占一个 */
|
||||
HANDLE HandleRead = INVALID_HANDLE_VALUE;
|
||||
Dri_Hid_Struct_ReadPort ReadPort;
|
||||
HANDLE HandleWriteVendor = INVALID_HANDLE_VALUE;
|
||||
HANDLE HandleWriteCommand = INVALID_HANDLE_VALUE;
|
||||
HANDLE HandleWriteNkro = INVALID_HANDLE_VALUE;
|
||||
HANDLE HandleEvent = nullptr;
|
||||
OVERLAPPED OverlappedRead = {};
|
||||
/* 运行状态 + 报文长度缓存,便于 UI/LOGIC 层快速判断 */
|
||||
bool IsOpened = false;
|
||||
bool IsReadPending = false;
|
||||
quint16 InputLength = 0;
|
||||
quint16 OutputLength = 0;
|
||||
quint16 VendorWriteOutputLength = 0;
|
||||
quint16 CommandWriteOutputLength = 0;
|
||||
quint16 NkroWriteOutputLength = 0;
|
||||
QByteArray ReadBuffer;
|
||||
bool IsBluetoothTransport = false;
|
||||
};
|
||||
|
||||
/* 关闭全部句柄,安全退出时务必调用以便复用设备。 */
|
||||
void Dri_Vendor_Func_Close(Dri_Vendor_Struct_Port* p_Port);
|
||||
/* 根据 VID/PID 打开对应 HID 接口,并创建必需句柄。 */
|
||||
bool Dri_Vendor_Func_Open(Dri_Vendor_Struct_Port* p_Port,
|
||||
void Dri_Vendor_Close(Dri_Vendor_Struct_Port* p_Port);
|
||||
bool Dri_Vendor_Init(
|
||||
Dri_Vendor_Struct_Port* p_Port,
|
||||
const Mid_Struct_DeviceConfig& DeviceConfig,
|
||||
QString* p_TextStatus);
|
||||
/* 读取 Vendor 报文:一次返回一个 Mid_Struct_RawPacket。 */
|
||||
bool Dri_Vendor_Func_Read(Dri_Vendor_Struct_Port* p_Port,
|
||||
bool Dri_Vendor_Read(
|
||||
Dri_Vendor_Struct_Port* p_Port,
|
||||
Mid_Struct_RawPacket* p_Packet,
|
||||
QString* p_TextStatus);
|
||||
/* 写入 Vendor/NKRO 报文,ByteArray 按固件定义组包。 */
|
||||
bool Dri_Vendor_Func_Write(Dri_Vendor_Struct_Port* p_Port,
|
||||
bool Dri_Vendor_Write(
|
||||
Dri_Vendor_Struct_Port* p_Port,
|
||||
const QByteArray& ByteArray,
|
||||
QString* p_TextStatus);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user