Command Handler: File manipulation support

Overview

// global functions

int rcf_ch_file(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, rcf_op_t op, const char* filename);

Detailed Documentation

Global Functions

int rcf_ch_file(struct rcf_comm_connection* handle, char* cbuf, size_t buflen, size_t answer_plen, const uint8_t* ba, size_t cmdlen, rcf_op_t op, const char* filename)

Put/get file to/from the Test Agent or NUT served by it. If the function returns -1, default command processing (using stdio library) is performed by caller.

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

ba

pointer to location of binary attachment in the command buffer or NULL if no binary attachment is provided

cmdlen

full length of the command including binary attachment

op

RCFOP_FGET, RCFOP_FPUT or RCFOP_FDEL

filename

full name of the file in TA or NUT file system

0

command is supported

-1

command is not supported

other

error returned by communication library

Returns:

Indication of command support or error code