Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00022
00023 #include "icl_hardware_can/tCanMessage.h"
00024
00025 #include <string.h>
00026
00027 namespace icl_hardware {
00028 namespace can {
00029
00030 tCanMessage::tCanMessage(unsigned param_id, unsigned char param_dlc,
00031 unsigned char param_rtr, const unsigned char* param_data)
00032 {
00033
00034 memset(this, 0, sizeof(tCanMessage));
00035
00036 id = param_id;
00037 dlc = param_dlc;
00038 rtr = param_rtr;
00039 memset(data, 0, sizeof(data));
00040 if (param_data)
00041 memcpy(data, param_data, sizeof(data));
00042 #ifdef _IC_BUILDER_CAN_ITEC_
00043 eff = 0;
00044 tv.tv_sec=0;
00045 tv.tv_usec=0;
00046 #endif
00047 }
00048
00049 tCanMessage::tCanMessage(const tCanMessage &other)
00050 {
00051
00052 memset(this, 0, sizeof(tCanMessage));
00053
00054 id=other.id;
00055 dlc=other.dlc;
00056 rtr=other.rtr;
00057 memcpy(data, other.data, sizeof(data));
00058 #ifdef _IC_BUILDER_CAN_ITEC_
00059 eff = other.eff;
00060 tv = other.tv;
00061 #endif
00062 }
00063
00064 tCanMessage& tCanMessage::operator = (const tCanMessage &other)
00065 {
00066 id=other.id;
00067 dlc=other.dlc;
00068 rtr=other.rtr;
00069 memcpy(data, other.data, sizeof(data));
00070 #ifdef _IC_BUILDER_CAN_ITEC_
00071 eff = other.eff;
00072 tv = other.tv;
00073 #endif
00074 return *this;
00075 }
00076
00077 }
00078 }