Closed shuffle2 closed 1 year ago
Good point, too. The SDP parser supports arbitrary chunking and the hid descriptor ends up in the larger/user provided HID descriptor storage. So there's no technically reason to limit it by MAX_ATTRIBUTE_VALUE_SIZ. We'll have a look into this.
Please have a look at the latest commits on develop. The state machine isn't trivial, but the HID Descriptor is not limited by a fixed array anymore.
Thanks! The new logic looks good to me. I did leave some comments though
Is your feature request related to a problem? Please describe. I'm trying to use hid_host to connect to a device which has a large HID Report Descriptor ("report map") in a SDP attribute. It is larger than the currently hardcoded max size in btstack of 300 bytes.
Describe the solution you'd like
MAX_ATTRIBUTE_VALUE_SIZE
should be configurable (as other sizes throughout btstack already are), possibly optionally supporting dynamic allocations ifHAVE_MALLOC
is defined.Describe alternatives you've considered The current way to fix this error is to manually edit btstack source code to change the value of
MAX_ATTRIBUTE_VALUE_SIZE
.An alternative fix could be to just use a new, higher constant size value. However it doesn't seem like a good solution.
Another solution could be to allow the application to directly control/own this buffer in some way, instead of putting the control within hid_host at all.