diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-17 17:16:30 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-05-19 11:36:43 +0200 |
commit | 7b64216f9d8784f28b79ea7545392036f190fb6c (patch) | |
tree | 21c25fb7ac95e49ca9cf7943e32de05d682eb5fc /CAN-binder | |
parent | e6364699d1948d7a3b48d4f309e2b7a39bc1f015 (diff) |
Don't collide with application framework ERROR in some configuration.
Change-Id: Idd600a47960850cd4afc553fdb79f5c57f93f64b
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-message.cpp | 12 | ||||
-rw-r--r-- | CAN-binder/low-can-binding/can/can-message.hpp | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/CAN-binder/low-can-binding/can/can-message.cpp b/CAN-binder/low-can-binding/can/can-message.cpp index 3fe2a5c..66a4f4f 100644 --- a/CAN-binder/low-can-binding/can/can-message.cpp +++ b/CAN-binder/low-can-binding/can/can-message.cpp @@ -27,7 +27,7 @@ /// Constructor about can_message_t class. /// can_message_t::can_message_t() - : maxdlen_{0}, id_{0}, length_{0}, format_{can_message_format_t::ERROR}, rtr_flag_{false}, flags_{0} + : maxdlen_{0}, id_{0}, length_{0}, format_{can_message_format_t::INVALID}, rtr_flag_{false}, flags_{0} {} can_message_t::can_message_t(uint8_t maxdlen, @@ -74,7 +74,7 @@ bool can_message_t::get_rtr_flag_() const can_message_format_t can_message_t::get_format() const { if (format_ != can_message_format_t::STANDARD || format_ != can_message_format_t::EXTENDED) - return can_message_format_t::ERROR; + return can_message_format_t::INVALID; return format_; } @@ -127,7 +127,7 @@ uint8_t can_message_t::get_length() const /// bool can_message_t::is_correct_to_send() { - if (id_ != 0 && length_ != 0 && format_ != can_message_format_t::ERROR) + if (id_ != 0 && length_ != 0 && format_ != can_message_format_t::INVALID) { int i; for(i=0;i<CAN_MESSAGE_SIZE;i++) @@ -147,7 +147,7 @@ bool can_message_t::is_correct_to_send() /// void can_message_t::set_format(const can_message_format_t new_format) { - if(new_format == can_message_format_t::STANDARD || new_format == can_message_format_t::EXTENDED || new_format == can_message_format_t::ERROR) + if(new_format == can_message_format_t::STANDARD || new_format == can_message_format_t::EXTENDED || new_format == can_message_format_t::INVALID) format_ = new_format; else ERROR(binder_interface, "%s: Can set format, wrong format chosen", __FUNCTION__); @@ -187,7 +187,7 @@ can_message_t can_message_t::convert_from_frame(const struct canfd_frame& frame, if (frame.can_id & CAN_ERR_FLAG) { - format = can_message_format_t::ERROR; + format = can_message_format_t::INVALID; id = frame.can_id & (CAN_ERR_MASK|CAN_ERR_FLAG); } else if (frame.can_id & CAN_EFF_FLAG) @@ -262,7 +262,7 @@ can_message_t can_message_t::convert_from_frame(const struct can_frame& frame, s if (frame.can_id & CAN_ERR_FLAG) { - format = can_message_format_t::ERROR; + format = can_message_format_t::INVALID; id = frame.can_id & (CAN_ERR_MASK|CAN_ERR_FLAG); } else if (frame.can_id & CAN_EFF_FLAG) diff --git a/CAN-binder/low-can-binding/can/can-message.hpp b/CAN-binder/low-can-binding/can/can-message.hpp index 94847ef..3fde5f1 100644 --- a/CAN-binder/low-can-binding/can/can-message.hpp +++ b/CAN-binder/low-can-binding/can/can-message.hpp @@ -33,7 +33,7 @@ enum class can_message_format_t { STANDARD, /*!< STANDARD - standard 11-bit CAN arbitration ID. */ EXTENDED, /*!< EXTENDED - an extended frame, with a 29-bit arbitration ID. */ - ERROR, /*!< ERROR - ERROR code used at initialization to signify that it isn't usable'*/ + INVALID, /*!< INVALID - INVALID code used at initialization to signify that it isn't usable'*/ }; /** |