00001 #ifndef RL_CANSTRUCTS_H 00002 #define RL_CANSTRUCTS_H 00003 00005 typedef union 00006 { 00007 struct{ 00008 unsigned char byte1; 00009 }oneByteMsg; 00010 00011 struct{ 00012 unsigned char byte1, byte2; 00013 }twoByteMsg; 00014 00015 struct{ 00016 unsigned char byte1, byte2, byte3; 00017 }threeByteMsg; 00018 00019 struct{ 00020 unsigned char byte1, byte2, byte3, byte4; 00021 }fourByteMsg; 00022 00023 struct{ 00024 unsigned char byte1, byte2, byte3, byte4, byte5; 00025 }fiveByteMsg; 00026 00027 struct{ 00028 unsigned char byte1, byte2, byte3, byte4, byte5, byte6; 00029 }sixByteMsg; 00030 00031 struct{ 00032 unsigned char byte1, byte2, byte3, byte4, byte5, byte6, byte7; 00033 }sevenByteMsg; 00034 struct{ 00035 unsigned char byte1, byte2, byte3, byte4, byte5, byte6, byte7, byte8; 00036 }eightByteMsg; 00037 00038 } CANMessage; 00039 00041 typedef struct 00042 { 00043 long id; 00044 CANMessage message; 00045 unsigned int dlc, flags; 00046 unsigned long timestamp; 00047 } CANStruct; 00048 00049 #endif