Files
0417_QT_code/LOGIC/Lgc_Consumer.h
2026-03-26 10:45:29 +08:00

32 lines
818 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include "MID/Mid_Def.h"
/*
* 这份文件负责解析 report id 0x03 的 Consumer 包。
*
* 当前下位机真实结构很简单:
* 1. 第 0 字节是 report id固定为 0x03
* 2. 第 1、2 字节拼成一个 16 位 consumer usage
* 3. 整包固定长度 3 字节
*
* 所以这里不需要像 0x01 / 0x04 那样去拆 modifier 和 usage 位图。
*/
struct Lgc_Consumer_Struct_Result
{
// 这一包是否匹配 report id 0x03。
bool IsMatch = false;
// 如果匹配 0x03长度是否也正确。
bool IsLengthOk = false;
// 解析得到的 consumer usage。
quint16 Usage = 0;
// 给调试窗口显示的简短中文说明。
QString TextExplain;
};
void Lgc_Consumer_Func_Parse(const QByteArray& ByteArray, Lgc_Consumer_Struct_Result* p_Result);