Skip to content

Commit

Permalink
Fix DroneCAN/UAVCANv0 handling of uavcan.protocol.file.Read responses (
Browse files Browse the repository at this point in the history
…#28)

An empty response to the uavcan.protocol.file.Read will have a size of 2 bytes (this is the size of the error field), while the DroneCAN -> Cyphal converter expects at least 4, because it mistakenly assumes that the minimum response size will be like in Cyphal, where there is no tail array optimization.
  • Loading branch information
DJ-Von authored Apr 16, 2024
1 parent a566ca6 commit d806ba1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kocherga/kocherga_can.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ class V0MainActivity : public IActivity
const std::size_t response_size,
const std::uint8_t* const response_data)
{
if (response_size >= 4)
if (response_size >= 2)
{
std::array<std::uint8_t, 270> buf{};
buf.back() = 0xAA;
Expand Down

0 comments on commit d806ba1

Please sign in to comment.