EmbeddedRPC / erpc

Embedded RPC
https://github.com/EmbeddedRPC/erpc/wiki
BSD 3-Clause "New" or "Revised" License
702 stars 200 forks source link

erpc robustness #147

Open tmordeko opened 3 years ago

tmordeko commented 3 years ago

Hi,

Is it possible to recover gracefully from an erpc error during one of the remote procedures calls ? currently the server and client are stuck.

/Tzvika

MichalPrincNXP commented 3 years ago

Hello @tmordeko , as stated in #145 , one can catch the status return value of the server run/poll function on the server side. On the client side you need to set client error handler function, like this:

    #include "erpc_error_handler.h"
    erpc_client_set_error_handler(erpc_error_handler);
    for (;;)
    {
        erpcFunctionCall();

        /* Check if some error occurred in eRPC */
        if (g_erpc_error_occurred)
        {
            /* Exit program loop or do whatever is needed in your app. */
            break;
        }
    }

Hope it helps. Michal