--- /dev/null
+Jinmin Jung <jinmin@samsung.com>
+DoHyun Pyun <dh79.pyun@samsung.com>
--- /dev/null
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
--- /dev/null
+Copyright (c) Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE.APLv2 file for Apache License terms and conditions.
</define>
<assign>
<filesystem path="/usr/share/dbus-1/services/org.bluetooth.share.service" label="_"/>
+ <filesystem path="/usr/lib/libbluetooth-share-api.so.0.1.0" label="_"/>
</assign>
<request>
<domain name="bt_share"/>
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#define BT_SHARE_FAIL -1
#define BT_SHARE_ERROR_NONE 0
+#define BT_TMP_DIR "/tmp/"
+#define BT_TMP_FILE BT_TMP_DIR"bluetooth_content_share"
+#define TXT_FILE_NAME BT_TMP_DIR"bluetooth_content_share.txt"
+#define HTML_FILE_NAME BT_TMP_DIR"bluetooth_content_share.html"
+#define TXT_FILE_FORMAT BT_TMP_DIR"bluetooth_content_share%s.txt"
+#define HTML_FILE_FORMAT BT_TMP_DIR"bluetooth_content_share%s.html"
+#define HTML_FORMAT "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\"/></head><body><a href=\"%s\">%s</a></body></html>"
+
+typedef enum {
+ BT_HTTP_FILE,
+ BT_TXT_FILE,
+} bt_file_t;
+
typedef enum {
BT_STATUS_OFF = 0x0000,
BT_STATUS_ON = 0x0001,
int _bt_share_block_sleep(gboolean is_block);
int _bt_set_transfer_indicator(gboolean state);
-
+char *_bt_share_create_transfer_file(char *text);
+void _bt_remove_tmp_file(char *file_path);
#ifdef __cplusplus
}
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
char name[BLUETOOTH_DEVICE_NAME_LENGTH_MAX];
char *mode;
char **file_path;
+ char **content;
+ char *type;
} opc_transfer_info_t;
typedef struct {
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#endif
#define STORAGE_PATH_LEN_MAX 30
-
+#define BT_DEFAULT_MEM_PHONE 0
+#define BT_DEFAULT_MEM_MMC 1
#define BT_DOWNLOAD_PHONE_FOLDER "/opt/usr/media/Downloads"
#define BT_DOWNLOAD_MMC_FOLDER "/opt/storage/sdcard"
#define BT_FTP_FOLDER "/opt/share/bt-ftp"
void _bt_init_vconf_notification(void);
+void _bt_deinit_vconf_notification(void);
#ifdef __cplusplus
}
#endif
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#define BT_COMMON_PKG "ug-setting-bluetooth-efl"
#define BT_COMMON_RES "/usr/ug/res/locale"
-#define BT_STR_FILE_EXSIST_MSG \
- dgettext(BT_COMMON_PKG, "IDS_BT_POP_PS_ALREADY_EXISTS_OVERWRITE_Q")
-#define BT_STR_FILE_DELETE_AUTHORIZE_MSG \
- dgettext(BT_COMMON_PKG, "Delete %s by %s ?")
-#define BT_STR_RECEIVING dgettext(BT_COMMON_PKG, "IDS_BT_POP_RECEIVING_ING")
-#define BT_STR_SENDING \
- dgettext(BT_COMMON_PKG, "IDS_BT_POP_SHARING_ING")
#define BT_STR_MEMORY_FULL \
dgettext(BT_COMMON_PKG, "IDS_BT_POP_MEMORYFULL")
-#define BT_STR_RECEIVCED \
- dgettext(BT_COMMON_PKG, "IDS_BT_BODY_RECEIVED")
-#define BT_STR_PD_FILES_RECEIVED \
- dgettext(BT_COMMON_PKG, "IDS_BT_POP_PD_FILES_RECEIVED")
#define BT_STR_UNABLE_TO_SEND \
dgettext(BT_COMMON_PKG, "IDS_BT_POP_SENDINGFAIL")
-
-#define BT_STR_SEND_NOTI "Bluetooth share: Sent"
-#define BT_STR_RECEIVED_NOTI "Bluetooth share: Received"
-#define BT_TR_STATUS "%d successful, %d failed"
+#define BT_TR_STATUS \
+ dgettext(BT_COMMON_PKG, "IDS_BT_BODY_PD_SUCCESSFUL_PD_FAILED")
+#define BT_STR_RECEIVED \
+ dgettext(BT_COMMON_PKG, "IDS_BT_BODY_RECEIVED")
+#define BT_STR_SENT \
+ dgettext(BT_COMMON_PKG, "IDS_BT_BODY_SENT")
+#define BT_STR_SHARE \
+ dgettext(BT_COMMON_PKG, "IDS_BT_BODY_BLUETOOTH_SHARE")
+#define BT_STR_BLUETOOTH_ON \
+ dgettext(BT_COMMON_PKG, "IDS_BT_POP_ACTIVATED")
+#define BT_STR_BLUETOOTH_AVAILABLE \
+ dgettext(BT_COMMON_PKG, "IDS_BT_BODY_BLUETOOTH_AVAILABLE")
/*============== Image ================= */
#define ICONDIR "/opt/apps/org.tizen.bluetooth-share-ui/res/images"
#define BT_ICON_QP_SEND ICONDIR"/Q02_icon_BT_transmit.png"
#define BT_ICON_QP_RECEIVE ICONDIR"/Q02_icon_BT_receive.png"
-#define BT_ICON_QP_BT_ON ICONDIR"/Q02_QuickPanel_icon_bluetooth_noti.png"
+#define BT_ICON_QP_BT_ON ICONDIR"/Q02_Notification_bluetooth.png"
#ifdef __cplusplus
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
gboolean _bt_app_popup_memoryfull(gpointer user_data);
-//void _bt_app_obex_download_dup_file_cb(void *data, void *obj,
-// void *event_info);
-
-
#ifdef __cplusplus
}
#endif
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#include <pmapi.h>
#include <glib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <vconf.h>
+#include <Ecore_File.h>
+
#include "vconf-keys.h"
#include "applog.h"
#include "bt-share-common.h"
-#include <vconf.h>
int _bt_share_block_sleep(gboolean is_block)
{
return 0;
}
+static char *__bt_share_get_transfer_file_name(int file_type)
+{
+ int count = 0;
+ char *appendix;
+ char *file;
+ char *file_format;
+ char *file_name;
+
+ if (file_type == BT_HTTP_FILE) {
+ file_name = HTML_FILE_NAME;
+ file_format = HTML_FILE_FORMAT;
+ } else {
+ file_name = TXT_FILE_NAME;
+ file_format = TXT_FILE_FORMAT;
+ }
+
+ file = g_strdup(file_name);
+
+ /* While the file exists, increase the file name */
+ while (access(file, F_OK) == 0) {
+ g_free(file);
+
+ appendix = g_strdup_printf("_%d", count);
+ file = g_strdup_printf(file_format, appendix);
+ g_free(appendix);
+
+ count++;
+ }
+
+ return file;
+}
+
+void _bt_remove_tmp_file(char *file_path)
+{
+ if (g_str_has_prefix(file_path, BT_TMP_FILE) == TRUE) {
+ DBG("Remove the file: %s", file_path);
+ ecore_file_remove(file_path);
+ }
+}
+
+char *_bt_share_create_transfer_file(char *text)
+{
+ int fd;
+ int file_type;
+ char *file = NULL;
+ char *content;
+ char *url_sheme;
+ ssize_t write_size;
+
+ retv_if(text == NULL, NULL);
+
+ url_sheme = g_uri_parse_scheme(text);
+
+ if (url_sheme) {
+ /* HTTP file generate */
+ g_free(url_sheme);
+ file_type = BT_HTTP_FILE;
+ } else {
+ /* TXT file generate */
+ file_type = BT_TXT_FILE;
+ }
+
+ file = __bt_share_get_transfer_file_name(file_type);
+ retv_if(file == NULL, NULL);
+
+ fd = open(file, O_RDWR | O_CREAT, 0755);
+
+ if (fd < 0) {
+ ERR("Fail to open the file");
+ goto fail;
+ }
+
+ if (file_type == BT_HTTP_FILE) {
+ content = g_strdup_printf(HTML_FORMAT, text, text);
+ } else {
+ content = g_strdup(text);
+ }
+
+ DBG("content: \n%s", content);
+
+ write_size = write(fd, content, strlen(content));
+ g_free(content);
+ close(fd);
+ fd = -1;
+
+ if (write_size < 0) {
+ ERR("Fail to write in file");
+ goto fail;
+ }
+
+ return file;
+fail:
+ if (fd > 0)
+ close(fd);
+
+ g_free(file);
+ return NULL;
+}
+
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#include "bt-share-resource.h"
#include "obex-event-handler.h"
#include "bluetooth-share-api.h"
+#include "bt-share-common.h"
GSList *bt_transfer_list = NULL;
DBusConnection *dbus_connection = NULL;
g_free(data->file_path);
g_free(data->dev_name);
g_free(data->addr);
+ g_free(data->type);
+ g_free(data->content);
g_free(data);
}
char *filepath = NULL;
char *mode = NULL;
char *name = NULL;
+ char *type = NULL;
opc_transfer_info_t *data;
int i = 0;
char *token = NULL;
- char *tmp = NULL;
char *ptr = NULL;
retv_if(msg == NULL, NULL);
DBUS_TYPE_STRING, &filepath,
DBUS_TYPE_STRING, &mode,
DBUS_TYPE_STRING, &name,
+ DBUS_TYPE_STRING, &type,
DBUS_TYPE_INVALID);
retv_if(cnt <= 0, NULL);
DBG(" filepath( %s )\n", filepath);
DBG(" mode ( %s )\n", mode);
DBG(" name ( %s )\n", name);
+ DBG(" type ( %s )\n", type);
data = g_new0(opc_transfer_info_t, 1);
+ data->content = g_new0(char *, cnt + 1);
data->file_path = g_new0(char *, cnt + 1);
data->file_cnt = cnt;
memcpy(data->addr, addr, BLUETOOTH_ADDRESS_LENGTH);
memcpy(data->name, name, BLUETOOTH_DEVICE_NAME_LENGTH_MAX);
+ data->type = g_strdup(type);
token = strtok_r(filepath, FILE_PATH_DELIM, &ptr);
while ((token != NULL) && (i < cnt)) {
- len = strlen(token);
+ if (g_strcmp0(type, "text") == 0) {
+ data->file_path[i] = _bt_share_create_transfer_file(token);
+ } else {
+ data->file_path[i] = g_strdup(token);
+ }
- tmp = g_malloc0(len + 1);
+ DBG(" file path ( %s )\n", data->file_path[i]);
- g_strlcpy(tmp, token, len + 1);
- data->file_path[i] = tmp;
- DBG("File [%d] [%s]\n", i, data->file_path[i]);
+ data->content[i] = g_strdup(token);
+ DBG("Content [%d] [%s]\n", i, data->content[i]);
i++;
token = strtok_r(NULL, FILE_PATH_DELIM, &ptr);
ret_if(node == NULL);
for (i = 0; i < node->file_cnt; i++) {
+ _bt_remove_tmp_file(node->file_path[i]);
g_free(node->file_path[i]);
+ g_free(node->content[i]);
}
g_free(node->file_path);
+ g_free(node->content);
+ g_free(node->type);
g_free(node);
DBG("-\n");
/* Otherwise create the process and terminate it after popup shown */
if (sysman_get_pid(UI_PKG_PATH) == -1) {
char str[BT_TEXT_LEN_MAX] = {0,};
- bundle *b = NULL;
- b = bundle_create();
- ret_if(b == NULL);
+ bundle *b;
switch(error_type) {
case BLUETOOTH_ERROR_SERVICE_NOT_FOUND:
snprintf(str, BT_TEXT_LEN_MAX, "%s", BT_STR_UNABLE_TO_SEND);
break;
default:
- bundle_free(b);
return;
}
+ b = bundle_create();
+ ret_if(b == NULL);
+
bundle_add(b, "launch-type", "warning_popup");
bundle_add(b, "message", str);
for (count = 0; count < node->file_cnt; count++) {
bt_tr_data_t *tmp;
tmp = g_malloc0(sizeof(bt_tr_data_t));
- if (!tmp) {
- bt_share_close_db(db);
- return;
- }
tmp->tr_status = BT_TR_ONGOING;
tmp->sid = session_id + 1;
tmp->file_path = g_strdup(node->file_path[count]);
+ tmp->content = g_strdup(node->content[count]);
tmp->dev_name = g_strdup(node->name);
+ tmp->type = g_strdup(node->type);
tmp->timestamp = __bt_get_current_timedata();
tmp->addr = __bt_conv_addr_type_to_addr_string(node->addr);
bt_share_add_tr_data(db, BT_DB_OUTBOUND, tmp);
DBG("uid = %d \n", uid);
sqlite3 *db = NULL;
bt_tr_data_t *tmp;
- tmp = g_malloc0(sizeof(bt_tr_data_t));
- if (!tmp)
- return FALSE;
db = bt_share_open_db();
- if (!db) {
- g_free(tmp);
+ if (!db)
return FALSE;
- }
+
+ tmp = g_malloc0(sizeof(bt_tr_data_t));
tmp->tr_status = status;
tmp->timestamp = __bt_get_current_timedata();
bt_tr_data_t *tmp;
DBG("Name [%s]\n", device_name);
- tmp = g_malloc0(sizeof(bt_tr_data_t));
- if (!tmp)
- return FALSE;
db = bt_share_open_db();
- if (!db) {
- g_free(tmp);
+ if (!db)
return FALSE;
- }
+
+ tmp = g_malloc0(sizeof(bt_tr_data_t));
tmp->tr_status = status;
tmp->file_path = g_strdup(filepath);
ad->send_data.tr_success, ad->send_data.tr_fail);
_bt_update_notification(ad->send_noti,
- BT_STR_SEND_NOTI, str,
+ BT_STR_SENT, str,
BT_ICON_QP_SEND);
} else {
_bt_delete_notification(ad->send_noti);
ad->recv_data.tr_success, ad->recv_data.tr_fail);
_bt_update_notification(ad->receive_noti,
- BT_STR_RECEIVED_NOTI, str,
+ BT_STR_RECEIVED, str,
BT_ICON_QP_RECEIVE);
} else {
_bt_delete_notification(ad->receive_noti);
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
if (ad == NULL)
return;
+ _bt_deinit_vconf_notification();
_bt_delete_notification(ad->send_noti);
_bt_delete_notification(ad->receive_noti);
_bt_delete_notification(ad->opc_noti);
if (vconf_set_bool(BT_VCONF_OPP_SERVER_INIT, FALSE) < 0)
ERR("Fail to set the vconf");
+
+ DBG("Terminating bluetooth-share daemon");
}
static void __bt_sigterm_handler(int signo)
NOTI_TR_TYPE_OUT, NULL, NULL);
_bt_set_notification_property(noti, QP_NO_DELETE | QP_NO_TICKER);
_bt_insert_notification(noti,
- BT_STR_SEND_NOTI, str,
+ BT_STR_SENT, str,
BT_ICON_QP_SEND);
ad->send_noti = noti;
}
NOTI_TR_TYPE_IN, NULL, NULL);
_bt_set_notification_property(noti, QP_NO_DELETE | QP_NO_TICKER);
_bt_insert_notification(noti,
- BT_STR_RECEIVED_NOTI, str,
+ BT_STR_RECEIVED, str,
BT_ICON_QP_RECEIVE);
ad->receive_noti = noti;
}
return;
}
+static notification_h __bt_update_notification_adapter_status(void)
+{
+ notification_h noti;
+ notification_error_e ret;
+
+ noti = _bt_create_notification(BT_NOTI_T);
+ if (!noti)
+ return NULL;
+
+ ret = notification_set_property(noti, QP_NO_DELETE | QP_NO_TICKER);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ goto failed;
+ }
+
+ ret = notification_set_application(noti, "ug-bluetooth-efl");
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ goto failed;
+ }
+
+ ret = notification_set_display_applist(noti,
+ NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ goto failed;
+ }
+
+ _bt_insert_notification(noti,
+ BT_STR_BLUETOOTH_ON, BT_STR_BLUETOOTH_AVAILABLE,
+ BT_ICON_QP_BT_ON);
+ return noti;
+
+failed:
+ ERR("Fail to register notification");
+ notification_free(noti);
+ return NULL;
+
+}
+
static gboolean __bt_dbus_request_name(void)
{
int ret_code = 0;
}
}
-int main(int argc, char *argv[])
+int main(void)
{
- DBG("+");
int ret;
struct bt_appdata ad;
+ DBG("Starting bluetooth-share daemon");
memset(&ad, 0, sizeof(struct bt_appdata));
app_state = &ad;
return -1;
}
+ notification_h noti;
+ noti = __bt_update_notification_adapter_status();
+
main_loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(main_loop);
+ _bt_delete_notification(noti);
__bt_release_service(&ad);
- DBG("-");
return 0;
}
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#include "bt-share-main.h"
#include "obex-event-handler.h"
#include "bluetooth-share-api.h"
+#include "bt-share-resource.h"
#define BT_PERCENT_STR_LEN 5
#define BT_PRIV_ID_STR_LEN 8
+#define BT_NOTI_STR_LEN_MAX 50
notification_h _bt_create_notification(bt_qp_type_t type)
{
char *icon_path)
{
DBG("+\n");
+ char str[BT_NOTI_STR_LEN_MAX] = {0,};
+
if (!noti)
return BT_SHARE_FAIL;
}
if (title) {
- ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
- title, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+ snprintf(str, sizeof(str), "%s: %s", BT_STR_SHARE, title);
+
+ ret = notification_set_text(noti,
+ NOTIFICATION_TEXT_TYPE_TITLE,
+ str, NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
if (ret != NOTIFICATION_ERROR_NONE) {
ERR("Fail to notification_set_text\n");
}
}
if (content) {
- ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
- content, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
+ ret = notification_set_text(noti,
+ NOTIFICATION_TEXT_TYPE_CONTENT,
+ content, NULL,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
if (ret != NOTIFICATION_ERROR_NONE) {
ERR("Fail to notification_set_text\n");
}
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
#include "bt-share-resource.h"
#include "obex-event-handler.h"
-
-
-
extern struct bt_appdata *app_state;
#define BT_POPUP_SYSPOPUP_TIMEOUT_FOR_MULTIPLE_POPUPS 200
#define BT_SYSPOPUP_EVENT_LEN_MAX 50
-
-
-
static gboolean __bt_system_popup_timer_cb(gpointer user_data)
{
int ret = 0;
ERR("There is some problem with the user data..popup can not be created\n");
return FALSE;
}
- ret = syspopup_launch("bt-syspopup", b);
+ ret = syspopup_launch("bt-syspopup", b);
if (0 > ret) {
ERR("launching sys-popup failed\n");
- return TRUE;
- } else {
- DBG("Hurray Popup launched \n");
- bundle_free(b);
- return FALSE;
}
+
+ bundle_free(b);
+ return FALSE;
}
int _bt_launch_system_popup(bt_app_event_type_t event_type,
/*
- * bluetooth-share
+ * bluetooth-share
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
DBG("BLUETOOTH_EVENT_OPC_CONNECTED, result [%d] \n", param->result);
if (param->result != BLUETOOTH_ERROR_NONE) {
_bt_create_warning_popup(param->result);
-
if (NULL != node && node->file_cnt > send_index) {
info = (bt_tr_data_t *)(ad->tr_next_data)->data;
+ if (info == NULL) {
+ DBG("info is NULL");
+ return;
+ }
+
s_id = info->sid;
DBG("info->sid = %d info->id = %d\n", info->sid, info->id);
while (NULL != ad->tr_next_data) {
NOTI_TR_TYPE_OUT, NULL, NULL);
_bt_set_notification_property(noti, QP_NO_DELETE);
_bt_insert_notification(noti,
- BT_STR_SEND_NOTI, str,
+ BT_STR_SENT, str,
BT_ICON_QP_SEND);
ad->send_noti = noti;
} else {
_bt_update_notification(ad->send_noti,
- BT_STR_SEND_NOTI, str,
+ BT_STR_SENT, str,
BT_ICON_QP_SEND);
}
}
NOTI_TR_TYPE_OUT, NULL, NULL);
_bt_set_notification_property(noti, QP_NO_DELETE);
_bt_insert_notification(noti,
- BT_STR_SEND_NOTI, str,
+ BT_STR_SENT, str,
BT_ICON_QP_SEND);
ad->send_noti = noti;
} else {
_bt_update_notification(ad->send_noti,
- BT_STR_SEND_NOTI, str,
+ BT_STR_SENT, str,
BT_ICON_QP_SEND);
}
+ _bt_remove_tmp_file(client_info->filename);
+
if (param->result != BLUETOOTH_ERROR_NONE) {
_bt_update_sent_data_status(ad->current_tr_uid,
BT_TR_FAIL);
NOTI_TR_TYPE_OUT, NULL, NULL);
_bt_set_notification_property(noti, QP_NO_DELETE);
_bt_insert_notification(noti,
- BT_STR_SEND_NOTI, str,
+ BT_STR_SENT, str,
BT_ICON_QP_SEND);
ad->send_noti = noti;
} else {
_bt_update_notification(ad->send_noti,
- BT_STR_SEND_NOTI, str,
+ BT_STR_SENT, str,
BT_ICON_QP_SEND);
}
}
NOTI_TR_TYPE_IN, NULL, NULL);
_bt_set_notification_property(noti, QP_NO_DELETE);
_bt_insert_notification(noti,
- BT_STR_RECEIVED_NOTI, str,
+ BT_STR_RECEIVED, str,
BT_ICON_QP_RECEIVE);
ad->receive_noti = noti;
} else {
_bt_update_notification(ad->receive_noti,
- BT_STR_RECEIVED_NOTI, str,
+ BT_STR_RECEIVED, str,
BT_ICON_QP_RECEIVE);
}
}
void _bt_get_default_storage(char *storage)
{
- int val = -1;
- if (-1 == vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT, (void *)&val)) {
+ int val;
+ int err;
+ char *path;
+
+ if (vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT,
+ (void *)&val)) {
DBG("vconf error\n");
- val = 0;
+ val = BT_DEFAULT_MEM_PHONE;
}
- if (val == 0) /* Phone memory is 0, MMC is 1 */
- g_strlcpy(storage, BT_DOWNLOAD_PHONE_FOLDER, STORAGE_PATH_LEN_MAX);
+
+ if (val == BT_DEFAULT_MEM_MMC)
+ path = BT_DOWNLOAD_MMC_FOLDER;
else
- g_strlcpy(storage, BT_DOWNLOAD_MMC_FOLDER, STORAGE_PATH_LEN_MAX);
+ path = BT_DOWNLOAD_PHONE_FOLDER;
+
+ if (access(path, W_OK) == 0) {
+ g_strlcpy(storage, path, STORAGE_PATH_LEN_MAX);
+ DBG("Storage path = [%s]\n", storage);
+ return;
+ }
+
+ if (mkdir(BT_DOWNLOAD_PHONE_FOLDER, 0755) < 0) {
+ err = -errno;
+ DBG("mkdir: %s(%d)", strerror(-err), -err);
+ }
+
+ g_strlcpy(storage, BT_DOWNLOAD_PHONE_FOLDER, STORAGE_PATH_LEN_MAX);
+
DBG("Default storage : %s\n", storage);
}
void *event_info)
{
bt_obex_server_authorize_into_t *server_auth_info = data;
+ char storage[STORAGE_PATH_LEN_MAX] = { 0, };
+ char temp_filename[BT_FILE_PATH_LEN_MAX] = { 0, };
DBG("response : %d\n", (int)event_info);
if ((int)event_info == POPUP_RESPONSE_OK) {
DBG("OK button pressed \n");
+
+ _bt_get_default_storage(storage);
+ snprintf(temp_filename, BT_FILE_PATH_LEN_MAX, "%s/%s",
+ storage, server_auth_info->filename);
+
+ if (remove(temp_filename) != 0) {
+ ERR("File remove failed\n");
+ bluetooth_obex_server_reject_authorize();
+ return;
+ }
+
+ DBG("temp_filename %s", temp_filename);
bluetooth_obex_server_accept_authorize(server_auth_info->filename);
} else if ((int)event_info == POPUP_RESPONSE_CANCEL) {
bluetooth_obex_server_reject_authorize();
/*
- * bluetooth-share-api
+ * bluetooth-share-api
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
/*
- * bluetooth-share-api
+ * bluetooth-share-api
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
char *file_path;
char *dev_name;
char *addr;
+ char *type;
+ char *content;
}bt_tr_data_t;
/*
- * bluetooth-share-api
+ * bluetooth-share-api
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
retvm_if(data == NULL, BT_SHARE_ERR_INTERNAL, "Insert data is null");
snprintf(query, BT_DB_QUERY_LEN,
- "INSERT INTO %s (id, sid, tr_status, file_path, dev_name, timestamp, addr) VALUES(?, '%d', '%d', '%s', '%s', '%d', '%s');",
+ "INSERT INTO %s (id, sid, tr_status, file_path, dev_name, timestamp, addr, type, content) VALUES(?, '%d', '%d', '%s', '%s', '%d', '%s', '%s', '%s');",
TABLE(db_table), data->sid, data->tr_status, data->file_path,
- data->dev_name, data->timestamp, data->addr);
+ data->dev_name, data->timestamp, data->addr, data->type, data->content);
ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
if (ret != SQLITE_OK)
data->dev_name = g_strdup(TEXT(stmt, idx++));
data->timestamp = INT(stmt, idx++);
data->addr = g_strdup(TEXT(stmt, idx++));
+ data->type = g_strdup(TEXT(stmt, idx++));
+ data->content = g_strdup(TEXT(stmt, idx++));
} else {
goto error;
}
data->dev_name = g_strdup(TEXT(stmt, idx++));
data->timestamp = INT(stmt, idx++);
data->addr = g_strdup(TEXT(stmt, idx++));
+ data->type = g_strdup(TEXT(stmt, idx++));
+ data->content = g_strdup(TEXT(stmt, idx++));
slist = g_slist_append(slist, data);
char query[BT_DB_QUERY_LEN] = {0, };
sqlite3_stmt *stmt = NULL;
- retvm_if(db == NULL, NULL, "DB handler is null");
+ retvm_if(db == NULL, BT_SHARE_ERR_INTERNAL, "DB handler is null");
snprintf(query, BT_DB_QUERY_LEN,
"SELECT * FROM %s WHERE id=(SELECT MAX(id) FROM %s);",
g_free(data->file_path);
g_free(data->dev_name);
g_free(data->addr);
+ g_free(data->type);
+ g_free(data->content);
g_free(data);
}
EXPORT_API unsigned int bt_share_get_last_session_id(sqlite3 *db, int db_table)
{
- retvm_if(db == NULL, NULL, "DB handle is NULL");
+ retvm_if(db == NULL, BT_SHARE_ERR_INTERNAL, "DB handle is NULL");
return __bt_db_get_last_session_id(db, db_table);
}
/*
- * bluetooth-share-api
+ * bluetooth-share-api
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved
- *
- * Contact: Hocheol Seo <hocheol.seo@samsung.com>
- * GirishAshok Joshi <girish.joshi@samsung.com>
- * DoHyun Pyun <dh79.pyun@samsung.com>
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Name: bluetooth-share
Summary: Bluetooth file share Agent
-Version: 0.0.46
+Version: 0.0.47
Release: 2
Group: TO_BE/FILLED_IN
License: Apache License, Version 2.0
Source0: %{name}-%{version}.tar.gz
+Requires(post): vconf
+Requires(post): coreutils
+Requires(post): sqlite
+Requires(post): smack-utils
BuildRequires: cmake
BuildRequires: gettext-tools
BuildRequires: pkgconfig(appcore-efl)
%setup -q
%build
+export CFLAGS+=" -fpie -fvisibility=hidden"
+export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
+
cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
make
file_path TEXT,
dev_name TEXT,
timestamp INTEGER default 0,
- addr TEXT
+ addr TEXT,
+ type TEXT,
+ content TEXT
);
create table if not exists outbound (
id INTEGER PRIMARY KEY autoincrement,
file_path TEXT,
dev_name TEXT,
timestamp INTEGER default 0,
- addr TEXT
+ addr TEXT,
+ type TEXT,
+ content TEXT
);
'
fi