diff options
Diffstat (limited to 'contrib/SDL-3.2.8/src/hidapi/windows/pp_data_dump/README.md')
| -rw-r--r-- | contrib/SDL-3.2.8/src/hidapi/windows/pp_data_dump/README.md | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/hidapi/windows/pp_data_dump/README.md b/contrib/SDL-3.2.8/src/hidapi/windows/pp_data_dump/README.md new file mode 100644 index 0000000..a0989cd --- /dev/null +++ b/contrib/SDL-3.2.8/src/hidapi/windows/pp_data_dump/README.md | |||
| @@ -0,0 +1,122 @@ | |||
| 1 | ## pp_data_dump.exe for Windows | ||
| 2 | |||
| 3 | |||
| 4 | pp_data_dump.exe is a small command line tool for Windows, which dumps the content of the [Preparsed Data](https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/preparsed-data) structure, provided by the Windows HID subsystem, into a file. | ||
| 5 | |||
| 6 | The generated file is in a text format, which is readable for human, as by the hid_report_reconstructor_test.exe unit test executable of the HIDAPI project. This unit test allows it to test the HIDAPIs report descriptor reconstructor - offline, without the hardware device connected. | ||
| 7 | |||
| 8 | pp_data_dump.exe has no arguments, just connect you HID device and execute pp_data_dump.exe. It will generate one file with the name | ||
| 9 | ``` | ||
| 10 | <vendor_id>_<product_id>_<usage>_<usage_table>.pp_data | ||
| 11 | ``` | ||
| 12 | for each top-level collection, of each connected HID device. | ||
| 13 | |||
| 14 | |||
| 15 | ## File content | ||
| 16 | |||
| 17 | The content of such a .pp_data file looks like the struct, which HIDAPI uses internally to represent the Preparsed Data. | ||
| 18 | |||
| 19 | *NOTE: | ||
| 20 | Windows parses HID report descriptors into opaque `_HIDP_PREPARSED_DATA` objects. | ||
| 21 | The internal structure of `_HIDP_PREPARSED_DATA` is reserved for internal system use.\ | ||
| 22 | Microsoft doesn't document this structure. [hid_preparsed_data.cc](https://chromium.googlesource.com/chromium/src/+/73fdaaf605bb60caf34d5f30bb84a417688aa528/services/device/hid/hid_preparsed_data.cc) is taken as a reference for its parsing.* | ||
| 23 | |||
| 24 | ``` | ||
| 25 | # HIDAPI device info struct: | ||
| 26 | dev->vendor_id = 0x046D | ||
| 27 | dev->product_id = 0xB010 | ||
| 28 | dev->manufacturer_string = "Logitech" | ||
| 29 | dev->product_string = "Logitech Bluetooth Wireless Mouse" | ||
| 30 | dev->release_number = 0x0000 | ||
| 31 | dev->interface_number = -1 | ||
| 32 | dev->usage = 0x0001 | ||
| 33 | dev->usage_page = 0x000C | ||
| 34 | dev->path = "\\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col02#8&1cf1c1b9&3&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}" | ||
| 35 | |||
| 36 | # Preparsed Data struct: | ||
| 37 | pp_data->MagicKey = 0x48696450204B4452 | ||
| 38 | pp_data->Usage = 0x0001 | ||
| 39 | pp_data->UsagePage = 0x000C | ||
| 40 | pp_data->Reserved = 0x00000000 | ||
| 41 | # Input caps_info struct: | ||
| 42 | pp_data->caps_info[0]->FirstCap = 0 | ||
| 43 | pp_data->caps_info[0]->LastCap = 1 | ||
| 44 | pp_data->caps_info[0]->NumberOfCaps = 1 | ||
| 45 | pp_data->caps_info[0]->ReportByteLength = 2 | ||
| 46 | # Output caps_info struct: | ||
| 47 | pp_data->caps_info[1]->FirstCap = 1 | ||
| 48 | pp_data->caps_info[1]->LastCap = 1 | ||
| 49 | pp_data->caps_info[1]->NumberOfCaps = 0 | ||
| 50 | pp_data->caps_info[1]->ReportByteLength = 0 | ||
| 51 | # Feature caps_info struct: | ||
| 52 | pp_data->caps_info[2]->FirstCap = 1 | ||
| 53 | pp_data->caps_info[2]->LastCap = 1 | ||
| 54 | pp_data->caps_info[2]->NumberOfCaps = 0 | ||
| 55 | pp_data->caps_info[2]->ReportByteLength = 0 | ||
| 56 | # LinkCollectionArray Offset & Size: | ||
| 57 | pp_data->FirstByteOfLinkCollectionArray = 0x0068 | ||
| 58 | pp_data->NumberLinkCollectionNodes = 1 | ||
| 59 | # Input hid_pp_cap struct: | ||
| 60 | pp_data->cap[0]->UsagePage = 0x0006 | ||
| 61 | pp_data->cap[0]->ReportID = 0x03 | ||
| 62 | pp_data->cap[0]->BitPosition = 0 | ||
| 63 | pp_data->cap[0]->BitSize = 8 | ||
| 64 | pp_data->cap[0]->ReportCount = 1 | ||
| 65 | pp_data->cap[0]->BytePosition = 0x0001 | ||
| 66 | pp_data->cap[0]->BitCount = 8 | ||
| 67 | pp_data->cap[0]->BitField = 0x02 | ||
| 68 | pp_data->cap[0]->NextBytePosition = 0x0002 | ||
| 69 | pp_data->cap[0]->LinkCollection = 0x0000 | ||
| 70 | pp_data->cap[0]->LinkUsagePage = 0x000C | ||
| 71 | pp_data->cap[0]->LinkUsage = 0x0001 | ||
| 72 | pp_data->cap[0]->IsMultipleItemsForArray = 0 | ||
| 73 | pp_data->cap[0]->IsButtonCap = 0 | ||
| 74 | pp_data->cap[0]->IsPadding = 0 | ||
| 75 | pp_data->cap[0]->IsAbsolute = 1 | ||
| 76 | pp_data->cap[0]->IsRange = 0 | ||
| 77 | pp_data->cap[0]->IsAlias = 0 | ||
| 78 | pp_data->cap[0]->IsStringRange = 0 | ||
| 79 | pp_data->cap[0]->IsDesignatorRange = 0 | ||
| 80 | pp_data->cap[0]->Reserved1 = 0x000000 | ||
| 81 | pp_data->cap[0]->pp_cap->UnknownTokens[0].Token = 0x00 | ||
| 82 | pp_data->cap[0]->pp_cap->UnknownTokens[0].Reserved = 0x000000 | ||
| 83 | pp_data->cap[0]->pp_cap->UnknownTokens[0].BitField = 0x00000000 | ||
| 84 | pp_data->cap[0]->pp_cap->UnknownTokens[1].Token = 0x00 | ||
| 85 | pp_data->cap[0]->pp_cap->UnknownTokens[1].Reserved = 0x000000 | ||
| 86 | pp_data->cap[0]->pp_cap->UnknownTokens[1].BitField = 0x00000000 | ||
| 87 | pp_data->cap[0]->pp_cap->UnknownTokens[2].Token = 0x00 | ||
| 88 | pp_data->cap[0]->pp_cap->UnknownTokens[2].Reserved = 0x000000 | ||
| 89 | pp_data->cap[0]->pp_cap->UnknownTokens[2].BitField = 0x00000000 | ||
| 90 | pp_data->cap[0]->pp_cap->UnknownTokens[3].Token = 0x00 | ||
| 91 | pp_data->cap[0]->pp_cap->UnknownTokens[3].Reserved = 0x000000 | ||
| 92 | pp_data->cap[0]->pp_cap->UnknownTokens[3].BitField = 0x00000000 | ||
| 93 | pp_data->cap[0]->NotRange.Usage = 0x0020 | ||
| 94 | pp_data->cap[0]->NotRange.Reserved1 = 0x0020 | ||
| 95 | pp_data->cap[0]->NotRange.StringIndex = 0 | ||
| 96 | pp_data->cap[0]->NotRange.Reserved2 = 0 | ||
| 97 | pp_data->cap[0]->NotRange.DesignatorIndex = 0 | ||
| 98 | pp_data->cap[0]->NotRange.Reserved3 = 0 | ||
| 99 | pp_data->cap[0]->NotRange.DataIndex = 0 | ||
| 100 | pp_data->cap[0]->NotRange.Reserved4 = 0 | ||
| 101 | pp_data->cap[0]->NotButton.HasNull = 0 | ||
| 102 | pp_data->cap[0]->NotButton.Reserved4 = 0x000000 | ||
| 103 | pp_data->cap[0]->NotButton.LogicalMin = 0 | ||
| 104 | pp_data->cap[0]->NotButton.LogicalMax = 100 | ||
| 105 | pp_data->cap[0]->NotButton.PhysicalMin = 0 | ||
| 106 | pp_data->cap[0]->NotButton.PhysicalMax = 0 | ||
| 107 | pp_data->cap[0]->Units = 0 | ||
| 108 | pp_data->cap[0]->UnitsExp = 0 | ||
| 109 | |||
| 110 | # Output hid_pp_cap struct: | ||
| 111 | # Feature hid_pp_cap struct: | ||
| 112 | # Link Collections: | ||
| 113 | pp_data->LinkCollectionArray[0]->LinkUsage = 0x0001 | ||
| 114 | pp_data->LinkCollectionArray[0]->LinkUsagePage = 0x000C | ||
| 115 | pp_data->LinkCollectionArray[0]->Parent = 0 | ||
| 116 | pp_data->LinkCollectionArray[0]->NumberOfChildren = 0 | ||
| 117 | pp_data->LinkCollectionArray[0]->NextSibling = 0 | ||
| 118 | pp_data->LinkCollectionArray[0]->FirstChild = 0 | ||
| 119 | pp_data->LinkCollectionArray[0]->CollectionType = 1 | ||
| 120 | pp_data->LinkCollectionArray[0]->IsAlias = 0 | ||
| 121 | pp_data->LinkCollectionArray[0]->Reserved = 0x00000000 | ||
| 122 | ``` \ No newline at end of file | ||
