mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 23:53:33 +08:00
CAN Error frame support for future extensibility
This commit is contained in:
@@ -14,6 +14,7 @@ const uint32_t CanFrame::MaskStdID;
|
||||
const uint32_t CanFrame::MaskExtID;
|
||||
const uint32_t CanFrame::FlagEFF;
|
||||
const uint32_t CanFrame::FlagRTR;
|
||||
const uint32_t CanFrame::FlagERR;
|
||||
|
||||
|
||||
std::string CanFrame::toString(StringRepresentation mode) const
|
||||
@@ -42,6 +43,11 @@ std::string CanFrame::toString(StringRepresentation mode) const
|
||||
{
|
||||
wpos += snprintf(wpos, epos - wpos, " RTR");
|
||||
}
|
||||
else if (id & FlagERR)
|
||||
{
|
||||
// TODO: print error flags
|
||||
wpos += snprintf(wpos, epos - wpos, " ERR");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int dlen = 0; dlen < dlc; dlen++) // hex bytes
|
||||
|
||||
Reference in New Issue
Block a user