146 id=can_packet->
getId();
148 uint64_t candatabytes = can_packet->
getData();
149 char *candata=(
char*)&candatabytes;
150 int code = candata[0]&0xFF;
152 string_id = (candata[1]&0xF0)>>4;
153 offset = (candata[1]&0x0F);
154 data_can[string_id].board_id = char(
id>>4&0xf);
160 yError(
"CANPrint msg from board %d contains an ERROR! (>MAX_STRINGS)\n",data_can[string_id ].board_id);
163 for (j=0 ; j<size-2; j++)
164 data_can[string_id].text_buffer[j+
offset*6]=candata[j+2];
166 if (code==ICUBCANPROTO_PER_MC_MSG__PRINT + 128)
168 data_can[string_id].maybe_last_part =
true;
169 data_can[string_id].expected_length=
offset*6+size-2;
172 if (data_can[string_id].maybe_last_part)
174 data_can[string_id].current_length=strlen(data_can[string_id].text_buffer);
176 if (data_can[string_id].expected_length==data_can[string_id].current_length)
177 data_can[string_id].complete =
true;
186 if (data_can[string_id].complete)
return string_id;
194 for (
int i = 0; i < 256; i++) data_can[buffer_num].text_buffer[i]=0;
195 data_can[buffer_num].complete=
false;
196 data_can[buffer_num].maybe_last_part=
false;
197 data_can[buffer_num].expected_length = 0;
198 data_can[buffer_num].board_id=0;
199 data_can[buffer_num].current_length = 0;