浏览代码

#10 - added documentation for the new write function

prozessorkern 5 年之前
父节点
当前提交
bc8a9f1dce
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/shellmatta.c

+ 9 - 0
src/shellmatta.c

@@ -1074,6 +1074,13 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t     handle,
     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,
                                         char                *data,
                                         uint32_t            length)
@@ -1085,6 +1092,7 @@ shellmatta_retCode_t shellmatta_write(  shellmatta_handle_t handle,
     if(     (NULL               != inst)
         &&  (SHELLMATTA_MAGIC   == inst->magic))
     {
+        /** -# pass the data to the write function of the instance  */
         ret = inst->write(data, length);
     }
 
@@ -1115,6 +1123,7 @@ shellmatta_retCode_t shellmatta_printf( shellmatta_handle_t handle,
     if(     (NULL               != inst)
         &&  (SHELLMATTA_MAGIC   == inst->magic))
     {
+        /** -# assemble output string and write it  */
         va_start(arg, fmt);
         length = vsnprintf(outputBuffer, SHELLMATTA_OUTPUT_BUFFER_SIZE, fmt, arg);
         va_end(arg);