Fix a warning, better comments
authornorly <ny-git@enpas.org>
Tue, 19 Mar 2019 22:01:05 +0000 (23:01 +0100)
committernorly <ny-git@enpas.org>
Tue, 19 Mar 2019 22:01:05 +0000 (23:01 +0100)
include/vag-bap.h
src/bap-rx.c
tools/vag-bap-sniffer.c

index 8e96623509646d7cb607afdbe574e4eb8f4ae775..b2fbde232bb40895191a72657919f91a45c8154b 100644 (file)
@@ -64,7 +64,7 @@ struct BAP_TXer {
        /* Temporary storage for frames not yet fully sent */
        struct BAP_Frame *slot[4];
 
-       /* How many bytes have we already sent on each channel? */
+       /* How many bytes have we already sent on each open slot? */
        BAP_FrameLen slot_done[4];
 };
 
index d82f03d145d507a88d8b78af7caef29b44b95aa1..2a75704b4b5ccdccfbb33ff013131415111983c5 100644 (file)
@@ -30,8 +30,9 @@ struct BAP_Frame* vag_bap_handle_can_frame(struct BAP_RXer *bap, struct can_fram
                        unsigned short header;
                        unsigned this_len;
 
+                       /* Sanity checks */
                        if (frame->can_dlc < 4) {
-                               VAG_DEBUG("Error: Frame too short\n");
+                               VAG_DEBUG("bap_handle_can_frame: Frame too short\n");
                        }
 
                        if (bap->mfchannel[mfchannel]) {
@@ -39,6 +40,7 @@ struct BAP_Frame* vag_bap_handle_can_frame(struct BAP_RXer *bap, struct can_fram
                        }
                        bap->mfchannel[mfchannel] = NULL;
 
+                       /* Frame looks okay, start parsing */
                        bap_frame = vag_bap_frame_alloc();
                        if (!bap_frame) {
                                VAG_DEBUG("bap_handle_can_frame: Failed to allocate new frame\n");
index 1c17a25c5262c555615c31b8f2e9a9fb895c2ea5..65580f9dd98bb25ae52eff58c99fc40b26b91fc4 100644 (file)
@@ -6,6 +6,7 @@
  * by the Free Software Foundation.
  */
 
+#include <ctype.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <unistd.h>