We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b697fe commit 931f0bbCopy full SHA for 931f0bb
libraries/Arduino_CAN/src/Arduino_CAN.cpp
@@ -57,7 +57,10 @@ int Arduino_CAN::write(CanMsg const & msg)
57
CANData,
58
is_standard_id ? CANStandard : CANExtended);
59
60
- return _can.write(can_msg);
+ int const rc = _can.write(can_msg);
61
+ if (rc == 0) /* mbed returns 0 in case of failed CAN::write(). */
62
+ return -1; /* Note: provide named constant in ArduinoCore-API/HardwareCAN.h, i.e. CAN_WRITE_GENERIC_ERROR */
63
+ return 1;
64
}
65
66
size_t Arduino_CAN::available()
0 commit comments