Skip to content

Commit

Permalink
Merge pull request #98 from norberttak/set-report-id-to-zero
Browse files Browse the repository at this point in the history
HID send feature report: set report id to 0
  • Loading branch information
norberttak authored Apr 6, 2024
2 parents db0f7d4 + b438608 commit c266e6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/UsbHidDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ int UsbHidDevice::send_feature_report(unsigned char* buf, int length)
return EXIT_FAILURE;
}

buf[0] = 0x00; // don't use report id
if (hid_send_feature_report(device_handle, buf, length) == -1)
{
Logger(TLogLevel::logERROR) << "error in UsbHidDevice::send_feature_report" << " reason=" << hidapi_error(device_handle) << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion src/devices/saitek-radio/SaitekRadioPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int SaitekRadioPanel::connect(hid_device* _device_handle)
memcpy(read_buffer_old, read_buffer, read_buffer_size);

unsigned char buff[WRITE_BUFFER_SIZE];
memset(buff, 0xff, sizeof(buff)); // clear all displays
memset(buff, 0x00, sizeof(buff)); // set all displays to 0
if (send_feature_report(buff, sizeof(buff)) != EXIT_SUCCESS)
{
Logger(TLogLevel::logERROR) << "SaitekRadioPanel connect. error in write_device" << std::endl;
Expand Down

0 comments on commit c266e6e

Please sign in to comment.