diff -r f45fd4cd3832 -r 34654679f262 doc/doxygen/html/can__lincan_8c-source.html --- a/doc/doxygen/html/can__lincan_8c-source.html Fri Jul 06 10:53:15 2007 +0200 +++ b/doc/doxygen/html/can__lincan_8c-source.html Mon Jul 16 08:56:03 2007 +0200 @@ -18,7 +18,7 @@
00001 /* 00002 This file is part of CanFestival, a library implementing CanOpen Stack. 00003 @@ -52,12 +52,12 @@ 00031 #include "can_driver.h" 00032 00033 /*********functions which permit to communicate with the board****************/ -00034 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) +00034 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m) 00035 { 00036 int res; 00037 struct canmsg_t canmsg; 00038 -00039 canmsg.flags = 0; /* Ensure standard receive, not required for LinCAN>=0.3.1 */ +00039 canmsg.flags = 0; /* Ensure standard receive, not required for LinCAN>=0.3.1 */ 00040 00041 do{ 00042 res = read(fd0,&canmsg,sizeof(canmsg_t)); @@ -67,40 +67,40 @@ 00046 if(res != sizeof(canmsg_t)) // No new message 00047 return 1; 00048 -00049 if(canmsg.flags&MSG_EXT){ +00049 if(canmsg.flags&MSG_EXT){ 00050 /* There is no mark for extended messages in CanFestival */; 00051 } 00052 -00053 m->cob_id.w = canmsg.id; -00054 m->len = canmsg.length; -00055 if(canmsg.flags&MSG_RTR){ -00056 m->rtr = 1; +00053 m->cob_id.w = canmsg.id; +00054 m->len = canmsg.length; +00055 if(canmsg.flags&MSG_RTR){ +00056 m->rtr = 1; 00057 }else{ -00058 m->rtr = 0; -00059 memcpy(m->data,canmsg.data,8); +00058 m->rtr = 0; +00059 memcpy(m->data,canmsg.data,8); 00060 } 00061 00062 return 0; 00063 } 00064 00065 /***************************************************************************/ -00066 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) +00066 UNS8 canSend_driver(CAN_HANDLE fd0, Message *m) 00067 { 00068 int res; 00069 struct canmsg_t canmsg; 00070 00071 -00072 canmsg.flags = 0; -00073 canmsg.id = m->cob_id.w; -00074 canmsg.length = m->len; -00075 if(m->rtr){ -00076 canmsg.flags |= MSG_RTR; +00072 canmsg.flags = 0; +00073 canmsg.id = m->cob_id.w; +00074 canmsg.length = m->len; +00075 if(m->rtr){ +00076 canmsg.flags |= MSG_RTR; 00077 }else{ -00078 memcpy(canmsg.data,m->data,8); +00078 memcpy(canmsg.data,m->data,8); 00079 } 00080 -00081 if(canmsg.id >= 0x800){ -00082 canmsg.flags |= MSG_EXT; +00081 if(canmsg.id >= 0x800){ +00082 canmsg.flags |= MSG_EXT; 00083 } 00084 00085 res = write(fd0,&canmsg,sizeof(canmsg_t)); @@ -113,13 +113,13 @@ 00092 /***************************************************************************/ 00093 static const char lnx_can_dev_prefix[] = "/dev/can"; 00094 -00095 CAN_HANDLE canOpen_driver(s_BOARD *board) +00095 CAN_HANDLE canOpen_driver(s_BOARD *board) 00096 { -00097 int name_len = strlen(board->busname); +00097 int name_len = strlen(board->busname); 00098 int prefix_len = strlen(lnx_can_dev_prefix); 00099 char dev_name[prefix_len+name_len+1]; 00100 int o_flags = 0; -00101 CAN_HANDLE fd0; +00101 CAN_HANDLE fd0; 00102 00103 fd0=malloc(sizeof(*fd0)); 00104 if(fd0==NULL) @@ -128,12 +128,12 @@ 00107 /*o_flags = O_NONBLOCK;*/ 00108 00109 memcpy(dev_name,lnx_can_dev_prefix,prefix_len); -00110 memcpy(dev_name+prefix_len,board->busname,name_len); +00110 memcpy(dev_name+prefix_len,board->busname,name_len); 00111 dev_name[prefix_len+name_len] = 0; 00112 00113 fd0 = open(dev_name, O_RDWR|o_flags); 00114 if(fd0 < 0){ -00115 fprintf(stderr,"!!! Board %s is unknown. See can_lincan.c\n", board->busname); +00115 fprintf(stderr,"!!! Board %s is unknown. See can_lincan.c\n", board->busname); 00116 goto error_ret; 00117 } 00118 @@ -145,14 +145,14 @@ 00124 } 00125 00126 /***************************************************************************/ -00127 int canClose_driver(CAN_HANDLE fd0) +00127 int canClose_driver(CAN_HANDLE fd0) 00128 { 00129 if(!fd0) 00130 return 0; 00131 close(fd0); 00132 return 0; 00133 } -