TWS TRPC Functions

[English]

TWS_TRPC API Brief

Application

Brief

tws_trpc_send()

Send RPC message to TWS task

tws_trpc_exec()

Implement RPC function in TWS task

TWS_TRPC API Reference

Header File

Functions

void tws_trpc_send(uint32_t *pu4_blk)

Send RPC message to TWS task.

Send the RPC message [pu4_blk] to TWS task.

参数:

pu4_blk[in] pointer to RPC message

返回:

N/A

void tws_trpc_exec(uint32_t *pu4_blk)

Implement RPC function in TWS task.

Implement the function of RPC message [pu4_blk] in the TWS task.

参数:

pu4_blk[in] pointer to RPC message

返回:

N/A TWS_TRPC_H EOF

Macros

TWS_TRPC_0ARG(ret_type, ret_val, func)
TWS_TRPC_0ARG_RET_VOID(func)
TWS_TRPC_1ARG(ret_type, ret_val, func, a1)

tws task RPC with 0 argument.

tws task RPC blocking call with 0 argument, blocking call, the function will not return until it is actually executed.

参数:
  • ret_type[in] the return type of func(next argument)

  • func[in] rpc function to be called

返回:

value depends on ret_type, return nothing when ret_type=void

TWS_TRPC_1ARG_RET_VOID(func, a1)
TWS_TRPC_2ARG(ret_type, ret_val, func, a1, a2)
TWS_TRPC_2ARG_RET_VOID(func, a1, a2)
TWS_TRPC_3ARG(ret_type, ret_val, func, a1, a2, a3)
TWS_TRPC_3ARG_RET_VOID(func, a1, a2, a3)
TWS_TRPC_4ARG(ret_type, ret_val, func, a1, a2, a3, a4)
TWS_TRPC_5ARG(ret_type, ret_val, func, a1, a2, a3, a4, a5)
TWS_TRPC_6ARG(ret_type, ret_val, func, a1, a2, a3, a4, a5, a6)
TWS_TRPC_ASYNC_0ARG_RET_VOID(func)

tws stack RPC RPC async with 0 arguments.

tws stack RPC RPC non-blocking call with 0 arguments, non-blocking call, the result of the function execution can be obtained via res_cb.

参数:
  • func[in] rpc function to be called

返回:

N/A

TWS_TRPC_ASYNC_1ARG_RET_VOID(func, a1)
TWS_TRPC_ASYNC_2ARG(func, a1, a2)
TWS_TRPC_ASYNC_3ARG_RET_VOID(func, a1, a2, a3)
TWS_TRPC_ASYNC_4ARG_RET_VOID(func, a1, a2, a3, a4)
TWS_TRPC_ASYNC_5ARG_RET_VOID(func, a1, a2, a3, a4, a5)
TWS_TRPC_ASYNC_6ARG_RET_VOID(func, a1, a2, a3, a4, a5, a6)