Command Handler: Function call support

Overview

// global functions

int rcf_ch_call(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const char* rtn, bool is_argv, int argc, void** params);

Detailed Documentation

Global Functions

int rcf_ch_call(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const char* rtn, bool is_argv, int argc, void** params)

Execute routine on the Test Agent or NUT served by it. Parameters of the function are not parsed. If the handler returns -1, then default processing is performed by caller: Portable Commands Handler obtains address of the function using rcf_ch_symbol_addr(), calls a routine rcf_ch_call_routine() to execute the routine and sends an answer.

Parameters:

handle

connection handle

cbuf

command buffer

buflen

length of the command buffer

answer_plen

number of bytes in the command buffer to be copied to the answer

rtn

routine name

is_argv

if true, then routine prototype is (int argc, char **argv)

argc

number of arguments

params

pointer to array of RCF_MAX_PARAMS length with routine arguments

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code