drivers/can_can4linux/can_can4linux.c
changeset 365 9b76e0881beb
parent 364 17edd8a028fa
child 384 83793fc7ce48
equal deleted inserted replaced
364:17edd8a028fa 365:9b76e0881beb
    52 
    52 
    53 	if(canmsg.flags&MSG_EXT){
    53 	if(canmsg.flags&MSG_EXT){
    54    		/* There is no mark for extended messages in CanFestival */;
    54    		/* There is no mark for extended messages in CanFestival */;
    55 	}
    55 	}
    56   		
    56   		
    57 	m->cob_id.w = canmsg.id;
    57 	m->cob_id = canmsg.id;
    58 	m->len = canmsg.length;
    58 	m->len = canmsg.length;
    59 	if(canmsg.flags&MSG_RTR){
    59 	if(canmsg.flags&MSG_RTR){
    60  		m->rtr = 1;
    60  		m->rtr = 1;
    61 	}else{
    61 	}else{
    62  		m->rtr = 0;
    62  		m->rtr = 0;
    64 	}
    64 	}
    65 	
    65 	
    66 	
    66 	
    67  	/*gettimeofday(&current_time,NULL);
    67  	/*gettimeofday(&current_time,NULL);
    68  	time_period=(current_time.tv_sec - init_time.tv_sec)* 1000000 + current_time.tv_usec - init_time.tv_usec;
    68  	time_period=(current_time.tv_sec - init_time.tv_sec)* 1000000 + current_time.tv_usec - init_time.tv_usec;
    69  	printf("%3ld.%3ld.%3ld - Receive ID: %lx ->",time_period/1000000,(time_period%1000000)/1000,time_period%1000,m->cob_id.w);
    69  	printf("%3ld.%3ld.%3ld - Receive ID: %lx ->",time_period/1000000,(time_period%1000000)/1000,time_period%1000,m->cob_id);
    70  	printf("Receive ID: %lx ->",m->cob_id.w);
    70  	printf("Receive ID: %lx ->",m->cob_id);
    71  	for(i=0; i<canmsg.length;i++)printf("%x, ", m->data[i]);
    71  	for(i=0; i<canmsg.length;i++)printf("%x, ", m->data[i]);
    72  	printf("\n");*/
    72  	printf("\n");*/
    73  
    73  
    74   return 0;
    74   return 0;
    75 }
    75 }
    79 {
    79 {
    80   int res;
    80   int res;
    81   canmsg_t canmsg;
    81   canmsg_t canmsg;
    82 
    82 
    83   canmsg.flags = 0;
    83   canmsg.flags = 0;
    84   canmsg.id = m->cob_id.w;
    84   canmsg.id = m->cob_id;
    85   canmsg.length = m->len;
    85   canmsg.length = m->len;
    86   if(m->rtr){
    86   if(m->rtr){
    87     canmsg.flags |= MSG_RTR;
    87     canmsg.flags |= MSG_RTR;
    88   }else{
    88   }else{
    89     memcpy(canmsg.data,m->data,8);
    89     memcpy(canmsg.data,m->data,8);