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

HID devices with large report maps don't allocate enough space? #818

Open
benjie-git opened this issue Dec 22, 2024 · 1 comment
Open

HID devices with large report maps don't allocate enough space? #818

benjie-git opened this issue Dec 22, 2024 · 1 comment

Comments

@benjie-git
Copy link

My HID descriptor is large at 283 bytes.

It looks to me like the m_reportMapChr characteristic in NimBLEHIDDevice.cpp gets set up with a default max Characteristic size of 20. Does this need to be re-created with a bigger max size in NimBLEHIDDevice::setReportMap?
I get very strange behavior with inconsistent bond failures, which resolved when I change NimBLEHIDDevice.cpp, line 48 to:

    m_reportMapCharacteristic = m_hidService->createCharacteristic((uint16_t)0x2a4b, NIMBLE_PROPERTY::READ, 300);

to allocate 300 bytes for this characteristic's value.

Obviously this is not the right fix, but maybe we sould create the characteristic in setReportMap() with the necessary size, and then add a lazy call to createCharacteristic() on startServices() if setReportMap() was never called?

I'm still using NimBLE-Arduino 1.4.3 and esp32 3.1.0.

@h2zero
Copy link
Owner

h2zero commented Dec 22, 2024

All characteristics are created by default with a max value size of 512 bytes, your code would actually reduce the size. The value container will self adjust up to the max size provided.

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