Skip to content
Snippets Groups Projects
Commit cea127e5 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added and exception in the read_frame function to notify that no data is available.

parent 4101cd1f
No related branches found
No related tags found
No related merge requests found
......@@ -304,13 +304,15 @@ void CCAN::read_frame(unsigned int *can_id, unsigned char *data, int *len)
frame=this->rx_frames.front();
this->rx_frames.pop();
*can_id=frame.can_id;
*len=frame.can_dlc;
*len=frame.can_dlc; //COMMENT: Do we need a cast ? frame.can_dlc is __u8 type variable (see /usr/include/linux/can.h)
for(i=0;i<frame.can_dlc;i++)
data[i]=frame.data[i];
}
else
{
/* handle exceptions */
this->can_access.exit();
throw CCommException(_HERE_,"No data available",this->comm_id);
}
this->can_access.exit();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment