[TBT][D2D and TPK][ACR-571][D2D module implementation and TPK Update] 17/77517/2
authorAmlan Chowdhury <amlan.c@samsung.com>
Thu, 30 Jun 2016 05:33:30 +0000 (11:33 +0600)
committerAmlan Chowdhury <amlan.c@samsung.com>
Thu, 30 Jun 2016 08:28:38 +0000 (14:28 +0600)
Signed-off-by: Amlan Chowdhury <amlan.c@samsung.com>
Change-Id: I53f76f367b6056e1498574106dae26a1f1df75c6

39 files changed:
coretbt_dataprovider/.gbs.conf
coretbt_dataprovider/CMakeLists.txt
coretbt_serviceapp/.gbs.conf
coretbt_serviceapp/tizen-manifest.xml
coretbt_uiapp/.gbs.conf
coretbt_uiapp/tizen-manifest.xml
coretbtwidgetapp/.gbs.conf
release/binary-armv7l/install.sh
release/binary-armv7l/org.tizen.coretbt_dataprovider-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.coretbt_serviceapp-0.0.1-1.armv7l.tpk [deleted file]
release/binary-armv7l/org.tizen.coretbt_serviceapp-1.0.0-arm.tpk [new file with mode: 0644]
release/binary-armv7l/org.tizen.coretbt_uiapp-0.0.1-1.armv7l.tpk [deleted file]
release/binary-armv7l/org.tizen.coretbt_uiapp-1.0.0-arm.tpk [new file with mode: 0644]
release/binary-armv7l/org.tizen.coretbtwidgetapp-0.0.1-1.armv7l.tpk [deleted file]
release/binary-armv7l/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk [new file with mode: 0644]
release/binary-armv7l/org.tizen.operationpickviewapp-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.tbt-ime-0.0.1-1.armv7l.tpk [deleted file]
release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk [new file with mode: 0644]
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.coretbt_dataprovider-1.0.0-i386.tpk
release/binary-x86/org.tizen.coretbt_serviceapp-1.0.0-i386.tpk
release/binary-x86/org.tizen.coretbt_uiapp-1.0.0-i386.tpk
release/binary-x86/org.tizen.coretbtwidgetapp-1.0.0-i386.tpk
release/binary-x86/org.tizen.operationpickviewapp-1.0.0-i386.tpk
release/binary-x86/org.tizen.tbt-ime-1.0.0-i386.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk
tbt-ime/.gbs.conf
tbtcoreapp/inc/model/tbt-info.h
tbtcoreapp/inc/utils/app_module_config.h
tbtcoreapp/inc/view/tbt-d2d-view.h [new file with mode: 0644]
tbtcoreapp/res/edje/2.4/mobile/d2d_viewer.edc [new file with mode: 0644]
tbtcoreapp/res/edje/3.0/mobile/attachpanel_viewer.edc [new file with mode: 0644]
tbtcoreapp/res/edje/3.0/mobile/d2d_viewer.edc [new file with mode: 0644]
tbtcoreapp/src/model/tbt-list.c
tbtcoreapp/src/view/tbt-attachpanel-view.c
tbtcoreapp/src/view/tbt-bluetooth-view.c
tbtcoreapp/src/view/tbt-d2d-view.c [new file with mode: 0644]
tbtcoreapp/src/view/tbt-event-view.c
tbtcoreapp/src/view/tbt-genlist-view.c

index d4e6e828b9f554fef31193b2e5a3aba2b266ab69..5a50939cf44477129fcc32edb19b96e0aefaf5a9 100644 (file)
@@ -1,14 +1,14 @@
 [general]
-buildroot=~/GBS-ROOT-TBT-MOBILE-2.4
+buildroot=~/GBS-ROOT-TBT-MOBILE
 profile = profile.device
 
 [profile.device] # Profile for Device
 obs = obs.device
-repos = repo.spin_2.4_base_standard, repo.device
+repos = repo.device
 
 [profile.sdk]   # Profile for SDK
 obs = obs.sdk
-repos=repo.spin_2.4_base_standard, repo.sdk
+repos = repo.sdk
 
 [obs.device]   # obs for SDK.Ref_Target
 #OBS API URL pointing to a remote OBS.
@@ -18,14 +18,13 @@ url = https://168.219.209.58/
 #OBS API URL pointing to a remote OBS.
 url = https://168.219.209.58/
 
+
 #device
 [repo.device] # Repository for Tizen 2.4 SDK Target snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/target-TM1/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 #SDK
 [repo.sdk] # Repository for Tizen 2.4 SDK Emulator snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/emulator/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 
-[repo.spin_2.4_base_standard]
-url = http://168.219.209.55/download/snapshots/2.4-base/common/latest/repos/standard/packages/ 
index d7bad4c679aff8a116f1fa09bd903b293f02d6e3..18e20907ce653935d75ca1eb60acefbac84f2e9e 100755 (executable)
@@ -49,7 +49,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME}
        appcore-agent
        bundle
        sqlite3
-       capi-data-control
+       data-control
 )
 
 
index d4e6e828b9f554fef31193b2e5a3aba2b266ab69..5a50939cf44477129fcc32edb19b96e0aefaf5a9 100644 (file)
@@ -1,14 +1,14 @@
 [general]
-buildroot=~/GBS-ROOT-TBT-MOBILE-2.4
+buildroot=~/GBS-ROOT-TBT-MOBILE
 profile = profile.device
 
 [profile.device] # Profile for Device
 obs = obs.device
-repos = repo.spin_2.4_base_standard, repo.device
+repos = repo.device
 
 [profile.sdk]   # Profile for SDK
 obs = obs.sdk
-repos=repo.spin_2.4_base_standard, repo.sdk
+repos = repo.sdk
 
 [obs.device]   # obs for SDK.Ref_Target
 #OBS API URL pointing to a remote OBS.
@@ -18,14 +18,13 @@ url = https://168.219.209.58/
 #OBS API URL pointing to a remote OBS.
 url = https://168.219.209.58/
 
+
 #device
 [repo.device] # Repository for Tizen 2.4 SDK Target snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/target-TM1/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 #SDK
 [repo.sdk] # Repository for Tizen 2.4 SDK Emulator snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/emulator/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 
-[repo.spin_2.4_base_standard]
-url = http://168.219.209.55/download/snapshots/2.4-base/common/latest/repos/standard/packages/ 
index 68a2c043449f54bb67e670fa826aae5b671a6cc5..fbb57aff0ee2e4ec6396caa7ece5a0d937ef798f 100644 (file)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.coretbt_serviceapp" version="1.0.0">
-    <profile name="mobile"/>
-    <service-application appid="org.tizen.coretbt_serviceapp" exec="coretbt_serviceapp" multiple="false" nodisplay="true" taskmanage="false" type="capp">
-        <label>coretbt_serviceapp</label>
+    <profile name="mobile" />
+    <service-application appid="org.tizen.coretbt_serviceapp" exec="coretbt_serviceapp" type="capp" multiple="false" taskmanage="false" nodisplay="true">
         <icon>coretbt_serviceapp.png</icon>
