Skip to content

Commit

Permalink
Ignore CAN messages that are not repsonses
Browse files Browse the repository at this point in the history
  • Loading branch information
kr0ner committed Dec 10, 2024
1 parent 72286a2 commit 18cc2ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/communication.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ std::pair<Property, SimpleVariant> processCanMessage(const std::vector<std::uint
ESP_LOGI("Communication",
"Message received: Read/Write ID 0x%02x 0x%02x(0x%04x) for property %s (0x%04x) with raw value: %d",
msg[0U], msg[1U], canId, std::string(property.name).c_str(), property.id, value);
if (isRequest(msg)) {
if (!isResponse(msg)) {
ESP_LOGD("Communication", "Message is not a response. Dropping it!");
return {Property::kINDEX_NOT_FOUND, value};
}
return {property, GetValueByType(value, property.type)};
Expand Down

0 comments on commit 18cc2ca

Please sign in to comment.