[NFC][Non-ACR] Add wallet.xml for HCE test 21/204321/3
authorJihoon Jung <jh8801.jung@samsung.com>
Tue, 23 Apr 2019 05:36:58 +0000 (14:36 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Tue, 23 Apr 2019 07:02:03 +0000 (16:02 +0900)
Change-Id: I70cbc6184e5803e25325cd4f2799f24108fbd5bb
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
tct-suite-vs/Tizen.Nfc.Manual.Tests/shared/res/wallet.xml [new file with mode: 0644]
tct-suite-vs/Tizen.Nfc.Manual.Tests/testcase/TSNfcCardEmulationAdapter.cs
tct-suite-vs/Tizen.Nfc.Manual.Tests/tizen-manifest.xml

diff --git a/tct-suite-vs/Tizen.Nfc.Manual.Tests/shared/res/wallet.xml b/tct-suite-vs/Tizen.Nfc.Manual.Tests/shared/res/wallet.xml
new file mode 100644 (file)
index 0000000..01efefe
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+   <application name = "Tizen.Nfc.Manual.Tests">
+      <wallet>
+         <aid-group category = "payment">
+            <aid aid = "A0000000041010" se_type = "hce" unlock = "false" power = "on"/>
+         </aid-group>
+         <aid-group category = "other">
+            <aid aid = "D4100000030001" se_type = "hce" unlock = "false" power = "on"/>
+         </aid-group>
+      </wallet>
+   </application>
index c620145..2015232 100755 (executable)
@@ -36,6 +36,30 @@ namespace Tizen.Network.Nfc.Tests
         private HostCardEmulationEventArgs _hceEventArgs = null;
         private SecureElementEventArgs _seEventArgs = null;
 
+        public void HostCardEmulationActivatedCallback(object sender, HostCardEmulationEventArgs e)
+        {
+            if (e.HceEvent == NfcHceEvent.Activated)
+            {
+                _hceEventArgs = e;
+            }
+        }
+
+        public void HostCardEmulationDeactivatedCallback(object sender, HostCardEmulationEventArgs e)
+        {
+            if (e.HceEvent == NfcHceEvent.Deactivated)
+            {
+                _hceEventArgs = e;
+            }
+        }
+
+        public void HostCardEmulationApduReceivedCallback(object sender, HostCardEmulationEventArgs e)
+        {
+            if (e.HceEvent == NfcHceEvent.ApduReceived)
+            {
+                _hceEventArgs = e;
+            }
+        }
+
         public void HostCardEmulationCallback(object sender, HostCardEmulationEventArgs e)
         {
             _hceEventArgs = e;
@@ -166,7 +190,7 @@ namespace Tizen.Network.Nfc.Tests
                 * 3. Register SE event handler
                 */
                 _cardEmulationAdapter = NfcManager.GetCardEmulationAdapter();
-                _cardEmulationAdapter.HostCardEmulationEvent += HostCardEmulationCallback;
+                _cardEmulationAdapter.HostCardEmulationEvent += HostCardEmulationActivatedCallback;
                 _cardEmulationAdapter.SecureElementEvent += SecureElementCallback;
 
                 /* TEST CODE */
@@ -180,7 +204,7 @@ namespace Tizen.Network.Nfc.Tests
                 * 2. Reset variables
                 */
                 Assert.IsNotNull(_cardEmulationAdapter, "_cardEmulationAdapter should not be null");
-                _cardEmulationAdapter.HostCardEmulationEvent -= HostCardEmulationCallback;
+                _cardEmulationAdapter.HostCardEmulationEvent -= HostCardEmulationActivatedCallback;
                 _cardEmulationAdapter.SecureElementEvent -= SecureElementCallback;
 
                 _cardEmulationAdapter = null;
@@ -217,7 +241,7 @@ namespace Tizen.Network.Nfc.Tests
                 * 3. Register SE event handler
                 */
                 _cardEmulationAdapter = NfcManager.GetCardEmulationAdapter();
-                _cardEmulationAdapter.HostCardEmulationEvent += HostCardEmulationCallback;
+                _cardEmulationAdapter.HostCardEmulationEvent += HostCardEmulationDeactivatedCallback;
                 _cardEmulationAdapter.SecureElementEvent += SecureElementCallback;
 
                 /* TEST CODE */
@@ -231,7 +255,7 @@ namespace Tizen.Network.Nfc.Tests
                 * 2. Reset variables
                 */
                 Assert.IsNotNull(_cardEmulationAdapter, "_cardEmulationAdapter should not be null");
-                _cardEmulationAdapter.HostCardEmulationEvent -= HostCardEmulationCallback;
+                _cardEmulationAdapter.HostCardEmulationEvent -= HostCardEmulationDeactivatedCallback;
                 _cardEmulationAdapter.SecureElementEvent -= SecureElementCallback;
 
                 _cardEmulationAdapter = null;
@@ -268,7 +292,7 @@ namespace Tizen.Network.Nfc.Tests
                 * 3. Register SE event handler
                 */
                 _cardEmulationAdapter = NfcManager.GetCardEmulationAdapter();
-                _cardEmulationAdapter.HostCardEmulationEvent += HostCardEmulationCallback;
+                _cardEmulationAdapter.HostCardEmulationEvent += HostCardEmulationApduReceivedCallback;
                 _cardEmulationAdapter.SecureElementEvent += SecureElementCallback;
 
                 /* TEST CODE */
@@ -282,7 +306,7 @@ namespace Tizen.Network.Nfc.Tests
                 * 2. Reset variables
                 */
                 Assert.IsNotNull(_cardEmulationAdapter, "_cardEmulationAdapter should not be null");
-                _cardEmulationAdapter.HostCardEmulationEvent -= HostCardEmulationCallback;
+                _cardEmulationAdapter.HostCardEmulationEvent -= HostCardEmulationApduReceivedCallback;
                 _cardEmulationAdapter.SecureElementEvent -= SecureElementCallback;
 
                 _cardEmulationAdapter = null;
index 1e8833b..82484dd 100644 (file)
@@ -4,6 +4,7 @@
   <ui-application appid="Tizen.Nfc.Manual.Tests" exec="Tizen.Nfc.Manual.Tests.dll" multiple="false" taskmanage="true" splash-screen-display="true" type="dotnet" launch_mode="single">\r
     <icon>Tizen.Nfc.Manual.Tests.png</icon>\r
     <label>Tizen.Nfc.Manual.Tests</label>\r
+    <metadata key="http://tizen.org/metadata/nfc_cardemulation" value="/shared/res/wallet.xml"/>\r
   </ui-application>\r
   <shortcut-list />\r
   <privileges>\r
@@ -11,4 +12,4 @@
     <privilege>http://tizen.org/privilege/nfc.cardemulation</privilege>\r
     <privilege>http://tizen.org/privilege/appmanager.launch</privilege>\r
   </privileges>\r
-</manifest>
\ No newline at end of file
+</manifest>\r