/* Get data size in bytes based on the Data Length Code (DLC) option of a message. */
static uint8_t can_ctrl_dlc_to_size(enum can_ctrl_dlc dlc)
/* Get data size in bytes based on the Data Length Code (DLC) option of a message. */
static uint8_t can_ctrl_dlc_to_size(enum can_ctrl_dlc dlc)
{
	switch(dlc) {
	case CAN_DLC_0:
	case CAN_DLC_1:
	case CAN_DLC_2:
	case CAN_DLC_3:
	case CAN_DLC_4:
	case CAN_DLC_5:
	case CAN_DLC_6:
	case CAN_DLC_7:
	case CAN_DLC_8:
		return dlc;
	case CAN_DLC_12:
		return 12;
	case CAN_DLC_16:
		return 16;
	case CAN_DLC_20:
		return 20;
	case CAN_DLC_24:
		return 24;
	case CAN_DLC_32:
		return 32;
	case CAN_DLC_48:
		return 48;
	case CAN_DLC_64:
		return 64;
	default:
		return 0;
	}
}