94 for (
int i = 0; i < 256; i++) data[buffer_num].text_buffer[i]=0;
95 data[buffer_num].complete=
false;
96 data[buffer_num].maybe_last_part=
false;
97 data[buffer_num].expected_length = 0;
98 data[buffer_num].board_id=0;
99 data[buffer_num].current_length = 0;
108 yarp::dev::CanMessage* t;
112 t = (yarp::dev::CanMessage*) (can_packet);
115 unsigned char *candata=t->getData();
116 string_id = (candata[1]>>4);
117 offset = (candata[1]&0x0F);
118 data[string_id].board_id = char(
id>>4&0xf);
122 yError(
"msg from board %d contains an ERROR! (>MAX_STRINGS)\n",data[string_id ].board_id);
126 for (j=0 ; j<len-2; j++)
127 data[string_id].text_buffer[j+
offset*6]=candata[j+2];
129 if (candata[0]==ICUBCANPROTO_PER_MC_MSG__PRINT + 128)
131 data[string_id].maybe_last_part =
true;
132 data[string_id].expected_length=
offset*6+len-2;
135 if (data[string_id].maybe_last_part)
137 data[string_id].current_length=strlen(data[string_id].text_buffer);
139 if (data[string_id].expected_length==data[string_id].current_length)
140 data[string_id].complete =
true;
163 if (data[string_id].complete)
return string_id;