Changeset 23 in pacpussensors for trunk/CanGateway/driver
- Timestamp:
- Aug 11, 2013, 11:19:01 AM (11 years ago)
- Location:
- trunk/CanGateway/driver
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CanGateway/driver/PeakCanDriver.cpp
r1 r23 144 144 short PeakCanDriver::sendFrame (struct CanFrame frame) 145 145 { 146 TPCANMsg msg; 147 msg.MSGTYPE = 0; //normal message 148 //msg.MSGTYPE |= MSGTYPE_EXTENDED; //extended ? 149 msg.ID = frame.id; 150 msg.LEN = frame.dlc; 151 memcpy(msg.DATA, frame.data, frame.dlc); 152 if(CAN_Write(canDeviceHandle_, &msg)) { 153 perror("application: CAN_Write()"); 154 return errno; 155 } 146 156 return PSUCCESS; 147 157 } … … 164 174 if ((errno = LINUX_CAN_Read_Timeout(canDeviceHandle_, &message, READ_TIMEOUT))) 165 175 { 166 perror("application: CAN_Read()"); 176 //Timeout: 177 //perror("application: CAN_Read()"); 167 178 return errno; 168 179 } -
trunk/CanGateway/driver/PeakCanDriver.h
r1 r23 18 18 19 19 #include "CanDriverBase.h" 20 #include "libpcan.h"20 #include <libpcan.h> 21 21 #include <fcntl.h> // O_RDWR 22 22 #include <errno.h> … … 24 24 25 25 #define PSUCCESS 0 26 #define READ_TIMEOUT 100000 26 #define READ_TIMEOUT 100000// 100 miliseconds timeout 27 27 28 28 class PeakCanDriver : public CanDriverBase
Note:
See TracChangeset
for help on using the changeset viewer.