-    </service-application>
+        <label>coretbt_serviceapp</label>
+       </service-application>
 </manifest>
index d4e6e828b9f554fef31193b2e5a3aba2b266ab69..5a50939cf44477129fcc32edb19b96e0aefaf5a9 100644 (file)
@@ -1,14 +1,14 @@
 [general]
-buildroot=~/GBS-ROOT-TBT-MOBILE-2.4
+buildroot=~/GBS-ROOT-TBT-MOBILE
 profile = profile.device
 
 [profile.device] # Profile for Device
 obs = obs.device
-repos = repo.spin_2.4_base_standard, repo.device
+repos = repo.device
 
 [profile.sdk]   # Profile for SDK
 obs = obs.sdk
-repos=repo.spin_2.4_base_standard, repo.sdk
+repos = repo.sdk
 
 [obs.device]   # obs for SDK.Ref_Target
 #OBS API URL pointing to a remote OBS.
@@ -18,14 +18,13 @@ url = https://168.219.209.58/
 #OBS API URL pointing to a remote OBS.
 url = https://168.219.209.58/
 
+
 #device
 [repo.device] # Repository for Tizen 2.4 SDK Target snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/target-TM1/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 #SDK
 [repo.sdk] # Repository for Tizen 2.4 SDK Emulator snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/emulator/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 
-[repo.spin_2.4_base_standard]
-url = http://168.219.209.55/download/snapshots/2.4-base/common/latest/repos/standard/packages/ 
index 6fe923cc1dd36ef850f849c4d8017feae54f9654..d489469cbe8fa08b98e2de63779e1e67cd2822c1 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.coretbt_uiapp" version="1.0.0">
     <profile name="mobile"/>
-    <ui-application appid="org.tizen.coretbt_uiapp" exec="coretbt_uiapp" multiple="false" nodisplay="false" splash-screen-display="true" taskmanage="true" type="capp">
+    <ui-application appid="org.tizen.coretbt_uiapp" exec="coretbt_uiapp" multiple="false" nodisplay="false" taskmanage="true" type="capp">
         <label>coretbt_uiapp</label>
         <icon>coretbt_uiapp.png</icon>
     </ui-application>
index d4e6e828b9f554fef31193b2e5a3aba2b266ab69..5a50939cf44477129fcc32edb19b96e0aefaf5a9 100644 (file)
@@ -1,14 +1,14 @@
 [general]
-buildroot=~/GBS-ROOT-TBT-MOBILE-2.4
+buildroot=~/GBS-ROOT-TBT-MOBILE
 profile = profile.device
 
 [profile.device] # Profile for Device
 obs = obs.device
-repos = repo.spin_2.4_base_standard, repo.device
+repos = repo.device
 
 [profile.sdk]   # Profile for SDK
 obs = obs.sdk
-repos=repo.spin_2.4_base_standard, repo.sdk
+repos = repo.sdk
 
 [obs.device]   # obs for SDK.Ref_Target
 #OBS API URL pointing to a remote OBS.
@@ -18,14 +18,13 @@ url = https://168.219.209.58/
 #OBS API URL pointing to a remote OBS.
 url = https://168.219.209.58/
 
+
 #device
 [repo.device] # Repository for Tizen 2.4 SDK Target snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/target-TM1/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 #SDK
 [repo.sdk] # Repository for Tizen 2.4 SDK Emulator snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/emulator/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 
-[repo.spin_2.4_base_standard]
-url = http://168.219.209.55/download/snapshots/2.4-base/common/latest/repos/standard/packages/ 
index 76203b280a9efe13ee77bf2a37afe99e6802b901..293b6b54b60d5c5dbfddc4ac992d6de2bd5d6706 100644 (file)
  #
 
 sdb install org.tizen.coretbt_dataprovider-1.0.0-arm.tpk
-sdb install org.tizen.coretbt_serviceapp-0.0.1-1.armv7l.tpk
-sdb install org.tizen.coretbt_uiapp-0.0.1-1.armv7l.tpk
-sdb install org.tizen.coretbtwidgetapp-0.0.1-1.armv7l.tpk
-sdb install org.tizen.tbt-ime-0.0.1-1.armv7l.tpk
+sdb install org.tizen.coretbt_serviceapp-1.0.0-arm.tpk
+sdb install org.tizen.coretbt_uiapp-1.0.0-arm.tpk
+sdb install org.tizen.coretbtwidgetapp-1.0.0-arm.tpk
+sdb install org.tizen.tbt-ime-1.0.0-arm.tpk
 sdb install org.tizen.operationpickviewapp-1.0.0-arm.tpk
 sdb install org.tizen.tbtcoreapp-1.0.0-arm.tpk
 
