-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Callback-based system. #27
Comments
Additionally this could be used to enable advanced communication with the user. |
Sure thing. This will be an ongoing WIP I intend to further explore over the course of the next week. Changes will surely be pushed to |
Just pushed the first changes related to this issue to I tested it a bit with all my flash drives and it seems to work fine. |
Thanks for the quick patch, I'll try to move my app to this system soon and give you feedback. |
@averne Had some time to spare, so I went ahead and implemented support for a user data pointer in 2c401e8. I'll be waiting for your feedback, there's some other stuff I want to tackle in the meantime. |
Is your feature request related to a problem? Please describe.
Back when I designed the interface for this library in 2020, it seemed like a no-brainer to use an event-based system based on the ABI used by multiple Switch background services, which in turn makes it possible for the application using the library to span a single additional background thread that uses
waitMulti()
to handle multiple events and call it a day.However, this very same reasoning falls short if the application using the library doesn't use events at all, which is something I never stopped to consider. This forces the developer to span an additional background thread to exclusively handle changes from the library, which is a bit overkill.
Please consider this library was specifically designed with nxdumptool in mind before it became a much broader project, and that application relies heavily on background services that do use this kind of ABI.
Describe the solution you'd like
A callback-based system that uses a function pointer provided by the user to handle UMS status changes under the library's very own background thread.
This new system should be able to co-exist with the current event-based system, because both designs have their own particular use cases.
Additional context
Initially proposed by averne and discussed in #26.
The text was updated successfully, but these errors were encountered: