Skip to content

Commit

Permalink
Removed redundant ReportId from returned data-array of getInputReport:
Browse files Browse the repository at this point in the history
-Now the arguments are identical with the similar function getFeatureReport
-This array is no longer compatible with incomingData anyway, because the type changed in mixxxdj#4521
-And even before, it was only compatible, under the assumption, that the HID device uses ReportIds
Note, that getInputReport is new for 2.4 and can be changed without breaking backward compatibility
  • Loading branch information
JoergAtGithub committed Apr 2, 2022
1 parent fbaad10 commit ee70626
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/controllers/hid/hidcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ class HidControllerJSProxy : public ControllerJSProxy {
/// @brief getInputReport receives an InputReport from the HID device on request.
/// @details This can be used on startup to initialize the knob positions in Mixxx
/// to the physical position of the hardware knobs on the controller.
/// The returned data structure for the input reports is the same
/// as in the polling functionality (including ReportID in first byte).
/// The returned list can be used to call the incomingData
/// function of the common-hid-packet-parser.
/// This is an optional command in the HID standard - not all devices support it.
/// @param reportID 1...255 for HID devices that uses ReportIDs - or 0 for devices, which don't use
/// @return Returns report data with ReportID byte as prefix
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/hid/hidiothread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,9 @@ QByteArray HidIoThread::getInputReport(unsigned int reportID) {
}

// Convert array of bytes read in a JavaScript compatible return type, this is returned as deep-copy, for thread safety.
// For compatibility with HidController::processInputReport, the reportID prefix is included added here
QByteArray returnArray = QByteArray(
reinterpret_cast<char*>(m_pPollData[m_pollingBufferIndex]),
bytesRead);
reinterpret_cast<char*>(m_pPollData[m_pollingBufferIndex] + kReportIdSize),
bytesRead - kReportIdSize);

hidDeviceLock.unlock();

Expand Down

0 comments on commit ee70626

Please sign in to comment.