-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
double GetValue(String name) {
if (state != IDLE) return 0;
twai_message_t rxframe;
int id = getId(name);
requestSdoElement(SDO_INDEX_PARAM_UID | (id >> 8), id & 0xFF);
if (twai_receive(&rxframe, pdMS_TO_TICKS(10)) == ESP_OK) {
if (rxframe.data[0] == 0x80)
return 0;
else
return ((double)*(uint32_t*)&rxframe.data[4]) / 32;
}
else {
return 0;
}
}
It doesn't check the ID of the received can message is an SDO response, if it's a response for the requested parameter ID etc
Metadata
Metadata
Assignees
Labels
No labels