-
Notifications
You must be signed in to change notification settings - Fork 624
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 host optionally disable fetching report descriptor #635
Comments
HID report descriptor is wasting even more memory if you want to support both BLE and Classic devices you also need to provide BLE a large 4K buffer through Adding that extra 4K buffer actually tripped me over on Pico W got OOM panic. I'm planning to switch to Pico 2 W and it should be fine there. Still we should really come up with a design that does not require such large static buffers that we still need to copy anyway. |
Thanks for the suggestion. Not fetching the HID Descriptor would be easy to implement, as in your suggestion. However, HID Host still needs to query SDP to get the L2CAP PSM and a few other values. I'd like to better understand your reasoning. Why do you want/need to store the HID descriptor in the application? |
The app persists HID report descriptors of paired devices. It actually needs them before devices are connected. Maybe the way forward is for the app to provide a buffer large enough for one descriptor which is only valid for the app to copy from a callback and will then be overwritten next time a device connects. That or just let the app fetch the descriptor. |
Hi. I've made a small commit on develop branch which allows to pass NULL for the HID Descriptor Storage. It will still do the SDP query, but ignore the HID Descriptor. Could you check if this already helps with your project? Now.. you still need the HID Descriptor in general and are also interested in getting other SDP Record values. |
Is your feature request related to a problem? Please describe.
Especially in the context of multiple HID connections the storage of report descriptors in a single buffer is problematic.
Say if you want up to 8 connections you should have like a 4KB buffer with each device having up to a 512KB descriptor.
Then your app still need to copy those descriptors anyway as they are moved around the buffer when devices a disconnecting.
See: #633 (comment)
On top of that the app may need to do the exact same SDP query to fetch other attributes anyway.
So being able to disable that SDP query would prevent a redundant query, see: #618
Adding documentations to
hid_host_init
would be great too.Describe the solution you'd like
Do not fetch report descriptor when
hid_host_init
is passed a NULL pointer and/or a size of zero.Describe alternatives you've considered
None
Possible solution
The text was updated successfully, but these errors were encountered: