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
%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}
/// <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>
/// <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);
/// </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" },
/// </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" },
/// 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);
/// <pre>
/// Initialize() should be called to initialize.
/// </pre>
+ /// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
/// <code>
/// IoTConnectivityClientManager.InvokePolling();
/// </code>
/// <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);
/// <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);
/// <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);
/// <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);
/// <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);
/// <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)
/// <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
/// <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
/// 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
/// </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) =>
Representation = repr,
Result = (ResponseCode)result
};
- ObserverNotified?.Invoke(null, e);
+ ObserverNotified?.Invoke(this, e);
};
IntPtr queryHandle = IntPtr.Zero;
/// <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);
{
Representation = repr
};
- CacheUpdated?.Invoke(null, e);
+ CacheUpdated?.Invoke(this, e);
}
};
/// 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>
/// <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";
/// 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" });
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);
/// 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 });
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);
/// 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() {
/// <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
/// </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" });
/// </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>
/// 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 });
/// </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);
/// </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);
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);
}
}
/// </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>
/// <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");
/// <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");
/// <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");
/// </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>
/// <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";
if (ret != (int)IoTConnectivityError.None)
{
Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type");
- throw IoTConnectivityErrorFactory.GetException(ret);
+ return "";
}
return Marshal.PtrToStringAnsi(type);
}
/// <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;
if (ret != (int)IoTConnectivityError.None)
{
Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get interface");
- throw IoTConnectivityErrorFactory.GetException(ret);
+ return "";
}
return Marshal.PtrToStringAnsi(iface);
}
/// <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");
/// <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");
/// <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");
/// </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>
/// </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");
/// </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");