]> rtime.felk.cvut.cz Git - can-utils.git/blobdiff - lib.c
pointer to const in lib
[can-utils.git] / lib.c
diff --git a/lib.c b/lib.c
index 2c8df32388c4ba7b604512c608b58549ce690067..fe18e0f9781206030a62aaecf9a61394cf6b8525 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -446,6 +446,7 @@ static const char *controller_problems[] = {
        "tx-error-warning",
        "rx-error-passive",
        "tx-error-passive",
+       "back-to-error-active",
 };
 
 static const char *protocol_violation_types[] = {
@@ -455,7 +456,7 @@ static const char *protocol_violation_types[] = {
        "tx-dominant-bit-error",
        "tx-recessive-bit-error",
        "bus-overload",
-       "back-to-error-active",
+       "active-error",
        "error-on-tx",
 };
 
@@ -518,14 +519,14 @@ static int snprintf_error_data(char *buf, size_t len, uint8_t err,
        return n;
 }
 
-static int snprintf_error_lostarb(char *buf, size_t len, struct canfd_frame *cf)
+static int snprintf_error_lostarb(char *buf, size_t len, const struct canfd_frame *cf)
 {
        if (len <= 0)
                return 0;
        return snprintf(buf, len, "{at bit %d}", cf->data[0]);
 }
 
-static int snprintf_error_ctrl(char *buf, size_t len, struct canfd_frame *cf)
+static int snprintf_error_ctrl(char *buf, size_t len, const struct canfd_frame *cf)
 {
        int n = 0;
 
@@ -541,7 +542,7 @@ static int snprintf_error_ctrl(char *buf, size_t len, struct canfd_frame *cf)
        return n;
 }
 
-static int snprintf_error_prot(char *buf, size_t len, struct canfd_frame *cf)
+static int snprintf_error_prot(char *buf, size_t len, const struct canfd_frame *cf)
 {
        int n = 0;
 
@@ -562,8 +563,8 @@ static int snprintf_error_prot(char *buf, size_t len, struct canfd_frame *cf)
        return n;
 }
 
-void snprintf_can_error_frame(char *buf, size_t len, struct canfd_frame *cf,
-                             char* sep)
+void snprintf_can_error_frame(char *buf, size_t len, const struct canfd_frame *cf,
+                  const char* sep)
 {
        canid_t class, mask;
        int i, n = 0, classes = 0;