summaryrefslogtreecommitdiffstats
path: root/low-can-binding/can/can-message.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-07-04 14:27:16 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-07-04 14:27:16 +0200
commitc16ccc9d6a1de5406ba0e74f757403ac7553b6a8 (patch)
tree16df16f5cf53367e21aa865426ded8e9fd78a0f3 /low-can-binding/can/can-message.cpp
parent621f55e3e4b104d5771a38aae4db5439fe9a5aa8 (diff)
DAB RC3 Fixes follows appfw API break.
Following functions now return 0 on success and negative value on failure : o afb_req_subcall o afb_req_subcall_sync o afb_service_call o afb_service_call_sync Verbosity macros used in v2 bindings now needs to be prefixed with AFB_ (ERROR -> AFB_ERROR) Change-Id: Ica4346f215bb142fcda0c6ea15e7074f7091f4cc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/can/can-message.cpp')
-rw-r--r--low-can-binding/can/can-message.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/low-can-binding/can/can-message.cpp b/low-can-binding/can/can-message.cpp
index 057bc71f..fe66936c 100644
--- a/low-can-binding/can/can-message.cpp
+++ b/low-can-binding/can/can-message.cpp
@@ -176,7 +176,7 @@ 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::INVALID)
format_ = new_format;
else
- ERROR("Can set format, wrong format chosen");
+ AFB_ERROR("Can set format, wrong format chosen");
}
/// @brief Take a canfd_frame struct to initialize class members
@@ -198,15 +198,15 @@ can_message_t can_message_t::convert_from_frame(const struct canfd_frame& frame,
switch(nbytes)
{
case CANFD_MTU:
- DEBUG("Got an CAN FD frame");
+ AFB_DEBUG("Got an CAN FD frame");
maxdlen = CANFD_MAX_DLEN;
break;
case CAN_MTU:
- DEBUG("Got a legacy CAN frame");
+ AFB_DEBUG("Got a legacy CAN frame");
maxdlen = CAN_MAX_DLEN;
break;
default:
- ERROR("unsupported CAN frame");
+ AFB_ERROR("unsupported CAN frame");
break;
}
@@ -260,7 +260,7 @@ can_message_t can_message_t::convert_from_frame(const struct canfd_frame& frame,
data.push_back(frame.data[i]);
};
- DEBUG("Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X",
+ AFB_DEBUG("Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X",
id, (uint8_t)format, length, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
}
@@ -285,12 +285,12 @@ can_message_t can_message_t::convert_from_frame(const struct can_frame& frame, s
if(nbytes <= CAN_MTU)
{
- DEBUG("Got a legacy CAN frame");
+ AFB_DEBUG("Got a legacy CAN frame");
maxdlen = CAN_MAX_DLEN;
}
else
{
- ERROR("unsupported CAN frame");
+ AFB_ERROR("unsupported CAN frame");
}
if (frame.can_id & CAN_ERR_FLAG)
@@ -339,7 +339,7 @@ can_message_t can_message_t::convert_from_frame(const struct can_frame& frame, s
data.push_back(frame.data[i]);
};
-// DEBUG("Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X",
+// AFB_DEBUG("Found id: %X, format: %X, length: %X, data %02X%02X%02X%02X%02X%02X%02X%02X",
// id, (uint8_t)format, length, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
}
@@ -362,7 +362,7 @@ struct canfd_frame can_message_t::convert_to_canfd_frame()
::memcpy(frame.data, get_data(), length_);
}
else
- ERROR("can_message_t not correctly initialized to be sent");
+ AFB_ERROR("can_message_t not correctly initialized to be sent");
return frame;
}
@@ -383,7 +383,7 @@ struct can_frame can_message_t::convert_to_can_frame()
::memcpy(frame.data, get_data(), length_);
}
else
- ERROR("can_message_t not correctly initialized to be sent");
+ AFB_ERROR("can_message_t not correctly initialized to be sent");
return frame;
}