Changeset 94 in pacpussensors for trunk/CanGateway/driver/KVaserCanDriver.cpp
- Timestamp:
- Sep 28, 2015, 10:49:02 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CanGateway/driver/KVaserCanDriver.cpp
r91 r94 4 4 5 5 #include "KVaserCanDriver.h" 6 #include "kvaser/canlib.h" 7 6 #ifdef WIN32 7 #include "kvaser/windows/canlib.h" 8 #else 9 #include "kvaser/linux/canlib.h" 10 #endif 8 11 #include <cassert> 9 12 #include <cstdio> … … 11 14 #include <iostream> 12 15 #include <string> 16 #include <string.h> 13 17 14 18 #include "Pacpus/kernel/Log.h" … … 46 50 buf[0] = '\0'; 47 51 canGetErrorText(stat, buf, sizeof(buf)); 48 LOG_ERROR( "%s: failed, stat=%d (%s)\n", id, (int)stat, buf);52 LOG_ERROR(id << ": failed, stat=" << (int)stat << " (" << buf << ")"); 49 53 //exit(1); 50 54 } … … 175 179 short KVaserCanDriver::initPort (void) 176 180 { 177 // 181 #ifdef WIN32 178 182 // Initialize CANLIB. 179 183 // 180 184 canInitializeLibrary(); 181 185 #endif 186 182 187 // open the physical CAN interface 183 188 initialize(kvaserHardwareType_, canChannel_, canBitRate_); … … 229 234 unsigned int dlc, flags; 230 235 unsigned char msg[8]; 231 DWORD time; 236 //DWORD timestamp; 237 unsigned long timestamp; 232 238 233 canStatus stat = canReadWait(canHandle_, &id, msg, &dlc, &flags, &time , WAIT_RECEIVING_FRAME_TIMEOUT);239 canStatus stat = canReadWait(canHandle_, &id, msg, &dlc, &flags, ×tamp, WAIT_RECEIVING_FRAME_TIMEOUT); 234 240 if (stat == canOK ) 235 241 {
Note:
See TracChangeset
for help on using the changeset viewer.