diff options
-rw-r--r-- | ahl-binding/ahl-binding.cpp | 18 | ||||
-rw-r--r-- | ahl-binding/role.cpp | 8 |
2 files changed, 13 insertions, 13 deletions
diff --git a/ahl-binding/ahl-binding.cpp b/ahl-binding/ahl-binding.cpp index 8ac5b22..79cf7b2 100644 --- a/ahl-binding/ahl-binding.cpp +++ b/ahl-binding/ahl-binding.cpp @@ -93,7 +93,7 @@ void ahl_api_get_roles(afb_request* req) /** * @brief Callback invoked when clients call a 'role' verb. * @param[in] req Request to handle. - * + * * Handle dynamic verbs based on role name ('multimedia', 'navigation', ...) */ void ahl_api_role(afb_request* req) @@ -157,14 +157,14 @@ int ahl_binding_t::preinit(afb_dynapi* handle) int ahl_binding_t::init() { using namespace std::placeholders; - + if (afb_dynapi_require_api(handle_, HAL_MGR_API, 1)) { AFB_DYNAPI_ERROR(handle_, "Failed to require '%s' API!", HAL_MGR_API); return -1; } AFB_DYNAPI_NOTICE(handle_, "Required '%s' API found!", HAL_MGR_API); - + if (afb_dynapi_require_api(handle_, "smixer", 1)) { AFB_DYNAPI_ERROR(handle_, "Failed to require 'smixer' API!"); @@ -175,7 +175,7 @@ int ahl_binding_t::init() afb_dynapi_seal(handle_); AFB_DYNAPI_NOTICE(handle_, "API is now sealed!"); - if (update_streams()) return -1; + if (update_streams()) return -1; return 0; } @@ -192,7 +192,7 @@ int ahl_binding_t::update_streams() if (afb_dynapi_call_sync(handle_, "4a-hal-manager", "loaded", json_object_new_object(), &loaded)) { AFB_DYNAPI_ERROR(handle_, "Failed to call 'loaded' verb on '4a-hal-manager' API!"); - if (loaded) AFB_DYNAPI_NOTICE(handle_, "%s", json_object_to_json_string(loaded)); + if (loaded) AFB_DYNAPI_ERROR(handle_, "%s", json_object_to_json_string(loaded)); return -1; } json_bool ret = json_object_object_get_ex(loaded, "response", &response); @@ -213,7 +213,7 @@ int ahl_binding_t::update_streams() if (afb_dynapi_call_sync(handle_, halname, "info", json_object_new_object(), &info)) { AFB_DYNAPI_ERROR(handle_, "Failed to call 'info' verb on '%s' API!", halname); - if (info) AFB_DYNAPI_NOTICE(handle_, "%s", json_object_to_json_string(info)); + if (info) AFB_DYNAPI_ERROR(handle_, "%s", json_object_to_json_string(info)); return -1; } @@ -238,7 +238,7 @@ int ahl_binding_t::update_streams() ); } - json_object_put(info); + json_object_put(info); } json_object_put(loaded); @@ -324,7 +324,7 @@ int ahl_binding_t::load_controller_config(const std::string& path) AFB_DYNAPI_ERROR(handle_, "Failed to load controller from config file!"); return -1; } - + static CtlSectionT controller_sections[] = { {.key = "plugins", .uid = nullptr, .info = nullptr, .loadCB = PluginConfig, .handle = nullptr, .actions = nullptr}, @@ -346,7 +346,7 @@ int ahl_binding_t::parse_roles_config(json_object* o) assert(json_object_is_type(o, json_type_array)); if (roles_.size()) return 0; // Roles already added, ignore. - + size_t count = json_object_array_length(o); roles_.reserve(count); for(int i = 0; i < count; ++i) diff --git a/ahl-binding/role.cpp b/ahl-binding/role.cpp index 1b60a40..a122fc2 100644 --- a/ahl-binding/role.cpp +++ b/ahl-binding/role.cpp @@ -135,7 +135,7 @@ int role_t::apply_policy(afb_request* req) json_object_get(i.args()); json_object* result = nullptr; - AFB_DYNAPI_NOTICE(ahl_binding_t::instance().handle(), + AFB_DYNAPI_DEBUG(ahl_binding_t::instance().handle(), "Call '%s'/'%s' '%s", r.hal().c_str(), r.stream().c_str(), json_object_to_json_string(arg)); @@ -144,7 +144,7 @@ int role_t::apply_policy(afb_request* req) afb_request_fail(req, "Failed to call 'ramp' action on stream", nullptr); return -1; } - AFB_DYNAPI_NOTICE(ahl_binding_t::instance().handle(), + AFB_DYNAPI_DEBUG(ahl_binding_t::instance().handle(), "POLICY: Applying a ramp to '%s' stream because '%s' is opened and have higher priority!", r.stream().c_str(), stream_.c_str()); } @@ -210,7 +210,7 @@ void role_t::open(afb_request* r, json_object* o) role_t * role = (role_t*) arg; afb_dynapi * api = ahl_binding_t::instance().handle(); - AFB_DYNAPI_NOTICE(api, "Released role %s\n", role->uid_.c_str()); + AFB_DYNAPI_DEBUG(api, "Released role %s\n", role->uid_.c_str()); role->opened_ = false; // send a mute command to the HAL. We cannot reuse the do_mute function, @@ -306,7 +306,7 @@ void role_t::volume(afb_request* r, json_object* o) } else { - AFB_DYNAPI_NOTICE(api, "Granted special audio-mixer permission to change volume"); + AFB_DYNAPI_DEBUG(api, "Granted special audio-mixer permission to change volume"); } json_object* value; |