Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reenable RawHID #245

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Reenable RawHID #245

wants to merge 1 commit into from

Conversation

arunmjayan
Copy link

Hi there,
We are thankful for your support, i came here to request you to include the RawHID.h file into the HID-Project.h

Hi there, 
We are thankful for your support, i came here to request you to include the RawHID.h file into the HID-Project.h
@NicoHood
Copy link
Owner

I am not yet sure why I removed it. I guess because it is not working properly yet. There are several issue about that already open. If you find a way to fix those, I am happy to enable the code again.

@NicoHood NicoHood changed the title Update regarding the HID-Project.h Reenable RawHID Mar 12, 2021
@spuder
Copy link

spuder commented Aug 7, 2022

Here is one of the issues specifically #133

Currently HID-Project is able to receive data from a PC with RawHID.read() but it is not able to send data back to the PC with RawHID.write()

@NicoHood
Copy link
Owner

@spuder How can we fix raw hid? I really do not remember the current state. What is needed to make write work properly?

@spuder
Copy link

spuder commented Sep 25, 2022

I don't fully understand the bug, but as long as the RawHID sends an array of atleast 64 bytes it works fine.

    // Workaround for bug when sending less than 64 bytes of data
    for (byte i = 0; i < sizeof(rawhidData); i++)
    {
        rawhidData[i] = 0x00;
    }
    RawHID.begin(rawhidData, sizeof(rawhidData));

If you attempt to send an array smaller than 64 bytes, nothing is transferred.

Here is a working example

https://github.com/spuder/MuteMe-arduino/blob/main/src/main.cpp

@NicoHood
Copy link
Owner

Yeah, I think this has to be because a zero length package is missing or so.

@mcuee
Copy link

mcuee commented Jun 17, 2023

The current git seems to work reasonaby well based on my testing using the example here.

There is a bug for the Feature report but the fix is simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants