Skip to content

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

Open
@gabbla

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions