diff options
-rw-r--r-- | low-can-binding/binding/low-can-cb.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp index cac9fc4e..be2985fb 100644 --- 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());} } } |