Commit b3fda596 authored by winckel's avatar winckel

Created function to set received some data in user buffer (used in simulated UserProcess mode).

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4808 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 4ea3d1cb
......@@ -304,6 +304,36 @@ int user_api_read_data(int fd)
LOG_FUNC_RETURN (rbytes);
}
/****************************************************************************
** **
** Name: user_api_set_data() **
** **
** Description: Set content of data received buffer to allow loop back **
** **
** Inputs: message: Message to set into the received buffer **
** **
** Outputs: Return: The number of bytes write when success; **
** RETURNerror Otherwise **
** Others: _user_api_recv_buffer **
** **
***************************************************************************/
int user_api_set_data(char *message)
{
LOG_FUNC_IN;
int rbytes;
memset(_user_api_recv_buffer, 0, USER_API_RECV_BUFFER_SIZE);
strncpy(_user_api_recv_buffer, message, USER_API_RECV_BUFFER_SIZE);
rbytes = strlen(_user_api_recv_buffer);
LOG_TRACE(INFO, "USR-API - %d bytes write", rbytes);
LOG_DUMP(_user_api_recv_buffer, rbytes);
LOG_FUNC_RETURN (rbytes);
}
/****************************************************************************
** **
** Name: user_api_send_data() **
......
......@@ -49,6 +49,7 @@ int user_api_get_fd(void);
const void* user_api_get_data(int index);
int user_api_read_data(int fd);
int user_api_set_data(char *message);
int user_api_send_data(int fd, int length);
void user_api_close(int fd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment