Pārlūkot izejas kodu

added structure documentation for ymodem

stefan 9 mēneši atpakaļ
vecāks
revīzija
26b25ee206
2 mainītis faili ar 11 papildinājumiem un 13 dzēšanām
  1. 11 12
      api/shellmatta.h
  2. 0 1
      src/shellmatta_ymodem.c

+ 11 - 12
api/shellmatta.h

@@ -244,18 +244,17 @@ typedef struct
  */
 typedef struct
 {
-    shellmatta_ymodem_state_t state;                            /**< todo */
-    uint32_t byteCounter;                                       /**< todo */
-    uint32_t packetCounter;                                     /**< todo */
-    uint32_t totalBytesReceived;                                /**< todo */
-    char *fileName;                                             /**< todo */
-    uint32_t fileSize;                                          /**< todo */
-    bool pauseRequested;                                        /**< todo */
-    shellmatta_ymodem_packet_t packet;                          /**< todo */
-    shellmatta_ymodem_cancel_t cancelCallback;                  /**< todo */
-    shellmatta_ymodem_recvHeader_t recvHeaderCallback;          /**< todo */
-    shellmatta_ymodem_recvPacket_t recvPacketCallback;          /**< todo */
-    shellmatta_ymodem_complete_t transmissionCompleteCallback;  /**< todo */
+    shellmatta_ymodem_state_t state;                            /**< current stat of the ymodem module              */
+    uint32_t byteCounter;                                       /**< internal counter for processing input data     */
+    uint32_t packetCounter;                                     /**< counter of the totally received packets        */
+    uint32_t totalBytesReceived;                                /**< counter of the totally received bytes          */
+    uint32_t fileSize;                                          /**< size of the file received in packet 0          */
+    bool pauseRequested;                                        /**< pause requested from the application           */
+    shellmatta_ymodem_packet_t packet;                          /**< currently processed packet                     */
+    shellmatta_ymodem_cancel_t cancelCallback;                  /**< callback to pass cancel events                 */
+    shellmatta_ymodem_recvHeader_t recvHeaderCallback;          /**< callback to pass received header data          */
+    shellmatta_ymodem_recvPacket_t recvPacketCallback;          /**< callback to pass received data                 */
+    shellmatta_ymodem_complete_t transmissionCompleteCallback;  /**< callback to be called on a complete transfer   */
 } shellmatta_ymodem_t;
 
 #ifdef SHELLMATTA_TRANSPORT

+ 0 - 1
src/shellmatta_ymodem.c

@@ -70,7 +70,6 @@ static void shellmatta_ymodem_reset(shellmatta_handle_t handle, bool doCancel)
     inst->ymodem.byteCounter = 0u;
     inst->ymodem.packetCounter = 0u;
     inst->ymodem.totalBytesReceived = 0u;
-    inst->ymodem.fileName = NULL;
     inst->ymodem.fileSize = 0u;
     inst->ymodem.pauseRequested = false;