]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
status-bit warnings
authorhadaq <hadaq>
Mon, 28 Sep 2009 14:09:16 +0000 (14:09 +0000)
committerhadaq <hadaq>
Mon, 28 Sep 2009 14:09:16 +0000 (14:09 +0000)
libtrbnet/trbcmd.c

index f2adca4d639eb4e3bc23aec9e557dc2fb16f6d6b..a7488d27e24202b18b61bad3ec3eb2370fa14a89 100644 (file)
@@ -16,7 +16,7 @@
 
 static int hexMode = HEXMODE;
 
-static const char trbcmd_version[] = "$Revision: 2.25 $";
+static const char trbcmd_version[] = "$Revision: 2.26 $";
 
 /* ------ MAIN ---------------------------------------------------------- */
 
@@ -237,6 +237,16 @@ int main(int argc, char ** argv)
             exit(EXIT_FAILURE);
           }
         }
+        
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+      
       } else if (strncmp(cmd[0], "r", CMD_SIZE) == 0) {
 
         /*******************************************/
@@ -282,6 +292,16 @@ int main(int argc, char ** argv)
           fprintf(stdout, "0x%04x  0x%08x\n",
                   data[i], data[i + 1]);
         }
+             
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+
       } else if (strncmp(cmd[0], "rm", CMD_SIZE) == 0) {
       
         /*******************************************/
@@ -350,6 +370,15 @@ int main(int argc, char ** argv)
           }
         }
         
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+        
         if (data != NULL) free(data);
       } else if (strncmp(cmd[0], "wm", CMD_SIZE) == 0) {
     
@@ -429,6 +458,16 @@ int main(int argc, char ** argv)
             exit(EXIT_FAILURE);
           }
         }
+        
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+        
       } else if (strncmp(cmd[0], "i", CMD_SIZE) == 0) {
 
         /*******************************************/
@@ -475,6 +514,16 @@ int main(int argc, char ** argv)
                   uidBuffer[i + 1], 
                   uidBuffer[i + 2]);
         }
+        
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+        
       } else if (strncmp(cmd[0], "s", CMD_SIZE) == 0) {
     
         /*******************************************/
@@ -517,6 +566,16 @@ int main(int argc, char ** argv)
             exit(EXIT_FAILURE);
           }
         }
+        
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+        
       } else if (strncmp(cmd[0], "T", CMD_SIZE) == 0) {
     
         /*******************************************/
@@ -561,7 +620,17 @@ int main(int argc, char ** argv)
           if (trb_errno != TRB_ENDPOINT_NOT_REACHED) {
             exit(EXIT_FAILURE);
           }
-        } 
+        }
+        
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+        
       } else if (strncmp(cmd[0], "TR", CMD_SIZE) == 0) {
     
         /*********************************************/
@@ -610,6 +679,16 @@ int main(int argc, char ** argv)
             exit(EXIT_FAILURE);
           }
         }
+        
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+        
       } else if (strncmp(cmd[0], "I", CMD_SIZE) == 0) {
     
         /*******************************************/
@@ -662,6 +741,16 @@ int main(int argc, char ** argv)
         for (i = 0; i < status; i++) {
           fprintf(stdout, "0x%08x\n", buffer[i]);
         }
+        
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+        
       } else if (strncmp(cmd[0], "f", CMD_SIZE) == 0) {
     
         /*******************************************/
@@ -692,6 +781,15 @@ int main(int argc, char ** argv)
           exit(EXIT_FAILURE);
         }
         
+        /* Check Status-Bits */
+        if ((trb_term.status_common != 0x01) || 
+            (trb_term.status_channel != 0)) {
+          if (scriptFile != NULL) {
+            fprintf(stderr, "Line #%d: ", lineCtr);
+          }
+          fprintf(stderr, "WARNING Status-Bits:\n%s\n", trb_strterm(trb_term));
+        }
+        
       } else if (strncmp(cmd[0], "R", CMD_SIZE) == 0) {
     
         /*******************************************/