From c16ccc9d6a1de5406ba0e74f757403ac7553b6a8 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 4 Jul 2017 14:27:16 +0200 Subject: 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 --- low-can-binding/binding/low-can-cb.cpp | 18 +++++++++--------- low-can-binding/binding/low-can-hat.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'low-can-binding/binding') diff --git a/low-can-binding/binding/low-can-cb.cpp b/low-can-binding/binding/low-can-cb.cpp index 824aa811..e2ddf07e 100644 --- a/low-can-binding/binding/low-can-cb.cpp +++ b/low-can-binding/binding/low-can-cb.cpp @@ -105,7 +105,7 @@ static int make_subscription_unsubscription(struct afb_req request, std::shared_ /* Make the subscription or unsubscription to the event */ if (((subscribe ? afb_req_subscribe : afb_req_unsubscribe)(request, s[can_subscription->get_index()]->get_event())) < 0) { - ERROR("Operation goes wrong for signal: %s", can_subscription->get_name().c_str()); + AFB_ERROR("Operation goes wrong for signal: %s", can_subscription->get_name().c_str()); return -1; } return 0; @@ -118,7 +118,7 @@ static int create_event_handle(std::shared_ptr& can_subs s[sub_index] = can_subscription; if (!afb_event_is_valid(s[sub_index]->get_event())) { - ERROR("Can't create an event for %s, something goes wrong.", can_subscription->get_name().c_str()); + AFB_ERROR("Can't create an event for %s, something goes wrong.", can_subscription->get_name().c_str()); return -1; } return 0; @@ -136,7 +136,7 @@ static int subscribe_unsubscribe_signal(struct afb_req request, bool subscribe, { if (!afb_event_is_valid(s[sub_index]->get_event()) && !subscribe) { - NOTICE("Event isn't valid, no need to unsubscribed."); + AFB_NOTICE("Event isn't valid, no need to unsubscribed."); ret = -1; } ret = 0; @@ -192,22 +192,22 @@ static int subscribe_unsubscribe_diagnostic_messages(struct afb_req request, boo diag_m.add_recurring_request(diag_req, sig->get_name().c_str(), false, sig->get_decoder(), sig->get_callback(), event_filter.frequency); if(can_subscription->create_rx_filter(sig) < 0) {return -1;} - DEBUG("Signal: %s subscribed", sig->get_name().c_str()); + AFB_DEBUG("Signal: %s subscribed", sig->get_name().c_str()); if(it == s.end() && add_to_event_loop(can_subscription) < 0) { diag_m.cleanup_request( diag_m.find_recurring_request(*diag_req), true); - WARNING("signal: %s isn't supported. Canceling operation.", sig->get_name().c_str()); + AFB_WARNING("signal: %s isn't supported. Canceling operation.", sig->get_name().c_str()); return -1; } } else { if(sig->get_supported()) - {DEBUG("%s cancelled due to unsubscribe", sig->get_name().c_str());} + {AFB_DEBUG("%s cancelled due to unsubscribe", sig->get_name().c_str());} else { - WARNING("signal: %s isn't supported. Canceling operation.", sig->get_name().c_str()); + AFB_WARNING("signal: %s isn't supported. Canceling operation.", sig->get_name().c_str()); return -1; } } @@ -246,7 +246,7 @@ static int subscribe_unsubscribe_can_signals(struct afb_req request, bool subscr {return -1;} rets++; - DEBUG("signal: %s subscribed", sig->get_name().c_str()); + AFB_DEBUG("signal: %s subscribed", sig->get_name().c_str()); } return rets; } @@ -308,7 +308,7 @@ static int one_subscribe_unsubscribe(struct afb_req request, bool subscribe, con openxc_DynamicField search_key = build_DynamicField(tag); sf = utils::signals_manager_t::instance().find_signals(search_key); if (sf.can_signals.empty() && sf.diagnostic_messages.empty()) - NOTICE("No signal(s) found for %s.", tag.c_str()); + AFB_NOTICE("No signal(s) found for %s.", tag.c_str()); else ret = subscribe_unsubscribe_signals(request, subscribe, sf, event_filter); diff --git a/low-can-binding/binding/low-can-hat.cpp b/low-can-binding/binding/low-can-hat.cpp index 7113b69a..fc6f9b5d 100644 --- a/low-can-binding/binding/low-can-hat.cpp +++ b/low-can-binding/binding/low-can-hat.cpp @@ -67,7 +67,7 @@ extern "C" if(application_t::instance().get_diagnostic_manager().initialize()) return 0; - ERROR("There was something wrong with CAN device Initialization."); + AFB_ERROR("There was something wrong with CAN device Initialization."); return 1; } }; -- cgit 1.2.3-korg