From: Dohyun Pyun Date: Tue, 4 Oct 2022 23:37:39 +0000 (+0900) Subject: Add Model Device methods X-Git-Tag: accepted/tizen/unified/20221005.144506~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F282505%2F1;p=profile%2Fiot%2Fapps%2Fdotnet%2Fsetting-bluetooth.git Add Model Device methods Change-Id: I4d126d86def1a0c9e888d6f600c7bfdc0635700d Signed-off-by: Dohyun Pyun --- diff --git a/SettingBluetooth/SettingBluetooth/Model/BtModelDevice.cs b/SettingBluetooth/SettingBluetooth/Model/BtModelDevice.cs index 5b9cf1f..5141813 100644 --- a/SettingBluetooth/SettingBluetooth/Model/BtModelDevice.cs +++ b/SettingBluetooth/SettingBluetooth/Model/BtModelDevice.cs @@ -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) + } } } diff --git a/SettingBluetooth/SettingBluetooth/Model/BtModelEnumerations.cs b/SettingBluetooth/SettingBluetooth/Model/BtModelEnumerations.cs index 2a64e2a..d7e6811 100644 --- a/SettingBluetooth/SettingBluetooth/Model/BtModelEnumerations.cs +++ b/SettingBluetooth/SettingBluetooth/Model/BtModelEnumerations.cs @@ -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, + } }