feat: add Xbox One HID report layout and mapping
Phase 4 foundation, independent of the presentation mechanism: - hid/hid_report.hpp: standard Xbox One report layout (64-byte input: buttons/guide/triggers/sticks; 64-byte output: motors), the HID report descriptor, and GIP state to report mapping. - make_input_report(): remaps GIP button bits to the standard Xbox bitmask, scales 10-bit triggers to 8-bit, sticks pass through. - parse_output_report(): extracts motor intensities from output reports for the rumble relay; malformed reports stop the motors. - test_hid: unit tests for the mapping, scaling, and descriptor. Report packing verified with a descriptor walker: input and output are exactly 64 bytes each. Next step is presentation via DriverKit, which needs a Developer ID with the DriverKit entitlement. Co-Authored-By: qwen3.8-27b@q3_k_xl: implemented HID report layer
This commit is contained in:
@@ -50,6 +50,13 @@ target_compile_features(test_gip PRIVATE cxx_std_23)
|
||||
add_test(NAME test_gip COMMAND test_gip)
|
||||
list(APPEND TEST_TARGETS test_gip)
|
||||
|
||||
add_executable(test_hid test_hid.cpp)
|
||||
target_include_directories(test_hid PRIVATE "${CMAKE_SOURCE_DIR}/include")
|
||||
target_link_libraries(test_hid PRIVATE xone_hid Unity::Unity)
|
||||
target_compile_features(test_hid PRIVATE cxx_std_23)
|
||||
add_test(NAME test_hid COMMAND test_hid)
|
||||
list(APPEND TEST_TARGETS test_hid)
|
||||
|
||||
add_custom_target(check
|
||||
COMMAND ${CMAKE_CTEST_COMMAND}
|
||||
--test-dir "${CMAKE_BINARY_DIR}"
|
||||
|
||||
Reference in New Issue
Block a user