drivers/can_virtual/can_virtual.c
changeset 193 0487270d441c
parent 157 8b45ff4202c3
child 301 f4b64aa848e1
equal deleted inserted replaced
192:9dd6f17ef7e5 193:0487270d441c
    40 CANPipe canpipes[MAX_NB_CAN_PIPES] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},};
    40 CANPipe canpipes[MAX_NB_CAN_PIPES] = {{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},{0,},};
    41 
    41 
    42 /*********functions which permit to communicate with the board****************/
    42 /*********functions which permit to communicate with the board****************/
    43 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m)
    43 UNS8 canReceive_driver(CAN_HANDLE fd0, Message *m)
    44 {
    44 {
    45 	if(read(((CANPipe*)fd0)->pipe[0], m, sizeof(Message)) < sizeof(Message))
    45 	if(read(((CANPipe*)fd0)->pipe[0], m, sizeof(Message)) != (ssize_t)sizeof(Message))
    46 	{
    46 	{
    47 		return 1;
    47 		return 1;
    48 	}
    48 	}
    49 	return 0;
    49 	return 0;
    50 }
    50 }