Code Review
/
apps
/
agl-service-can-low-level.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
1a90ede
)
Check whether a signal is writable before sending
author
Romain Forlot
<romain.forlot@iot.bzh>
Mon, 17 Jul 2017 08:57:45 +0000
(10:57 +0200)
committer
Romain Forlot
<romain.forlot@iot.bzh>
Fri, 21 Jul 2017 10:02:11 +0000
(12:02 +0200)
Change-Id: Id04d04a07e43738f7379e33fa7c6022eaa426343
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
low-can-binding/binding/low-can-cb.cpp
patch
|
blob
|
history
diff --git
a/low-can-binding/binding/low-can-cb.cpp
b/low-can-binding/binding/low-can-cb.cpp
index
cac9fc4
..
be2985f
100644
(file)
--- a/
low-can-binding/binding/low-can-cb.cpp
+++ b/
low-can-binding/binding/low-can-cb.cpp
@@
-427,9
+427,14
@@
static int write_signal(const std::string& name, uint64_t value)
{
for(const auto& sig: sf.can_signals)
{
- cf = encoder_t::build_frame(sig, value);
- const std::string bus_name = sig->get_message()->get_bus_name();
- rc = send_frame(bus_name, cf);
+ if(sig->get_writable())
+ {
+ cf = encoder_t::build_frame(sig, value);
+ const std::string bus_name = sig->get_message()->get_bus_name();
+ rc = send_frame(bus_name, cf);
+ }
+ else
+ {AFB_NOTICE("%s isn't writable. Message not sent.", sig->get_name().c_str());}
}
}