summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunyong Sim <junyong.sim@samsung.com>2012-12-28 09:14:27 +0900
committerJunyong Sim <junyong.sim@samsung.com>2012-12-28 11:20:37 +0900
commit027bc61a0a1c21e4898f08fe7fedfb55e4c64bf4 (patch)
tree1f4d7e7b2740ac2f4dc6deeeb8f550ab6bcafe7a
parent39ed553301b8179b9480bca0dd8ce54b1fb68aab (diff)
downloadug-nfc-efl-027bc61a0a1c21e4898f08fe7fedfb55e4c64bf4.tar.gz
ug-nfc-efl-027bc61a0a1c21e4898f08fe7fedfb55e4c64bf4.tar.bz2
ug-nfc-efl-027bc61a0a1c21e4898f08fe7fedfb55e4c64bf4.zip
code update
Change-Id: Icadecee28a61d08caf021d7273bbc6c1ef352df3
-rw-r--r--packaging/ug-nfc-efl.spec2
-rw-r--r--ug-nfc-setting-efl/CMakeLists.txt1
-rw-r--r--ug-nfc-setting-efl/include/ug-nfc-setting-main.h3
-rw-r--r--ug-nfc-setting-efl/src/ug-nfc-setting-main.c358
-rw-r--r--ug-nfc-share-efl/CMakeLists.txt2
-rw-r--r--ug-nfc-share-efl/include/ug-nfc-share-main.h2
-rw-r--r--ug-nfc-share-efl/src/ug-nfc-share-main.c37
-rw-r--r--ug-nfc-share-efl/src/ug-nfc-share-tag.c27
8 files changed, 23 insertions, 409 deletions
diff --git a/packaging/ug-nfc-efl.spec b/packaging/ug-nfc-efl.spec
index fc8aae1..1c8922a 100644
--- a/packaging/ug-nfc-efl.spec
+++ b/packaging/ug-nfc-efl.spec
@@ -16,7 +16,7 @@ BuildRequires: pkgconfig(ui-gadget-1)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(utilX)
-BuildRequires: pkgconfig(status)
+BuildRequires: pkgconfig(notification)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-network-nfc)
BuildRequires: pkgconfig(capi-content-mime-type)
diff --git a/ug-nfc-setting-efl/CMakeLists.txt b/ug-nfc-setting-efl/CMakeLists.txt
index 3eb6521..f352bfc 100644
--- a/ug-nfc-setting-efl/CMakeLists.txt
+++ b/ug-nfc-setting-efl/CMakeLists.txt
@@ -64,7 +64,6 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
-#ADD_DEFINITIONS("-D_SBEAM_SUPPORT_")
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0)
diff --git a/ug-nfc-setting-efl/include/ug-nfc-setting-main.h b/ug-nfc-setting-efl/include/ug-nfc-setting-main.h
index ef710f4..25fb99d 100644
--- a/ug-nfc-setting-efl/include/ug-nfc-setting-main.h
+++ b/ug-nfc-setting-efl/include/ug-nfc-setting-main.h
@@ -67,9 +67,6 @@ extern "C" {
typedef enum _NFCSettingType {
NFC_ON_OFF = 0,
-#ifdef _SBEAM_SUPPORT_
- NFC_S_BEAM,
-#endif
NFC_PREDEFINED_ITEM,
NFC_SETTING_MAX
} NFCSettingType;
diff --git a/ug-nfc-setting-efl/src/ug-nfc-setting-main.c b/ug-nfc-setting-efl/src/ug-nfc-setting-main.c
index 973098a..205fb59 100644
--- a/ug-nfc-setting-efl/src/ug-nfc-setting-main.c
+++ b/ug-nfc-setting-efl/src/ug-nfc-setting-main.c
@@ -18,9 +18,6 @@
#include "ug-nfc-setting-main.h"
#include "ug-nfc-setting-popup.h"
#include "ug-nfc-setting-db.h"
-#ifdef MDM_PHASE_2
-#include <mdm.h>
-#endif
#ifndef UG_MODULE_API
#define UG_MODULE_API __attribute__ ((visibility("default")))
@@ -33,43 +30,11 @@ static Elm_Genlist_Item_Class itc_helptext;
static Elm_Genlist_Item_Class itc_2text;
static Elm_Object_Item *nfc_item = NULL;
-#ifdef _SBEAM_SUPPORT_
-static Elm_Object_Item *sbeam_item = NULL;
-#endif
static Elm_Object_Item *predefined_item = NULL;
static bool pending_status = false;
-#ifdef MDM_PHASE_2
-static void _mdm_restricted_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
- LOGD("BEGIN >>>>");
- ugdata_t *ug_data = (ugdata_t *)data;
- if (!ug_data)
- return;
-
- LOGD("END >>>>");
-}
-
-static void _mdm_restricted_popup(void *data)
-{
- LOGD("BEGIN >>>>");
-
- char popup_str[POPUP_TEXT_SIZE] = { 0, };
- char *buf = NULL;
- ugdata_t *ug_data = (ugdata_t *)data;
- if (!ug_data)
- return;
-
- buf = strdup(IDS_SECURITY_POLICY_RESTRICTS_USE_OF_PS);
- snprintf(popup_str, POPUP_TEXT_SIZE, buf, IDS_NFC_NFC);
- ug_nfc_setting_create_popup(ug_data, ug_data->base_layout, popup_str, NULL, 0, NULL, 0, NULL, 0, true, true, _mdm_restricted_popup_response_cb);
-
- LOGD("END >>>>");
-}
-#endif
-
static void _show_app_error_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
{
ugdata_t *ug_data = (ugdata_t *)data;
@@ -151,138 +116,18 @@ static void _change_nfc_onoff_setting(void *data)
if (!ug_data)
return;
- /* check MDM */
-#ifdef MDM_PHASE_2
- result = mdm_get_service();
- if (result == MDM_RESULT_SUCCESS)
- {
- result = mdm_get_allow_nfc();
- if (result == MDM_ALLOWED)
- {
- LOGD( "MDM_ALLOWED!\n");
- mdm_release_service();
- }
- else if (result == MDM_RESTRICTED)
- {
- LOGD( "MDM_RESTRICTED!\n");
- _mdm_restricted_popup(ug_data);
- return;
- }
- else
- {
- LOGD( "exception case!\n");
- return;
- }
- }
- else
- {
- LOGD( "failed to get mdm service!\n");
- return;
- }
-#endif
-
if ((result = vconf_get_bool(VCONFKEY_NFC_STATE, &status)) == 0)
{
LOGD("vconf_get_bool status [%d]\n", status);
result = nfc_manager_set_activation(!status, NULL, NULL);
- _set_pending_status(true);
- }
- else
- {
- LOGD("vconf_get_bool failed\n");
- }
-
- LOGD("END <<<<");
-}
-
-#ifdef _SBEAM_SUPPORT_
-static void _change_nfc_sbeam_setting(void *data)
-{
- int status = 0;
- int result = -1;
-
- LOGD("BEGIN >>>>");
-
- ugdata_t *ug_data = (ugdata_t *)data;
- if (!ug_data)
- return;
-
- /* check MDM */
-#ifdef MDM_PHASE_2
- result = mdm_get_service();
- if (result == MDM_RESULT_SUCCESS)
- {
- result = mdm_get_allow_nfc();
- if (result == MDM_ALLOWED)
- {
- LOGD( "MDM_ALLOWED!\n");
- mdm_release_service();
- }
- else if (result == MDM_RESTRICTED)
- {
- LOGD( "MDM_RESTRICTED!\n");
- _mdm_restricted_popup(ug_data);
- return;
- }
- else
+ if (result != NFC_ERROR_NONE)
{
- LOGD( "exception case!\n");
- return;
- }
- }
- else
- {
- LOGD( "failed to get mdm service!\n");
- return;
- }
-#endif
+ LOGD("nfc_manager_set_activation failed");
- if ((result = vconf_get_bool(VCONFKEY_NFC_SBEAM, &status)) == 0)
- {
- LOGD("vconf_get_bool status [%d]\n", status);
-
- if (status)
- {
- /* sbeam off */
- result = vconf_set_bool(VCONFKEY_NFC_SBEAM, FALSE);
- if (!result )
- {
- LOGD("vconf_set_bool success\n");
- }
- else
- {
- LOGD("vconf_set_bool failed\n");
- }
- }
- else
- {
- /* sbeam on */
- result = vconf_set_bool(VCONFKEY_NFC_SBEAM, TRUE);
- if (!result )
- {
- LOGD("vconf_set_bool success\n");
- }
- else
- {
- LOGD("vconf_set_bool failed\n");
- }
-
- /* nfc on */
- if ((result = vconf_get_bool(VCONFKEY_NFC_STATE, &status)) == 0)
- {
- LOGD("vconf_get_bool status [%d]\n", status);
- if (!status)
- {
- result = nfc_manager_set_activation(true, NULL, NULL);
- _set_pending_status(true);
- }
- }
- else
- {
- LOGD("vconf_get_bool failed\n");
- }
+ return;
}
+ _set_pending_status(true);
}
else
{
@@ -291,7 +136,6 @@ static void _change_nfc_sbeam_setting(void *data)
LOGD("END <<<<");
}
-#endif
void _change_nfc_predefined_item_setting(void *data)
{
@@ -304,36 +148,6 @@ void _change_nfc_predefined_item_setting(void *data)
if (!ug_data)
return;
- /* check MDM */
-#ifdef MDM_PHASE_2
- result = mdm_get_service();
- if (result == MDM_RESULT_SUCCESS)
- {
- result = mdm_get_allow_nfc();
- if (result == MDM_ALLOWED)
- {
- LOGD( "MDM_ALLOWED!\n");
- mdm_release_service();
- }
- else if (result == MDM_RESTRICTED)
- {
- LOGD( "MDM_RESTRICTED!\n");
- _mdm_restricted_popup(ug_data);
- return;
- }
- else
- {
- LOGD( "exception case!\n");
- return;
- }
- }
- else
- {
- LOGD( "failed to get mdm service!\n");
- return;
- }
-#endif
-
if ((result = vconf_get_bool(VCONFKEY_NFC_PREDEFINED_ITEM_STATE, &status)) == 0)
{
LOGD("vconf_get_bool status [%d]\n", status);
@@ -424,10 +238,6 @@ void _nfc_activation_changed_cb(bool activated , void *user_data)
}
else
{
-#ifdef _SBEAM_SUPPORT_
- int sbeam_state = 0;
-#endif
-
/* predefined item setting disabled */
elm_object_item_disabled_set(predefined_item, EINA_TRUE);
@@ -443,32 +253,6 @@ void _nfc_activation_changed_cb(bool activated , void *user_data)
/* set internal flag */
predefined_item_off_by_nfcOnOff = true;
-
-#ifdef _SBEAM_SUPPORT_
- /* sbeam off */
- if ((result = vconf_get_bool(VCONFKEY_NFC_SBEAM, &sbeam_state)) == 0)
- {
- LOGD("vconf_get_bool status [%d]\n", sbeam_state);
-
- if (sbeam_state)
- {
- /* sbeam off */
- result = vconf_set_bool(VCONFKEY_NFC_SBEAM, FALSE);
- if (!result )
- {
- LOGD("vconf_set_bool success\n");
- }
- else
- {
- LOGD("vconf_set_bool failed\n");
- }
- }
- }
- else
- {
- LOGD("vconf_get_bool failed\n");
- }
-#endif
}
LOGD("END <<<<");
@@ -502,7 +286,6 @@ static Evas_Object *_create_main_layout(Evas_Object *parent)
elm_layout_theme_set(layout, "layout", "application", "default");
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(parent, layout);
evas_object_show(layout);
@@ -544,27 +327,6 @@ static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part)
LOGD("vconf_get_bool error [%d]", result);
}
}
-#ifdef _SBEAM_SUPPORT_
- else if (item_data->type == NFC_S_BEAM)
- {
- if (!vconf_get_bool(VCONFKEY_NFC_SBEAM, &enable))
- {
- if (enable != 0)
- {
- LOGD("vconf_get_bool true");
- result = EINA_TRUE;
- }
- else
- {
- LOGD("vconf_get_bool false");
- }
- }
- else
- {
- LOGD("vconf_get_bool error [%d]", result);
- }
- }
-#endif
else if (item_data->type == NFC_PREDEFINED_ITEM)
{
if (!vconf_get_bool(VCONFKEY_NFC_PREDEFINED_ITEM_STATE, &enable))
@@ -634,14 +396,6 @@ static void _gl_sel_activation(void *data, Evas_Object *obj, void *event_info)
elm_genlist_item_update(item);
}
-#ifdef _SBEAM_SUPPORT_
- else if (item_data->type == NFC_S_BEAM)
- {
- _change_nfc_sbeam_setting(item_data->data);
-
- elm_genlist_item_update(item);
- }
-#endif
else if (item_data->type == NFC_PREDEFINED_ITEM)
{
Evas_Object *predefined_item_list = NULL;
@@ -695,15 +449,6 @@ static void _check_changed_cb(void *data, Evas_Object *obj, void *event_info)
if (nfc_item != NULL)
elm_genlist_item_update(nfc_item);
}
-#ifdef _SBEAM_SUPPORT_
- else if (item_data->type == NFC_S_BEAM)
- {
- _change_nfc_sbeam_setting(item_data->data);
-
- if (sbeam_item != NULL)
- elm_genlist_item_update(sbeam_item);
- }
-#endif
else if (item_data->type == NFC_PREDEFINED_ITEM)
{
_change_nfc_predefined_item_setting(item_data->data);
@@ -772,27 +517,6 @@ static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *pa
elm_object_style_set(content, "on&off");
}
}
-#ifdef _SBEAM_SUPPORT_
- else if (item_data->type == NFC_S_BEAM)
- {
- content = elm_check_add(obj);
- evas_object_propagate_events_set(content, EINA_FALSE);
- evas_object_smart_callback_add(content, "changed", _check_changed_cb, item_data);
-
- if (((result = vconf_get_bool(VCONFKEY_NFC_SBEAM, &on)) == 0) && (on != 0))
- {
- LOGD("vconf_get_bool true");
- elm_check_state_set(content, EINA_TRUE);
- }
- else
- {
- LOGD("vconf_get_bool false");
- elm_check_state_set(content, EINA_FALSE);
- }
-
- elm_object_style_set(content, "on&off");
- }
-#endif
else if (item_data->type == NFC_PREDEFINED_ITEM)
{
content = elm_check_add(obj);
@@ -842,12 +566,6 @@ static char *_gl_text_get_onoff(void *data, Evas_Object *obj, const char *part)
{
text = strdup(IDS_NFC_NFC);
}
-#ifdef _SBEAM_SUPPORT_
- else if (item_data->type == NFC_S_BEAM)
- {
- text = strdup(IDS_NFC_S_BEAM);
- }
-#endif
else if (item_data->type == NFC_PREDEFINED_ITEM)
{
if (!strcmp(part, "elm.text.1"))
@@ -1027,68 +745,6 @@ static Evas_Object *_ug_nfc_create_nfc_setting_list(void *data)
return genlist;
}
-#ifdef _SBEAM_SUPPORT_
-static Evas_Object *_ug_nfc_create_sbeam_setting_list(void *data)
-{
- LOGD("BEGIN >>>>");
-
- ugdata_t *ug_data = (ugdata_t *)data;
- Evas_Object *genlist = NULL;
- Elm_Object_Item* seperator = NULL;
-
-
- /* make genlist */
- genlist = elm_genlist_add(ug_data->base_naviframe);
- if (genlist == NULL)
- {
- LOGD("genlist is null");
- return NULL;
- }
- elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
-
- itc_sep.item_style = "dialogue/separator";
- itc_sep.func.text_get = NULL;
- itc_sep.func.content_get = NULL;
- itc_sep.func.state_get = NULL;
- itc_sep.func.del = NULL;
-
- itc_check.item_style = "dialogue/1text.1icon";
- itc_check.func.text_get = _gl_text_get_onoff;
- itc_check.func.content_get = _gl_content_get;
- itc_check.func.state_get = _gl_state_get;
- itc_check.func.del = _gl_del;
-
- itc_helptext.item_style = "multiline/1text";
- itc_helptext.func.text_get = _gl_text_get_help;
- itc_helptext.func.content_get = NULL;
- itc_helptext.func.state_get = NULL;
- itc_helptext.func.del = NULL;
-
-
- /* seperator */
- seperator= elm_genlist_item_append(genlist, &itc_sep, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- elm_genlist_item_select_mode_set(seperator, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-
- /* S beam setting */
- gl_item_data *sbeam_data = NULL;
- sbeam_data = malloc(sizeof(gl_item_data));
- if (!sbeam_data)
- return NULL;
- sbeam_data->type = NFC_S_BEAM;
- sbeam_data->data = ug_data;
- sbeam_item = elm_genlist_item_append(genlist, &itc_check, (void *)sbeam_data, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_activation, (void *)sbeam_data);
-
- /* S beam setting Help Text */
- elm_genlist_item_append(genlist, &itc_helptext, (void *)2, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
-
- evas_object_show(genlist);
-
- LOGD("END <<<<");
-
- return genlist;
-}
-#endif
-
static void *__ug_nfc_setting_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv)
{
LOGD("BEGIN >>>>");
@@ -1137,12 +793,6 @@ static void *__ug_nfc_setting_create(ui_gadget_h ug, enum ug_mode mode, service_
nfc_setting_list = _ug_nfc_create_nfc_setting_list(ug_data);
}
-#ifdef _SBEAM_SUPPORT_
- else if (strncmp(type, "sbeam", strlen("sbeam")) == 0)
- {
- nfc_setting_list = _ug_nfc_create_sbeam_setting_list(ug_data);
- }
-#endif
else
{
return NULL;
diff --git a/ug-nfc-share-efl/CMakeLists.txt b/ug-nfc-share-efl/CMakeLists.txt
index ada6d8a..3897109 100644
--- a/ug-nfc-share-efl/CMakeLists.txt
+++ b/ug-nfc-share-efl/CMakeLists.txt
@@ -38,7 +38,7 @@ elementary
ui-gadget-1
dlog
vconf
-status
+notification
capi-appfw-application
capi-network-nfc
capi-content-mime-type
diff --git a/ug-nfc-share-efl/include/ug-nfc-share-main.h b/ug-nfc-share-efl/include/ug-nfc-share-main.h
index 83c6555..3513ff0 100644
--- a/ug-nfc-share-efl/include/ug-nfc-share-main.h
+++ b/ug-nfc-share-efl/include/ug-nfc-share-main.h
@@ -84,7 +84,7 @@ extern "C" {
/* will be deleted */
-#define IDS_NFC_SERVICE_IS_NOT_SUPPORTED _("NFC service is not supported")
+#define IDS_NFC_SERVICE_IS_NOT_SUPPORTED _("NFC service is not supported")
/* System string */
#define IDS_YES dgettext("sys_string", "IDS_COM_SK_YES")
diff --git a/ug-nfc-share-efl/src/ug-nfc-share-main.c b/ug-nfc-share-efl/src/ug-nfc-share-main.c
index 75cac26..7feeb73 100644
--- a/ug-nfc-share-efl/src/ug-nfc-share-main.c
+++ b/ug-nfc-share-efl/src/ug-nfc-share-main.c
@@ -47,7 +47,6 @@ void ug_nfc_share_create_nfc_share_view(void *user_data);
bool ug_nfc_share_check_nfc_isAvailable(void *user_data);
static void ug_nfc_share_create_data(ugdata_t* ug_data);
-static Ecore_Timer *mdmPopup_timer = NULL;
int _get_theme_type()
{
@@ -285,43 +284,12 @@ static Evas_Object *_create_main_layout(Evas_Object* parent)
elm_layout_theme_set(layout, "layout", "application", "default");
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(parent, layout);
evas_object_show(layout);
return layout;
}
-static void _mdm_restricted_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
-{
-
- ugdata_t *ug_data = (ugdata_t *)data;
- ret_if(ug_data == NULL);
-
- LOGD("BEGIN >>>>");
- LOGD("END >>>>");
-
- ug_destroy_me(ug_data->nfc_share_ug);
-}
-
-static Eina_Bool _mdm_restricted_popup(void *data)
-{
- LOGD("BEGIN >>>>");
-
- char popup_str[POPUP_TEXT_SIZE] = { 0, };
- char *buf = NULL;
- ugdata_t *ug_data = (ugdata_t *)data;
- retv_if(ug_data == NULL, ECORE_CALLBACK_CANCEL);
-
- buf = strdup(IDS_SECURITY_POLICY_RESTRICTS_USE_OF_PS);
- snprintf(popup_str, POPUP_TEXT_SIZE, buf, IDS_NFC_NFC);
- ug_nfc_share_create_popup(ug_data, ug_data->base_layout, popup_str, NULL, 0, NULL, 0, NULL, 0, true, true, _mdm_restricted_popup_response_cb);
-
- LOGD("END >>>>");
-
- return ECORE_CALLBACK_CANCEL;
-}
-
static void _activation_completed_cb(nfc_error_e error, void *user_data)
{
ugdata_t *ug_data = (ugdata_t *)user_data;
@@ -352,10 +320,9 @@ static void _setting_on_YesNo_popup_response_cb(void *data, Evas_Object *obj, vo
LOGD("setting is on >>>>");
result = nfc_manager_set_activation(true, _activation_completed_cb, ug_data);
- if (result == NFC_ERROR_SECURITY_RESTRICTED)
+ if (result != NFC_ERROR_NONE)
{
- LOGD("mdmPopup_timer START ");
- mdmPopup_timer = ecore_timer_add(0.25, _mdm_restricted_popup, ug_data);
+ LOGD("nfc_manager_set_activation failed");
}
break;
diff --git a/ug-nfc-share-efl/src/ug-nfc-share-tag.c b/ug-nfc-share-efl/src/ug-nfc-share-tag.c
index 4947215..d86cc31 100644
--- a/ug-nfc-share-efl/src/ug-nfc-share-tag.c
+++ b/ug-nfc-share-efl/src/ug-nfc-share-tag.c
@@ -28,15 +28,15 @@
#include <sys/wait.h>
/* external library header */
-#include "mime_type.h"
-#include "status.h"
+#include <mime_type.h>
+#include <notification.h>
#define NFC_POPUP_TIMEOUT 3.0
static ug_nfc_share_tag_type ug_nfc_share_tagType;
-int _bt_ipc_send_obex_message(uint8_t *address, const uint8_t *files, uint32_t length);
+int _bt_ipc_send_obex_message(char *address, const uint8_t *files, uint32_t length);
/*-----------------------------------------------------------------------------------------------*/
@@ -49,7 +49,7 @@ static void _show_status_text(void *data, char *text)
ret_if(ug_data == NULL);
ret_if(text == NULL);
- status_message_post(text);
+ notification_status_message_post(text);
ug_destroy_me(ug_data->nfc_share_ug);
@@ -449,7 +449,6 @@ static void _p2p_connection_handover_completed_cb(nfc_error_e result, nfc_ac_typ
if(result == NFC_ERROR_NONE)
{
- uint8_t address[6] = { 0, };
char *data = NULL;
LOGD("p2p_connection_handover is completed");
@@ -458,11 +457,7 @@ static void _p2p_connection_handover_completed_cb(nfc_error_e result, nfc_ac_typ
LOGD("uri[%d] = %s", strlen(data), data);
- _ug_nfc_share_get_bt_addr_from_string(address, (char *)ac_data);
-
- LOGD("address[%d] = { 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X }", sizeof(address), address[0], address[1], address[2], address[3], address[4], address[5]);
-
- if (_bt_ipc_send_obex_message(address, (uint8_t *)data, strlen(data) + 1) == 0)
+ if (_bt_ipc_send_obex_message((char *)ac_data, (uint8_t *)data, strlen(data) + 1) == 0)
{
_show_status_text(ug_data, IDS_SHARED);
}
@@ -583,7 +578,7 @@ void ug_nfc_unset_nfc_callback(void)
LOGD("END>>>>");
}
-int _bt_ipc_send_obex_message(uint8_t *address, const uint8_t *files, uint32_t length)
+int _bt_ipc_send_obex_message(char *address, const uint8_t *files, uint32_t length)
{
int result = 0;
uint32_t i, count = 1;
@@ -618,15 +613,21 @@ int _bt_ipc_send_obex_message(uint8_t *address, const uint8_t *files, uint32_t l
{
int reserved = 0;
char *type = "nfc";
+ char *name = address;
+ uint8_t temp[6] = { 0, };
+ uint8_t *addr = temp;
+
+ _ug_nfc_share_get_bt_addr_from_string(temp, address);
- LOGD("msg [%p], reserved [%d], address [%02X:%02X:%02X:%02X:%02X:%02X], count [%d], files [%s]", msg, reserved, address[0], address[1], address[2], address[3], address[4], address[5], count, files);
+ LOGD("msg [%p], reserved [%d], address [%02X:%02X:%02X:%02X:%02X:%02X], count [%d], files [%s]", msg, reserved, addr[0], addr[1], addr[2], addr[3], addr[4], addr[5], count, files);
if (dbus_message_append_args(msg,
DBUS_TYPE_INT32, &reserved,
- DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &address, 6,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &addr, 6,
DBUS_TYPE_INT32, &count,
DBUS_TYPE_STRING, &files,
DBUS_TYPE_STRING, &type,
+ DBUS_TYPE_STRING, &name,
DBUS_TYPE_INVALID))
{
e_dbus_message_send(conn, msg, NULL, -1, NULL);