index 5ab4193ee378c2fc8fafede3022299bd0db13712..351c86a86a24fe80bde9ecd1aac8c342e84c34a9 100644 (file)
Binary files a/release/binary-armv7l/org.tizen.coretbt_dataprovider-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.coretbt_dataprovider-1.0.0-arm.tpk differ
diff --git a/release/binary-armv7l/org.tizen.coretbt_serviceapp-0.0.1-1.armv7l.tpk b/release/binary-armv7l/org.tizen.coretbt_serviceapp-0.0.1-1.armv7l.tpk
deleted file mode 100644 (file)
index 0c0229f..0000000
Binary files a/release/binary-armv7l/org.tizen.coretbt_serviceapp-0.0.1-1.armv7l.tpk and /dev/null differ
diff --git a/release/binary-armv7l/org.tizen.coretbt_serviceapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.coretbt_serviceapp-1.0.0-arm.tpk
new file mode 100644 (file)
index 0000000..75f6712
Binary files /dev/null and b/release/binary-armv7l/org.tizen.coretbt_serviceapp-1.0.0-arm.tpk differ
diff --git a/release/binary-armv7l/org.tizen.coretbt_uiapp-0.0.1-1.armv7l.tpk b/release/binary-armv7l/org.tizen.coretbt_uiapp-0.0.1-1.armv7l.tpk
deleted file mode 100644 (file)
index 0dc8107..0000000
Binary files a/release/binary-armv7l/org.tizen.coretbt_uiapp-0.0.1-1.armv7l.tpk and /dev/null differ
diff --git a/release/binary-armv7l/org.tizen.coretbt_uiapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.coretbt_uiapp-1.0.0-arm.tpk
new file mode 100644 (file)
index 0000000..baf21e6
Binary files /dev/null and b/release/binary-armv7l/org.tizen.coretbt_uiapp-1.0.0-arm.tpk differ
diff --git a/release/binary-armv7l/org.tizen.coretbtwidgetapp-0.0.1-1.armv7l.tpk b/release/binary-armv7l/org.tizen.coretbtwidgetapp-0.0.1-1.armv7l.tpk
deleted file mode 100644 (file)
index 5c26a1f..0000000
Binary files a/release/binary-armv7l/org.tizen.coretbtwidgetapp-0.0.1-1.armv7l.tpk and /dev/null differ
diff --git a/release/binary-armv7l/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk
new file mode 100644 (file)
index 0000000..7a53367
Binary files /dev/null and b/release/binary-armv7l/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk differ
index c7da30ffb807e1ba2b189e052e4e3cf1383ad8af..c11a792eda955f50c9cfa9c5e31aca62e760527f 100644 (file)
Binary files a/release/binary-armv7l/org.tizen.operationpickviewapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.operationpickviewapp-1.0.0-arm.tpk differ
diff --git a/release/binary-armv7l/org.tizen.tbt-ime-0.0.1-1.armv7l.tpk b/release/binary-armv7l/org.tizen.tbt-ime-0.0.1-1.armv7l.tpk
deleted file mode 100644 (file)
index 0834a08..0000000
Binary files a/release/binary-armv7l/org.tizen.tbt-ime-0.0.1-1.armv7l.tpk and /dev/null differ
diff --git a/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk
new file mode 100644 (file)
index 0000000..18de81b
Binary files /dev/null and b/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk differ
index 5b90dde09ebb102490f4ad737cc51a062d3929f0..fbf42343b19c7d6918b83cedf16891f7e6f31f49 100644 (file)
Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ
index c0f2e125cf6e9acbdc3d5a2077b365c24a48d3ab..bbca4eb7f33364f499e05c0ab7fddeb641c779f9 100644 (file)
Binary files a/release/binary-x86/org.tizen.coretbt_dataprovider-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.coretbt_dataprovider-1.0.0-i386.tpk differ
index 828a6d768a159f9fc9b0024b2f362539c6301b32..0db57c010b343fe5129a113979c4c56a64dc4958 100644 (file)
Binary files a/release/binary-x86/org.tizen.coretbt_serviceapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.coretbt_serviceapp-1.0.0-i386.tpk differ
index 32154d5d088de13d5d192258755036bc199c6538..34ce201ef1d0f6f872bd5e3f4c17ac182591adac 100644 (file)
Binary files a/release/binary-x86/org.tizen.coretbt_uiapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.coretbt_uiapp-1.0.0-i386.tpk differ
index bb630216e9d89b6ec6e6243bddef738f116125ec..69cfc38e06378b7730914a870a9ba720758f2dca 100644 (file)
Binary files a/release/binary-x86/org.tizen.coretbtwidgetapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.coretbtwidgetapp-1.0.0-i386.tpk differ
index 8052d37e031cf4bda4d38378e89ce919dc56e566..27153cc31a133d29eba59f5a8955b288a92b099e 100644 (file)
Binary files a/release/binary-x86/org.tizen.operationpickviewapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.operationpickviewapp-1.0.0-i386.tpk differ
index c8955757471e35d555a06f92fe1ae2e736362208..f08e4cc516d3e632fd9de1cea051875d6cff46f9 100644 (file)
Binary files a/release/binary-x86/org.tizen.tbt-ime-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbt-ime-1.0.0-i386.tpk differ
index 3b569d06d36d479b01b4977f7ad47ccf617cb347..aeb9bee77b4566605cb05078ae2bbae46620b580 100644 (file)
Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-i386.tpk differ
index d4e6e828b9f554fef31193b2e5a3aba2b266ab69..5a50939cf44477129fcc32edb19b96e0aefaf5a9 100644 (file)
@@ -1,14 +1,14 @@
 [general]
-buildroot=~/GBS-ROOT-TBT-MOBILE-2.4
+buildroot=~/GBS-ROOT-TBT-MOBILE
 profile = profile.device
 
 [profile.device] # Profile for Device
 obs = obs.device
-repos = repo.spin_2.4_base_standard, repo.device
+repos = repo.device
 
 [profile.sdk]   # Profile for SDK
 obs = obs.sdk
-repos=repo.spin_2.4_base_standard, repo.sdk
+repos = repo.sdk
 
 [obs.device]   # obs for SDK.Ref_Target
 #OBS API URL pointing to a remote OBS.
@@ -18,14 +18,13 @@ url = https://168.219.209.58/
 #OBS API URL pointing to a remote OBS.
 url = https://168.219.209.58/
 
+
 #device
 [repo.device] # Repository for Tizen 2.4 SDK Target snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/target-TM1/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 #SDK
 [repo.sdk] # Repository for Tizen 2.4 SDK Emulator snapshot
-url = http://168.219.209.55/download/snapshots/2.4-mobile/common/latest/repos/emulator/packages/
+url = http://download.tizen.org/snapshots/tizen/mobile/latest/repos/arm64-wayland/packages/
 
 
-[repo.spin_2.4_base_standard]
-url = http://168.219.209.55/download/snapshots/2.4-base/common/latest/repos/standard/packages/ 
index ac95acbeb3db0559f0f4152a1c06b760f9cc4517..afcf4a12870949e6aa517d7fd72837df4a32bc31 100644 (file)
@@ -215,9 +215,13 @@ typedef enum {
        
     TBT_APP_CONNECTION,
 
-       TBT_APP_SYSTEM_SETTINGS,
+    TBT_APP_SYSTEM_SETTINGS,
 
-    TBT_APP_CONTACTS
+    TBT_APP_CONTACTS,
+
+    TBT_APP_D2D_CLIENT,
+
+    TBT_APP_D2D_SERVER
 
 } tbt_app_type_e;
 
index 4bfbc466c2b7cf22353ceab7bea3e9fdc6b0b67e..729f0102569fa2407ab54360a72763f3254121cc 100644 (file)
 #define TBT_MODULE_CONTACTS
 #define TBT_MODULE_APP_CONTACTS
 
+#define TBT_MODULE_D2D
+#define TBT_MODULE_APP_D2D_CLIENT
+#define TBT_MODULE_APP_D2D_SERVER
+
 #endif
