summaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding/low-can-cb.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-11-20 13:02:24 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2020-01-09 15:55:03 +0100
commit779da0a54b29db5dd4c12387970026a264d2e6cb (patch)
treef15bc290e899682a0e2abfd2d7559b3d2cd499e1 /low-can-binding/binding/low-can-cb.cpp
parent5b9913d4d7fcf273380b2aeb780cf0a42cc99725 (diff)
message: More explicit define about CAN protocols.
Change a bit CAN binding define about used protocol. There was a mistake about BCM define which isn't a protocol at all but a maner to filter and retrieve CAN message through SocketCAN. Also FD_FRAME was using the same name than SocketCAN which isn't a good idea, better to distinguis both of them. Bug-AGL: SPEC-2988 Change-Id: I255fa03029c7d5f90a33448e5e7692d8c249279b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/binding/low-can-cb.cpp')
-rw-r--r--low-can-binding/binding/low-can-cb.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp
index 0445de3e..14e1f87e 100644
--- a/low-can-binding/binding/low-can-cb.cpp
+++ b/low-can-binding/binding/low-can-cb.cpp
@@ -526,7 +526,7 @@ static int send_message(message_t *message, const std::string& bus_name, uint32_
cd[bus_name]->set_signal(signal);
- if(flags&BCM_PROTOCOL)
+ if(flags&CAN_PROTOCOL)
return low_can_subscription_t::tx_send(*cd[bus_name], message, bus_name);
#ifdef USE_FEATURE_ISOTP
else if(flags&ISOTP_PROTOCOL)
@@ -552,12 +552,12 @@ static void write_raw_frame(afb_req_t request, const std::string& bus_name, mess
if( !sf.signals.empty() )
{
AFB_DEBUG("ID WRITE RAW : %d", sf.signals.front()->get_message()->get_id());
- if(flags & BCM_PROTOCOL)
+ if(flags & CAN_PROTOCOL)
{
if(sf.signals.front()->get_message()->is_fd())
{
AFB_DEBUG("CANFD_MAX_DLEN");
- message->set_flags(CAN_FD_FRAME);
+ message->set_flags(CAN_PROTOCOL_WITH_FD_FRAME);
message->set_maxdlen(CANFD_MAX_DLEN);
}
else
@@ -591,7 +591,7 @@ static void write_raw_frame(afb_req_t request, const std::string& bus_name, mess
}
else
{
- if(flags&BCM_PROTOCOL)
+ if(flags&CAN_PROTOCOL)
afb_req_fail(request, "Invalid", "Frame BCM");
else if(flags&J1939_PROTOCOL)
afb_req_fail(request, "Invalid", "Frame J1939");
@@ -631,7 +631,7 @@ static void write_frame(afb_req_t request, const std::string& bus_name, json_obj
"can_data", &can_data))
{
message = new can_message_t(0, id, length, false, 0, data, 0);
- write_raw_frame(request, bus_name, message, can_data, BCM_PROTOCOL, event_filter);
+ write_raw_frame(request, bus_name, message, can_data, CAN_PROTOCOL, event_filter);
}
#ifdef USE_FEATURE_J1939
else if(!wrap_json_unpack(json_value, "{si, si, so !}",
@@ -688,7 +688,7 @@ static void write_signal(afb_req_t request, const std::string& name, json_object
else if(sig->get_message()->is_isotp())
flags = ISOTP_PROTOCOL;
else
- flags = BCM_PROTOCOL;
+ flags = CAN_PROTOCOL;
// cfd = encoder_t::build_frame(sig, value);
message_t *message = encoder_t::build_message(sig, value, false, false);