[FL-2242] RPC: Wait for session termination in unit tests (#1005)

* rpc: session termination callback
* grammar fixes

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-02-24 15:08:58 +03:00
committed by GitHub
parent 24987b95cd
commit da6e31b2bf
3 changed files with 45 additions and 0 deletions

12
applications/rpc/rpc.h Executable file → Normal file
View File

@@ -21,6 +21,9 @@ typedef void (*RpcBufferIsEmptyCallback)(void* context);
* is received. Any other actions lays on transport layer.
* No destruction or session close preformed. */
typedef void (*RpcSessionClosedCallback)(void* context);
/** Callback to notify transport layer that session was closed
* and all operations were finished */
typedef void (*RpcSessionTerminatedCallback)(void* context);
/** Open RPC session
*
@@ -82,6 +85,15 @@ void rpc_session_set_buffer_is_empty_callback(
*/
void rpc_session_set_close_callback(RpcSession* session, RpcSessionClosedCallback callback);
/** Set callback to be called when RPC session is closed
*
* @param session pointer to RpcSession descriptor
* @param callback callback to inform about RPC session state
*/
void rpc_session_set_terminated_callback(
RpcSession* session,
RpcSessionTerminatedCallback callback);
/** Give bytes to RPC service to decode them and perform command
*
* @param session pointer to RpcSession descriptor