diff --git a/features/FEATURE_UVISOR/includes/uvisor/api/inc/rpc.h b/features/FEATURE_UVISOR/includes/uvisor/api/inc/rpc.h index 8bee897bff..b1a89cef5a 100644 --- a/features/FEATURE_UVISOR/includes/uvisor/api/inc/rpc.h +++ b/features/FEATURE_UVISOR/includes/uvisor/api/inc/rpc.h @@ -33,7 +33,6 @@ typedef uint32_t uvisor_rpc_result_t; typedef uint32_t (*TFN_Ptr)(uint32_t, uint32_t, uint32_t, uint32_t); -typedef int (*TFN_RPC_Callback)(int); /** Wait for incoming RPC. * @@ -43,6 +42,21 @@ typedef int (*TFN_RPC_Callback)(int); * @param timeout_ms specifies how long to wait (in ms) for an incoming RPC * message before returning */ -int rpc_fncall_waitfor(const TFN_Ptr fn_ptr_array[], size_t fn_count, uint32_t timeout_ms); +UVISOR_EXTERN int rpc_fncall_waitfor(const TFN_Ptr fn_ptr_array[], size_t fn_count, uint32_t timeout_ms); + +/** Wait for an outgoing RPC to finish. + * + * Wait for the result of a previously started asynchronous RPC. After this + * call, ret will contain the return value of the RPC. The return value of this + * function may indicate that there was an error or a timeout with non-zero. + * + * @param result[in] The token to wait on for the result of an asynchronous RPC + * @param timeout_ms[in] How long to wait (in ms) for the asynchronous RPC + * message to finish before returning + * @param ret[out] The return value resulting from the finished RPC to + * the target function + * @returns Non-zero on error or timeout, zero on successful wait + */ +UVISOR_EXTERN int rpc_fncall_wait(uvisor_rpc_result_t result, uint32_t timeout_ms, uint32_t * ret); #endif /* __UVISOR_API_RPC_H__ */