Код
//virtual UART packet
if (report.Data[0] == 0)
{
int length = report.Data[1];
Output.AppendText("<data: 00 " + length);
String data = "";
for (int i = 0; i < length; i++)
{
data += (char)(report.Data[i + 2]);
}
Output.AppendText(data);
Output.AppendText("\r\n");
if(Linked)
serialPort1.Write(report.Data, 2, length);
}
//Redut packet
if (report.Data[0] == 1)
{
int length = report.Data[1];
Output.AppendText("<data: 01 " + length);
for (int i = 0; i < length; i++)
{
Output.AppendText(String.Format("{0:X2}", report.Data[i + 2]));
}
Output.AppendText("\r\n");
if (Linked)
{
serialPort1.Write(report.Data, 2, length);
Output.AppendText(">port: ");
for (int i = 0; i < length; i++)
{
Output.AppendText(String.Format("{0:X2}", report.Data[i + 2]));
}
Output.AppendText("\r\n");
}
}
Эти части кода как я понимаю, не являются необходимыми?
А вот такая штука Вам не попадалась?
USB_Generic_HID_reference_application_3_0_0_0.zip ( 99.36 килобайт )
Кол-во скачиваний: 73
Живи днем так, чтобы ночью ты спал спокойно.