Win32 IXXAT driver:
authorChristian Taedcke <hacking@taedcke.com>
Tue, 08 Nov 2011 08:27:29 +0000
changeset 683 a3ff0e3e9829
parent 682 dce1e0af6604
child 684 3804ee7f9030
Win32 IXXAT driver:
FIXED: - A return value of 0 from VCI_ResetCan() and VCI_StartCan() indicates an error, too.
CHANGED: - The return values of VCI_ResetCan() and VCI_StartCan() are logged in case of an error.
drivers/can_ixxat_win32/ixxat.cpp
--- a/drivers/can_ixxat_win32/ixxat.cpp	Thu Dec 22 16:03:39 2011 +0100
+++ b/drivers/can_ixxat_win32/ixxat.cpp	Tue Nov 08 08:27:29 2011 +0000
@@ -338,14 +338,20 @@
           ::OutputDebugString("\nIXXAT canBusWatchdog: Remote queue overrun detected!\n");
         }
 
-        if (VCI_ResetCan(m_BoardHdl, CAN_NUM) < 0)
-        {
-          ::OutputDebugString("\nIXXAT canBusWatchdog: ERROR: Resetting the can module failed!\n");
+        res = VCI_ResetCan(m_BoardHdl, CAN_NUM);
+        if (res <= 0)
+        {
+          char buf[200];
+          ::sprintf(buf, "\nIXXAT canBusWatchdog: ERROR: Resetting the can module failed with code '%d'!\n", res);
+          ::OutputDebugString(buf);
         }
 
-        if (VCI_StartCan(m_BoardHdl, CAN_NUM) < 0)
-        {
-          ::OutputDebugString("\nIXXAT canBusWatchdog: ERROR: Restaring the can module failed!\n");
+        res = VCI_StartCan(m_BoardHdl, CAN_NUM);
+        if (res <= 0)
+        {
+          char buf[200];
+          ::sprintf(buf, "\nIXXAT canBusWatchdog: ERROR: Restaring the can module failed with code '%d'!\n", res);
+          ::OutputDebugString(buf);
         }
       }
     }