diff options
Diffstat (limited to 'plugin/unicens-output/most_unicens.c')
-rw-r--r-- | plugin/unicens-output/most_unicens.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/plugin/unicens-output/most_unicens.c b/plugin/unicens-output/most_unicens.c index a0d040b..848a09b 100644 --- a/plugin/unicens-output/most_unicens.c +++ b/plugin/unicens-output/most_unicens.c @@ -37,7 +37,7 @@ CTLP_CAPI_REGISTER(UCS_PLUGIN_NAME) -AFB_ApiT unicensHalApiHandle; +afb_api_t unicensHalApiHandle; static uint8_t initialized = 0; @@ -46,7 +46,7 @@ static uint8_t initialized = 0; CTLP_ONLOAD(plugin, callbacks) { unicensHalApiHandle = plugin->api; - AFB_ApiNotice(unicensHalApiHandle, "4A-HAL-UNICENS: Plugin Register: uid='%s' 'info='%s'", plugin->uid, plugin->info); + AFB_API_NOTICE(unicensHalApiHandle, "4A-HAL-UNICENS: Plugin Register: uid='%s' 'info='%s'", plugin->uid, plugin->info); return 0; } @@ -57,15 +57,15 @@ CTLP_CAPI(Init, source, argsJ, queryJ) int err = 0; int pcm_volume[PCM_MAX_CHANNELS] = { 100, 100, 100, 100, 100, 100 }; - AFB_ApiNotice(source->api, "4A-HAL-UNICENS: Initializing 4a plugin"); + AFB_API_NOTICE(source->api, "4A-HAL-UNICENS: Initializing 4a plugin"); if((err = wrap_volume_init())) { - AFB_ApiError(source->api, "Failed to initialize wrapper for volume library"); + AFB_API_ERROR(source->api, "Failed to initialize wrapper for volume library"); goto Abort_Exit; } if((err = wrap_ucs_subscribe_sync(source->api))) { - AFB_ApiError(source->api, "Failed to subscribe to UNICENS binding"); + AFB_API_ERROR(source->api, "Failed to subscribe to UNICENS binding"); goto Abort_Exit; } @@ -76,7 +76,7 @@ CTLP_CAPI(Init, source, argsJ, queryJ) initialized = 1; Abort_Exit: - AFB_ApiNotice(source->api, "4A-HAL-UNICENS: Initializing plugin done, err=%d", err); + AFB_API_NOTICE(source->api, "4A-HAL-UNICENS: Initializing plugin done, err=%d", err); err = 0; /* avoid returning non-zero value, to force loading the plugin */ return err; } @@ -89,22 +89,22 @@ CTLP_CAPI(MasterVol, source, argsJ, queryJ) json_object *valueJ; int err = 0; - AFB_ApiNotice(source->api, "4A-HAL-UNICENS: MasterVolume=%s", json_object_to_json_string(queryJ)); + AFB_API_NOTICE(source->api, "4A-HAL-UNICENS: MasterVolume=%s", json_object_to_json_string(queryJ)); if(! initialized) { - AFB_ApiWarning(source->api, "%s: Link to unicens binder is not initialized, can't set master volume, value=%s", __func__, json_object_get_string(queryJ)); + AFB_API_WARNING(source->api, "%s: Link to unicens binder is not initialized, can't set master volume, value=%s", __func__, json_object_get_string(queryJ)); err = -1; goto Abort_Exit; } if(! json_object_is_type(queryJ, json_type_array) || json_object_array_length(queryJ) <= 0) { - AFB_ApiError(source->api, "%s: invalid json (should be a non empty json array) value=%s", __func__, json_object_get_string(queryJ)); + AFB_API_ERROR(source->api, "%s: invalid json (should be a non empty json array) value=%s", __func__, json_object_get_string(queryJ)); err = -2; goto Abort_Exit; } valueJ = json_object_array_get_idx(queryJ, 0); if(! json_object_is_type(valueJ, json_type_int)) { - AFB_ApiError(source->api, "%s: invalid json (should be an array of int) value=%s", __func__, json_object_get_string(queryJ)); + AFB_API_ERROR(source->api, "%s: invalid json (should be an array of int) value=%s", __func__, json_object_get_string(queryJ)); err = -3; goto Abort_Exit; } @@ -121,7 +121,7 @@ Abort_Exit: /* not used at the moment, disabled in JSON configuration */ CTLP_CAPI(PCMVol, source, argsJ, queryJ) { - AFB_ApiNotice(source->api, "4A-HAL-UNICENS: PCMVolume=%s", json_object_to_json_string(queryJ)); + AFB_API_NOTICE(source->api, "4A-HAL-UNICENS: PCMVolume=%s", json_object_to_json_string(queryJ)); return 0; } @@ -134,10 +134,10 @@ CTLP_CAPI(Events, source, argsJ, queryJ) int err = 0; json_object *j_tmp = NULL; - AFB_ApiError(source->api, "4A-HAL-UNICENS: receiving event query=%s", json_object_to_json_string(queryJ)); + AFB_API_ERROR(source->api, "4A-HAL-UNICENS: receiving event query=%s", json_object_to_json_string(queryJ)); if (initialized == 0) { - AFB_ApiError(source->api, "4A-HAL-UNICENS: Not initialized while receiving event query=%s", json_object_to_json_string(queryJ)); + AFB_API_ERROR(source->api, "4A-HAL-UNICENS: Not initialized while receiving event query=%s", json_object_to_json_string(queryJ)); err = 0; goto Abort_Exit; } @@ -157,11 +157,11 @@ CTLP_CAPI(Events, source, argsJ, queryJ) } if(err == 0) { - AFB_ApiNotice(source->api, "4A-HAL-UNICENS: Node-Availability: node=0x%03X, available=%d", node, available); + AFB_API_NOTICE(source->api, "4A-HAL-UNICENS: Node-Availability: node=0x%03X, available=%d", node, available); wrap_volume_node_avail(source->api, node, available); } else { - AFB_ApiError(source->api, "4A-HAL-UNICENS: Failed to parse events query=%s", json_object_to_json_string(queryJ)); + AFB_API_ERROR(source->api, "4A-HAL-UNICENS: Failed to parse events query=%s", json_object_to_json_string(queryJ)); } Abort_Exit: |