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

Sending Hid Messages gives strange result #148

Open
K372470 opened this issue Sep 24, 2023 · 3 comments
Open

Sending Hid Messages gives strange result #148

K372470 opened this issue Sep 24, 2023 · 3 comments

Comments

@K372470
Copy link

K372470 commented Sep 24, 2023

Good day

Im trying to make a controller for my device(NUX-MG30) and I need to send {12,192,4,88} to the usb interface of this device:

#include "hidgeneric.h"
#if CFG_TUD_HID
HIDgeneric dev;
const uint8_t buffer[4]={12,192,4,88};

void setup()
{
    Serial.begin(115200);
    dev.begin();
}

void loop()
{
    delay(1000);
    dev.write(buffer, sizeof(buffer));
}

#endif

This is a bit changed version of hid_generic.ino

Problem

It works and sends data, BUT USB Analyzer by Eltima Software says im sending {1,12,192,4,88} => arduino adds '1' byte at the start of my message
Is there anything I can do with it?

My settings

Plate: Esp32s3 dev module
USB-MODE: USB-OTG (TinyUsb)
CDC-ON-BOOT: True
JTAG: Disabled

End

Thanks to everyone who took a look at my problem

@chegewara
Copy link
Owner

Its good that the 1 is added. It is report ID.
Its USB standard.

@K372470
Copy link
Author

K372470 commented Oct 4, 2023

Hmm...
Sounds realistic.
Could you then give me any tip for "is my idea is even realisable",please ?
As i can think esp32 should programmed as usb-host, but when i tried no data was sent at all(

@chegewara
Copy link
Owner

There is a chance it may works when report ID is 0.
Please check code how to set report ID.

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

No branches or pull requests

2 participants