#10 - added documentation for the new write function
This commit is contained in:
parent
ad7d4c39c4
commit
bc8a9f1dce
@ -1074,6 +1074,13 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t handle,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief simple write function to write a datastream to the output of an instance
|
||||||
|
* @param[in] handle shellmatta instance handle
|
||||||
|
* @param[in] data data to be written
|
||||||
|
* @param[in] length amount of data to be written
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
shellmatta_retCode_t shellmatta_write( shellmatta_handle_t handle,
|
shellmatta_retCode_t shellmatta_write( shellmatta_handle_t handle,
|
||||||
char *data,
|
char *data,
|
||||||
uint32_t length)
|
uint32_t length)
|
||||||
@ -1085,6 +1092,7 @@ shellmatta_retCode_t shellmatta_write( shellmatta_handle_t handle,
|
|||||||
if( (NULL != inst)
|
if( (NULL != inst)
|
||||||
&& (SHELLMATTA_MAGIC == inst->magic))
|
&& (SHELLMATTA_MAGIC == inst->magic))
|
||||||
{
|
{
|
||||||
|
/** -# pass the data to the write function of the instance */
|
||||||
ret = inst->write(data, length);
|
ret = inst->write(data, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1115,6 +1123,7 @@ shellmatta_retCode_t shellmatta_printf( shellmatta_handle_t handle,
|
|||||||
if( (NULL != inst)
|
if( (NULL != inst)
|
||||||
&& (SHELLMATTA_MAGIC == inst->magic))
|
&& (SHELLMATTA_MAGIC == inst->magic))
|
||||||
{
|
{
|
||||||
|
/** -# assemble output string and write it */
|
||||||
va_start(arg, fmt);
|
va_start(arg, fmt);
|
||||||
length = vsnprintf(outputBuffer, SHELLMATTA_OUTPUT_BUFFER_SIZE, fmt, arg);
|
length = vsnprintf(outputBuffer, SHELLMATTA_OUTPUT_BUFFER_SIZE, fmt, arg);
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
|
Loading…
Reference in New Issue
Block a user