Skip to content

HID report ID parameter cannot be changed (from default 0x01) #59

@francesco919

Description

@francesco919

Hello,
when trying to use a different HID report ID (default = 0x01), no report is received at host side.
this is due to an hardcoded value used during the HID report descriptor construction, ignoring the value passed by the user in the Joystick.init(uint8_t hidReportId, ...)

from joystick.cpp:
// REPORT_ID (Default: 1)
tempHidReportDescriptor[hidReportDescriptorSize++] = 0x85;
tempHidReportDescriptor[hidReportDescriptorSize++] = 0x01;

changing this to :
tempHidReportDescriptor[hidReportDescriptorSize++] = _hidReportId;
fixes the issue.

to be noted that in the library from Hieronimus the issue is not present being the code as the one showed as fix.
Note : Hieronimus uses 0x03 as default instead of 0x01 (joystick.h). Any reason behind the change?
#define JOYSTICK_DEFAULT_REPORT_ID 0x03

BR
Francesco

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions