Skip to content

[QUESTION] How to register callback function from client to server? #451

@Fuyumeng10311298

Description

@Fuyumeng10311298

Dear developers and maintainers, I'm using the eRPC framework on Linux. At present, I have a certain understanding of this RPC framework.

The current requirement is that the client needs to provide a callback function to the server. This callback function is provided by the user and defined on the client side. The specific task process runs on the server side, which periodically calls the callback function passed to it by the client and passes certain parameters to this callback function. In this way, the client can periodically obtain the parameters filled into the callback function by the server.

I tried to study the examples given in the source code like /test/test_callbacks, but I didn't understand the calling process of these callback functions. For example, in file test_callbacks.erpc, what is the relationship between core0 and core1? And if I write the erpc file as below, when I use erpcgen to generate code file it reports an error.
`
program cbtest

callback1_t() -> void

interface CbTest {
register_cb(in callback1_t cb) -> int32
}
`
It reports an error like this: Function has function type parameter (callback parameter), but in IDL is missing function definition, which can be passed there. But from my understanding, isn't the function definition already written above?

I hope my question can be answered and can the requirements described in the second paragraph be achieved using eRPC? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions