53 return (
'0' + nibble);
56 return (
'A' + (nibble - 10));
66 if (
'0' <= c &&
'9' >= c)
70 else if (
'A' <= c &&
'F' >= c)
74 else if (
'a' <= c &&
'f' >= c)
84 CLR_CAN_FRAME_ERR(*can_frame);
92 SET_CAN_FRAME_EFF(*can_frame);
96 CLR_CAN_FRAME_EFF(*can_frame);
100 SET_CAN_FRAME_ERR(*can_frame);
114 else if (*buf ==
'N')
117 CLR_CAN_FRAME_RTR(*can_frame);
121 else if (*buf ==
'R')
124 SET_CAN_FRAME_RTR(*can_frame);
131 SET_CAN_FRAME_ERR(*can_frame);
135 if (IS_CAN_FRAME_EFF(*can_frame))
137 SET_CAN_FRAME_ID_EFF(*can_frame,
id);
141 SET_CAN_FRAME_ID(*can_frame,
id);
144 while ((*buf != 0) && (*buf !=
';'))
148 if (nh < 0 || nl < 0)
150 SET_CAN_FRAME_ERR(*can_frame);
153 can_frame->data[index++] = (nh << 4) | nl;
155 can_frame->can_dlc = index;
156 CLR_CAN_FRAME_ERR(*can_frame);
201 if (IS_CAN_FRAME_ERR(*can_frame))
203 LOG(
VERBOSE,
"GC generate: incoming frame ERR.");
206 void (*output)(
char*& dst,
char value);
219 if (IS_CAN_FRAME_EFF(*can_frame))
221 id = GET_CAN_FRAME_ID_EFF(*can_frame);
227 id = GET_CAN_FRAME_ID(*can_frame);
231 for (;offset >= 0; offset -= 4)
236 if (IS_CAN_FRAME_RTR(*can_frame))
244 for (offset = 0; offset < can_frame->can_dlc; ++offset)
#define CONSTANT_TRUE
We cannot compare constants to zero, so we use 1 and 2 as constant values for booleans.
#define LOG(level, message...)
Conditionally write a message to the logging output.
static const int VERBOSE
Loglevel that is usually not printed, reporting debugging information.