/* 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;
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;
{
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;
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;
}
}
{return -1;}
rets++;
- DEBUG("signal: %s subscribed", sig->get_name().c_str());
+ AFB_DEBUG("signal: %s subscribed", sig->get_name().c_str());
}
return rets;
}
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);