2 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
27 #include <curl/curl.h>
29 #include <openssl/evp.h>
30 #include <openssl/bio.h>
31 #include <openssl/buffer.h>
35 #include <wav_player.h>
38 #include <bundle_internal.h>
45 #include <Ecore_Wayland.h>
48 #include "net_nfc_typedef.h"
49 #include "net_nfc_typedef_internal.h"
50 #include "net_nfc_debug_internal.h"
51 #include "net_nfc_util_defines.h"
52 #include "net_nfc_util_internal.h"
53 #include "net_nfc_util_ndef_message.h"
54 #include "net_nfc_util_ndef_record.h"
55 #include "net_nfc_client_util.h"
56 #include "net_nfc_client_system_handler.h"
58 #define NET_NFC_MANAGER_SOUND_PATH_TASK_START \
59 "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
61 #define NET_NFC_MANAGER_SOUND_PATH_TASK_END \
62 "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
64 #define NET_NFC_MANAGER_SOUND_PATH_TASK_ERROR \
65 "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
67 #define OSP_K_COND "__OSP_COND_NAME__"
68 #define OSP_K_COND_TYPE "nfc"
69 #define OSP_K_LAUNCH_TYPE "__OSP_LAUNCH_TYPE__"
71 static const char osp_launch_type_condition[] = "condition";
73 static inline int _mkdir_recursive(char *path, mode_t mode)
84 found = strchr(found+1, '/');
94 exist = opendir(path);
99 ret = mkdir(path, mode);
103 NFC_ERR("mkdir() Failed(%s)", strerror_r(errno, buf, sizeof(buf)));
110 NFC_ERR("opendir() Failed(%s)", strerror_r(errno, buf, sizeof(buf)));
128 static bool _net_nfc_app_util_change_file_owner_permission(FILE *file)
131 size_t buffer_len = 0;
132 struct group grp = { 0, };
133 struct passwd pwd = { 0, };
134 struct group *gr_inhouse = NULL;
135 struct passwd *pw_inhouse = NULL;
137 RETV_IF(NULL == file, false);
139 /* change permission */
140 fchmod(fileno(file), 0777);
144 buffer_len = sysconf(_SC_GETPW_R_SIZE_MAX);
145 if (buffer_len == -1)
148 _net_nfc_util_alloc_mem(buffer, buffer_len);
152 getpwnam_r("inhouse", &pwd, buffer, buffer_len, &pw_inhouse);
153 _net_nfc_util_free_mem(buffer);
156 buffer_len = sysconf(_SC_GETGR_R_SIZE_MAX);
157 if (buffer_len == -1)
160 _net_nfc_util_alloc_mem(buffer, buffer_len);
164 getgrnam_r("inhouse", &grp, buffer, buffer_len, &gr_inhouse);
165 _net_nfc_util_free_mem(buffer);
167 if ((pw_inhouse != NULL) && (gr_inhouse != NULL))
169 if (fchown(fileno(file), pw_inhouse->pw_uid, gr_inhouse->gr_gid) < 0)
170 NFC_ERR("failed to change owner");
176 static net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
180 char file_name[1024] = { 0, };
181 net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
183 RETV_IF(NULL == data, NET_NFC_NULL_PARAMETER);
185 /* check and make directory */
186 snprintf(file_name, sizeof(file_name), "%s/%s", NET_NFC_MANAGER_DATA_PATH,
187 NET_NFC_MANAGER_DATA_PATH_MESSAGE);
189 ret = _mkdir_recursive(file_name, 0755);
192 NFC_ERR("_mkdir_recursive() Failed");
193 return NET_NFC_UNKNOWN_ERROR;
197 snprintf(file_name, sizeof(file_name), "%s/%s/%s", NET_NFC_MANAGER_DATA_PATH,
198 NET_NFC_MANAGER_DATA_PATH_MESSAGE, NET_NFC_MANAGER_NDEF_FILE_NAME);
199 SECURE_LOGD("file path : %s", file_name);
203 if ((fp = fopen(file_name, "w")) != NULL)
207 if ((length = fwrite(data->buffer, 1, data->length, fp)) > 0)
209 NFC_DBG("[%d] bytes is written", length);
211 _net_nfc_app_util_change_file_owner_permission(fp);
220 NFC_ERR("write is failed = [%d]", data->length);
221 result = NET_NFC_UNKNOWN_ERROR;
230 static bool _net_nfc_app_util_get_operation_from_record(
231 ndef_record_s *record, char *operation, size_t length)
234 char *op_text = NULL;
236 RETV_IF(NULL == record, result);
237 RETV_IF(NULL == operation, result);
238 RETV_IF(0 == length, result);
242 case NET_NFC_RECORD_WELL_KNOWN_TYPE :
243 op_text = "http://tizen.org/appcontrol/operation/nfc/wellknown";
246 case NET_NFC_RECORD_MIME_TYPE :
247 op_text = "http://tizen.org/appcontrol/operation/nfc/mime";
250 case NET_NFC_RECORD_URI : /* Absolute URI */
251 op_text = "http://tizen.org/appcontrol/operation/nfc/uri";
254 case NET_NFC_RECORD_EXTERNAL_RTD : /* external type */
255 if(strncmp((char*)record->type_s.buffer, NET_NFC_APPLICATION_RECORD,
256 record->type_s.length)==0)
258 //use APPSVC_OPERATION_VIEW in case of Selective App launch
259 op_text = APPSVC_OPERATION_VIEW;
263 op_text = "http://tizen.org/appcontrol/operation/nfc/external";
267 case NET_NFC_RECORD_EMPTY : /* empty_tag */
268 op_text = "http://tizen.org/appcontrol/operation/nfc/empty";
271 case NET_NFC_RECORD_UNKNOWN : /* unknown msg. discard it */
272 case NET_NFC_RECORD_UNCHAGNED : /* RFU msg. discard it */
279 snprintf(operation, length, "%s", op_text);
286 static void _to_lower_utf_8(char *str)
290 if (*str >= 'A' && *str <= 'Z')
297 static void _to_lower(int type, char *str)
299 _to_lower_utf_8(str);
302 static bool _net_nfc_app_util_get_mime_from_record(
303 ndef_record_s *record, char *mime, size_t length)
307 RETV_IF(NULL == record, result);
308 RETV_IF(NULL == mime, result);
309 RETV_IF(0 == length, result);
313 case NET_NFC_RECORD_WELL_KNOWN_TYPE :
315 if (record->type_s.buffer == NULL || record->type_s.length == 0 ||
316 record->payload_s.buffer == NULL || record->payload_s.length == 0)
318 NFC_ERR("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
322 if (record->type_s.length == 1 && record->type_s.buffer[0] == 'U')
324 snprintf(mime, length, "U/0x%02x", record->payload_s.buffer[0]);
328 memcpy(mime, record->type_s.buffer, record->type_s.length);
329 mime[record->type_s.length] = '\0';
331 strncat(mime, "/*", 2);
332 mime[record->type_s.length + 2] = '\0';
339 case NET_NFC_RECORD_MIME_TYPE :
345 if (record->type_s.buffer == NULL || record->type_s.length == 0)
347 NFC_ERR("Broken NDEF Message [NET_NFC_RECORD_MIME_TYPE]");
352 _net_nfc_util_alloc_mem(buffer, record->type_s.length + 1);
355 NFC_ERR("_net_nfc_manager_util_alloc_mem return NULL");
358 memcpy(buffer, record->type_s.buffer, record->type_s.length);
360 token = strchr(buffer, ';');
362 len = MIN(token - buffer, length - 1);
364 len = MIN(strlen(buffer), length - 1);
366 strncpy(mime, buffer, len);
371 _net_nfc_util_free_mem(buffer);
377 case NET_NFC_RECORD_URI : /* Absolute URI */
378 case NET_NFC_RECORD_EXTERNAL_RTD : /* external type */
379 case NET_NFC_RECORD_EMPTY : /* empty_tag */
383 case NET_NFC_RECORD_UNKNOWN : /* unknown msg. discard it */
384 case NET_NFC_RECORD_UNCHAGNED : /* RFU msg. discard it */
393 static bool _net_nfc_app_util_get_uri_from_record(ndef_record_s *record, char *data, size_t length)
397 RETV_IF(NULL == record, result);
398 RETV_IF(NULL == data, result);
399 RETV_IF(0 == length, result);
403 case NET_NFC_RECORD_WELL_KNOWN_TYPE :
404 case NET_NFC_RECORD_URI : /* Absolute URI */
408 if (net_nfc_util_create_uri_string_from_uri_record(record, &uri) == NET_NFC_OK &&
411 snprintf(data, length, "%s", uri);
413 _net_nfc_util_free_mem(uri);
419 case NET_NFC_RECORD_EXTERNAL_RTD : /* external type */
421 data_s *type = &record->type_s;
423 if (type->length > 0)
427 int len = strlen(NET_NFC_UTIL_EXTERNAL_TYPE_SCHEME);
429 _net_nfc_util_alloc_mem(buffer, type->length + len + 1);
432 memcpy(buffer, NET_NFC_UTIL_EXTERNAL_TYPE_SCHEME, len);
433 memcpy(buffer + len, type->buffer, type->length);
435 /* to lower case!! */
438 NFC_DBG("uri record : %s", buffer);
439 snprintf(data, length, "%s", buffer);
441 _net_nfc_util_free_mem(buffer);
444 int len = MIN(type->length, length - 1);
445 memcpy(data, type->buffer, len);
448 /* to lower case!! */
457 case NET_NFC_RECORD_MIME_TYPE :
458 case NET_NFC_RECORD_EMPTY : /* empy msg. discard it */
462 case NET_NFC_RECORD_UNKNOWN : /* unknown msg. discard it */
463 case NET_NFC_RECORD_UNCHAGNED : /* RFU msg. discard it */
472 static bool _net_nfc_app_util_get_data_from_record(ndef_record_s *record, char *data, size_t length)
476 RETV_IF(NULL == record, result);
477 RETV_IF(NULL == data, result);
478 RETV_IF(0 == length, result);
482 case NET_NFC_RECORD_WELL_KNOWN_TYPE :
484 if (record->type_s.buffer == NULL || record->type_s.length == 0
485 || record->payload_s.buffer == NULL || record->payload_s.length == 0)
487 NFC_ERR("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
491 if (record->type_s.length == 1 && record->type_s.buffer[0] == 'T')
493 uint8_t *buffer_temp = record->payload_s.buffer;
494 uint32_t buffer_length = record->payload_s.length;
496 int index = (buffer_temp[0] & 0x3F) + 1;
497 int text_length = buffer_length - index;
499 memcpy(data, &(buffer_temp[index]), MIN(text_length, length));
506 case NET_NFC_RECORD_MIME_TYPE :
507 case NET_NFC_RECORD_URI : /* Absolute URI */
509 case NET_NFC_RECORD_EXTERNAL_RTD : /* external type */
511 NFC_DBG("NDEF Message with external type");
512 if(strncmp((char*)record->type_s.buffer, NET_NFC_APPLICATION_RECORD,
513 record->type_s.length)==0)
515 uint8_t *buffer_temp = record->payload_s.buffer;
516 uint32_t buffer_length = record->payload_s.length;
517 if(buffer_length > length)
523 //Copy application id into data
524 memcpy(data,buffer_temp,MIN(buffer_length,length));
530 case NET_NFC_RECORD_EMPTY : /* empy msg. discard it */
534 case NET_NFC_RECORD_UNKNOWN : /* unknown msg. discard it */
535 case NET_NFC_RECORD_UNCHAGNED : /* RFU msg. discard it */
543 net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
546 char mime[2048] = { 0, };
547 char text[2048] = { 0, };
548 ndef_message_s *msg = NULL;
549 char operation[2048] = { 0, };
550 net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
552 char uri[2048] = { 0, };
555 RETV_IF(NULL == data, NET_NFC_NULL_PARAMETER);
556 RETV_IF(NULL == data->buffer, NET_NFC_NULL_PARAMETER);
557 RETV_IF(0 == data->length, NET_NFC_NULL_PARAMETER);
560 if ((result = net_nfc_app_util_store_ndef_message(data)) != NET_NFC_OK)
562 NFC_ERR("net_nfc_app_util_store_ndef_message failed [%d]", result);
566 /* check state of launch popup */
567 if(net_nfc_app_util_check_launch_state() == NET_NFC_NO_LAUNCH_APP_SELECT)
569 NFC_DBG("skip launch popup!!!");
574 if (net_nfc_util_create_ndef_message(&msg) != NET_NFC_OK)
576 NFC_ERR("memory alloc fail..");
577 return NET_NFC_ALLOC_FAIL;
580 /* parse ndef message and fill appsvc data */
581 if ((result = net_nfc_util_convert_rawdata_to_ndef_message(data, msg)) != NET_NFC_OK)
583 NFC_ERR("net_nfc_app_util_store_ndef_message failed [%d]", result);
587 if (_net_nfc_app_util_get_operation_from_record(msg->records, operation,
588 sizeof(operation)) == FALSE)
590 NFC_ERR("_net_nfc_app_util_get_operation_from_record failed [%d]", result);
591 result = NET_NFC_UNKNOWN_ERROR;
595 if (_net_nfc_app_util_get_mime_from_record(msg->records, mime, sizeof(mime)) == FALSE)
597 NFC_ERR("_net_nfc_app_util_get_mime_from_record failed [%d]", result);
598 result = NET_NFC_UNKNOWN_ERROR;
602 if (_net_nfc_app_util_get_uri_from_record(msg->records, uri, sizeof(uri)) == FALSE)
604 NFC_ERR("_net_nfc_app_util_get_uri_from_record failed [%d]", result);
605 result = NET_NFC_UNKNOWN_ERROR;
610 if (_net_nfc_app_util_get_data_from_record(msg->records, text, sizeof(text)) == FALSE)
612 NFC_ERR("_net_nfc_app_util_get_data_from_record failed [%d]", result);
613 result = NET_NFC_UNKNOWN_ERROR;
617 ret = net_nfc_app_util_appsvc_launch(operation, uri, mime, text);
619 if (ret == APPSVC_RET_ENOMATCH)
621 /* TODO : check again */
622 ret = net_nfc_app_util_appsvc_launch(operation, uri, mime, text);
626 NFC_DBG("net_nfc_app_util_appsvc_launch return %d", ret);
631 net_nfc_util_free_ndef_message(msg);
637 static bool net_nfc_app_util_is_dir(const char* path_name)
639 struct stat statbuf = { 0 };
641 if (stat(path_name, &statbuf) == -1)
644 if (S_ISDIR(statbuf.st_mode) != 0)
650 void net_nfc_app_util_clean_storage(const char* src_path)
653 char path[1024] = { 0 };
654 struct dirent* ent = NULL;
656 RET_IF((dir = opendir(src_path)) == NULL);
658 while ((ent = readdir(dir)) != NULL)
660 if (strncmp(ent->d_name, ".", 1) == 0 || strncmp(ent->d_name, "..", 2) == 0)
666 snprintf(path, 1024, "%s/%s", src_path, ent->d_name);
668 if (net_nfc_app_util_is_dir(path) != false)
670 net_nfc_app_util_clean_storage(path);
685 void net_nfc_app_util_aul_launch_app(char* package_name, bundle* kb)
688 if((result = aul_launch_app(package_name, kb)) < 0)
693 NFC_ERR("aul launch error : AUL_R_EINVAL");
696 NFC_ERR("aul launch error : AUL_R_ECOM");
699 NFC_ERR("aul launch error : AUL_R_ERROR");
702 NFC_ERR("aul launch error : unknown ERROR");
708 NFC_DBG("success to launch [%s]", package_name);
712 int net_nfc_app_util_appsvc_launch(const char *operation, const char *uri, const char *mime, const char *data)
717 bool specific_app_launch = false;
718 bd = bundle_create();
722 if (operation != NULL && strlen(operation) > 0)
724 NFC_DBG("operation : %s", operation);
725 appsvc_set_operation(bd, operation);
726 if(strncmp(operation, APPSVC_OPERATION_VIEW,strlen(APPSVC_OPERATION_VIEW))==0)
728 appsvc_set_appid(bd, data);
729 specific_app_launch = true;
734 if (uri != NULL && strlen(uri) > 0)
736 NFC_DBG("uri : %s", uri);
737 appsvc_set_uri(bd, uri);
740 if (mime != NULL && strlen(mime) > 0)
742 NFC_DBG("mime : %s", mime);
743 appsvc_set_mime(bd, mime);
746 if (data != NULL && strlen(data) > 0)
748 NFC_DBG("data : %s", data);
749 appsvc_add_data(bd, "data", data);
752 bundle_add(bd, OSP_K_COND, OSP_K_COND_TYPE);
753 bundle_add(bd, OSP_K_LAUNCH_TYPE, osp_launch_type_condition);
756 result = appsvc_run_service(bd, 0, NULL, NULL);
758 /*if the app could not be found*/
759 if(specific_app_launch && result == APPSVC_RET_ENOMATCH)
761 /*TODO: tizen store launch*/
769 void _binary_to_string(uint8_t *buffer, uint32_t len, char *out_buf, uint32_t max_len)
774 RET_IF(0 == max_len);
775 RET_IF(NULL == buffer);
776 RET_IF(NULL == out_buf);
778 while (len > 0 && current < max_len)
780 current += snprintf(out_buf + current, max_len - current, "%02X", *(buffer++));
785 void _string_to_binary(const char *input, uint8_t *output, uint32_t *length)
790 RET_IF(NULL == input);
791 RET_IF(NULL == length);
792 RET_IF(0 == *length);
793 RET_IF(NULL == output);
794 NFC_DBG("_string_to_binary ");
796 /* strlen("nfc://secure/aid/") = 17 */
800 while (*input && (current < *length))
802 temp = (*input++) - '0';
808 output[current / 2] += temp;
810 output[current / 2] = temp << 4;
815 *length = current / 2;
818 int net_nfc_app_util_launch_se_transaction_app(
819 net_nfc_secure_element_type_e se_type,
828 bd = bundle_create();
830 appsvc_set_operation(bd, "http://tizen.org/appcontrol/operation/nfc/transaction");
832 /* convert aid to aid string */
833 if (aid != NULL && aid_len > 0)
835 char temp_string[1024] = { 0, };
836 char aid_string[1024] = { 0, };
838 _binary_to_string(aid, aid_len, temp_string, sizeof(temp_string));
842 case SECURE_ELEMENT_TYPE_UICC:
843 snprintf(aid_string, sizeof(aid_string), "nfc://secure/SIM1/aid/%s", temp_string);
846 case SECURE_ELEMENT_TYPE_ESE:
847 snprintf(aid_string, sizeof(aid_string), "nfc://secure/eSE/aid/%s", temp_string);
850 snprintf(aid_string, sizeof(aid_string), "nfc://secure/aid/%s", temp_string);
854 NFC_DBG("aid_string : %s", aid_string);
855 appsvc_set_uri(bd, aid_string);
858 if (param != NULL && param_len > 0)
860 char param_string[1024] = { 0, };
862 _binary_to_string(param, param_len, param_string, sizeof(param_string));
863 NFC_DBG("param_string : %s", param_string);
864 appsvc_add_data(bd, "data", param_string);
867 appsvc_run_service(bd, 0, NULL, NULL);
873 int net_nfc_app_util_encode_base64(uint8_t *buffer, uint32_t buf_len, char *result, uint32_t max_result)
879 RETV_IF(NULL == buffer, ret);
880 RETV_IF(0 == buf_len, ret);
881 RETV_IF(NULL == result, ret);
882 RETV_IF(0 == max_result, ret);
885 b64 = BIO_new(BIO_f_base64());
886 BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
887 bmem = BIO_new(BIO_s_mem());
888 b64 = BIO_push(b64, bmem);
890 BIO_write(b64, buffer, buf_len);
892 BIO_get_mem_ptr(b64, &bptr);
894 memset(result, 0, max_result);
895 memcpy(result, bptr->data, MIN(bptr->length, max_result - 1));
904 int net_nfc_app_util_decode_base64(const char *buffer, uint32_t buf_len, uint8_t *result, uint32_t *res_len)
909 RETV_IF(NULL == buffer, ret);
910 RETV_IF(0 == buf_len, ret);
911 RETV_IF(NULL == result, ret);
912 RETV_IF(NULL == res_len, ret);
913 RETV_IF(0 == *res_len, ret);
915 _net_nfc_util_alloc_mem(temp, buf_len);
921 b64 = BIO_new(BIO_f_base64());
922 BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
923 bmem = BIO_new_mem_buf((void *)buffer, buf_len);
924 bmem = BIO_push(b64, bmem);
926 temp_len = BIO_read(bmem, temp, buf_len);
930 memset(result, 0, *res_len);
931 memcpy(result, temp, MIN(temp_len, *res_len));
933 *res_len = MIN(temp_len, *res_len);
935 _net_nfc_util_free_mem(temp);
941 NFC_ERR("alloc failed");
947 pid_t net_nfc_app_util_get_focus_app_pid()
950 Ecore_X_Window focus;
954 focus = ecore_x_window_focus_get();
955 if (ecore_x_netwm_pid_get(focus, &pid))
958 #ifdef USE_WAYLAND // TO_DO_WAYLAND
959 NFC_DBG("To implement: Wayland support");
964 bool net_nfc_app_util_check_launch_state()
968 net_nfc_client_sys_handler_get_launch_popup_state(&state);
973 static void _play_sound_callback(int id, void *data)
975 NFC_DBG("_play_sound_callback");
977 if (WAV_PLAYER_ERROR_NONE != wav_player_stop(id))
978 NFC_ERR("wav_player_stop failed");
981 void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type)
984 int bVibrationOn = 0;
987 if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &bSoundOn) != 0)
989 NFC_ERR("vconf_get_bool failed for Sound");
993 if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &bVibrationOn) != 0)
995 NFC_ERR("vconf_get_bool failed for Vibration");
999 if ((sound_type > NET_NFC_TASK_ERROR) || (sound_type < NET_NFC_TASK_START))
1001 NFC_ERR("Invalid Sound Type");
1007 NFC_DBG("Play Vibration");
1009 ret = feedback_initialize();
1010 if (ret == FEEDBACK_ERROR_NONE)
1012 ret = feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_SIP);
1013 if (ret != FEEDBACK_ERROR_NONE)
1014 NFC_ERR("Failed to play vibration(%d)", ret);
1015 feedback_deinitialize();
1019 NFC_ERR("Failed to init vibration(%d)", ret);
1025 char *sound_path = NULL;
1027 NFC_DBG("Play Sound");
1031 case NET_NFC_TASK_START :
1032 sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_START);
1034 case NET_NFC_TASK_END :
1035 sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_END);
1037 case NET_NFC_TASK_ERROR :
1038 sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_ERROR);
1042 if (sound_path != NULL)
1044 if (WAV_PLAYER_ERROR_NONE ==
1045 wav_player_start(sound_path, SOUND_TYPE_MEDIA, _play_sound_callback,
1048 NFC_DBG("wav_player_start success");
1051 _net_nfc_util_free_mem(sound_path);
1055 NFC_ERR("Invalid Sound Path");