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

[FEATURE] Add context to the error handler callback #424

Open
2 tasks done
gabbla opened this issue May 8, 2024 · 0 comments
Open
2 tasks done

[FEATURE] Add context to the error handler callback #424

gabbla opened this issue May 8, 2024 · 0 comments

Comments

@gabbla
Copy link
Contributor

gabbla commented May 8, 2024

Is your feature request related to a problem? Please describe

While encapsulating eRPC in a more transport-agnostic object, that can be instantiated multiple times (i.e.: multiple UARTs), there is no way to associate the error handler to a specific instance, since the handler does not support a context. Or, in other words, it is not possible to reuse the same error handler for multiple connections.

Describe the solution you'd like

Add a second parameter while registering the error handler function and pass it when calling such function.

Describe alternatives you've considered

Implementing some black magic using templates and static hash maps to provides a function table. See:

Steps you didn't forgot to do

  • I checked if there is no related issue opened/closed.
  • I checked that there doesn't exist opened PR which is solving this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant