DBG("-\n");
}
-gboolean _request_file_send(opc_transfer_info_t *node)
+int _request_file_send(opc_transfer_info_t *node)
{
struct bt_appdata *ad = app_state;
+ int ret;
DBG("+\n");
- retv_if(ad == NULL, FALSE);
- retv_if(node == NULL, FALSE);
+ retv_if(ad == NULL, BLUETOOTH_ERROR_INVALID_PARAM);
+ retv_if(node == NULL, BLUETOOTH_ERROR_INVALID_PARAM);
- if (bluetooth_opc_push_files((bluetooth_device_address_t *)node->addr,
- node->file_path) != BLUETOOTH_ERROR_NONE) {
- DBG("bluetooth_opc_push_files failed ");
- return FALSE;
+ ret = bluetooth_opc_push_files((bluetooth_device_address_t *)node->addr,
+ node->file_path);
+ if (ret != BLUETOOTH_ERROR_NONE) {
+ DBG("bluetooth_opc_push_files failed : %d", ret);
+ return ret;
}
__bt_create_send_data(node);
DBG("-\n");
- return TRUE;
+ return BLUETOOTH_ERROR_NONE;
}
static DBusHandlerResult __event_filter(DBusConnection *sys_conn,
DBusMessage *msg, void *data)
{
+ int ret;
char *member;
const char *path = dbus_message_get_path(msg);
if (path == NULL || strcmp(path, "/") == 0)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
member = (char *)dbus_message_get_member(msg);
DBG("member (%s)\n", member);
node = __add_transfer_info(msg);
if (node == NULL)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
if (bluetooth_opc_session_is_exist() == FALSE) {
- if (!_request_file_send(node)) {
+ ret = _request_file_send(node);
+ if (ret == BLUETOOTH_ERROR_IN_PROGRESS) {
+ DBG("Aleady OPC progressing. Once completed previous job, will be started\n");
+ } else if ( ret != BLUETOOTH_ERROR_NONE) {
_bt_create_warning_popup(BLUETOOTH_ERROR_INTERNAL);
g_slist_free_full(bt_transfer_list,
(GDestroyNotify)_free_transfer_info);
node = __add_transfer_info(msg);
if (node == NULL)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
if (bluetooth_opc_session_is_exist() == FALSE) {
- if (!_request_file_send(node)) {
+ ret = _request_file_send(node);
+ if (ret == BLUETOOTH_ERROR_IN_PROGRESS) {
+ DBG("Aleady OPC progressing. Once completed previous job, will be started\n");
+ } else if ( ret != BLUETOOTH_ERROR_NONE) {
_bt_create_warning_popup(BLUETOOTH_ERROR_INTERNAL);
g_slist_free_full(bt_transfer_list,
(GDestroyNotify)_free_transfer_info);
void _bt_share_event_handler(int event, bluetooth_event_param_t *param,
void *user_data)
{
+ int ret;
static int send_cnt = 0;
static char *name = NULL;
char str[NOTIFICATION_TEXT_LEN_MAX] = { 0 };
switch (event) {
case BLUETOOTH_EVENT_DISABLED:
+ g_free(server_auth_info.filename);
+ server_auth_info.filename = NULL;
_bt_terminate_app();
break;
DBG("gList len : %d\n", g_slist_length(bt_transfer_list));
if (g_slist_length(bt_transfer_list) > 0) {
DBG("One more job existed !!\n");
- if (!_request_file_send(bt_transfer_list->data)) {
+ ret = _request_file_send(bt_transfer_list->data);
+ if (ret != BLUETOOTH_ERROR_NONE) {
g_slist_free_full(bt_transfer_list,
(GDestroyNotify)_free_transfer_info);
bt_transfer_list = NULL;
case BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE:
DBG("BT_EVENT_OBEX_TRANSFER_AUTHORIZE \n");
if (param->result == BLUETOOTH_ERROR_NONE) {
+ g_free(server_auth_info.filename);
+ server_auth_info.filename = NULL;
+
auth_info = param->param_data;
- server_auth_info.filename = auth_info->filename;
+ server_auth_info.filename = g_strdup(auth_info->filename);
server_auth_info.length = auth_info->length;
if (server_auth_info.filename)
__bt_obex_file_push_auth(&server_auth_info);