diff --git a/tbtcoreapp/inc/view/tbt-d2d-view.h b/tbtcoreapp/inc/view/tbt-d2d-view.h
new file mode 100644 (file)
index 0000000..e4d0fa0
--- /dev/null
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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
+ *
+ *  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.
+ *******************************************************************************/
+/**
+ * @file       tbt-d2d-view.h
+ * @brief      covers device to device convergence communication
+ * @since_tizen 3.0
+ * @author     golam kayes(g.kayes@samsung.com)
+ * @date       June, 2016
+ * @bug
+ * @credit     Tizen SDK Version 3.0 Test app
+ *
+ */
+
+
+#ifndef __TBT_D2D_VIEW_H__
+#define __TBT_D2D_VIEW_H__
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_D2D
+
+#include "model/tbt-list.h"
+
+
+/**
+ * @typedef d2d_viewer_view
+ * @since_tizen 2.3
+ * @brief A d2d viewer view handle.
+ */
+typedef struct _d2d_view d2d_view;
+
+/**
+ * @brief Create tbt d2d view
+ * @since_tizen 2.3
+ * @param[in] navi Parent naviframe
+ * @param[in] custom structute to hold tbt application information
+ * @param[in] item of the main tbt menu
+ * @return Pointer of d2d on success, otherwise NULL
+ */
+d2d_view *d2d_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+
+#endif
+#endif // __TBT_D2D_VIEW_H__
diff --git a/tbtcoreapp/res/edje/2.4/mobile/d2d_viewer.edc b/tbtcoreapp/res/edje/2.4/mobile/d2d_viewer.edc
new file mode 100644 (file)
index 0000000..85772d8
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+
+collections
+{
+    base_scale: 1.8;
+    group
+    {
+        name: "d2d_viewer";
+        parts{
+            part{
+                name: "list_container";
+                type: SWALLOW;
+                description{
+                    state: "default" 0.0;
+                    align: 0.0 0.0;
+                    visible: 1;
+                    rel1 {relative: 0.0 0.0; }
+                    rel2 {relative: 1.0 0.8; }
+                }
+            }
+            
+            part{
+                name: "others";
+                type: SWALLOW;
+                description{
+                    state: "default" 0.0;
+                    align: 0.0 0.0;
+                    visible: 1;
+                    rel1 {relative: 0.0 0.8; }
+                    rel2 {relative: 1.0 1.0; }
+                }
+            }
+        }
+    }
+}
diff --git a/tbtcoreapp/res/edje/3.0/mobile/attachpanel_viewer.edc b/tbtcoreapp/res/edje/3.0/mobile/attachpanel_viewer.edc
new file mode 100644 (file)
index 0000000..8483e2e
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define FONT_SIZE 32
+
+collections
+{
+    base_scale: 1.8;
+    group
+    {
+        name: "attachpanel_viewer";
+        parts{
+            part{
+                name: "popup_entry";
+                type: SWALLOW;
+                description{
+                    state: "default" 0.0;
+                    align: 0.0 0.0;
+                    visible: 1;
+                    rel1 {relative: 0.0 .9; }
+                    rel2 {relative: .8 1; }
+                }
+            }
+         
+         
+         part{
+            name: "popup_button";
+            type: SWALLOW;
+            description{
+               state: "default" 0.0;
+               align: 0.0 0.0;
+               visible: 1;
+               rel1 {
+                  relative: 0.8 .9;
+               }
+               rel2 {
+                  relative: 1 1;
+               }
+            }
+         }
+            
+            
+            part{
+                name: "popup_content";
+                type: SWALLOW;
+                description{
+                    state: "default" 0.0;
+                    align: 0.0 0.0;
+                    visible: 1;
+                    rel1 {relative: 0.0 0.0; }
+                    rel2 {relative: 1.0 .9; }
+                }
+            }
+
+         
+        }
+    }
+   
+   
+   
+    
+    
+    
+}
diff --git a/tbtcoreapp/res/edje/3.0/mobile/d2d_viewer.edc b/tbtcoreapp/res/edje/3.0/mobile/d2d_viewer.edc
new file mode 100644 (file)
index 0000000..85772d8
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+
+collections
+{
+    base_scale: 1.8;
+    group
+    {
+        name: "d2d_viewer";
+        parts{
+            part{
+                name: "list_container";
+                type: SWALLOW;
+                description{
+                    state: "default" 0.0;
+                    align: 0.0 0.0;
+                    visible: 1;
+                    rel1 {relative: 0.0 0.0; }
+                    rel2 {relative: 1.0 0.8; }
+                }
+            }
+            
+            part{
+                name: "others";
+                type: SWALLOW;
+                description{
+                    state: "default" 0.0;
+                    align: 0.0 0.0;
+                    visible: 1;
+                    rel1 {relative: 0.0 0.8; }
+                    rel2 {relative: 1.0 1.0; }
+                }
+            }
+        }
+    }
+}
index 3ab0cb953fe3ed564806d2b55f7d7fa24bf9373e..ade172a2c3da7858b8d77a339c9ece50e7b89fdf 100644 (file)
@@ -1543,7 +1543,7 @@ static tbt_info tbtapps[] =
 
                //MTP
                {
-                       .name = "MTP",
+                       .name = "Transfer Photos",
                        .parent = "MTP",
                        .apptype = TBT_APP_MTP,
                        .icon_name = "dummy",
@@ -1790,10 +1790,34 @@ static tbt_info tbtapps[] =
                        .result = 0,
                        .required_features_count = 1,
                        .features_required = { 21 }
-               }
+               },
        #endif
 #endif
 
+#ifdef TBT_MODULE_D2D
+       #ifdef TBT_MODULE_APP_D2D_CLIENT
+
+               //NSD DNSSD
+               {
+                       .name = "D2D Client",
+                       .parent = "D2D Convergence",
+                       .apptype = TBT_APP_D2D_CLIENT,
+                       .icon_name = "dummy",
+                       .info = "Check D2d client service. <br/>",
+                       .result = 0
+               },
+       #endif
+       #ifdef TBT_MODULE_APP_D2D_SERVER
+               {
+                       .name = "D2D Server",
+                       .parent = "D2D Convergence",
+                       .apptype = TBT_APP_D2D_SERVER,
+                       .icon_name = "dummy",
+                       .info = "Check D2d server service <br/>",
+                       .result = 0
+               }
+       #endif
+#endif
 };
 
 #ifdef TBT_MODULE_SENSOR
