From: Yunhee Seo Date: Thu, 10 Oct 2024 06:30:04 +0000 (+0900) Subject: [Tizen.System.Device] Enhance API description X-Git-Tag: submit/tizen/20241010.110118~1^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88d68516d12a7c51ec93111f2f419c32987f605a;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Tizen.System.Device] Enhance API description Add more detailed APIs description. Signed-off-by: Yunhee Seo --- diff --git a/src/Tizen.System/Device/Battery.cs b/src/Tizen.System/Device/Battery.cs index 79627db05..94bc5bbc5 100755 --- a/src/Tizen.System/Device/Battery.cs +++ b/src/Tizen.System/Device/Battery.cs @@ -76,11 +76,20 @@ namespace Tizen.System { private static readonly object s_lock = new object(); /// - /// Gets the battery charge percentage. + /// Gets the current device's invalid battery charge percentage as an interger value. /// + /// + /// It returns an integer value from 0 to 100 that indicates remaining battery charge as a percentage of the maximum level. + /// /// 3 /// It returns an integer value from 0 to 100 that indicates the remaining /// battery charge as a percentage of the maximum level. + /// + /// + /// Console.WriteLine("battery Percent is: {0}", Tizen.System.Battery.Percent); + /// + /// + /// public static int Percent { get @@ -95,9 +104,25 @@ namespace Tizen.System } } /// - /// Gets the current battery level. + /// Gets the current device's battery level status as a BatteryLevelStatus. /// + /// + /// Retrieves the current battery level status based on remaining battery capacity. + /// /// 3 + /// The battery level status. + /// + /// + /// using Tizen.System; + /// ... + /// BatteryLevelStatus status = Battery.Level; + /// if (Battery.Percent == 0 && status == BatteryLevelStatus.Empty) + /// ... + /// ... + /// + /// + /// + /// public static BatteryLevelStatus Level { get @@ -112,9 +137,20 @@ namespace Tizen.System } } /// - /// Gets the current charging state. + /// Gets the current device's charging state which the battery is charging. /// + /// + /// Checks whether the battery is currently being charged or not. + /// /// 3 + /// + /// + /// using Tizen.System; + /// bool charging = Battery.IsCharging; + /// ... + /// + /// + /// public static bool IsCharging { get diff --git a/src/Tizen.System/Device/Display.cs b/src/Tizen.System/Device/Display.cs index 533669d88..3a6962a78 100644 --- a/src/Tizen.System/Device/Display.cs +++ b/src/Tizen.System/Device/Display.cs @@ -75,9 +75,21 @@ namespace Tizen.System } /// - /// The number of available display devices. + /// The number of available display devices connected to current device. /// + /// + /// Retrieves the number of display devices connected to the system. + /// /// 3 + /// + /// + /// using Tizen.System; + /// ... + /// Console.WriteLine("Total number of Displays are: {0}", Display.NumberOfDisplays); + /// + /// + /// + /// public static int NumberOfDisplays { get @@ -120,6 +132,9 @@ namespace Tizen.System /// /// The maximum brightness value that can be set for the specific display. /// + /// + /// Retrieves the maximum brightness level of a specific display device. + /// /// 3 /// /// @@ -142,7 +157,7 @@ namespace Tizen.System } /// - /// The brightness value of the display. + /// The brightness value of the specific display device. /// /// /// The brightness value should be less than or equal to the MaxBrightness value. @@ -150,12 +165,15 @@ namespace Tizen.System /// 3 /// When an invalid parameter value is set. /// If the privilege is not set. + /// In case of any system error. + /// This exception can be due to device not supported. /// /// /// Display display = Display.Displays[0]; /// Console.WriteLine("Display current Brightness is: {0}", display.Brightness); /// /// + /// public int Brightness { get @@ -179,9 +197,27 @@ namespace Tizen.System } } /// - /// The current device display state. + /// The current device display state, including normal, dim, and off states. /// + /// + /// When the display state is set, it should be checked the profile version and supported display state. + /// /// 3 + /// + /// + /// using Tizen.System; + /// ... + /// DisplayState current = Display.State; + /// Console.WriteLine("Display current state is: {0}", current); + /// ... + /// Display.State = DisplayState.Normal; + /// ... + /// + /// + /// + /// + /// + /// public static DisplayState State { get @@ -218,7 +254,7 @@ namespace Tizen.System /// { /// Console.WriteLine("Display State is: {0}", args.State); /// } - /// Battery.StateChanged += handler; + /// Display.StateChanged += handler; /// await Task.Delay(20000); /// } /// diff --git a/src/Tizen.System/Device/Haptic.cs b/src/Tizen.System/Device/Haptic.cs index 42d86cddb..c196445c1 100755 --- a/src/Tizen.System/Device/Haptic.cs +++ b/src/Tizen.System/Device/Haptic.cs @@ -73,9 +73,20 @@ namespace Tizen.System Dispose(false); } /// - /// Gets the number of the available vibrators. + /// Gets the number of the available vibrators available on the current device. /// + /// + /// Retrieves the total number of vibrators available on the device. + /// /// 3 + /// + /// + /// using Tizen.System; + /// ... + /// Console.WriteLine("Total number of Vibrators are: {0}", Vibrator.NumberOfVibrators); + /// ... + /// + /// public static int NumberOfVibrators { get @@ -121,6 +132,9 @@ namespace Tizen.System /// Vibrates during the specified time with a constant intensity. /// This function can be used to start monotonous vibration for the specified time. /// + /// + /// To prevent unexpected sleep (suspend) during vibration, please check and use Power module. + /// /// 3 /// The play duration in milliseconds. /// The amount of the intensity variation (0 ~ 100). @@ -143,7 +157,8 @@ namespace Tizen.System /// } /// /// - + /// + /// public void Vibrate(int duration, int feedback) { IntPtr effect; @@ -187,6 +202,7 @@ namespace Tizen.System /// } /// /// + /// public void Stop() { if (_hapticHandle != IntPtr.Zero) @@ -202,7 +218,22 @@ namespace Tizen.System /// Dispose API for closing the internal resources. /// This function can be used to stop all the effects started by Vibrate(). /// + /// + /// Internally, it disconnects the connection to the vibrator by Vibrate(). + /// /// 3 + /// + /// + /// using Tizen.System; + /// ... + /// Vibrator vibrator = Vibrator.Vibrators[0]; + /// vibrator.Vibrate(2000, 70); + /// ... + /// vibrator.Stop(); + /// vibrator.Dispose(); + /// + /// + /// public void Dispose() { Dispose(true); diff --git a/src/Tizen.System/Device/IR.cs b/src/Tizen.System/Device/IR.cs index 67b027462..fd9f59a2a 100755 --- a/src/Tizen.System/Device/IR.cs +++ b/src/Tizen.System/Device/IR.cs @@ -38,7 +38,18 @@ namespace Tizen.System /// /// Gets the information whether the IR module is available. /// + /// + /// Gets the boolean value whether the IR module is available on the device. + /// /// 3 + /// true if the IR module is available, otherwise false. + /// + /// + /// using Tizen.System; + /// ... + /// Console.WriteLine("IR availability for this device is: {0}", IR.IsAvailable); + /// + /// public static bool IsAvailable { get @@ -54,7 +65,7 @@ namespace Tizen.System } /// - /// Transmits the IR command. + /// Transmits IR command with the specified carrier frequency and pattern. /// /// 3 /// @@ -81,6 +92,7 @@ namespace Tizen.System /// } /// /// + /// public static void Transmit(int carrierFreequency, IList pattern) { int[] patternArray = pattern.ToArray(); diff --git a/src/Tizen.System/Device/Led.cs b/src/Tizen.System/Device/Led.cs index 5f100e761..f853a891a 100755 --- a/src/Tizen.System/Device/Led.cs +++ b/src/Tizen.System/Device/Led.cs @@ -46,10 +46,20 @@ namespace Tizen.System /// /// Gets the maximum brightness value of the LED that is located next to the camera. /// + /// + /// Retrieves the maximum brightness level of the back camera flash. + /// /// 3 /// When an invalid parameter value is set. /// If the privilege is not set. /// In case the device does not support this behavior. + /// + /// + /// using Tizen.System; + /// ... + /// Console.WriteLine("Led MaxBrightness is: {0}", Led.MaxBrightness); + /// + /// public static int MaxBrightness { get @@ -107,7 +117,7 @@ namespace Tizen.System } /// - /// Plays the LED that is located at the front of the device. + /// Plays the custom effect of the service LED that is located to the front of a device. /// /// 3 /// Turn on time in milliseconds. @@ -131,6 +141,7 @@ namespace Tizen.System /// } /// /// + /// public static void Play(int on, int off, Color color) { //looks like only blink option is supported. So hard coded to default blink option. @@ -142,8 +153,11 @@ namespace Tizen.System } /// - /// Stops the LED that is located at the front of the device. + /// Stops the custom effect of the service LED that is located to the front of a device. /// + /// + /// The custom effect was started by Led.Play(int,int,Color). + /// /// 3 /// If the privilege is not set. /// In case of any system error. @@ -161,7 +175,7 @@ namespace Tizen.System /// } /// /// - + /// public static void Stop() { DeviceError res = (DeviceError)Interop.Device.DeviceLedStopCustom(); @@ -177,6 +191,20 @@ namespace Tizen.System /// StateChanged is raised when the LED state is changed. /// /// 3 + /// + /// + /// public static async Task LedEventHandler() + /// { + /// EventHandler<LedBrightnessChangedEventArgs> handler = null; + /// handler = (object sender, LedBrightnessChangedEventArgs args) => + /// { + /// Console.WriteLine("battery Level is: {0}", args.Brightness); + /// } + /// Led.BrightnessChanged += handler; + /// await Task.Delay(20000); + /// } + /// + /// public static event EventHandler BrightnessChanged { add diff --git a/src/Tizen.System/Device/PerformanceController.cs b/src/Tizen.System/Device/PerformanceController.cs index 88206eb5e..684f1f73d 100644 --- a/src/Tizen.System/Device/PerformanceController.cs +++ b/src/Tizen.System/Device/PerformanceController.cs @@ -44,6 +44,10 @@ namespace Tizen.System /// /// Increase the cpu clock within timeout. /// + /// + /// The timeout parameter specifies the duration of the CPU boost in milliseconds. + /// If the timeout value exceeds 3000 milliseconds, it will automatically be set to 3000 milliseconds. + /// /// Performance Control Type /// Cpu clock increasing duration in milliseconds. /// When an invalid parameter value is set. diff --git a/src/Tizen.System/Device/Power.cs b/src/Tizen.System/Device/Power.cs index 7c194a03f..bb770b139 100644 --- a/src/Tizen.System/Device/Power.cs +++ b/src/Tizen.System/Device/Power.cs @@ -362,6 +362,9 @@ namespace Tizen.System /// /// If the process dies, then every lock will be removed. /// + /// + /// http://tizen.org/privilege/display.state + /// /// 5 /// /// The power type to request lock. @@ -378,6 +381,8 @@ namespace Tizen.System /// Tizen.System.Power.RequestLock(Tizen.System.Power.PowerLock.Cpu, 2000); /// /// + /// + /// public static void RequestLock(PowerLock type, int timeout) { DeviceError res = (DeviceError)Interop.Device.DevicePowerRequestLock((Interop.Device.PowerLock)type, timeout); @@ -387,8 +392,14 @@ namespace Tizen.System } } /// - /// Releases the lock state. + /// Releases the given specific power lock type which was locked before. /// + /// + /// Releases the lock of specific power lock type that was previously acquired using Power.RequestLock(PowerLock,int). + /// + /// + /// http://tizen.org/privilege/display.state + /// /// 5 /// /// The power type to request lock. @@ -401,6 +412,8 @@ namespace Tizen.System /// Tizen.System.Power.ReleaseLock(Tizen.System.Power.PowerLock.Cpu); /// /// + /// + /// public static void ReleaseLock(PowerLock type) { DeviceError res = (DeviceError)Interop.Device.DevicePowerReleaseLock((Interop.Device.PowerLock)type); @@ -410,8 +423,11 @@ namespace Tizen.System } } /// - /// Power off the device. + /// Requests the current device's power state change to be changed to powered off. /// + /// + /// It operates synchronously and powers off the current device. + /// /// http://tizen.org/privilege/reboot /// platform /// If the privilege is not set. @@ -421,6 +437,7 @@ namespace Tizen.System /// Tizen.System.Power.PowerOff(); /// /// + /// 9 [EditorBrowsable(EditorBrowsableState.Never)] public static void PowerOff() { @@ -431,8 +448,11 @@ namespace Tizen.System } } /// - /// Reboot the device. + /// Sends a request to the deviced Rebooting the current device. /// + /// + /// It operates asynchronously. + /// /// http://tizen.org/privilege/reboot /// platform /// If the privilege is not set. @@ -442,6 +462,8 @@ namespace Tizen.System /// Tizen.System.Power.Reboot(null); /// /// + /// + /// 9 [EditorBrowsable(EditorBrowsableState.Never)] public static void Reboot(string reason) { @@ -472,6 +494,9 @@ namespace Tizen.System /// } /// /// + /// + /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static void ConfirmWaitCallback(UInt64 wait_callback_id) { @@ -508,6 +533,9 @@ namespace Tizen.System /// } /// /// + /// + /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static void CancelWaitCallback(UInt64 wait_callback_id) { @@ -555,6 +583,8 @@ namespace Tizen.System /// /// /// + /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static void ChangeState(PowerState state, int timeout_sec) { @@ -590,7 +620,7 @@ namespace Tizen.System #if !PROFILE_TV /// - /// Get wakeup reason. + /// Gets the reason for the last device wakeup based on the scenario. /// /// /// This api is not supported at TV profile. @@ -603,6 +633,7 @@ namespace Tizen.System /// PowerTransitionReason transition_reason = Power.GetWakeupReason(); /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static PowerTransitionReason GetWakeupReason() { @@ -627,8 +658,11 @@ namespace Tizen.System #endif /// - /// Gets the status of power lock. + /// Gets the status of power lock is locked or not based on specific power lock type. /// + /// + /// Retrieves the status of a power lock. + /// /// 10 /// Type of power lock. /// When an invalid parameter value is set. @@ -638,6 +672,8 @@ namespace Tizen.System /// PowerLockState lock_state = Power.GetLockState(PowerLock.Cpu); /// /// + /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static PowerLockState GetLockState(PowerLock type) { @@ -672,6 +708,7 @@ namespace Tizen.System /// Power.StartStateChangeRequestCallback += PowerStateChangeRequestCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler StartStateChangeRequestCallback { @@ -738,6 +775,7 @@ namespace Tizen.System /// Power.SleepStateChangeRequestCallback += PowerStateChangeRequestCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler SleepStateChangeRequestCallback { @@ -772,6 +810,7 @@ namespace Tizen.System /// Power.PoweroffStateChangeRequestCallback += PowerStateChangeRequestCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler PoweroffStateChangeRequestCallback { @@ -805,6 +844,7 @@ namespace Tizen.System /// Power.RebootStateChangeRequestCallback += PowerStateChangeRequestCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler RebootStateChangeRequestCallback { @@ -838,6 +878,7 @@ namespace Tizen.System /// Power.ExitStateChangeRequestCallback += PowerStateChangeRequestCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler ExitStateChangeRequestCallback { @@ -977,6 +1018,7 @@ namespace Tizen.System /// Power.StartStateWaitCallback += PowerStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler StartStateWaitCallback { @@ -1020,6 +1062,7 @@ namespace Tizen.System /// Power.NormalStateWaitCallback += PowerStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler NormalStateWaitCallback { @@ -1063,6 +1106,7 @@ namespace Tizen.System /// Power.SleepStateWaitCallback += PowerStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler SleepStateWaitCallback { @@ -1107,6 +1151,7 @@ namespace Tizen.System /// Power.PoweroffStateWaitCallback += PowerStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler PoweroffStateWaitCallback { @@ -1150,6 +1195,7 @@ namespace Tizen.System /// Power.RebootStateWaitCallback += PowerStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler RebootStateWaitCallback { @@ -1193,6 +1239,7 @@ namespace Tizen.System /// Power.ExitStateWaitCallback += PowerStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler ExitStateWaitCallback { @@ -1367,6 +1414,7 @@ namespace Tizen.System /// Power.TransientResumingEarlyStateWaitCallback += PowerTransientStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler TransientResumingEarlyStateWaitCallback { @@ -1409,6 +1457,7 @@ namespace Tizen.System /// Power.TransientResumingStateWaitCallback += PowerTransientStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler TransientResumingStateWaitCallback { @@ -1451,6 +1500,7 @@ namespace Tizen.System /// Power.TransientResumingLateStateWaitCallback += PowerTransientStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler TransientResumingLateStateWaitCallback { @@ -1493,6 +1543,7 @@ namespace Tizen.System /// Power.TransientSuspendingEarlyStateWaitCallback += PowerTransientStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler TransientSuspendingEarlyStateWaitCallback { @@ -1535,6 +1586,7 @@ namespace Tizen.System /// Power.TransientSuspendingStateWaitCallback += PowerTransientStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler TransientSuspendingStateWaitCallback { @@ -1577,6 +1629,7 @@ namespace Tizen.System /// Power.TransientSuspendingLateStateWaitCallback += PowerTransientStateWaitCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler TransientSuspendingLateStateWaitCallback { @@ -1744,6 +1797,7 @@ namespace Tizen.System /// Power.CpuLockStateChangedCallback += PowerLockStateChangeCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler CpuLockStateChangedCallback { @@ -1785,6 +1839,7 @@ namespace Tizen.System /// Power.DisplayNormalLockStateChangedCallback += PowerLockStateChangeCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler DisplayNormalLockStateChangedCallback { @@ -1826,6 +1881,7 @@ namespace Tizen.System /// Power.DisplayDimLockStateChangedCallback += PowerLockStateChangeCallback; /// /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public static event EventHandler DisplayDimLockStateChangedCallback {