aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding
diff options
context:
space:
mode:
authorArthur Guyader <arthur.guyader@iot.bzh>2019-11-07 10:06:25 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-11-07 10:06:25 +0100
commit5912e67b3fe1366089102d1860c9f8ae01f8aec4 (patch)
treea95089c08af19a37cb6bfa391f8b8816187b6800 /low-can-binding/binding
parent33cc8f946c04532d395a3929ccb06938014b0714 (diff)
write: Add feature to build messages and fix some functions
Allows to build a message (J1939,BCM) with a signal and a value. Bug-AGL: SPEC-2386 Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh> Change-Id: Iadca13a927ff83f713f39da441c88356695a1285
Diffstat (limited to 'low-can-binding/binding')
-rw-r--r--low-can-binding/binding/low-can-cb.cpp3
-rw-r--r--low-can-binding/binding/low-can-subscription.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp
index 1c01738f..67386810 100644
--- a/low-can-binding/binding/low-can-cb.cpp
+++ b/low-can-binding/binding/low-can-cb.cpp
@@ -716,7 +716,9 @@ static void write_signal(afb_req_t request, const std::string& name, json_object
if(! send_message(message, sig->get_message()->get_bus_device_name(), flags, event_filter, sig) && send)
afb_req_success(request, nullptr, "Message correctly sent");
+ }
else
+ {
afb_req_fail(request, "Error", "Sending the message. See the log for more details.");
if(sig->get_message()->is_j1939())
@@ -867,7 +869,6 @@ void list(afb_req_t request)
afb_req_success(request, ans, NULL);
else
afb_req_fail(request, "error", NULL);
-
}
/// @brief Initialize the binding.
diff --git a/low-can-binding/binding/low-can-subscription.cpp b/low-can-binding/binding/low-can-subscription.cpp
index 8b5f302e..8c314af7 100644
--- a/low-can-binding/binding/low-can-subscription.cpp
+++ b/low-can-binding/binding/low-can-subscription.cpp
@@ -738,7 +738,9 @@ int low_can_subscription_t::tx_send(low_can_subscription_t &subscription, messag
}
if(! subscription.socket_.get())
- return -1;
+ {
+ return -1;
+ }
return 0;
}