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.
28 #include <curl/curl.h>
30 #include <openssl/evp.h>
31 #include <openssl/bio.h>
32 #include <openssl/buffer.h>
36 #include <wav_player.h>
39 #include <bundle_internal.h>
46 #include <Ecore_Wayland.h>
50 #include "net_nfc_typedef.h"
51 #include "net_nfc_typedef_internal.h"
52 #include "net_nfc_debug_internal.h"
53 #include "net_nfc_util_defines.h"
54 #include "net_nfc_util_internal.h"
55 #include "net_nfc_util_ndef_message.h"
56 #include "net_nfc_util_ndef_record.h"
57 #include "net_nfc_server_context.h"
58 #include "net_nfc_server_se.h"
59 #include "net_nfc_server_util.h"
61 #define NET_NFC_MANAGER_SOUND_PATH_TASK_START \
62 "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
64 #define NET_NFC_MANAGER_SOUND_PATH_TASK_END \
65 "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
67 #define NET_NFC_MANAGER_SOUND_PATH_TASK_ERROR \
68 "/usr/share/nfc-manager-daemon/sounds/Operation_sdk.wav"
70 #define OSP_K_COND "__OSP_COND_NAME__"
71 #define OSP_K_COND_TYPE "nfc"
72 #define OSP_K_LAUNCH_TYPE "__OSP_LAUNCH_TYPE__"
74 static const char osp_launch_type_condition[] = "condition";
76 static inline int _mkdir_recursive(char *path, mode_t mode)
87 found = strchr(found+1, '/');
97 exist = opendir(path);
102 ret = mkdir(path, mode);
106 NFC_ERR("mkdir() Failed(%s)", strerror_r(errno, buf, sizeof(buf)));
113 NFC_ERR("opendir() Failed(%s)", strerror_r(errno, buf, sizeof(buf)));
131 static bool _net_nfc_app_util_change_file_owner_permission(FILE *file)
134 size_t buffer_len = 0;
135 struct group grp = { 0, };
136 struct passwd pwd = { 0, };
137 struct group *gr_inhouse = NULL;
138 struct passwd *pw_inhouse = NULL;
140 RETV_IF(NULL == file, false);
142 /* change permission */
143 fchmod(fileno(file), 0777);
147 buffer_len = sysconf(_SC_GETPW_R_SIZE_MAX);
148 if (buffer_len == -1)
151 _net_nfc_util_alloc_mem(buffer, buffer_len);
155 getpwnam_r("inhouse", &pwd, buffer, buffer_len, &pw_inhouse);
156 _net_nfc_util_free_mem(buffer);
159 buffer_len = sysconf(_SC_GETGR_R_SIZE_MAX);
160 if (buffer_len == -1)
163 _net_nfc_util_alloc_mem(buffer, buffer_len);
167 getgrnam_r("inhouse", &grp, buffer, buffer_len, &gr_inhouse);
168 _net_nfc_util_free_mem(buffer);
170 if ((pw_inhouse != NULL) && (gr_inhouse != NULL))
172 if (fchown(fileno(file), pw_inhouse->pw_uid, gr_inhouse->gr_gid) < 0)
173 NFC_ERR("failed to change owner");
179 static net_nfc_error_e net_nfc_app_util_store_ndef_message(data_s *data)
183 char file_name[1024] = { 0, };
184 net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
186 RETV_IF(NULL == data, NET_NFC_NULL_PARAMETER);
188 /* check and make directory */
189 snprintf(file_name, sizeof(file_name), "%s/%s", NET_NFC_MANAGER_DATA_PATH,
190 NET_NFC_MANAGER_DATA_PATH_MESSAGE);
192 ret = _mkdir_recursive(file_name, 0755);
195 NFC_ERR("_mkdir_recursive() Failed");
196 return NET_NFC_UNKNOWN_ERROR;
200 snprintf(file_name, sizeof(file_name), "%s/%s/%s", NET_NFC_MANAGER_DATA_PATH,
201 NET_NFC_MANAGER_DATA_PATH_MESSAGE, NET_NFC_MANAGER_NDEF_FILE_NAME);
202 SECURE_LOGD("file path : %s", file_name);
206 if ((fp = fopen(file_name, "w")) != NULL)
210 if ((length = fwrite(data->buffer, 1, data->length, fp)) > 0)
212 NFC_DBG("[%d] bytes is written", length);
214 _net_nfc_app_util_change_file_owner_permission(fp);
223 NFC_ERR("write is failed = [%d]", data->length);
224 result = NET_NFC_UNKNOWN_ERROR;
233 static bool _net_nfc_app_util_get_operation_from_record(
234 ndef_record_s *record, char *operation, size_t length)
237 char *op_text = NULL;
239 RETV_IF(NULL == record, result);
240 RETV_IF(NULL == operation, result);
241 RETV_IF(0 == length, result);
245 case NET_NFC_RECORD_WELL_KNOWN_TYPE :
246 op_text = "http://tizen.org/appcontrol/operation/nfc/wellknown";
249 case NET_NFC_RECORD_MIME_TYPE :
250 op_text = "http://tizen.org/appcontrol/operation/nfc/mime";
253 case NET_NFC_RECORD_URI : /* Absolute URI */
254 op_text = "http://tizen.org/appcontrol/operation/nfc/uri";
257 case NET_NFC_RECORD_EXTERNAL_RTD : /* external type */
258 if(strncmp((char*)record->type_s.buffer, NET_NFC_APPLICATION_RECORD,
259 record->type_s.length)==0)
261 //use APPSVC_OPERATION_VIEW in case of Selective App launch
262 op_text = APPSVC_OPERATION_VIEW;
266 op_text = "http://tizen.org/appcontrol/operation/nfc/external";
270 case NET_NFC_RECORD_EMPTY : /* empty_tag */
271 op_text = "http://tizen.org/appcontrol/operation/nfc/empty";
274 case NET_NFC_RECORD_UNKNOWN : /* unknown msg. discard it */
275 case NET_NFC_RECORD_UNCHAGNED : /* RFU msg. discard it */
282 snprintf(operation, length, "%s", op_text);
289 static void _to_lower_utf_8(char *str)
293 if (*str >= 'A' && *str <= 'Z')
300 static void _to_lower(int type, char *str)
302 _to_lower_utf_8(str);
305 static bool _net_nfc_app_util_get_mime_from_record(
306 ndef_record_s *record, char *mime, size_t length)
310 RETV_IF(NULL == record, result);
311 RETV_IF(NULL == mime, result);
312 RETV_IF(0 == length, result);
316 case NET_NFC_RECORD_WELL_KNOWN_TYPE :
318 if (record->type_s.buffer == NULL || record->type_s.length == 0 ||
319 record->payload_s.buffer == NULL || record->payload_s.length == 0)
321 NFC_ERR("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
325 if (record->type_s.length == 1 && record->type_s.buffer[0] == 'U')
327 snprintf(mime, length, "U/0x%02x", record->payload_s.buffer[0]);
331 memcpy(mime, record->type_s.buffer, record->type_s.length);
332 mime[record->type_s.length] = '\0';
334 strncat(mime, "/*", 2);
335 mime[record->type_s.length + 2] = '\0';
342 case NET_NFC_RECORD_MIME_TYPE :
348 if (record->type_s.buffer == NULL || record->type_s.length == 0)
350 NFC_ERR("Broken NDEF Message [NET_NFC_RECORD_MIME_TYPE]");
355 _net_nfc_util_alloc_mem(buffer, record->type_s.length + 1);
358 NFC_ERR("_net_nfc_manager_util_alloc_mem return NULL");
361 memcpy(buffer, record->type_s.buffer, record->type_s.length);
363 token = strchr(buffer, ';');
365 len = MIN(token - buffer, length - 1);
367 len = MIN(strlen(buffer), length - 1);
369 strncpy(mime, buffer, len);
374 _net_nfc_util_free_mem(buffer);
380 case NET_NFC_RECORD_URI : /* Absolute URI */
381 case NET_NFC_RECORD_EXTERNAL_RTD : /* external type */
382 case NET_NFC_RECORD_EMPTY : /* empty_tag */
386 case NET_NFC_RECORD_UNKNOWN : /* unknown msg. discard it */
387 case NET_NFC_RECORD_UNCHAGNED : /* RFU msg. discard it */
396 static bool _net_nfc_app_util_get_uri_from_record(ndef_record_s *record, char *data, size_t length)
400 RETV_IF(NULL == record, result);
401 RETV_IF(NULL == data, result);
402 RETV_IF(0 == length, result);
406 case NET_NFC_RECORD_WELL_KNOWN_TYPE :
407 case NET_NFC_RECORD_URI : /* Absolute URI */
411 if (net_nfc_util_create_uri_string_from_uri_record(record, &uri) == NET_NFC_OK &&
414 snprintf(data, length, "%s", uri);
416 _net_nfc_util_free_mem(uri);
422 case NET_NFC_RECORD_EXTERNAL_RTD : /* external type */
424 data_s *type = &record->type_s;
426 if (type->length > 0)
430 int len = strlen(NET_NFC_UTIL_EXTERNAL_TYPE_SCHEME);
432 _net_nfc_util_alloc_mem(buffer, type->length + len + 1);
435 memcpy(buffer, NET_NFC_UTIL_EXTERNAL_TYPE_SCHEME, len);
436 memcpy(buffer + len, type->buffer, type->length);
438 /* to lower case!! */
441 NFC_DBG("uri record : %s", buffer);
442 snprintf(data, length, "%s", buffer);
444 _net_nfc_util_free_mem(buffer);
447 int len = MIN(type->length, length - 1);
448 memcpy(data, type->buffer, len);
451 /* to lower case!! */
460 case NET_NFC_RECORD_MIME_TYPE :
461 case NET_NFC_RECORD_EMPTY : /* empy msg. discard it */
465 case NET_NFC_RECORD_UNKNOWN : /* unknown msg. discard it */
466 case NET_NFC_RECORD_UNCHAGNED : /* RFU msg. discard it */
475 static bool _net_nfc_app_util_get_data_from_record(ndef_record_s *record, char *data, size_t length)
479 RETV_IF(NULL == record, result);
480 RETV_IF(NULL == data, result);
481 RETV_IF(0 == length, result);
485 case NET_NFC_RECORD_WELL_KNOWN_TYPE :
487 if (record->type_s.buffer == NULL || record->type_s.length == 0
488 || record->payload_s.buffer == NULL || record->payload_s.length == 0)
490 NFC_ERR("Broken NDEF Message [NET_NFC_RECORD_WELL_KNOWN_TYPE]");
494 if (record->type_s.length == 1 && record->type_s.buffer[0] == 'T')
496 uint8_t *buffer_temp = record->payload_s.buffer;
497 uint32_t buffer_length = record->payload_s.length;
499 int index = (buffer_temp[0] & 0x3F) + 1;
500 int text_length = buffer_length - index;
502 memcpy(data, &(buffer_temp[index]), MIN(text_length, length));
509 case NET_NFC_RECORD_MIME_TYPE :
510 case NET_NFC_RECORD_URI : /* Absolute URI */
512 case NET_NFC_RECORD_EXTERNAL_RTD : /* external type */
514 NFC_DBG("NDEF Message with external type");
515 if(strncmp((char*)record->type_s.buffer, NET_NFC_APPLICATION_RECORD,
516 record->type_s.length)==0)
518 uint8_t *buffer_temp = record->payload_s.buffer;
519 uint32_t buffer_length = record->payload_s.length;
520 if(buffer_length > length)
526 //Copy application id into data
527 memcpy(data,buffer_temp,MIN(buffer_length,length));
533 case NET_NFC_RECORD_EMPTY : /* empy msg. discard it */
537 case NET_NFC_RECORD_UNKNOWN : /* unknown msg. discard it */
538 case NET_NFC_RECORD_UNCHAGNED : /* RFU msg. discard it */
546 net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
549 char mime[2048] = { 0, };
550 char text[2048] = { 0, };
551 ndef_message_s *msg = NULL;
552 char operation[2048] = { 0, };
553 net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
555 char uri[2048] = { 0, };
558 RETV_IF(NULL == data, NET_NFC_NULL_PARAMETER);
559 RETV_IF(NULL == data->buffer, NET_NFC_NULL_PARAMETER);
560 RETV_IF(0 == data->length, NET_NFC_NULL_PARAMETER);
563 if ((result = net_nfc_app_util_store_ndef_message(data)) != NET_NFC_OK)
565 NFC_ERR("net_nfc_app_util_store_ndef_message failed [%d]", result);
569 /* check state of launch popup */
570 if(net_nfc_app_util_check_launch_state() == NET_NFC_NO_LAUNCH_APP_SELECT)
572 NFC_DBG("skip launch popup!!!");
577 if (net_nfc_util_create_ndef_message(&msg) != NET_NFC_OK)
579 NFC_ERR("memory alloc fail..");
580 return NET_NFC_ALLOC_FAIL;
583 /* parse ndef message and fill appsvc data */
584 if ((result = net_nfc_util_convert_rawdata_to_ndef_message(data, msg)) != NET_NFC_OK)
586 NFC_ERR("net_nfc_app_util_store_ndef_message failed [%d]", result);
590 if (_net_nfc_app_util_get_operation_from_record(msg->records, operation,
591 sizeof(operation)) == FALSE)
593 NFC_ERR("_net_nfc_app_util_get_operation_from_record failed [%d]", result);
594 result = NET_NFC_UNKNOWN_ERROR;
598 if (_net_nfc_app_util_get_mime_from_record(msg->records, mime, sizeof(mime)) == FALSE)
600 NFC_ERR("_net_nfc_app_util_get_mime_from_record failed [%d]", result);
601 result = NET_NFC_UNKNOWN_ERROR;
605 if (_net_nfc_app_util_get_uri_from_record(msg->records, uri, sizeof(uri)) == FALSE)
607 NFC_ERR("_net_nfc_app_util_get_uri_from_record failed [%d]", result);
608 result = NET_NFC_UNKNOWN_ERROR;
613 if (_net_nfc_app_util_get_data_from_record(msg->records, text, sizeof(text)) == FALSE)
615 NFC_ERR("_net_nfc_app_util_get_data_from_record failed [%d]", result);
616 result = NET_NFC_UNKNOWN_ERROR;
620 ret = net_nfc_app_util_appsvc_launch(operation, uri, mime, text);
622 if (ret == APPSVC_RET_ENOMATCH)
624 /* TODO : check again */
625 ret = net_nfc_app_util_appsvc_launch(operation, uri, mime, text);
629 NFC_DBG("net_nfc_app_util_appsvc_launch return %d", ret);
634 net_nfc_util_free_ndef_message(msg);
640 static bool net_nfc_app_util_is_dir(const char* path_name)
642 struct stat statbuf = { 0 };
644 if (stat(path_name, &statbuf) == -1)
647 if (S_ISDIR(statbuf.st_mode) != 0)
653 void net_nfc_app_util_clean_storage(const char* src_path)
656 char path[1024] = { 0 };
657 struct dirent* ent = NULL;
659 RET_IF((dir = opendir(src_path)) == NULL);
661 while ((ent = readdir(dir)) != NULL)
663 if (strncmp(ent->d_name, ".", 1) == 0 || strncmp(ent->d_name, "..", 2) == 0)
669 snprintf(path, 1024, "%s/%s", src_path, ent->d_name);
671 if (net_nfc_app_util_is_dir(path) != false)
673 net_nfc_app_util_clean_storage(path);
688 void net_nfc_app_util_aul_launch_app(char* package_name, bundle* kb)
691 if((result = aul_launch_app(package_name, kb)) < 0)
696 NFC_ERR("aul launch error : AUL_R_EINVAL");
699 NFC_ERR("aul launch error : AUL_R_ECOM");
702 NFC_ERR("aul launch error : AUL_R_ERROR");
705 NFC_ERR("aul launch error : unknown ERROR");
711 NFC_DBG("success to launch [%s]", package_name);
715 int net_nfc_app_util_appsvc_launch(const char *operation, const char *uri, const char *mime, const char *data)
720 bool specific_app_launch = false;
721 bd = bundle_create();
725 if (operation != NULL && strlen(operation) > 0)
727 NFC_DBG("operation : %s", operation);
728 appsvc_set_operation(bd, operation);
729 if(strncmp(operation, APPSVC_OPERATION_VIEW,strlen(APPSVC_OPERATION_VIEW))==0)
731 appsvc_set_appid(bd, data);
732 specific_app_launch = true;
737 if (uri != NULL && strlen(uri) > 0)
739 NFC_DBG("uri : %s", uri);
740 appsvc_set_uri(bd, uri);
743 if (mime != NULL && strlen(mime) > 0)
745 NFC_DBG("mime : %s", mime);
746 appsvc_set_mime(bd, mime);
749 if (data != NULL && strlen(data) > 0)
751 NFC_DBG("data : %s", data);
752 appsvc_add_data(bd, "data", data);
755 bundle_add(bd, OSP_K_COND, OSP_K_COND_TYPE);
756 bundle_add(bd, OSP_K_LAUNCH_TYPE, osp_launch_type_condition);
759 result = appsvc_run_service(bd, 0, NULL, NULL);
761 /*if the app could not be found*/
762 if(specific_app_launch && result == APPSVC_RET_ENOMATCH)
764 /*TODO: tizen store launch*/
772 void _binary_to_string(uint8_t *buffer, uint32_t len, char *out_buf, uint32_t max_len)
777 RET_IF(0 == max_len);
778 RET_IF(NULL == buffer);
779 RET_IF(NULL == out_buf);
781 while (len > 0 && current < max_len)
783 current += snprintf(out_buf + current, max_len - current, "%02X", *(buffer++));
788 void _string_to_binary(const char *input, uint8_t *output, uint32_t *length)
793 RET_IF(NULL == input);
794 RET_IF(NULL == length);
795 RET_IF(0 == *length);
796 RET_IF(NULL == output);
797 NFC_DBG("_string_to_binary ");
799 /* strlen("nfc://secure/aid/") = 17 */
803 while (*input && (current < *length))
805 temp = (*input++) - '0';
811 output[current / 2] += temp;
813 output[current / 2] = temp << 4;
818 *length = current / 2;
821 int net_nfc_app_util_launch_se_transaction_app(
822 net_nfc_secure_element_type_e se_type,
831 bd = bundle_create();
833 appsvc_set_operation(bd, "http://tizen.org/appcontrol/operation/nfc/transaction");
835 /* convert aid to aid string */
836 if (aid != NULL && aid_len > 0)
838 char temp_string[1024] = { 0, };
839 char aid_string[1024] = { 0, };
841 _binary_to_string(aid, aid_len, temp_string, sizeof(temp_string));
845 case SECURE_ELEMENT_TYPE_UICC:
846 snprintf(aid_string, sizeof(aid_string), "nfc://secure/SIM1/aid/%s", temp_string);
849 case SECURE_ELEMENT_TYPE_ESE:
850 snprintf(aid_string, sizeof(aid_string), "nfc://secure/eSE/aid/%s", temp_string);
853 snprintf(aid_string, sizeof(aid_string), "nfc://secure/aid/%s", temp_string);
857 NFC_DBG("aid_string : %s", aid_string);
858 appsvc_set_uri(bd, aid_string);
861 if (param != NULL && param_len > 0)
863 char param_string[1024] = { 0, };
865 _binary_to_string(param, param_len, param_string, sizeof(param_string));
866 NFC_DBG("param_string : %s", param_string);
867 appsvc_add_data(bd, "data", param_string);
870 appsvc_run_service(bd, 0, NULL, NULL);
876 int net_nfc_app_util_encode_base64(uint8_t *buffer, uint32_t buf_len, char *result, uint32_t max_result)
882 RETV_IF(NULL == buffer, ret);
883 RETV_IF(0 == buf_len, ret);
884 RETV_IF(NULL == result, ret);
885 RETV_IF(0 == max_result, ret);
888 b64 = BIO_new(BIO_f_base64());
889 BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
890 bmem = BIO_new(BIO_s_mem());
891 b64 = BIO_push(b64, bmem);
893 BIO_write(b64, buffer, buf_len);
895 BIO_get_mem_ptr(b64, &bptr);
897 memset(result, 0, max_result);
898 memcpy(result, bptr->data, MIN(bptr->length, max_result - 1));
907 int net_nfc_app_util_decode_base64(const char *buffer, uint32_t buf_len, uint8_t *result, uint32_t *res_len)
912 RETV_IF(NULL == buffer, ret);
913 RETV_IF(0 == buf_len, ret);
914 RETV_IF(NULL == result, ret);
915 RETV_IF(NULL == res_len, ret);
916 RETV_IF(0 == *res_len, ret);
918 _net_nfc_util_alloc_mem(temp, buf_len);
924 b64 = BIO_new(BIO_f_base64());
925 BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
926 bmem = BIO_new_mem_buf((void *)buffer, buf_len);
927 bmem = BIO_push(b64, bmem);
929 temp_len = BIO_read(bmem, temp, buf_len);
933 memset(result, 0, *res_len);
934 memcpy(result, temp, MIN(temp_len, *res_len));
936 *res_len = MIN(temp_len, *res_len);
938 _net_nfc_util_free_mem(temp);
944 NFC_ERR("alloc failed");
950 pid_t net_nfc_app_util_get_focus_app_pid()
953 Ecore_X_Window focus;
957 focus = ecore_x_window_focus_get();
958 if (ecore_x_netwm_pid_get(focus, &pid))
961 #ifdef USE_WAYLAND // TO_DO_WAYLAND
962 NFC_DBG("To implement: Wayland support");
967 bool net_nfc_app_util_check_launch_state()
971 net_nfc_launch_popup_state_e popup_state;
973 focus_app_pid = net_nfc_app_util_get_focus_app_pid();
975 popup_state = net_nfc_server_gdbus_get_client_popup_state(focus_app_pid);
977 if(NET_NFC_NO_LAUNCH_APP_SELECT == popup_state)
983 static void _play_sound_callback(int id, void *data)
985 NFC_DBG("_play_sound_callback");
987 if (WAV_PLAYER_ERROR_NONE != wav_player_stop(id))
988 NFC_ERR("wav_player_stop failed");
991 void net_nfc_manager_util_play_sound(net_nfc_sound_type_e sound_type)
994 int bVibrationOn = 0;
997 if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &bSoundOn) != 0)
999 NFC_ERR("vconf_get_bool failed for Sound");
1003 if (vconf_get_bool(VCONFKEY_SETAPPL_VIBRATION_STATUS_BOOL, &bVibrationOn) != 0)
1005 NFC_ERR("vconf_get_bool failed for Vibration");
1009 if ((sound_type > NET_NFC_TASK_ERROR) || (sound_type < NET_NFC_TASK_START))
1011 NFC_ERR("Invalid Sound Type");
1017 NFC_DBG("Play Vibration");
1019 ret = feedback_initialize();
1020 if (ret == FEEDBACK_ERROR_NONE)
1022 ret = feedback_play_type(FEEDBACK_TYPE_VIBRATION, FEEDBACK_PATTERN_SIP);
1023 if (ret != FEEDBACK_ERROR_NONE)
1024 NFC_ERR("Failed to play vibration(%d)", ret);
1025 feedback_deinitialize();
1029 NFC_ERR("Failed to init vibration(%d)", ret);
1035 char *sound_path = NULL;
1037 NFC_DBG("Play Sound");
1041 case NET_NFC_TASK_START :
1042 sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_START);
1044 case NET_NFC_TASK_END :
1045 sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_END);
1047 case NET_NFC_TASK_ERROR :
1048 sound_path = strdup(NET_NFC_MANAGER_SOUND_PATH_TASK_ERROR);
1052 if (sound_path != NULL)
1054 if (WAV_PLAYER_ERROR_NONE ==
1055 wav_player_start(sound_path, SOUND_TYPE_MEDIA, _play_sound_callback,
1058 NFC_DBG("wav_player_start success");
1061 _net_nfc_util_free_mem(sound_path);
1065 NFC_ERR("Invalid Sound Path");