equal
deleted
inserted
replaced
130 } |
130 } |
131 return 1; |
131 return 1; |
132 } |
132 } |
133 |
133 |
134 /********* functions which permit to communicate with the board ****************/ |
134 /********* functions which permit to communicate with the board ****************/ |
135 UNS8 canReceive_driver (CAN_HANDLE fd0, Message * m) |
135 UNS8 __stdcall canReceive_driver (CAN_HANDLE fd0, Message * m) |
136 { |
136 { |
137 int ret=0; |
137 int ret=0; |
138 UNS8 data; |
138 UNS8 data; |
139 TPCANMsg peakMsg; |
139 TPCANMsg peakMsg; |
140 TPCANTimestamp peakRcvTime; |
140 TPCANTimestamp peakRcvTime; |
215 }while(Res != CAN_ERR_OK); |
215 }while(Res != CAN_ERR_OK); |
216 return 0; |
216 return 0; |
217 } |
217 } |
218 |
218 |
219 /***************************************************************************/ |
219 /***************************************************************************/ |
220 UNS8 canSend_driver (CAN_HANDLE fd0, Message const * m) |
220 UNS8 __stdcall canSend_driver (CAN_HANDLE fd0, Message const * m) |
221 { |
221 { |
222 UNS8 data; |
222 UNS8 data; |
223 DWORD localerrno; |
223 DWORD localerrno; |
224 TPCANMsg peakMsg; |
224 TPCANMsg peakMsg; |
225 peakMsg.ID = m->cob_id; /* 11/29 bit code */ |
225 peakMsg.ID = m->cob_id; /* 11/29 bit code */ |
270 fail: |
270 fail: |
271 return 1; |
271 return 1; |
272 } |
272 } |
273 |
273 |
274 /***************************************************************************/ |
274 /***************************************************************************/ |
275 UNS8 canChangeBaudRate_driver( CAN_HANDLE fd, char* baud) |
275 UNS8 __stdcall canChangeBaudRate_driver( CAN_HANDLE fd, char* baud) |
276 { |
276 { |
277 printf("canChangeBaudRate not yet supported by this driver\n"); |
277 printf("canChangeBaudRate not yet supported by this driver\n"); |
278 return 0; |
278 return 0; |
279 } |
279 } |
280 |
280 |
281 /***************************************************************************/ |
281 /***************************************************************************/ |
282 CAN_HANDLE canOpen_driver (s_BOARD * board) |
282 CAN_HANDLE __stdcall canOpen_driver (s_BOARD * board) |
283 { |
283 { |
284 char busname[64]; |
284 char busname[64]; |
285 char* pEnd; |
285 char* pEnd; |
286 int ret; |
286 int ret; |
287 |
287 |
306 #endif |
306 #endif |
307 return NULL; |
307 return NULL; |
308 } |
308 } |
309 |
309 |
310 /***************************************************************************/ |
310 /***************************************************************************/ |
311 int canClose_driver (CAN_HANDLE fd0) |
311 int __stdcall canClose_driver (CAN_HANDLE fd0) |
312 { |
312 { |
313 #ifdef PCAN2_HEADER_ |
313 #ifdef PCAN2_HEADER_ |
314 // if not the first handler |
314 // if not the first handler |
315 if(second_board == (s_BOARD *)fd0) |
315 if(second_board == (s_BOARD *)fd0) |
316 { |
316 { |