- Timestamp:
- Jul 28, 2015, 4:28:08 PM (9 years ago)
- Location:
- trunk/CanGateway
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CanGateway/CanGateway.cpp
r44 r91 91 91 qFatal("Failed to open the CAN interface port %s in %s mode",port_, accessMode_); 92 92 } 93 else if (source_ == "kvaser") 94 { 95 canIf_.setSource(Win32CanInterface::KvaserCard); 96 // open interface 97 if (canIf_.openInterface(channel_,speed_)==0) 98 qFatal("Failed to open the CAN interface num %d at speed %d",channel_,speed_); 99 } 93 100 else 94 101 { … … 112 119 canIf_.stop(); 113 120 114 if ((source_ == "vector")||(source_=="peak")||(source_=="vectorXL")||(source_=="igep") )121 if ((source_ == "vector")||(source_=="peak")||(source_=="vectorXL")||(source_=="igep")||(source_=="kvaser")) 115 122 canIf_.closeInterface(channel_); 116 123 … … 151 158 } 152 159 setRecording( config.getProperty("recording") == "true" ? true : false ); 160 161 verbose_ = config.getProperty("verbose") == "true" ? true : false; 153 162 154 163 return ComponentBase::CONFIGURED_OK; … … 193 202 } 194 203 195 //displayData(incomingCanFrames_[counter_].frame.data, incomingCanFrames_[counter_].frame.dlc, incomingCanFrames_[counter_].frame.id);204 if (verbose_) displayData(incomingCanFrames_[counter_].frame.data, incomingCanFrames_[counter_].frame.dlc, incomingCanFrames_[counter_].frame.id); 196 205 if (isRecording()) 197 206 { -
trunk/CanGateway/CanGateway.h
r44 r91 82 82 bool THREAD_ALIVE; 83 83 84 bool verbose_; 85 84 86 }; 85 87 -
trunk/CanGateway/cangateway.xml
r66 r91 6 6 channel="1" 7 7 speed="500" 8 recording="true"/> 8 recording="true" 9 verbose="true" /> 9 10 </components> 10 11 <connections> -
trunk/CanGateway/driver/KVaserCanDriver.cpp
r89 r91 248 248 memcpy(frame.data, msg, frame.dlc); 249 249 return 0; 250 } else if (stat == canERR_NOMSG ) { 250 } 251 } 252 else if (stat == canERR_NOMSG ) { 251 253 // timeout occurs 252 254 LOG_WARN("Kvaser card - receiveFrame() method - TIMEOUT"); 253 255 return 1; 254 } else { 256 } 257 else { 255 258 // An error frame. 256 259 LOG_WARN("Kvaser card, error frame"); 257 260 return 1; 258 259 } 260 261 return 0;261 } 262 263 264 return 1; 262 265 } 263 266
Note:
See TracChangeset
for help on using the changeset viewer.