]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
minor updates
authorhadaq <hadaq>
Sat, 15 Jan 2011 10:37:34 +0000 (10:37 +0000)
committerhadaq <hadaq>
Sat, 15 Jan 2011 10:37:34 +0000 (10:37 +0000)
libtrbnet/trbcmd.c
libtrbnet/trbdhcp.c
libtrbnet/trbflash.c

index 1c27cad37ac3273369431ce25a42e471c7cbbf3c..a1657a6f6a7d64be09e768a08fbc0f26beae623a 100644 (file)
@@ -25,7 +25,7 @@
                                          
 static int hexMode = HEXMODE;
 
-static const char trbcmd_version[] = "$Revision: 2.63 $";
+static const char trbcmd_version[] = "$Revision: 2.64 $";
 
 #define BACKLOG 10
 static uint16_t tcp_port = 55555;
@@ -752,7 +752,11 @@ int start(int argc, char **argv)
         if (trb_debug > 0) {
           fprintf(stderr,
                   "Command: SET_ADDRESS: "
+#ifndef X86_64
                   "uid: 0x%016llx, "
+#else
+                  "uid: 0x%016lx, "
+#endif
                   "endpoint: 0x%02x, "
                   "trb_address: 0x%04x\n", uid, endpoint, trb_address);
         }
@@ -1444,7 +1448,7 @@ int main(int argc, char **argv)
                                                fprintf(clientout, "\n----------------------------\n\n");
                fflush(clientout);
                if (tcp_debug > 0) {
-               fprintf(stderr, "%d: received: %i\n", myPid, msgLen);
+               fprintf(stderr, "%d: received: %i\n", myPid, (int)msgLen);
                if (msgLen > 0) {
                fprintf(stderr, "%d: command: ", myPid);
                for (i = 1; i < (unsigned int)start_argc; i++) {
@@ -1474,7 +1478,7 @@ int main(int argc, char **argv)
                }
 
                if (tcp_debug > 0) {
-               fprintf(stderr, "%d: received: %i\n", myPid, msgLen);
+               fprintf(stderr, "%d: received: %i\n", myPid, (int)msgLen);
                if (msgLen > 0) {
                fprintf(stderr, "%d: command: ", myPid);
                for (i = 1; i < (unsigned int)start_argc; i++) {
index ecf092ef6b841ecc0db959747e887d776a47945d..1febf6a85e8d0604c1226002a214b3c73d07d8ef 100644 (file)
@@ -10,7 +10,7 @@
 #include <trbnet.h>
 #include <trberror.h>
 
-static const char trbdhcp_version[] = "$Revision: 1.4 $";
+static const char trbdhcp_version[] = "$Revision: 1.5 $";
 
 typedef struct {
   uint16_t address;
@@ -70,9 +70,14 @@ static int readConfigFile(const char* fileName)
       *c = '\0';
     }
     
+#ifndef X86_64
     if (sscanf(line, "%x %llx %x", &address, &uid, &endPoint) != 3) {
+#else
+    if (sscanf(line, "%x %lx %x", &address, &uid, &endPoint) != 3) {
+#endif
       continue;
     }
+
     if (counter < NUM_ENDPOINTS) {
       endPointList[counter].address = address;
       endPointList[counter].uid = uid;
@@ -95,7 +100,11 @@ static void dumpList()
 {
   unsigned int i;
   for (i = 0; i < listSize; i++) {
+#ifndef X86_64
     fprintf(stdout, "Entry #%d: 0x%04x 0x%08llx 0x%02x\n", i,
+#else
+    fprintf(stdout, "Entry #%d: 0x%04x 0x%08lx 0x%02x\n", i,
+#endif
            endPointList[i].address,
            endPointList[i].uid,
            endPointList[i].endPoint); 
@@ -199,7 +208,11 @@ int main(int argc, char ** argv)
         
         if (currentAddress != endPointList[j].address) {
           if (trb_debug > 0) {
+#ifndef X86_64
             fprintf(stderr, "set address: 0x%04x  0x%08llx 0x%02x\n",
+#else
+            fprintf(stderr, "set address: 0x%04x  0x%08lx 0x%02x\n",
+#endif
                     currentAddress, uid, endPoint);  
           }
           
index a9d687663e542028cfbe05b366fbe8313c3fc516..9bd6c7e23707a4067e874c70d56b7a38f926a0e4 100644 (file)
@@ -97,7 +97,7 @@ static const char FlashTypeStr[16][32] =
 
 static FlashType flashType = FLASH_INVALID; 
 static uint32_t manId = 0;
-static const char trbflash_version[] = "$Revision: 2.25 $"; 
+static const char trbflash_version[] = "$Revision: 2.26 $"; 
 
 static uint32_t mdcFlashSelect = 1;
 
@@ -186,7 +186,7 @@ static int readCtrlRegister(uint16_t trb_address,
   } while (trb_term.status_channel != 0);
   
   if (status <= 0) {
-    fprintf(logFile, "Error > readCtrlRegister: invalid length returned\n");
+    fprintf(logFile, "Error > readCtrlRegister: %s\n", trb_strerror());
     return -1;
   }