Allow CoE OD List Segments to have 6 bytes instead of 8.

This commit is contained in:
Florian Pose 2012-01-05 16:47:23 +01:00
parent 28d4117b19
commit 54e2ff770e
1 changed files with 5 additions and 5 deletions

View File

@ -507,16 +507,16 @@ void ec_fsm_coe_dict_response(ec_fsm_coe_t *fsm /**< finite state machine */)
return;
}
if (rec_size < 8 || rec_size % 2) {
EC_SLAVE_ERR(slave, "Invalid data size %zu!\n", rec_size);
first_segment = list_empty(&slave->sdo_dictionary) ? true : false;
index_list_offset = first_segment ? 8 : 6;
if (rec_size < index_list_offset || rec_size % 2) {
EC_SLAVE_ERR(slave, "Invalid data size %zu !\n", rec_size);
ec_print_data(data, rec_size);
fsm->state = ec_fsm_coe_error;
return;
}
first_segment = list_empty(&slave->sdo_dictionary) ? true : false;
index_list_offset = first_segment ? 8 : 6;
sdo_count = (rec_size - index_list_offset) / 2;
for (i = 0; i < sdo_count; i++) {