index 17909a7800bb941c644d963bb145fe9e7bb362c8..09431c353a9c83ea1f7d84817ab3e07da3aa9cae 100755 (executable)
@@ -211,6 +211,7 @@ static Evas_Object* create_bubble_table(Evas_Object *parent, Message_Bubble_Styl
        elm_table_padding_set(bubble_table, ELM_SCALE_SIZE(5), ELM_SCALE_SIZE(5));
        evas_object_show(bubble_table);
 
+
        //back_img
        const char *file_path;
        file_path = get_resource_path("images/thm_chatroom_message_bubble_me_no_tail_bg_n.9.png");
index fb072a9c05592fbe0e3fb72b661622eecfe2651e..c30497077816a9db64461fb7707f4243caa590e8 100644 (file)
@@ -1952,6 +1952,9 @@ static void _adapter_device_bond_created_cb(int result, bt_device_info_s *device
                {
                        if(device_info->is_bonded/* && device_info->is_connected*/)
                        {
+                               result = bt_device_set_alias(device_info->remote_address,device_info->remote_name);
+                               RETM_IF(result != BT_ERROR_NONE, "bt_device_set_alias fail > Error = %d", result);
+
 
                                        DBG("###Bond is created!!!");
                                        do_bt_common_feed(this, BT_BOND_SUCCESS, (void*)device_info);
@@ -3245,8 +3248,8 @@ switch(now)
                        bt_device_info_s* device_info_bonded;
                        result = bt_adapter_get_bonded_device_info(device_info->remote_address, &device_info_bonded);
                        RETM_IF(result != BT_ERROR_NONE, "bt_adapter_get_bonded_device_info fail > Error = %d", result);
-                       result = bt_device_set_alias(device_info_bonded->remote_address,device_info_bonded->remote_name);
-                       RETM_IF(result != BT_ERROR_NONE, "bt_device_set_alias fail > Error = %d", result);
+                       //result = bt_device_set_alias(device_info_bonded->remote_address,device_info_bonded->remote_name);
+                       //RETM_IF(result != BT_ERROR_NONE, "bt_device_set_alias fail > Error = %d", result);
                        result = bt_adapter_free_device_info (device_info_bonded);
                        RETM_IF(result != BT_ERROR_NONE, "bt_adapter_free_device_info fail > Error = %d", result);
 
diff --git a/tbtcoreapp/src/view/tbt-d2d-view.c b/tbtcoreapp/src/view/tbt-d2d-view.c
new file mode 100644 (file)
index 0000000..04110af
--- /dev/null
@@ -0,0 +1,588 @@
+/*******************************************************************************
+ * Copyright (c) 2014 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
+ *
+ *  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.
+ *******************************************************************************/
+/**
+ * @file       tbt-d2d-view.c
+ * @brief      covers locationn retrieval
+ *                     starts location service using d2d method and continuously updates the current location
+ *
+ * @author     golam kayes(g.kayes@samsung.com) and salman rahman(salman.ran)
+ * @date       October, 2014
+ * @bug                location manager does not start in device
+ * @credit
+ *
+ */
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_D2D
+
+
+#include "utils/logger.h"
+#include "utils/config.h"
+#include "utils/ui-utils.h"
+#include "view/tbt-d2d-view.h"
+#include "view/tbt-common-view.h"
+
+#include <d2d_conv_manager.h>
+
+struct _d2d_view
+{
+       common_view* view;
+       Evas_Object *server_list;
+       Evas_Object *client_msg_list;
+       conv_h gl_conv_h;
+       conv_service_h service_handle;
+       conv_channel_h channel_handle;
+       conv_payload_h payld_handle;
+       conv_device_h selected_device;
+};
+
+typedef struct _service_data{
+       d2d_view *view;
+       conv_service_h service_handle;
+}service_data;
+
+static Evas_Object *found_device_list;
+static Evas_Object *service_list;
+static Evas_Object *app_comm_menu_list;
+static bool is_app_control_tested;
+
+
+static void _app_destroy_cb(void* this);
+static void _conv_service_listener_cb(conv_service_h service_handle, conv_channel_h channel_handle, conv_error_e error, conv_payload_h payload, void* user_data);
+static void make_service(d2d_view *this);
+static void discovery_cb(conv_device_h device, int result, void* user_data);
+static int app_communication_menu(conv_service_h service_handle, void* data);
+static void device_selected_cb(void *data, Evas_Object *obj, void *event_info);
+static void message_listener(conv_service_h handle, conv_channel_h channel, int error, conv_payload_h result, void* user_data);
+static void start_discovery_cb(void *data, Evas_Object *obj, void *event_info);
+static void _conv_service_connected_cb(conv_service_h service_handle, conv_error_e error, conv_payload_h result, void* user_data);
+
+/**
+ * @function           d2d_view_add
+ * @since_tizen                2.3
+ * @description                Gps View Add
+ * @parameter          Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
+ * @return             d2d_view*
+ */
+d2d_view *d2d_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+{
+       RETVM_IF(NULL == navi, NULL, "navi is null");
+       RETVM_IF(NULL == tbt_info, NULL, "tbt_info is null");
+    RETVM_IF(NULL == item, NULL, "item is NULL");
+
+    is_app_control_tested = false;
+
+    d2d_view *this = NULL;
+    this = calloc(1, sizeof(d2d_view));
+    RETVM_IF(!this, NULL, "calloc failed");
+    this->view = calloc(1, sizeof(common_view));
+    RETVM_IF(!this->view, NULL, "calloc failed");
+
+    tbt_info->layout_group = "d2d_viewer";
+    tbt_info->layout_file = get_edje_path("d2d_viewer.edj");
+
+    common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+
+    if (tbt_info->apptype == TBT_APP_D2D_CLIENT)
+    {
+               this->server_list = elm_list_add(this->view->layout);
+               elm_list_mode_set(this->server_list, ELM_LIST_COMPRESS);
+               evas_object_smart_callback_add(this->server_list, "selected", NULL, NULL);
+               elm_list_item_append(this->server_list, "D2D discover", NULL, NULL, start_discovery_cb, this);
+
+               elm_list_go(this->server_list);
+
+               elm_object_part_content_set(this->view->layout, "list_container", this->server_list);
+
+       found_device_list = elm_list_add(this->view->layout);
+       elm_list_mode_set(found_device_list, ELM_LIST_COMPRESS);
+       evas_object_smart_callback_add(found_device_list, "selected", NULL, NULL);
+
+       service_list = elm_list_add(this->view->layout);
+       elm_list_mode_set(service_list, ELM_LIST_COMPRESS);
+       evas_object_smart_callback_add(service_list, "selected", NULL, NULL);
+       elm_list_select_mode_set(service_list, ELM_OBJECT_SELECT_MODE_ALWAYS);
+
+       app_comm_menu_list = elm_list_add(this->view->layout);
+       elm_list_mode_set(app_comm_menu_list, ELM_LIST_COMPRESS);
+       evas_object_smart_callback_add(app_comm_menu_list, "selected", NULL, NULL);
+
+    }
+    else  if (tbt_info->apptype == TBT_APP_D2D_SERVER)
+    {
+       make_service(this);
+       this->client_msg_list = elm_list_add(this->view->layout);
+       elm_list_mode_set(this->client_msg_list, ELM_LIST_COMPRESS);
+       elm_list_item_append(this->client_msg_list, "Ready", NULL, NULL, NULL, NULL);
+
+       elm_list_go(this->client_msg_list);
+
+       elm_object_part_content_set(this->view->layout, "list_container", this->client_msg_list);
+    }
+
+    return this;
+}
+
+
+static void _conv_service_connected_cb(conv_service_h service_handle, conv_error_e error, conv_payload_h result, void* user_data)
+{
+       DBG("_conv_service_connected_cb");
+}
+
+
+/**
+ * @function           get_d2d_error
+ * @since_tizen                3.0
+ * @description                get the name of the error for d2d
+ * @parameter          int: error int
+ * @return                     char*: error string
+ */
+static char* get_d2d_error(int e)
+{
+       switch (e) {
+       case CONV_ERROR_NONE:
+               return "CONV_ERROR_NONE";
+       case CONV_ERROR_INVALID_PARAMETER:
+               return "CONV_ERROR_INVALID_PARAMETER";
+       case CONV_ERROR_INVALID_OPERATION:
+               return "CONV_ERROR_INVALID_OPERATION";
+       case CONV_ERROR_OUT_OF_MEMORY:
+               return "CONV_ERROR_OUT_OF_MEMORY";
+       case CONV_ERROR_PERMISSION_DENIED:
+               return "CONV_ERROR_PERMISSION_DENIED";
+       case CONV_ERROR_NOT_SUPPORTED:
+               return "CONV_ERROR_NOT_SUPPORTED";
+       case CONV_ERROR_NO_DATA:
+               return "CONV_ERROR_NO_DATA";
+       default:
+               return "UNKNOWN_ERROR";
+       }
+
+       return "UNKNOWN_ERROR";
+}
+
+static void start_discovery_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       d2d_view* this = (d2d_view*) data;
+       DBG("Inside start server discovery cb");
+
+       int ret = conv_create(&this->gl_conv_h);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_create failed with error : %s", get_d2d_error(ret));
+
+    ret = conv_discovery_start(this->gl_conv_h, 30, discovery_cb, this);/*Timeout 30 seconds*/
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_discovery_start failed with error : %s", get_d2d_error(ret));
+}
+
+static int app_control_start(conv_service_h service_handle)
+{
+       DBG("app_control_start");
+       int ret;
+       ret = conv_service_start(service_handle, NULL, NULL);
+       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_service_start failed with error : %s", get_d2d_error(ret));
+
+       is_app_control_tested = true;
+       conv_payload_h payload_handle;
+
+       ret = conv_payload_create(&payload_handle);
+       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_payload_create failed with error : %s", get_d2d_error(ret));
+
+       app_control_h app_control = NULL;
+       app_control_create(&app_control);
+       app_control_set_app_id(app_control, "org.tizen.coretbt_uiapp");
+       app_control_set_operation(app_control, APP_CONTROL_OPERATION_MAIN);
+
+       ret = conv_payload_set_app_control(payload_handle, "app_control", app_control);
+       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_payload_set_app_control failed with error : %s", get_d2d_error(ret));
+       ret = conv_payload_set_string(payload_handle, "reply", "0");
+       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_payload_set_string failed with error : %s", get_d2d_error(ret));
+       ret = conv_service_publish(service_handle, NULL, payload_handle);
+       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_service_publish failed with error : %s", get_d2d_error(ret));
+
+       sleep(3);
+
+       ret = conv_service_stop(service_handle, NULL, NULL);
+       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_service_stop failed with error : %s", get_d2d_error(ret));
+
+       printf ("conv_payload_destroy called..\n");
+       ret = conv_payload_destroy(payload_handle);
+       RETVM_IF(ret != CONV_ERROR_NONE,0, "conv_payload_destroy failed with error : %s", get_d2d_error(ret));
+
+       return 0;
+}
+
+static void service_selected_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       DBG("service_selected_cb");
+
+       service_data *s_data = (service_data*) data;
+
+       RETM_IF(NULL==s_data, "s_data is NULL");
+
+       conv_service_e e = 0;
+       d2d_view* this = s_data->view;
+
+
+       if(s_data->service_handle == NULL)
+       {
+               ERR("s_data->service_handle is NULL");
+       }
+
+       conv_service_h service_handle =s_data->service_handle;
+
+       int ret = conv_service_get_type(service_handle, &e);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_get_type failed with error : %s", get_d2d_error(ret));
+
+       switch (e)
+       {
+       case CONV_SERVICE_APP_TO_APP_COMMUNICATION :
+               DBG("CONV_SERVICE_APP_TO_APP_COMMUNICATION");
+               ret = app_communication_menu(service_handle, this);
+               RETM_IF(ret != CONV_ERROR_NONE, "app_communication_menu failed with error : %s", get_d2d_error(ret));
+               break;
+
+       case CONV_SERVICE_REMOTE_APP_CONTROL :
+               DBG("CONV_SERVICE_REMOTE_APP_CONTROL");
+               ret = app_control_start(service_handle);
+               RETM_IF(ret != CONV_ERROR_NONE, "app_control_start failed with error : %s", get_d2d_error(ret));
+               break;
+       case CONV_SERVICE_REMOTE_INTERACTION:
+               DBG("CONV_SERVICE_REMOTE_INTERACTION");
+               break;
+
+       default :
+               DBG( "DTOD_TEST default");
+               break;
+       }
+
+}
+
+
+
+static void publish_cb(void *data, Evas_Object *obj, void *event_info)
+{
+
+       DBG("publish_cb");
+
+       conv_service_h service_handle = (conv_service_h)data;
+       conv_channel_h channel_handle;
+       conv_payload_h payload_handle;
+
+       int ret = conv_channel_create(&channel_handle);
+       DBG("conv_channel_create : %s", get_d2d_error(ret));
+       ret = conv_channel_set_string(channel_handle, "uri", "org.example.d2d_test");
+       DBG("conv_channel_set_string : %s", get_d2d_error(ret));
+       ret = conv_channel_set_string(channel_handle, "channel_id", "test");
+       DBG("conv_channel_set_string : %s", get_d2d_error(ret));
+       ret = conv_payload_create(&payload_handle);
+       DBG("conv_payload_create : %s", get_d2d_error(ret));
+       ret = conv_payload_set_string(payload_handle, "payload_type", "GoodNews");
+       DBG("conv_payload_set_string : %s", get_d2d_error(ret));
+       ret = conv_service_publish(service_handle, channel_handle, payload_handle);
+       DBG("conv_service_publish : %s", get_d2d_error(ret));
+       ret = conv_service_read(service_handle, channel_handle, payload_handle);
+       DBG("conv_service_read : %s", get_d2d_error(ret));
+
+       sleep(3);
+
+       ret = conv_service_stop(service_handle, NULL, NULL);
+       DBG("conv_service_stop : %s", get_d2d_error(ret));
+
+       DBG("conv_payload_destroy called..\n");
+       ret = conv_payload_destroy(payload_handle);
+       DBG("conv_payload_destroy : %s", get_d2d_error(ret));
+}
+
+static void read_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       conv_service_h service_handle = (conv_service_h)data;
+       conv_channel_h channel_handle;
+       conv_payload_h payload_handle;
+
+       int ret = conv_channel_create(&channel_handle);
+       ret = conv_channel_set_string(channel_handle, "uri", "org.example.d2d_test");
+       ret = conv_channel_set_string(channel_handle, "channel_id", "test");
+       ret = conv_payload_create(&payload_handle);
+
+       //To-do: implementation for "Read" API
+//     ret = conv_service_read(service_handle, channel_handle, payload_handle);
+//     DBG("conv_service_read : %s", get_d2d_error(ret));
+}
+
+static void app_launch_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       DBG("app_launch_cb");
+
+       conv_service_h service_handle = (conv_service_h)data;
+       conv_channel_h channel_handle;
+       conv_payload_h payload_handle;
+       int ret;
+
+       ret = conv_channel_create(&channel_handle);
+       DBG("conv_channel_create : %s", get_d2d_error(ret));
+       ret = conv_channel_create(&channel_handle);
+       DBG("conv_channel_create : %s", get_d2d_error(ret));
+       ret = conv_channel_set_string(channel_handle, "uri", "org.example.d2d_test");
+       DBG("conv_channel_set_string : %s", get_d2d_error(ret));
+       ret = conv_channel_set_string(channel_handle, "channel_id", "test");
+       DBG("conv_channel_set_string : %s", get_d2d_error(ret));
+       ret = conv_payload_create(&payload_handle);
+       DBG("conv_payload_create : %s", get_d2d_error(ret));
+
+       //To-do: implementation for service_start API with app launch
+
+}
+
+
+static void message_listener(conv_service_h handle, conv_channel_h channel, int error, conv_payload_h result, void* user_data)
+{
+       DBG("message_listener");
+
+       char* test;
+       service_data* s_data = (service_data*) user_data;
+       d2d_view* this = (d2d_view*)s_data->view;
+       conv_service_h listner_handle = (conv_service_h)s_data->service_handle;
+       conv_payload_get_string(result, "result_type", &test);
+
+       DBG("result_type : %s", test);
+
+       if (!strcmp(test, "onConnect"))
+       {
+               DBG("==== Connected ====");
+//             elm_list_item_append(app_comm_menu_list, "App Launch", NULL, NULL, app_launch_cb, listner_handle);
+//             elm_list_item_append(app_comm_menu_list, "Read", NULL, NULL, read_cb, listner_handle);
+
+               elm_list_item_append(app_comm_menu_list, "Publish", NULL, NULL, publish_cb, listner_handle);
+               elm_list_go(app_comm_menu_list);
+               elm_object_part_content_set(this->view->layout, "list_container", app_comm_menu_list);
+       }
+}
+
+static int app_communication_menu(conv_service_h service_handle, void* data)
+{
+       conv_channel_h channel_handle;
+       d2d_view* this = (d2d_view*) data;
+
+       DBG( "app_communication_start");
+
+       if(!is_app_control_tested)
+       {
+               DBG("Test app-control first");
+               Evas_Object* popup = ui_utils_popup_add(this->view->layout, "Test app-control first");
+               evas_object_show(popup);
+               return 0;
+       }
+
+       int ret = conv_channel_create(&channel_handle);
+       RETVM_IF(ret != CONV_ERROR_NONE, ret, "conv_channel_create failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_channel_set_string(channel_handle, "uri", "org.example.d2d_test");
+       RETVM_IF(ret != CONV_ERROR_NONE, ret, "conv_channel_set_string failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_channel_set_string(channel_handle, "channel_id", "test");
+       RETVM_IF(ret != CONV_ERROR_NONE, ret, "conv_channel_set_string failed with error : %s", get_d2d_error(ret));
+
+       service_data* s_data = (service_data*)malloc(sizeof(service_data));
+       s_data->view = this;
+       s_data->service_handle = service_handle;
+
+       ret = conv_service_set_listener_cb(service_handle, message_listener, s_data);
+       RETVM_IF(ret != CONV_ERROR_NONE, ret, "conv_service_set_listener_cb failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_service_connect(service_handle, _conv_service_connected_cb, this);
+       DBG( "conv_service_connect: %s", get_d2d_error(ret));
+
+       ret = conv_service_start(service_handle, channel_handle, NULL);
+       RETVM_IF(ret != CONV_ERROR_NONE, ret, "conv_service_start failed with error : %s", get_d2d_error(ret));
+
+       DBG( "app_communication_end");
+       return 0;
+}
+
+static void service_foreach_cb(conv_service_h service_handle, void *user_data)
+{
+       conv_service_e e;
+       d2d_view* this = (d2d_view*) user_data;
+
+       DBG( "Service----------------------------\n");
+       service_data* s_data = (service_data*)malloc(sizeof(service_data));
+       s_data->view = this;
+
+
+       int ret = conv_service_get_type(service_handle, &e);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_get_type failed with error : %s", get_d2d_error(ret));
+       DBG( "service_get_type = %d", (int)e);
+
+       char* value = NULL;
+       char* service_id = NULL;
+
+       ret = conv_service_get_property_string(service_handle, CONV_SERVICE_ID, &service_id);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_get_property_string failed with error : %s", get_d2d_error(ret));
+       DBG( "service id = %s", service_id);
+
+       ret = conv_service_get_property_string(service_handle, CONV_SERVICE_VERSION, &value);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_get_property_string failed with error : %s", get_d2d_error(ret));
+       DBG( "service version = %s", value);
+
+       conv_service_h clone_service_handle;
+
+       ret = conv_service_clone(service_handle, &clone_service_handle);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_clone failed with error : %s", get_d2d_error(ret));
+
+       s_data->service_handle = clone_service_handle;
+
+       elm_list_item_append(service_list, service_id, NULL, NULL, service_selected_cb, s_data);
+
+       elm_list_go(service_list);
+       elm_object_part_content_set(this->view->layout, "list_container", service_list);
+
+       conv_channel_h channel_h;
+       ret = conv_channel_create(&channel_h);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_channel_create failed with error : %s", get_d2d_error(ret));
+}
+
+static void device_selected_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       d2d_view* this = (d2d_view*) data;
+
+       elm_list_clear(this->server_list);
+       conv_device_h clone_device;
+       int ret = conv_device_clone(this->selected_device, &clone_device);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_device_clone failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_device_foreach_service(clone_device, service_foreach_cb, this);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_device_foreach_service failed with error : %s", get_d2d_error(ret));
+
+
+}
+
+static void discovery_cb(conv_device_h device, int result, void* user_data)
+{
+       char* value = NULL;
+       char* device_name = NULL;
+       d2d_view* this = (d2d_view*) user_data;
+       DBG("Inside server discovery cb.");
+       int ret = conv_device_get_property_string(device, CONV_DEVICE_ID, &value);
+       //RETM_IF(ret != CONV_ERROR_NONE, "conv_device_get_property_string failed with error : %s", get_d2d_error(ret));
+       DBG("device id = %s", value);
+
+       ret = conv_device_get_property_string(device, CONV_DEVICE_NAME, &device_name);
+       //RETM_IF(ret != CONV_ERROR_NONE, "conv_device_get_property_string failed with error : %s", get_d2d_error(ret));
+       DBG("device name = %s", device_name);
+
+    ret = conv_device_get_property_string(device, CONV_DEVICE_TYPE, &value);
+       //RETM_IF(ret != CONV_ERROR_NONE, "conv_device_get_property_string failed with error : %s", get_d2d_error(ret));
+       DBG( "device TYPE = %s", value);
+
+       this->selected_device = device;
+
+       if( device_name!=NULL)
+       {
+               elm_list_item_append(found_device_list, device_name, NULL, NULL, device_selected_cb, this);
+               elm_list_go(found_device_list);
+               elm_object_part_content_set(this->view->layout, "list_container", found_device_list);
+
+       }
+       //DBG("Device----------------------------");
+}
+
+static void make_service(d2d_view *this)
+{
+       int ret = conv_service_create(&this->service_handle);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_create failed with error : %s", get_d2d_error(ret));
+
+    ret = conv_channel_create(&this->channel_handle);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_channel_create failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_channel_set_string(this->channel_handle, "uri", "org.example.d2d_test");
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_channel_set_string failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_channel_set_string(this->channel_handle, "channel_id", "test");
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_channel_set_string failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_payload_create(&this->payld_handle);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_payload_create failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_service_set_type(this->service_handle, CONV_SERVICE_APP_TO_APP_COMMUNICATION);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_set_type failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_service_set_property_string(this->service_handle, CONV_SERVICE_ID, "test_app");
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_set_property_string failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_service_set_property_string(this->service_handle, CONV_SERVICE_VERSION, "1.0");
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_set_property_string failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_service_set_listener_cb(this->service_handle, _conv_service_listener_cb, (void *)this);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_set_listener_cb failed with error : %s", get_d2d_error(ret));
+
+       ret = conv_service_start(this->service_handle, this->channel_handle, this->payld_handle);
+       RETM_IF(ret != CONV_ERROR_NONE, "conv_service_start failed with error : %s", get_d2d_error(ret));
+}
+
+
+static void _conv_service_listener_cb(conv_service_h service_handle, conv_channel_h channel_handle, conv_error_e error, conv_payload_h payload, void* user_data)
+{
+       char* test;
+       char* payload_type;
+
+       d2d_view* this  = (d2d_view*) user_data;
+
+       DBG("callback for service..");
+       conv_payload_get_string(payload, "result_type", &test);
+
+       DBG( "result type : %s", test);
+
+       if (!strcmp(test, "onClientConnect"))
+       {
+               elm_list_item_append(this->client_msg_list, "Client Connected", NULL, NULL, NULL, NULL);
+               elm_list_go(this->client_msg_list);
+       }
+       else if (!strcmp(test, "onMessage"))
+       {
+                       int ret = conv_payload_get_string(payload, "payload_type", &payload_type);
+                       RETM_IF(ret != CONV_ERROR_NONE, "conv_payload_get_string failed with error: %s", get_d2d_error(ret));
+
+                       strcat(payload_type, " Received");
+                       elm_list_item_append(this->client_msg_list, payload_type, NULL, NULL, NULL, NULL);
+                       elm_list_go(this->client_msg_list);
+
+                       DBG("payload_type : %s", payload_type);
+                       DBG( "==== Received ====");
+
+       }
+}
+
+/**
+ * @function           _app_destroy_cb
+ * @since_tizen                2.3
+ * @description                 App Destroy Cb
+ * @parameter          void*: Void Pointer
+ * @return             static void
+ */
+static void _app_destroy_cb(void* this)
+{
+       RETM_IF(NULL == this, "data is NULL");
+
+       d2d_view *view = NULL;
+       view = (d2d_view*)this;
+       RETM_IF(NULL == view, "view is NULL");
+
+       conv_device_destroy(view->selected_device);
+
+       SAFE_DELETE(view->view);
+       SAFE_DELETE(view);
+}
+
+#endif
index 7ad90e0cff1538a40d64afd4ad7ae7644b2d4796..689900ac3acf8516ab08ff4d788e3398b133796f 100644 (file)
@@ -292,6 +292,10 @@ static void _app_destroy_cb(void* this)
        
 
        int result = APP_ERROR_NONE;
+
+       result = ui_app_remove_event_handler(view->suspended_state_handler);
+       RETM_IF(result != APP_ERROR_NONE, "ui_app_remove_event_handler(suspended_state_handler) fail > Error = %d", result);
+
        result = ui_app_remove_event_handler(view->language_handler);
        RETM_IF(result != APP_ERROR_NONE, "service_app_remove_event_handler(language_handler) fail > Error = %d", result);
        if (is_orientation_supported)
index 4674d8e7bd2ddf4acf5f4c0b7e869fa03cf890cf..3cd19874d9c15202be2208c14d9014254fcc13f1 100644 (file)
@@ -93,6 +93,7 @@
 #include "view/tbt-connection-view.h"
 #include "view/tbt-systemsettings-view.h"
 #include "view/tbt-contacts-view.h"
+#include "view/tbt-d2d-view.h"
 
 typedef struct
 {
@@ -1051,6 +1052,14 @@ static void _gl_item_selected_cb(void *data, Evas_Object *obj EINA_UNUSED, void
                                contacts_view_add(view->navi, info, it);
                                break;
                #endif
+               #ifdef TBT_MODULE_D2D
+                       case TBT_APP_D2D_CLIENT:
+                               d2d_view_add(view->navi, info, it);
+                               break;
+                       case TBT_APP_D2D_SERVER:
+                               d2d_view_add(view->navi, info, it);
+                               break;
+               #endif
 
                default:
                        assert(false);