diff options
author | Jooseok Park <jooseok.park@samsung.com> | 2017-02-27 14:33:12 +0900 |
---|---|---|
committer | Jooseok Park <jooseok.park@samsung.com> | 2017-02-27 14:42:46 +0900 |
commit | 024508a7a5c6df86f697e3160b6fbee86ad541b0 (patch) | |
tree | 1ee5937647cf5a098901cfd4c25b8989f8e552c0 | |
parent | 27d8528e7be25bfa5225cf59a013a9e75eb70e57 (diff) | |
download | iotcon-024508a7a5c6df86f697e3160b6fbee86ad541b0.tar.gz iotcon-024508a7a5c6df86f697e3160b6fbee86ad541b0.tar.bz2 iotcon-024508a7a5c6df86f697e3160b6fbee86ad541b0.zip |
Update according to design reviewsubmit/tizen/20170302.063428
- add error expeption description
- fix wrong log message
- invoke this as sender in case of nonstatic event
- do not throw expception in case of properites getter
- remove IsReadOnly property for IDictionary
Change-Id: I154daa67e22b758f5ffcdb921a82143b1d2bf575
10 files changed, 139 insertions, 66 deletions
diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs index dc3cae3..0bd797b 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs @@ -38,6 +38,9 @@ namespace Tizen.Network.IoTConnectivity /// <summary> /// The Attributes constructor /// </summary> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes(); /// </code> @@ -89,25 +92,6 @@ namespace Tizen.Network.IoTConnectivity } /// <summary> - /// Represents whether attribute is readonly - /// </summary> - /// <code> - /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { - /// { "state", "ON" }, - /// { "dim", 10 } - /// }; - /// if (attributes.IsReadOnly) - /// Console.WriteLine("Read only attribute"); - /// </code> - public bool IsReadOnly - { - get - { - return _attributes.IsReadOnly; - } - } - - /// <summary> /// Contains all the attribute keys /// </summary> /// <code> @@ -278,6 +262,9 @@ namespace Tizen.Network.IoTConnectivity /// <summary> /// Clears attributes collection /// </summary> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes(); /// attributes.Add("brightness", 50); @@ -377,6 +364,9 @@ namespace Tizen.Network.IoTConnectivity /// </summary> /// <param name="item">The attributes element to remove</param> /// <returns>true if operation is success. Otherwise, false</returns> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { /// { "state", "ON" }, @@ -395,6 +385,9 @@ namespace Tizen.Network.IoTConnectivity /// </summary> /// <param name="key">The attributes element to remove</param> /// <returns>true if operation is successful, Otherwise, false</returns> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { /// { "state", "ON" }, diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs index 1cf67f2..7711b44 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs @@ -166,6 +166,9 @@ namespace Tizen.Network.IoTConnectivity /// You must call Deinitialize() if IoTCon API is no longer needed. /// </post> /// <seealso cref="Deinitialize()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> /// <code> /// string filePath = "../../res/iotcon-test-svr-db-client.dat"; /// IoTConnectivityClientManager.Initialize(filePath); @@ -224,6 +227,7 @@ namespace Tizen.Network.IoTConnectivity /// <pre> /// Initialize() should be called to initialize. /// </pre> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> /// <code> /// IoTConnectivityClientManager.InvokePolling(); /// </code> @@ -263,6 +267,11 @@ namespace Tizen.Network.IoTConnectivity /// <seealso cref="IoTConnectivityServerManager.StopSendingPresence()"/> /// <seealso cref="StopReceivingPresence()"/> /// <seealso cref="PresenceReceived"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> /// <code> /// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => { /// Console.Log("PresenceReceived, presence id :" + e.PresenceId); @@ -354,6 +363,11 @@ namespace Tizen.Network.IoTConnectivity /// <seealso cref="IoTConnectivityServerManager.StopSendingPresence()"/> /// <seealso cref="StartReceivingPresence()"/> /// <seealso cref="PresenceReceived"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> /// <code> /// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => { /// Console.Log("PresenceReceived, presence id :" + e.PresenceId); @@ -420,6 +434,11 @@ namespace Tizen.Network.IoTConnectivity /// <seealso cref="ResourceFound"/> /// <seealso cref="ResourceFoundEventArgs"/> /// <seealso cref="TimeOut"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> /// <code> /// EventHandler<ResourceFoundEventArgs> handler = (sender, e) => { /// Console.Log("Found resource at host address :" + e.Resource.HostAddress + ", uri :" + e.Resource.UriPath); @@ -523,6 +542,11 @@ namespace Tizen.Network.IoTConnectivity /// <seealso cref="DeviceInformationFound"/> /// <seealso cref="DeviceInformationFoundEventArgs"/> /// <seealso cref="TimeOut"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> /// <code> /// EventHandler<DeviceInformationFoundEventArgs> handler = (sender, e) => { /// Console.Log("Device information found, id : " + e.RequestId + ", name : " + e.Name); @@ -616,6 +640,11 @@ namespace Tizen.Network.IoTConnectivity /// <seealso cref="PlatformInformationFound"/> /// <seealso cref="PlatformInformationFoundEventArgs"/> /// <seealso cref="TimeOut"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> /// <code> /// EventHandler<PlatformInformationFoundEventArgs> handler = (sender, e) => { /// Console.Log("PlatformInformationFound :" + e.RequestId); diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs index 30439e9..2672517 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs @@ -59,6 +59,9 @@ namespace Tizen.Network.IoTConnectivity /// <param name="policy">The policies of the resource</param> /// <param name="resourceTypes">The resource types of the resource</param> /// <param name="resourceInterfaces">The resource interfaces of the resource</param> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> public RemoteResource(string hostAddress, string uriPath, ResourcePolicy policy, ResourceTypes resourceTypes, ResourceInterfaces resourceInterfaces) { if (hostAddress == null || uriPath == null || resourceTypes == null || resourceInterfaces == null) @@ -162,6 +165,8 @@ namespace Tizen.Network.IoTConnectivity /// <summary> /// The header options of the resource /// </summary> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> public ResourceOptions Options { get @@ -189,6 +194,11 @@ namespace Tizen.Network.IoTConnectivity /// <remarks> /// Client can start caching only when this is set true. Set it to false to stop caching the resource attributes. /// </remarks> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> public bool CacheEnabled { get @@ -212,6 +222,8 @@ namespace Tizen.Network.IoTConnectivity /// Default time interval is 10 seconds.\n /// Seconds for time interval (must be in range from 1 to 3600) /// </remarks> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> public int TimeInterval { get @@ -273,6 +285,11 @@ namespace Tizen.Network.IoTConnectivity /// </privilege> /// <param name="policy">The type to specify how client wants to observe</param> /// <param name="query">The query to send to server</param> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> public void StartObserving(ObservePolicy policy, ResourceQuery query = null) { _observeCallback = (IntPtr resource, int err, int sequenceNumber, IntPtr response, IntPtr userData) => @@ -309,7 +326,7 @@ namespace Tizen.Network.IoTConnectivity Representation = repr, Result = (ResponseCode)result }; - ObserverNotified?.Invoke(null, e); + ObserverNotified?.Invoke(this, e); }; IntPtr queryHandle = IntPtr.Zero; @@ -332,6 +349,10 @@ namespace Tizen.Network.IoTConnectivity /// <privilege> /// http://tizen.org/privilege/internet /// </privilege> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> public void StopObserving() { int ret = Interop.IoTConnectivity.Client.RemoteResource.DeregisterObserve(_remoteResourceHandle); @@ -675,7 +696,7 @@ namespace Tizen.Network.IoTConnectivity { Representation = repr }; - CacheUpdated?.Invoke(null, e); + CacheUpdated?.Invoke(this, e); } }; diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs index a809f94..13d795c 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs @@ -37,6 +37,9 @@ namespace Tizen.Network.IoTConnectivity /// The Representation constructor /// </summary> /// </summary> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// Representation repr = new Representation(); /// </code> @@ -83,6 +86,9 @@ namespace Tizen.Network.IoTConnectivity /// <remarks> /// Setter can throw exceptions /// </remarks> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// Representation repr = new Representation(); /// repr.UriPath = "/a/light"; @@ -118,6 +124,9 @@ namespace Tizen.Network.IoTConnectivity /// The type of resource /// </summary> /// <seealso cref="ResourceTypes"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// Representation repr = new Representation(); /// ResourceTypes types = new ResourceTypes (new List<string>(){ "org.tizen.light" }); @@ -137,10 +146,6 @@ namespace Tizen.Network.IoTConnectivity if (ret != (int)IoTConnectivityError.None) { Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - if (typeHandle == IntPtr.Zero) - { return null; } return new ResourceTypes(typeHandle); @@ -162,6 +167,9 @@ namespace Tizen.Network.IoTConnectivity /// The interface of the resource /// </summary> /// <seealso cref="ResourceInterfaces"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// Representation repr = new Representation(); /// ResourceInterfaces ifaces = new ResourceInterfaces (new List<string>(){ ResourceInterfaces.DefaultInterface }); @@ -181,10 +189,6 @@ namespace Tizen.Network.IoTConnectivity if (ret != (int)IoTConnectivityError.None) { Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get interface"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - if (interfaceHandle == IntPtr.Zero) - { return null; } return new ResourceInterfaces(interfaceHandle); @@ -206,6 +210,9 @@ namespace Tizen.Network.IoTConnectivity /// Current attributes of the resource /// </summary> /// <seealso cref="Attributes"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// Representation repr = new Representation(); /// Attributes attributes = new Attributes() { diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs index 022c7aa..3fb5ce3 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs @@ -53,6 +53,9 @@ namespace Tizen.Network.IoTConnectivity /// <seealso cref="ResourceTypes"/> /// <seealso cref="ResourceInterfaces"/> /// <seealso cref="ResourcePolicy"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// // Create a class which inherits from Resource /// public class DoorResource : Resource @@ -155,6 +158,10 @@ namespace Tizen.Network.IoTConnectivity /// </pre> /// <seealso cref="Representation"/> /// <seealso cref="QualityOfService"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="UnauthorizedAccessException">Thrown when app does not have privilege to access</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.DefaultInterface }); /// ResourceTypes types = new ResourceTypes(new List<string>(){ "oic.iot.door.new.notify" }); diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs index bedfc4a..169bab2 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs @@ -63,6 +63,9 @@ namespace Tizen.Network.IoTConnectivity /// </summary> /// <seealso cref="Add()"/> /// <seealso cref="Remove()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(); /// </code> @@ -80,6 +83,9 @@ namespace Tizen.Network.IoTConnectivity /// Constructor of ResourceInterfaces using list of interfaces /// </summary> /// <param name="ifaces">List of resource interfaces</param> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>() /// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); @@ -161,6 +167,9 @@ namespace Tizen.Network.IoTConnectivity /// </remarks> /// <param name="item">The string data to insert into the resource interfaces</param> /// <seealso cref="Remove()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(); /// resourceInterfaces.Add(ResourceInterfaces.BatchInterface); @@ -189,6 +198,9 @@ namespace Tizen.Network.IoTConnectivity /// </summary> /// <param name="item">The string data to delete from the resource ifaces</param> /// <seealso cref="Add()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.BatchInterface }); /// resourceInterfaces.Add(ResourceInterfaces.BatchInterface); @@ -201,7 +213,7 @@ namespace Tizen.Network.IoTConnectivity int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Remove(_resourceInterfacesHandle, item); if (ret != (int)IoTConnectivityError.None) { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add interface"); + Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove interface"); throw IoTConnectivityErrorFactory.GetException(ret); } } diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs index ce17799..562f8bb 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs @@ -43,6 +43,9 @@ namespace Tizen.Network.IoTConnectivity /// </summary> /// <seealso cref="Add()"/> /// <seealso cref="Remove()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// ResourceOptions options = new ResourceOptions(); /// </code> @@ -143,22 +146,6 @@ namespace Tizen.Network.IoTConnectivity } /// <summary> - /// Represents whether the collection is readonly - /// </summary> - /// <code> - /// ResourceOptions options = new ResourceOptions(); - /// if (options.IsReadOnly) - /// Console.WriteLine("Read only options"); - /// </code> - public bool IsReadOnly - { - get - { - return _options.IsReadOnly; - } - } - - /// <summary> /// Gets or sets the option data /// </summary> /// <remarks> @@ -208,6 +195,8 @@ namespace Tizen.Network.IoTConnectivity /// <param name="key">The id of the option to insert</param> /// <param name="value">The string data to insert into the options</param> /// <seealso cref="Remove()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// ResourceOptions options = new ResourceOptions(); /// options.Add(2050, "sample-data"); @@ -238,6 +227,8 @@ namespace Tizen.Network.IoTConnectivity /// <param name="key">The id of the option to delete</param> /// <returns>True if operation is successful. Otherwise, false</returns> /// <seealso cref="Add()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// ResourceOptions options = new ResourceOptions(); /// options.Add(2050, "12345"); @@ -294,6 +285,8 @@ namespace Tizen.Network.IoTConnectivity /// <summary> /// Clears the Options collection /// </summary> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// ResourceOptions options = new ResourceOptions(); /// options.Add(2050, "12345"); diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs index 00a5f46..0d24434 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs @@ -37,6 +37,9 @@ namespace Tizen.Network.IoTConnectivity /// </summary> /// <seealso cref="Add()"/> /// <seealso cref="Remove()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// ResourceQuery query = new ResourceQuery(); /// </code> @@ -84,6 +87,9 @@ namespace Tizen.Network.IoTConnectivity /// <summary> /// Gets and sets the resource type of the query /// </summary> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// ResourceQuery query = new ResourceQuery(); /// query.Type = "org.tizen.light"; @@ -98,7 +104,7 @@ namespace Tizen.Network.IoTConnectivity if (ret != (int)IoTConnectivityError.None) { Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type"); - throw IoTConnectivityErrorFactory.GetException(ret); + return ""; } return Marshal.PtrToStringAnsi(type); } @@ -122,6 +128,9 @@ namespace Tizen.Network.IoTConnectivity /// <remarks> /// Setter value could be a value such as <see cref="ResourceInterfaces.DefaultInterface"/> /// </remarks> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// ResourceQuery query = new ResourceQuery(); /// query.Interface = ResourceInterfaces.LinkInterface; @@ -135,7 +144,7 @@ namespace Tizen.Network.IoTConnectivity if (ret != (int)IoTConnectivityError.None) { Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get interface"); - throw IoTConnectivityErrorFactory.GetException(ret); + return ""; } return Marshal.PtrToStringAnsi(iface); } @@ -208,22 +217,6 @@ namespace Tizen.Network.IoTConnectivity } /// <summary> - /// Represents whether the collection is readonly - /// </summary> - /// <code> - /// ResourceQuery query = new ResourceQuery(); - /// if (query.IsReadOnly) - /// Console.WriteLine("Read only query"); - /// </code> - public bool IsReadOnly - { - get - { - return _query.IsReadOnly; - } - } - - /// <summary> /// Gets or sets the query data /// </summary> /// <param name="key">The query key to get or set.</param> @@ -271,6 +264,9 @@ namespace Tizen.Network.IoTConnectivity /// <param name="key">The key of the query to insert</param> /// <param name="value">The string data to insert into the query</param> /// <seealso cref="Remove()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// ResourceQuery query = new ResourceQuery(); /// query.Add("key1", "value1"); @@ -300,6 +296,9 @@ namespace Tizen.Network.IoTConnectivity /// <param name="key">The id of the query to delete</param> /// <returns>True if operation is successful. Otherwise, false</returns> /// <seealso cref="Add()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// ResourceQuery query = new ResourceQuery(); /// query.Add("key1", "value1"); @@ -356,6 +355,9 @@ namespace Tizen.Network.IoTConnectivity /// <summary> /// Clears the Query collection /// </summary> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// ResourceQuery query = new ResourceQuery(); /// query.Add("key1", "value1"); diff --git a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs index 5f5900a..d01b4e1 100755 --- a/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs +++ b/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs @@ -38,6 +38,9 @@ namespace Tizen.Network.IoTConnectivity /// </summary> /// <seealso cref="Add()"/> /// <seealso cref="Remove()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="OutOfMemoryException">Thrown when there is not enough memory</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> /// <code> /// ResourceTypes types = new ResourceTypes(); /// </code> @@ -130,6 +133,9 @@ namespace Tizen.Network.IoTConnectivity /// </remarks> /// <param name="item">The string data to insert into the resource types</param> /// <seealso cref="Remove()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// ResourceTypes resourceTypes = new ResourceTypes(); /// resourceTypes.Add("org.tizen.light"); @@ -158,6 +164,9 @@ namespace Tizen.Network.IoTConnectivity /// </summary> /// <param name="item">The string data to delete from the resource types</param> /// <seealso cref="Add()"/> + /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception> + /// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception> + /// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception> /// <code> /// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" }); /// resourceTypes.Remove("oic.if.room"); diff --git a/packaging/csapi-network-iotconnectivity.spec b/packaging/csapi-network-iotconnectivity.spec index ed2b636..933df46 100644 --- a/packaging/csapi-network-iotconnectivity.spec +++ b/packaging/csapi-network-iotconnectivity.spec @@ -1,6 +1,6 @@ Name: csapi-network-iotconnectivity Summary: Tizen IoT Connectivity API for C# -Version: 1.0.1 +Version: 1.0.2 Release: 1 Group: Development/Libraries License: Apache-2.0 @@ -41,4 +41,4 @@ done %files %manifest %{name}.manifest %license LICENSE -%attr(644,root,root) %{dotnet_assembly_files}
\ No newline at end of file +%attr(644,root,root) %{dotnet_assembly_files} |