From 88211e8b9cb19ecec8c28c1de19e0d42dadcb916 Mon Sep 17 00:00:00 2001 From: Frederic Marec Date: Fri, 10 May 2019 10:54:58 +0200 Subject: Git submodule migration to separated libraries Bug-AGL: SPEC-2139 Change-Id: I6f1227f7b293b6a3dc8d527e18cd482955783021 Signed-off-by: Frederic Marec --- plugin/unicens-output/wrap_unicens.c | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'plugin/unicens-output/wrap_unicens.c') diff --git a/plugin/unicens-output/wrap_unicens.c b/plugin/unicens-output/wrap_unicens.c index 382eea7..1c16a08 100644 --- a/plugin/unicens-output/wrap_unicens.c +++ b/plugin/unicens-output/wrap_unicens.c @@ -44,7 +44,7 @@ typedef struct parse_result_ { * Subscribes to unicens2-binding events. * \return Returns 0 if successful, otherwise != 0". */ -extern int wrap_ucs_subscribe_sync(AFB_ApiT apiHandle) +extern int wrap_ucs_subscribe_sync(afb_api_t apiHandle) { int err; @@ -52,16 +52,16 @@ extern int wrap_ucs_subscribe_sync(AFB_ApiT apiHandle) /* Build an empty JSON object */ if((err = wrap_json_pack(&j_query, "{}"))) { - AFB_ApiError(apiHandle, "Failed to create subscribe json object"); + AFB_API_ERROR(apiHandle, "Failed to create subscribe json object"); return err; } - if((err = AFB_ServiceSync(apiHandle, "UNICENS", "subscribe", j_query, &j_response))) { - AFB_ApiError(apiHandle, "Fail subscribing to UNICENS events"); + if((err = afb_api_call_sync_legacy(apiHandle, "UNICENS", "subscribe", j_query, &j_response))) { + AFB_API_ERROR(apiHandle, "Fail subscribing to UNICENS events"); return err; } else { - AFB_ApiNotice(apiHandle, "Subscribed to UNICENS events, res=%s", json_object_to_json_string(j_response)); + AFB_API_NOTICE(apiHandle, "Subscribed to UNICENS events, res=%s", json_object_to_json_string(j_response)); json_object_put(j_response); } @@ -75,7 +75,7 @@ extern int wrap_ucs_subscribe_sync(AFB_ApiT apiHandle) * \param data_sz Size of the command data. Valid values: 1..32. * \return Returns 0 if successful, otherwise != 0". */ -extern int wrap_ucs_i2cwrite_sync(AFB_ApiT apiHandle, uint16_t node, uint8_t *data_ptr, uint8_t data_sz) +extern int wrap_ucs_i2cwrite_sync(afb_api_t apiHandle, uint16_t node, uint8_t *data_ptr, uint8_t data_sz) { int err; uint8_t cnt; @@ -86,7 +86,7 @@ extern int wrap_ucs_i2cwrite_sync(AFB_ApiT apiHandle, uint16_t node, uint8_t *da j_array = json_object_new_array(); if(! j_query || ! j_array) { - AFB_ApiError(apiHandle, "Failed to create writei2c json objects"); + AFB_API_ERROR(apiHandle, "Failed to create writei2c json objects"); return -1; } @@ -96,12 +96,12 @@ extern int wrap_ucs_i2cwrite_sync(AFB_ApiT apiHandle, uint16_t node, uint8_t *da json_object_object_add(j_query, "node", json_object_new_int(node)); json_object_object_add(j_query, "data", j_array); - if((err = AFB_ServiceSync(apiHandle, "UNICENS", "writei2c", j_query, &j_response))) { - AFB_ApiError(apiHandle, "Failed to call writei2c_sync"); + if((err = afb_api_call_sync_legacy(apiHandle, "UNICENS", "writei2c", j_query, &j_response))) { + AFB_API_ERROR(apiHandle, "Failed to call writei2c_sync"); return err; } else { - AFB_ApiInfo(apiHandle, "Called writei2c_sync, res=%s", json_object_to_json_string(j_response)); + AFB_API_INFO(apiHandle, "Called writei2c_sync, res=%s", json_object_to_json_string(j_response)); json_object_put(j_response); } @@ -116,7 +116,7 @@ extern int wrap_ucs_sendmessage_sync(uint16_t src_addr, uint16_t msg_id, uint8_t int msgid = (int)msg_id; size_t data_size = (size_t)data_sz; - AFB_ApiNotice(unicensHalApiHandle, "--- HAL triggering send message ---"); + AFB_API_NOTICE(unicensHalApiHandle, "--- HAL triggering send message ---"); /* skip data attribute if possible, wrap_json_unpack may fail to deal with * an empty Base64 string */ @@ -125,19 +125,19 @@ extern int wrap_ucs_sendmessage_sync(uint16_t src_addr, uint16_t msg_id, uint8_t else wrap_json_pack(&j_query, "{s:i, s:i}", "node", node, "msgid", msgid); - AFB_ApiNotice(unicensHalApiHandle, "wrap_ucs_sendmessage: jquery=%s", json_object_to_json_string(j_query)); + AFB_API_NOTICE(unicensHalApiHandle, "wrap_ucs_sendmessage: jquery=%s", json_object_to_json_string(j_query)); - err = AFB_ServiceSync(unicensHalApiHandle, "UNICENS", "sendmessage", j_query, &j_response); + err = afb_api_call_sync_legacy(unicensHalApiHandle, "UNICENS", "sendmessage", j_query, &j_response); if (err != 0) { - AFB_ApiError(unicensHalApiHandle, "Failed to call wrap_ucs_sendmessage ret=%d", err); + AFB_API_ERROR(unicensHalApiHandle, "Failed to call wrap_ucs_sendmessage ret=%d", err); } else { - AFB_ApiNotice(unicensHalApiHandle, "Called wrap_ucs_sendmessage, successful"); + AFB_API_NOTICE(unicensHalApiHandle, "Called wrap_ucs_sendmessage, successful"); } if (j_response != NULL) { - AFB_ApiNotice(unicensHalApiHandle, "wrap_ucs_sendmessage, response=%s", json_object_to_json_string(j_response)); + AFB_API_NOTICE(unicensHalApiHandle, "wrap_ucs_sendmessage, response=%s", json_object_to_json_string(j_response)); json_object_put(j_response); } @@ -145,11 +145,11 @@ extern int wrap_ucs_sendmessage_sync(uint16_t src_addr, uint16_t msg_id, uint8_t } /* ---------------------------- ASYNCHRONOUS API ---------------------------- */ -static void wrap_ucs_i2cwrite_cb(void *closure, int status, struct json_object *j_result, AFB_ApiT apiHandle) +static void wrap_ucs_i2cwrite_cb(void *closure, int status, struct json_object *j_result, afb_api_t apiHandle) { async_job_t *job_ptr; - AFB_ApiInfo(apiHandle, "%s: closure=%p status=%d, res=%s", __func__, closure, status, json_object_to_json_string(j_result)); + AFB_API_INFO(apiHandle, "%s: closure=%p status=%d, res=%s", __func__, closure, status, json_object_to_json_string(j_result)); if(closure) { job_ptr = (async_job_t *) closure; @@ -183,7 +183,7 @@ extern int wrap_ucs_i2cwrite(uint16_t node, j_array = json_object_new_array(); if(! j_query || ! j_array) { - AFB_ApiError(unicensHalApiHandle, "Failed to create writei2c json objects"); + AFB_API_ERROR(unicensHalApiHandle, "Failed to create writei2c json objects"); return -1; } @@ -196,7 +196,7 @@ extern int wrap_ucs_i2cwrite(uint16_t node, job_ptr = malloc(sizeof(async_job_t)); if(! job_ptr) { - AFB_ApiError(unicensHalApiHandle, "Failed to create async job object"); + AFB_API_ERROR(unicensHalApiHandle, "Failed to create async job object"); json_object_put(j_query); return -2; } @@ -204,7 +204,7 @@ extern int wrap_ucs_i2cwrite(uint16_t node, job_ptr->result_fptr = result_fptr; job_ptr->result_user_ptr = result_user_ptr; - AFB_ServiceCall(unicensHalApiHandle, "UNICENS", "writei2c", j_query, wrap_ucs_i2cwrite_cb, job_ptr); + afb_api_call_legacy(unicensHalApiHandle, "UNICENS", "writei2c", j_query, wrap_ucs_i2cwrite_cb, job_ptr); return 0; } -- cgit 1.2.3-korg