Add Model Device methods 05/282505/1
authorDohyun Pyun <dh79.pyun@samsung.com>
Tue, 4 Oct 2022 23:37:39 +0000 (08:37 +0900)
committerDohyun Pyun <dh79.pyun@samsung.com>
Tue, 4 Oct 2022 23:38:06 +0000 (08:38 +0900)
Change-Id: I4d126d86def1a0c9e888d6f600c7bfdc0635700d
Signed-off-by: Dohyun Pyun <dh79.pyun@samsung.com>
SettingBluetooth/SettingBluetooth/Model/BtModelDevice.cs
SettingBluetooth/SettingBluetooth/Model/BtModelEnumerations.cs

index 5b9cf1f0b67dd244184d23652af0573665155b8d..514181325a9a9fbad398772878845553e6395dba 100644 (file)
@@ -13,5 +13,65 @@ namespace SettingBluetooth.Model
         {
             RemoteDeviceAddress = address;
         }
+
+        internal static void Pair()
+        {
+            // TODO
+            // 1. Call CreateBond API
+            // 2. Set BT Operation state as Pairing
+            // 3. Set Device state as Pairing
+            // 4. Bonding Created
+            //  --> Remove device into searched list
+            //  --> Add device into paired list
+            //  --> Invoke Remove Searched Device event to View
+            //  --> Invoke New Paired Device event to View
+            // 5. Set BT Operation state as Activated
+        }
+
+        internal static void Unpair()
+        {
+            // TODO
+            // 1. Call DestroyBond API
+            // 2. Set BT Operation state as Pairing
+            // 3. Set Device state as Unpairing
+            // 4. Bonding Destroyed
+            //  --> Remove device into paired list
+            //  --> Invoke Remove Paired Device event to View
+            // 5. Set BT Operation state as Activated
+        }
+
+        internal static void ConnectAudio()
+        {
+            // TODO
+            // 1. Call Connect API (Audio)
+            // 2. Set BT Operation state as Connecting
+            // 3. Set Device state as Connecting
+            // 4. Audio Connection Callback
+            //  --> Update Device State (Success -> Connected, Fail -> Paired)
+            //  --> Update Device Connected info (Connected Profile info - HFP / A2DP)
+            // 5. Set BT Operation state as Activated
+        }
+
+        internal static void DisConnectAudio()
+        {
+            // TODO
+            // 1. Call Disconnect API (Audio)
+            // 2. Set BT Operation state as Connecting
+            // 3. Set Device state as Disonnecting
+            // 4. Audio Disconnection Callback
+            //  --> Update Device State (Success -> Paired, Fail -> Connected)
+            //  --> Update Device Connected info (Connected Profile info - HFP / A2DP)
+            // 5. Set BT Operation state as Activated
+        }
+
+        internal static void ConnectHid()
+        {
+            // TODO (Same with audio)
+        }
+
+        internal static void DisConnectHid()
+        {
+            // TODO (Same with audio)
+        }
     }
 }
index 2a64e2a807f89efb3131a7ae17cfb410b4b7f1fa..d7e681113da810b23c37a8e640e400bb766689cf 100644 (file)
@@ -4,10 +4,34 @@ using System.Text;
 
 namespace SettingBluetooth.Model
 {
+    /* Removable - We can use BtOperationState and BtDeviceState */
     public enum BtModelDiscoveryState
     {
         Started,
         Finished,
         Found
     }
+
+    public enum BtOperationState
+    {
+        Deactivated,
+        Deactivating,
+        Activated,
+        Activating,
+        Searching,
+        Pairing,
+        Connecting,
+    }
+
+    public enum BtDeviceState
+    {
+        Idle,
+        Pairing,
+        Unpairing,
+        Paired,
+        Connecting,
+        Connected,
+        Disconnecting,
+        ServiceSearching,
+    }
 }