summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3b1bb7d)
Signed-off-by: Hongkuk, Son <hongkuk.son@samsung.com>
Change-Id: I0acad01500685b6734b33687e9bf02ebf343e070
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
public Attributes()
{
int ret = Interop.IoTConnectivity.Common.Attributes.Create(out _resourceAttributesHandle);
public Attributes()
{
int ret = Interop.IoTConnectivity.Common.Attributes.Create(out _resourceAttributesHandle);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The number of keys.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The number of keys.</value>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// attributes.Add("brightness", 50);
/// var count = attributes.Count;
/// Console.WriteLine("There are {0} keys in the attribute object", count);
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// attributes.Add("brightness", 50);
/// var count = attributes.Count;
/// Console.WriteLine("There are {0} keys in the attribute object", count);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Whether an attribute is readonly.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Whether an attribute is readonly.</value>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.IsReadOnly)
/// Console.WriteLine("Read only attribute");
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.IsReadOnly)
/// Console.WriteLine("Read only attribute");
public bool IsReadOnly
{
get
public bool IsReadOnly
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the attribute keys.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the attribute keys.</value>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// var keys = attributes.Keys;
/// Console.WriteLine("Attribute contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// var keys = attributes.Keys;
/// Console.WriteLine("Attribute contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
public ICollection<string> Keys
{
get
public ICollection<string> Keys
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the attribute values.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the attribute values.</value>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// var values = attributes.Values;
/// Console.WriteLine("Attribute contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// var values = attributes.Values;
/// Console.WriteLine("Attribute contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
public ICollection<object> Values
{
get
public ICollection<object> Values
{
get
/// <value>The attribute with the specified key.</value>
/// <param name="key">The key of the attribute to get or set.</param>
/// <returns>The element with the specified key.</returns>
/// <value>The attribute with the specified key.</value>
/// <param name="key">The key of the attribute to get or set.</param>
/// <returns>The element with the specified key.</returns>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes["state"] = "ON";
/// Console.WriteLine("Attribute value for key 'state' : {0}", attributes["state"]);
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes["state"] = "ON";
/// Console.WriteLine("Attribute value for key 'state' : {0}", attributes["state"]);
public object this[string key]
{
get
public object this[string key]
{
get
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The key value pair to add.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The key value pair to add.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes.Add(new KeyValuePair<string, object> ("state", "ON"));
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes.Add(new KeyValuePair<string, object> ("state", "ON"));
+ /// ]]></code></example>
public void Add(KeyValuePair<string, object> item)
{
Add(item.Key, item.Value);
public void Add(KeyValuePair<string, object> item)
{
Add(item.Key, item.Value);
/// <param name="key">The key representing the attribute.</param>
/// <param name="value">The value representing the attribute.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <param name="key">The key representing the attribute.</param>
/// <param name="value">The value representing the attribute.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes.Add("brightness", 50);
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes.Add("brightness", 50);
public void Add(string key, object value)
{
int ret = 0;
public void Add(string key, object value)
{
int ret = 0;
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid</exception>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes.Add("brightness", 50);
/// attributes.Clear();
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes();
/// attributes.Add("brightness", 50);
/// attributes.Clear();
public void Clear()
{
foreach (string key in _attributes.Keys)
public void Clear()
{
foreach (string key in _attributes.Keys)
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The status key value pair.</param>
/// <returns>true if exists. Otherwise, false.</returns>
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The status key value pair.</param>
/// <returns>true if exists. Otherwise, false.</returns>
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.Contains(new KeyValuePair<string, object> ("dim", 10))
/// Console.WriteLine("Attribute conatins pair ('dim', 10)");
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.Contains(new KeyValuePair<string, object> ("dim", 10))
/// Console.WriteLine("Attribute conatins pair ('dim', 10)");
+ /// ]]></code></example>
public bool Contains(KeyValuePair<string, object> item)
{
return _attributes.Contains(item);
public bool Contains(KeyValuePair<string, object> item)
{
return _attributes.Contains(item);
/// <since_tizen> 3 </since_tizen>
/// <param name="key">The status key to look for.</param>
/// <returns>true if exists. Otherwise, false.</returns>
/// <since_tizen> 3 </since_tizen>
/// <param name="key">The status key to look for.</param>
/// <returns>true if exists. Otherwise, false.</returns>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.ContainsKey("dim"))
/// Console.WriteLine("Attribute conatins key : dim");
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.ContainsKey("dim"))
/// Console.WriteLine("Attribute conatins key : dim");
public bool ContainsKey(string key)
{
return _attributes.ContainsKey(key);
public bool ContainsKey(string key)
{
return _attributes.ContainsKey(key);
/// <since_tizen> 3 </since_tizen>
/// <param name="array">The destination array.</param>
/// <param name="arrayIndex">The zero-based index in an array at which copying begins.</param>
/// <since_tizen> 3 </since_tizen>
/// <param name="array">The destination array.</param>
/// <param name="arrayIndex">The zero-based index in an array at which copying begins.</param>
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// int index = 0;
/// attributes.CopyTo(dest, index);
/// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
/// int index = 0;
/// attributes.CopyTo(dest, index);
/// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
+ /// ]]></code></example>
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
{
_attributes.CopyTo(array, arrayIndex);
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
{
_attributes.CopyTo(array, arrayIndex);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns> An enumerator that can be used to iterate through the collection.</returns>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns> An enumerator that can be used to iterate through the collection.</returns>
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
+ /// ]]></code></example>
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
return _attributes.GetEnumerator();
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
return _attributes.GetEnumerator();
/// <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="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>
+ /// <example><code><![CDATA[
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.Remove(new KeyValuePair<string, object>("dim", 10)))
/// Console.WriteLine("Remove was successful");
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.Remove(new KeyValuePair<string, object>("dim", 10)))
/// Console.WriteLine("Remove was successful");
+ /// ]]></code></example>
public bool Remove(KeyValuePair<string, object> item)
{
return Remove(item.Key);
public bool Remove(KeyValuePair<string, object> item)
{
return Remove(item.Key);
/// <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="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>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.Remove("state"))
/// Console.WriteLine("Remove was successful");
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" },
/// { "dim", 10 }
/// };
/// if (attributes.Remove("state"))
/// Console.WriteLine("Remove was successful");
public bool Remove(string key)
{
int ret = Interop.IoTConnectivity.Common.Attributes.Remove(_resourceAttributesHandle, key);
public bool Remove(string key)
{
int ret = Interop.IoTConnectivity.Common.Attributes.Remove(_resourceAttributesHandle, key);
/// <param name="key">The key whose value to get.</param>
/// <param name="value"> The value associated with the specified key.</param>
/// <returns> true if the attributes collection contains an element with the specified key, otherwise, false.</returns>
/// <param name="key">The key whose value to get.</param>
/// <param name="value"> The value associated with the specified key.</param>
/// <returns> true if the attributes collection contains an element with the specified key, otherwise, false.</returns>
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" }
/// };
/// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() {
/// { "state", "ON" }
/// };
/// var isPresent = attributes.TryGetValue("state", out value);
/// if (isPresent)
/// Console.WriteLine("value : {0}", value);
/// var isPresent = attributes.TryGetValue("state", out value);
/// if (isPresent)
/// Console.WriteLine("value : {0}", value);
public bool TryGetValue(string key, out object value)
{
return _attributes.TryGetValue(key, out value);
public bool TryGetValue(string key, out object value)
{
return _attributes.TryGetValue(key, out value);
/// <pre>
/// Initialize() should be called to initialize.
/// </pre>
/// <pre>
/// Initialize() should be called to initialize.
/// </pre>
/// IoTConnectivityClientManager.Initialize();
/// IoTConnectivityClientManager.TimeOut = 120;
/// IoTConnectivityClientManager.Initialize();
/// IoTConnectivityClientManager.TimeOut = 120;
public static int TimeOut
{
get
public static int TimeOut
{
get
/// <pre>
/// Initialize() should be called to initialize.
/// </pre>
/// <pre>
/// Initialize() should be called to initialize.
/// </pre>
/// IoTConnectivityClientManager.Initialize();
/// IoTConnectivityClientManager.PollingInterval = 100;
/// IoTConnectivityClientManager.Initialize();
/// IoTConnectivityClientManager.PollingInterval = 100;
public static int PollingInterval
{
get
public static int PollingInterval
{
get
/// <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 an application does not have privilege to access.</exception>
/// <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 an application does not have privilege to access.</exception>
/// string filePath = "../../res/iotcon-test-svr-db-client.dat";
/// IoTConnectivityClientManager.Initialize(filePath);
/// string filePath = "../../res/iotcon-test-svr-db-client.dat";
/// IoTConnectivityClientManager.Initialize(filePath);
public static void Initialize(string filePath)
{
int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath);
public static void Initialize(string filePath)
{
int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath);
/// Initialize() should be called to initialize.
/// </pre>
/// <seealso cref="Initialize(string)"/>
/// Initialize() should be called to initialize.
/// </pre>
/// <seealso cref="Initialize(string)"/>
/// IoTConnectivityClientManager.Deinitialize();
/// IoTConnectivityClientManager.Deinitialize();
public static void Deinitialize()
{
s_presenceListenerId = 1;
public static void Deinitialize()
{
s_presenceListenerId = 1;
/// Initialize() should be called to initialize.
/// </pre>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// Initialize() should be called to initialize.
/// </pre>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// IoTConnectivityClientManager.InvokePolling();
/// IoTConnectivityClientManager.InvokePolling();
public static void InvokePolling()
{
int ret = Interop.IoTConnectivity.Client.IoTCon.InvokePolling();
public static void InvokePolling()
{
int ret = Interop.IoTConnectivity.Client.IoTCon.InvokePolling();
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+ /// <example><code><![CDATA[
/// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => {
/// Console.Log("PresenceReceived, presence id :" + e.PresenceId);
/// }
/// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => {
/// Console.Log("PresenceReceived, presence id :" + e.PresenceId);
/// }
/// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartReceivingPresence(IoTConnectivityClientManager.MulticastAddress, "oic.iot.door");
/// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartReceivingPresence(IoTConnectivityClientManager.MulticastAddress, "oic.iot.door");
+ /// ]]></code></example>
public static int StartReceivingPresence(string hostAddress, string resourceType)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
public static int StartReceivingPresence(string hostAddress, string resourceType)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+ /// <example><code><![CDATA[
/// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => {
/// Console.Log("PresenceReceived, presence id :" + e.PresenceId);
/// }
/// EventHandler<PresenceReceivedEventArgs> handler = (sender, e) => {
/// Console.Log("PresenceReceived, presence id :" + e.PresenceId);
/// }
/// IoTConnectivityClientManager.PresenceReceived -= handler;
/// IoTConnectivityClientManager.FindingErrorOccurred -= errorHandler;
/// IoTConnectivityClientManager.StopReceivingPresence(id);
/// IoTConnectivityClientManager.PresenceReceived -= handler;
/// IoTConnectivityClientManager.FindingErrorOccurred -= errorHandler;
/// IoTConnectivityClientManager.StopReceivingPresence(id);
+ /// ]]></code></example>
public static void StopReceivingPresence(int presenceId)
{
if (!s_presenceHandlesMap.ContainsKey((IntPtr)presenceId))
public static void StopReceivingPresence(int presenceId)
{
if (!s_presenceHandlesMap.ContainsKey((IntPtr)presenceId))
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
- /// <para>Sends request to find a resource of <paramref name="hostAddress" /> server with <paramref name="resourceType" />.
+ /// <para>Sends request to find a resource of <paramref name="hostAddress" /> server with <paramref name="query" />.
/// If succeeded, <see cref="ResourceFound"/> event handler will be triggered with information of the resource.</para>
/// If succeeded, <see cref="ResourceFound"/> event handler will be triggered with information of the resource.</para>
- /// <para><paramref name="hostAddress" /> could be <see cref="MulticastAddress"/> for the IPv4 multicast.
- /// The length of <paramref name="resourceType" /> should be less than or equal to 61. The <paramref name="resourceType" /> must start
- /// with a lowercase alphabetic character, followed by a sequence
- /// of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space.</para>
+ /// <para><paramref name="hostAddress" /> could be <see cref="MulticastAddress"/> for the IPv4 multicast.</para>
/// </remarks>
/// <privilege>http://tizen.org/privilege/internet</privilege>
/// <privlevel>public</privlevel>
/// </remarks>
/// <privilege>http://tizen.org/privilege/internet</privilege>
/// <privlevel>public</privlevel>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+ /// <example><code><![CDATA[
/// EventHandler<ResourceFoundEventArgs> handler = (sender, e) => {
/// Console.Log("Found resource at host address :" + e.Resource.HostAddress + ", uri :" + e.Resource.UriPath);
/// }
/// EventHandler<ResourceFoundEventArgs> handler = (sender, e) => {
/// Console.Log("Found resource at host address :" + e.Resource.HostAddress + ", uri :" + e.Resource.UriPath);
/// }
/// query.Type = "oic.iot.door";
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartFindingResource(null, query);
/// query.Type = "oic.iot.door";
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartFindingResource(null, query);
+ /// ]]></code></example>
public static int StartFindingResource(string hostAddress, ResourceQuery query = null)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
public static int StartFindingResource(string hostAddress, ResourceQuery query = null)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+ /// <example><code><![CDATA[
/// EventHandler<DeviceInformationFoundEventArgs> handler = (sender, e) => {
/// Console.Log("Device information found, id : " + e.RequestId + ", name : " + e.Name);
/// }
/// EventHandler<DeviceInformationFoundEventArgs> handler = (sender, e) => {
/// Console.Log("Device information found, id : " + e.RequestId + ", name : " + e.Name);
/// }
/// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartFindingDeviceInformation(IoTConnectivityClientManager.MulticastAddress);
/// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartFindingDeviceInformation(IoTConnectivityClientManager.MulticastAddress);
+ /// ]]></code></example>
public static int StartFindingDeviceInformation(string hostAddress, ResourceQuery query = null)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
public static int StartFindingDeviceInformation(string hostAddress, ResourceQuery query = null)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
+ /// <example><code><![CDATA[
/// EventHandler<PlatformInformationFoundEventArgs> handler = (sender, e) => {
/// Console.Log("PlatformInformationFound :" + e.RequestId);
/// }
/// EventHandler<PlatformInformationFoundEventArgs> handler = (sender, e) => {
/// Console.Log("PlatformInformationFound :" + e.RequestId);
/// }
/// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartFindingPlatformInformation(IoTConnectivityClientManager.MulticastAddress);
/// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler;
/// // Do not forget to remove these event handlers when they are not required any more.
/// int id = IoTConnectivityClientManager.StartFindingPlatformInformation(IoTConnectivityClientManager.MulticastAddress);
+ /// ]]></code></example>
public static int StartFindingPlatformInformation(string hostAddress, ResourceQuery query = null)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
public static int StartFindingPlatformInformation(string hostAddress, ResourceQuery query = null)
{
Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ip;
/// <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 an application does not have privilege to access</exception>
/// <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 an application does not have privilege to access</exception>
/// string filePath = "../../res/iotcon-test-svr-db-server.dat";
/// IoTConnectivityServerManager.Initialize(filePath);
/// string filePath = "../../res/iotcon-test-svr-db-server.dat";
/// IoTConnectivityServerManager.Initialize(filePath);
public static void Initialize(string filePath)
{
int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath);
public static void Initialize(string filePath)
{
int ret = Interop.IoTConnectivity.Client.IoTCon.Initialize(filePath);
/// Initialize() should be called to initialize.
/// </pre>
/// <seealso cref="Initialize(string)"/>
/// Initialize() should be called to initialize.
/// </pre>
/// <seealso cref="Initialize(string)"/>
/// IoTConnectivityServerManager.Deinitialize();
/// IoTConnectivityServerManager.Deinitialize();
public static void Deinitialize()
{
_resources.Clear();
public static void Deinitialize()
{
_resources.Clear();
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+ /// <example><code><![CDATA[
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "org.tizen.light" });
/// Attributes attributes = new Attributes { { "state", "ON" }};
/// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "org.tizen.light" });
/// Attributes attributes = new Attributes { { "state", "ON" }};
/// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
/// } catch(Exception ex) {
/// Console.Log("Exception caught : " + ex.Message);
/// }
/// } catch(Exception ex) {
/// Console.Log("Exception caught : " + ex.Message);
/// }
+ /// ]]></code></example>
public static void RegisterResource(Resource resource)
{
Log.Info(IoTConnectivityErrorFactory.LogTag, "...");
public static void RegisterResource(Resource resource)
{
Log.Info(IoTConnectivityErrorFactory.LogTag, "...");
/// <seealso cref="LiteResource"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <seealso cref="LiteResource"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
+ /// <example><code><![CDATA[
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "org.tizen.light" });
/// Attributes attributes = new Attributes { { "state", "ON" }};
/// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "org.tizen.light" });
/// Attributes attributes = new Attributes { { "state", "ON" }};
/// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes);
/// } catch(Exception ex) {
/// Console.Log("Exception caught : " + ex.Message);
/// }
/// } catch(Exception ex) {
/// Console.Log("Exception caught : " + ex.Message);
/// }
+ /// ]]></code></example>
public static void UnregisterResource(Resource resource)
{
if (resource != null)
public static void UnregisterResource(Resource resource)
{
if (resource != null)
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// try {
/// IoTConnectivityServerManager.StartSendingPresence(120);
/// } catch(Exception ex) {
/// Console.Log("Exception caught : " + ex.Message);
/// }
/// try {
/// IoTConnectivityServerManager.StartSendingPresence(120);
/// } catch(Exception ex) {
/// Console.Log("Exception caught : " + ex.Message);
/// }
public static void StartSendingPresence(uint time)
{
int ret = Interop.IoTConnectivity.Server.IoTCon.StartPresence(time);
public static void StartSendingPresence(uint time)
{
int ret = Interop.IoTConnectivity.Server.IoTCon.StartPresence(time);
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// IoTConnectivityServerManager.StopSendingPresence();
/// IoTConnectivityServerManager.StopSendingPresence();
public static void StopSendingPresence()
{
int ret = Interop.IoTConnectivity.Server.IoTCon.StopPresence();
public static void StopSendingPresence()
{
int ret = Interop.IoTConnectivity.Server.IoTCon.StopPresence();
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// IoTConnectivityServerManager.SetDeviceName("my-tizen");
/// IoTConnectivityServerManager.SetDeviceName("my-tizen");
public static void SetDeviceName(string deviceName)
{
int ret = Interop.IoTConnectivity.Server.IoTCon.SetDeviceName(deviceName);
public static void SetDeviceName(string deviceName)
{
int ret = Interop.IoTConnectivity.Server.IoTCon.SetDeviceName(deviceName);
/// <seealso cref="ResourceTypes"/>
/// <seealso cref="ResourcePolicy"/>
/// <seealso cref="Attributes"/>
/// <seealso cref="ResourceTypes"/>
/// <seealso cref="ResourcePolicy"/>
/// <seealso cref="Attributes"/>
+ /// <example><code><![CDATA[
/// List<string> list = new List<string>() { "org.tizen.light" };
/// Attributes attributes = new Attributes() {
/// { "state", "ON" }
/// };
/// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable, attributes);
/// List<string> list = new List<string>() { "org.tizen.light" };
/// Attributes attributes = new Attributes() {
/// { "state", "ON" }
/// };
/// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable, attributes);
+ /// ]]></code></example>
public LiteResource(string uri, ResourceTypes types, ResourcePolicy policy, Attributes attribs = null)
: base(uri, types, new ResourceInterfaces(new string[] { ResourceInterfaces.DefaultInterface }), policy)
{
public LiteResource(string uri, ResourceTypes types, ResourcePolicy policy, Attributes attribs = null)
: base(uri, types, new ResourceInterfaces(new string[] { ResourceInterfaces.DefaultInterface }), policy)
{
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The attributes of the lite resource.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The attributes of the lite resource.</value>
+ /// <example><code><![CDATA[
/// List<string> list = new List<string>() { "org.tizen.light" };
/// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable);
/// Attributes attributes = new Attributes() {
/// List<string> list = new List<string>() { "org.tizen.light" };
/// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable);
/// Attributes attributes = new Attributes() {
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
+ /// ]]></code></example>
public Attributes Attributes { get; set; }
/// <summary>
public Attributes Attributes { get; set; }
/// <summary>
/// </remarks>
/// <param name="attribs">The new attributes of the lite resource.</param>
/// <returns>true to accept post request, false to reject it.</returns>
/// </remarks>
/// <param name="attribs">The new attributes of the lite resource.</param>
/// <returns>true to accept post request, false to reject it.</returns>
/// public class MyLightResource : LiteResource
/// {
/// protected override bool OnPost(Attributes attributes)
/// public class MyLightResource : LiteResource
/// {
/// protected override bool OnPost(Attributes attributes)
/// return false;
/// }
/// }
/// return false;
/// }
/// }
protected virtual bool OnPost(Attributes attribs)
{
return true;
protected virtual bool OnPost(Attributes attribs)
{
return true;
/// <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>
/// <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>
/// Representation repr = new Representation();
/// Representation repr = new Representation();
public Representation()
{
int ret = Interop.IoTConnectivity.Common.Representation.Create(out _representationHandle);
public Representation()
{
int ret = Interop.IoTConnectivity.Common.Representation.Create(out _representationHandle);
/// <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="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>
/// Representation repr = new Representation();
/// repr.UriPath = "/a/light";
/// Console.WriteLine("URI is {0}", repr.UriPath); //Getter
/// Representation repr = new Representation();
/// repr.UriPath = "/a/light";
/// Console.WriteLine("URI is {0}", repr.UriPath); //Getter
public string UriPath
{
get
public string UriPath
{
get
/// <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="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>
+ /// <example><code><![CDATA[
/// Representation repr = new Representation();
/// ResourceTypes types = new ResourceTypes (new List<string>(){ "org.tizen.light" });
/// repr.Type = types;
/// Representation repr = new Representation();
/// ResourceTypes types = new ResourceTypes (new List<string>(){ "org.tizen.light" });
/// repr.Type = types;
/// {
/// Console.WriteLine("Type is {0}", item);
/// }
/// {
/// Console.WriteLine("Type is {0}", item);
/// }
+ /// ]]></code></example>
public ResourceTypes Type
{
get
public ResourceTypes Type
{
get
/// <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="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>
+ /// <example><code><![CDATA[
/// Representation repr = new Representation();
/// ResourceInterfaces ifaces = new ResourceInterfaces (new List<string>(){ ResourceInterfaces.DefaultInterface });
/// repr.Interface = ifaces;
/// Representation repr = new Representation();
/// ResourceInterfaces ifaces = new ResourceInterfaces (new List<string>(){ ResourceInterfaces.DefaultInterface });
/// repr.Interface = ifaces;
/// {
/// Console.WriteLine("Interface is {0}", iface);
/// }
/// {
/// Console.WriteLine("Interface is {0}", iface);
/// }
+ /// ]]></code></example>
public ResourceInterfaces Interface
{
get
public ResourceInterfaces Interface
{
get
/// <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="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>
/// Representation repr = new Representation();
/// Attributes attributes = new Attributes() {
/// { "state", "ON" },
/// Representation repr = new Representation();
/// Attributes attributes = new Attributes() {
/// { "state", "ON" },
/// string strval = newAttributes["state"] as string;
/// int intval = (int)newAttributes["dim"];
/// Console.WriteLine("attributes are {0} and {1}", strval, intval);
/// string strval = newAttributes["state"] as string;
/// int intval = (int)newAttributes["dim"];
/// Console.WriteLine("attributes are {0} and {1}", strval, intval);
public Attributes Attributes
{
get
public Attributes Attributes
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>List of Child resource representation.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>List of Child resource representation.</value>
+ /// <example><code><![CDATA[
/// Representation repr = new Representation();
/// Representation child1 = new Representation();
/// ResourceTypes types1 = new ResourceTypes(new List<string>() { "org.tizen.light" });
/// Representation repr = new Representation();
/// Representation child1 = new Representation();
/// ResourceTypes types1 = new ResourceTypes(new List<string>() { "org.tizen.light" });
/// {
/// Console.WriteLine("Exception caught : " + ex.Message);
/// }
/// {
/// Console.WriteLine("Exception caught : " + ex.Message);
/// }
+ /// ]]></code></example>
public ICollection<Representation> Children
{
get
public ICollection<Representation> Children
{
get
/// <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>
/// <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>
+ /// <example><code><![CDATA[
/// // Create a class which inherits from Resource
/// public class DoorResource : Resource
/// {
/// // Create a class which inherits from Resource
/// public class DoorResource : Resource
/// {
/// ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.DefaultInterface });
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "oic.iot.door.new" });
/// Resource resource = new DoorResource("/door/uri1", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
/// ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.DefaultInterface });
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "oic.iot.door.new" });
/// Resource resource = new DoorResource("/door/uri1", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
+ /// ]]></code></example>
protected Resource(string uri, ResourceTypes types, ResourceInterfaces interfaces, ResourcePolicy policy)
{
UriPath = uri;
protected Resource(string uri, ResourceTypes types, ResourceInterfaces interfaces, ResourcePolicy policy)
{
UriPath = uri;
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="UnauthorizedAccessException">Thrown when an application does not have privilege to access.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
+ /// <example><code><![CDATA[
/// ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.DefaultInterface });
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "oic.iot.door.new.notify" });
/// Resource resource = new DoorResource("/door/uri/new/notify", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
/// ResourceInterfaces ifaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.DefaultInterface });
/// ResourceTypes types = new ResourceTypes(new List<string>(){ "oic.iot.door.new.notify" });
/// Resource resource = new DoorResource("/door/uri/new/notify", types, ifaces, ResourcePolicy.Discoverable | ResourcePolicy.Observable);
/// _attribute, 1 }
/// };
/// resource.Notify(repr, QualityOfService.High);
/// _attribute, 1 }
/// };
/// resource.Notify(repr, QualityOfService.High);
+ /// ]]></code></example>
public void Notify(Representation representation, QualityOfService qos)
{
int ret = (int)IoTConnectivityError.None;
public void Notify(Representation representation, QualityOfService qos)
{
int ret = (int)IoTConnectivityError.None;
/// <seealso cref="Remove(string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <seealso cref="Remove(string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces();
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces();
public ResourceInterfaces()
{
int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle);
public ResourceInterfaces()
{
int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle);
/// <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>
/// <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>
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
+ /// ]]></code></example>
public ResourceInterfaces(IEnumerable<string> ifaces)
{
int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle);
public ResourceInterfaces(IEnumerable<string> ifaces)
{
int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Count of interfaces in the list.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Count of interfaces in the list.</value>
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// Console.WriteLine("There are {0} interfaces", resourceInterfaces.Count);
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// Console.WriteLine("There are {0} interfaces", resourceInterfaces.Count);
+ /// ]]></code></example>
/// <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>
/// <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>
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces();
/// resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces();
/// resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
public void Add(string item)
{
if (IsValid(item))
public void Add(string item)
{
if (IsValid(item))
/// <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="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>
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.BatchInterface });
/// resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>(){ ResourceInterfaces.BatchInterface });
/// resourceInterfaces.Add(ResourceInterfaces.BatchInterface);
+ /// ]]></code></example>
public void Remove(string item)
{
bool isRemoved = _resourceInterfaces.Remove(item);
public void Remove(string item)
{
bool isRemoved = _resourceInterfaces.Remove(item);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// foreach(string item in resourceInterfaces)
/// {
/// Console.WriteLine("Interface : {0}", item);
/// }
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// foreach(string item in resourceInterfaces)
/// {
/// Console.WriteLine("Interface : {0}", item);
/// }
+ /// ]]></code></example>
public IEnumerator<string> GetEnumerator()
{
return _resourceInterfaces.GetEnumerator();
public IEnumerator<string> GetEnumerator()
{
return _resourceInterfaces.GetEnumerator();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
+ /// <example><code><![CDATA[
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// foreach(string item in resourceInterfaces)
/// {
/// Console.WriteLine("Interface : {0}", item);
/// }
/// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List<string>()
/// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface });
/// foreach(string item in resourceInterfaces)
/// {
/// Console.WriteLine("Interface : {0}", item);
/// }
+ /// ]]></code></example>
IEnumerator IEnumerable.GetEnumerator()
{
return _resourceInterfaces.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator()
{
return _resourceInterfaces.GetEnumerator();
/// <seealso cref="Remove(ushort)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <seealso cref="Remove(ushort)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// ResourceOptions options = new ResourceOptions();
/// ResourceOptions options = new ResourceOptions();
public ResourceOptions()
{
int ret = Interop.IoTConnectivity.Common.Options.Create(out _resourceOptionsHandle);
public ResourceOptions()
{
int ret = Interop.IoTConnectivity.Common.Options.Create(out _resourceOptionsHandle);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the Option keys.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the Option keys.</value>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// options.Add(2055, "sample value");
/// var keys = options.Keys;
/// Console.WriteLine("Resource options contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// options.Add(2055, "sample value");
/// var keys = options.Keys;
/// Console.WriteLine("Resource options contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
public ICollection<ushort> Keys
{
get
public ICollection<ushort> Keys
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the Option values.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the Option values.</value>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// options.Add(2055, "sample value");
/// var values = options.Values;
/// Console.WriteLine("Resource options contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// options.Add(2055, "sample value");
/// var values = options.Values;
/// Console.WriteLine("Resource options contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
public ICollection<string> Values
{
get
public ICollection<string> Values
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The number of options.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The number of options.</value>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// options.Add(2055, "sample value");
/// var count = options.Count;
/// Console.WriteLine("There are {0} keys in the options object", count);
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// options.Add(2055, "sample value");
/// var count = options.Count;
/// Console.WriteLine("There are {0} keys in the options object", count);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Whether the collection is readonly.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Whether the collection is readonly.</value>
/// ResourceOptions options = new ResourceOptions();
/// if (options.IsReadOnly)
/// Console.WriteLine("Read only options");
/// ResourceOptions options = new ResourceOptions();
/// if (options.IsReadOnly)
/// Console.WriteLine("Read only options");
public bool IsReadOnly
{
get
public bool IsReadOnly
{
get
/// <value>The option data.</value>
/// <param name="key">The option ID to get or set.</param>
/// <returns>The option with the specified ID.</returns>
/// <value>The option data.</value>
/// <param name="key">The option ID to get or set.</param>
/// <returns>The option with the specified ID.</returns>
/// ResourceOptions options = new ResourceOptions();
/// options[2055] = "sample-data";
/// Console.WriteLine("Option has : {0}", options[2055]);
/// ResourceOptions options = new ResourceOptions();
/// options[2055] = "sample-data";
/// Console.WriteLine("Option has : {0}", options[2055]);
public string this[ushort key]
{
get
public string this[ushort key]
{
get
/// <since_tizen> 3 </since_tizen>
/// <param name="key">The key to look for.</param>
/// <returns>true if exists. Otherwise, false.</returns>
/// <since_tizen> 3 </since_tizen>
/// <param name="key">The key to look for.</param>
/// <returns>true if exists. Otherwise, false.</returns>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// if (options.ContainsKey(2050))
/// Console.WriteLine("options conatins key : 2050");
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// if (options.ContainsKey(2050))
/// Console.WriteLine("options conatins key : 2050");
public bool ContainsKey(ushort key)
{
return _options.ContainsKey(key);
public bool ContainsKey(ushort key)
{
return _options.ContainsKey(key);
/// <seealso cref="Remove(ushort)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <seealso cref="Remove(ushort)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "sample-data");
public void Add(ushort key, string value)
{
int ret = (int)IoTConnectivityError.InvalidParameter;
public void Add(ushort key, string value)
{
int ret = (int)IoTConnectivityError.InvalidParameter;
/// <seealso cref="Add(ushort, string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <seealso cref="Add(ushort, string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "12345");
/// var result = options.Remove(2050);
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "12345");
/// var result = options.Remove(2050);
public bool Remove(ushort key)
{
int ret = Interop.IoTConnectivity.Common.Options.Remove(_resourceOptionsHandle, key);
public bool Remove(ushort key)
{
int ret = Interop.IoTConnectivity.Common.Options.Remove(_resourceOptionsHandle, key);
/// <param name="key">The option ID.</param>
/// <param name="value">Value corresponding to option ID.</param>
/// <returns>True if the key exists, false otherwise.</returns>
/// <param name="key">The option ID.</param>
/// <param name="value">Value corresponding to option ID.</param>
/// <returns>True if the key exists, false otherwise.</returns>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "12345");
/// string value;
/// var isPresent = options.TryGetValue(2050, out value);
/// if (isPresent)
/// Console.WriteLine("value : {0}", value);
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "12345");
/// string value;
/// var isPresent = options.TryGetValue(2050, out value);
/// if (isPresent)
/// Console.WriteLine("value : {0}", value);
public bool TryGetValue(ushort key, out string value)
{
return _options.TryGetValue(key, out value);
public bool TryGetValue(ushort key, out string value)
{
return _options.TryGetValue(key, out value);
/// <param name="item">The key value pair.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Remove(KeyValuePair{ushort, string})"/>
/// <param name="item">The key value pair.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Remove(KeyValuePair{ushort, string})"/>
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
+ /// ]]></code></example>
public void Add(KeyValuePair<ushort, string> item)
{
Add(item.Key, item.Value);
public void Add(KeyValuePair<ushort, string> item)
{
Add(item.Key, item.Value);
/// <since_tizen> 3 </since_tizen>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <since_tizen> 3 </since_tizen>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "12345");
/// options.Add(2055, "sample");
/// options.Clear();
/// ResourceOptions options = new ResourceOptions();
/// options.Add(2050, "12345");
/// options.Add(2055, "sample");
/// options.Clear();
public void Clear()
{
foreach (ushort key in Keys)
public void Clear()
{
foreach (ushort key in Keys)
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The key value pair.</param>
/// <returns>True if exists. Otherwise, false.</returns>
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The key value pair.</param>
/// <returns>True if exists. Otherwise, false.</returns>
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// var isPresent = options.Contains(new KeyValuePair<ushort, string>(2050, "12345"));
/// if (isPresent)
/// Console.WriteLine("Key value pair is present");
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// var isPresent = options.Contains(new KeyValuePair<ushort, string>(2050, "12345"));
/// if (isPresent)
/// Console.WriteLine("Key value pair is present");
+ /// ]]></code></example>
public bool Contains(KeyValuePair<ushort, string> item)
{
return _options.Contains(item);
public bool Contains(KeyValuePair<ushort, string> item)
{
return _options.Contains(item);
/// <since_tizen> 3 </since_tizen>
/// <param name="array">The destination array.</param>
/// <param name="arrayIndex">Index parameter.</param>
/// <since_tizen> 3 </since_tizen>
/// <param name="array">The destination array.</param>
/// <param name="arrayIndex">Index parameter.</param>
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// KeyValuePair<ushort, string>[] dest = new KeyValuePair<ushort, string>[options.Count];
/// options.CopyTo(dest, 0);
/// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// KeyValuePair<ushort, string>[] dest = new KeyValuePair<ushort, string>[options.Count];
/// options.CopyTo(dest, 0);
/// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
+ /// ]]></code></example>
public void CopyTo(KeyValuePair<ushort, string>[] array, int arrayIndex)
{
_options.CopyTo(array, arrayIndex);
public void CopyTo(KeyValuePair<ushort, string>[] array, int arrayIndex)
{
_options.CopyTo(array, arrayIndex);
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Add(KeyValuePair{ushort, string})"/>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Add(KeyValuePair{ushort, string})"/>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter</exception>
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// var result = options.Remove(new KeyValuePair<ushort, string>(2050, "12345"));
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "12345"));
/// var result = options.Remove(new KeyValuePair<ushort, string>(2050, "12345"));
+ /// ]]></code></example>
public bool Remove(KeyValuePair<ushort, string> item)
{
return Remove(item.Key);
public bool Remove(KeyValuePair<ushort, string> item)
{
return Remove(item.Key);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>Enumerator to option pairs.</returns>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>Enumerator to option pairs.</returns>
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "sample1"));
/// options.Add(new KeyValuePair<ushort, string>(2055, "sample2"));
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "sample1"));
/// options.Add(new KeyValuePair<ushort, string>(2055, "sample2"));
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
+ /// ]]></code></example>
public IEnumerator<KeyValuePair<ushort, string>> GetEnumerator()
{
return _options.GetEnumerator();
public IEnumerator<KeyValuePair<ushort, string>> GetEnumerator()
{
return _options.GetEnumerator();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>Enumerator to option pairs.</returns>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>Enumerator to option pairs.</returns>
+ /// <example><code><![CDATA[
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "sample1"));
/// options.Add(new KeyValuePair<ushort, string>(2055, "sample2"));
/// ResourceOptions options = new ResourceOptions();
/// options.Add(new KeyValuePair<ushort, string>(2050, "sample1"));
/// options.Add(new KeyValuePair<ushort, string>(2055, "sample2"));
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
+ /// ]]></code></example>
IEnumerator IEnumerable.GetEnumerator()
{
return _options.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator()
{
return _options.GetEnumerator();
/// <seealso cref="Remove(string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <seealso cref="Remove(string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// ResourceQuery query = new ResourceQuery();
/// ResourceQuery query = new ResourceQuery();
public ResourceQuery()
{
int ret = Interop.IoTConnectivity.Common.Query.Create(out _resourceQueryHandle);
public ResourceQuery()
{
int ret = Interop.IoTConnectivity.Common.Query.Create(out _resourceQueryHandle);
/// <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="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>
/// ResourceQuery query = new ResourceQuery();
/// query.Type = "org.tizen.light";
/// Console.WriteLine("Type of query : {0}", query.Type);
/// ResourceQuery query = new ResourceQuery();
/// query.Type = "org.tizen.light";
/// Console.WriteLine("Type of query : {0}", query.Type);
/// <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="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>
/// ResourceQuery query = new ResourceQuery();
/// query.Interface = ResourceInterfaces.LinkInterface;
/// ResourceQuery query = new ResourceQuery();
/// query.Interface = ResourceInterfaces.LinkInterface;
public string Interface
{
get
public string Interface
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the query keys.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the query keys.</value>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key", "value");
/// query.Add("newKey", "sample value");
/// var keys = query.Keys;
/// Console.WriteLine("Resource query contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key", "value");
/// query.Add("newKey", "sample value");
/// var keys = query.Keys;
/// Console.WriteLine("Resource query contains keys {0} and {1}", keys.ElementAt(0), keys.ElementAt(1));
public ICollection<string> Keys
{
get
public ICollection<string> Keys
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the query values.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>All the query values.</value>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key", "value");
/// query.Add("newKey", "sample value");
/// var values = query.Values;
/// Console.WriteLine("Resource query contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key", "value");
/// query.Add("newKey", "sample value");
/// var values = query.Values;
/// Console.WriteLine("Resource query contains values {0} and {1}", values.ElementAt(0), values.ElementAt(1));
public ICollection<string> Values
{
get
public ICollection<string> Values
{
get
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The number of query elements.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>The number of query elements.</value>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key", "value");
/// query.Add("newKey", "sample value");
/// var count = query.Count;
/// Console.WriteLine("There are {0} keys in the query object", count);
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key", "value");
/// query.Add("newKey", "sample value");
/// var count = query.Count;
/// Console.WriteLine("There are {0} keys in the query object", count);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Whether the collection is readonly.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Whether the collection is readonly.</value>
/// ResourceQuery query = new ResourceQuery();
/// if (query.IsReadOnly)
/// Console.WriteLine("Read only query");
/// ResourceQuery query = new ResourceQuery();
/// if (query.IsReadOnly)
/// Console.WriteLine("Read only query");
public bool IsReadOnly
{
get
public bool IsReadOnly
{
get
/// <value>The query data.</value>
/// <param name="key">The query key to get or set.</param>
/// <returns>The query with the specified key.</returns>
/// <value>The query data.</value>
/// <param name="key">The query key to get or set.</param>
/// <returns>The query with the specified key.</returns>
/// ResourceQuery query = new ResourceQuery();
/// query["key1"] = "sample-data";
/// Console.WriteLine("query has : {0}", query["key1"]);
/// ResourceQuery query = new ResourceQuery();
/// query["key1"] = "sample-data";
/// Console.WriteLine("query has : {0}", query["key1"]);
public string this[string key]
{
get
public string this[string key]
{
get
/// <since_tizen> 3 </since_tizen>
/// <param name="key">The key to look for.</param>
/// <returns>true if exists. Otherwise, false.</returns>
/// <since_tizen> 3 </since_tizen>
/// <param name="key">The key to look for.</param>
/// <returns>true if exists. Otherwise, false.</returns>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// if (query.ContainsKey("key1"))
/// Console.WriteLine("query conatins key : key1");
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// if (query.ContainsKey("key1"))
/// Console.WriteLine("query conatins key : key1");
public bool ContainsKey(string key)
{
return _query.ContainsKey(key);
public bool ContainsKey(string key)
{
return _query.ContainsKey(key);
/// <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="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>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
public void Add(string key, string value)
{
if (CanAddQuery(key, value))
public void Add(string key, string value)
{
if (CanAddQuery(key, value))
/// <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="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>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// var result = query.Remove("key1");
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// var result = query.Remove("key1");
public bool Remove(string key)
{
int ret = Interop.IoTConnectivity.Common.Query.Remove(_resourceQueryHandle, key);
public bool Remove(string key)
{
int ret = Interop.IoTConnectivity.Common.Query.Remove(_resourceQueryHandle, key);
/// <param name="key">The query key.</param>
/// <param name="value">Value corresponding to query key.</param>
/// <returns>True if the key exists, false otherwise.</returns>
/// <param name="key">The query key.</param>
/// <param name="value">Value corresponding to query key.</param>
/// <returns>True if the key exists, false otherwise.</returns>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// string value;
/// var isPresent = query.TryGetValue("key1", out value);
/// if (isPresent)
/// Console.WriteLine("value : {0}", value);
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// string value;
/// var isPresent = query.TryGetValue("key1", out value);
/// if (isPresent)
/// Console.WriteLine("value : {0}", value);
public bool TryGetValue(string key, out string value)
{
return _query.TryGetValue(key, out value);
public bool TryGetValue(string key, out string value)
{
return _query.TryGetValue(key, out value);
/// <param name="item">The key value pair.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Remove(KeyValuePair{string, string})"/>
/// <param name="item">The key value pair.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Remove(KeyValuePair{string, string})"/>
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
+ /// ]]></code></example>
public void Add(KeyValuePair<string, string> item)
{
Add(item.Key, item.Value);
public void Add(KeyValuePair<string, string> item)
{
Add(item.Key, item.Value);
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="InvalidOperationException">Thrown when the operation is invalid.</exception>
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// query.Add("key2", "value2");
/// query.Clear();
/// ResourceQuery query = new ResourceQuery();
/// query.Add("key1", "value1");
/// query.Add("key2", "value2");
/// query.Clear();
public void Clear()
{
foreach (string key in _query.Keys)
public void Clear()
{
foreach (string key in _query.Keys)
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The key value pair.</param>
/// <returns>True if exists. Otherwise, false.</returns>
/// <since_tizen> 3 </since_tizen>
/// <param name="item">The key value pair.</param>
/// <returns>True if exists. Otherwise, false.</returns>
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// var isPresent = query.Contains(new KeyValuePair<string, string>("key1", "value1"));
/// if (isPresent)
/// Console.WriteLine("Key value pair is present");
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// var isPresent = query.Contains(new KeyValuePair<string, string>("key1", "value1"));
/// if (isPresent)
/// Console.WriteLine("Key value pair is present");
+ /// ]]></code></example>
public bool Contains(KeyValuePair<string, string> item)
{
return _query.Contains(item);
public bool Contains(KeyValuePair<string, string> item)
{
return _query.Contains(item);
/// <since_tizen> 3 </since_tizen>
/// <param name="array">The destination array.</param>
/// <param name="arrayIndex">Index parameter.</param>
/// <since_tizen> 3 </since_tizen>
/// <param name="array">The destination array.</param>
/// <param name="arrayIndex">Index parameter.</param>
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// KeyValuePair<string, string>[] dest = new KeyValuePair<string, string>[query.Count];
/// query.CopyTo(dest, 0);
/// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// KeyValuePair<string, string>[] dest = new KeyValuePair<string, string>[query.Count];
/// query.CopyTo(dest, 0);
/// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value);
+ /// ]]></code></example>
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
{
_query.CopyTo(array, arrayIndex);
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
{
_query.CopyTo(array, arrayIndex);
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Add(KeyValuePair{string, string})"/>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <seealso cref="Add(KeyValuePair{string, string})"/>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// var result = query.Remove(new KeyValuePair<string, string>("key1", "value1"));
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// var result = query.Remove(new KeyValuePair<string, string>("key1", "value1"));
+ /// ]]></code></example>
public bool Remove(KeyValuePair<string, string> item)
{
return Remove(item.Key);
public bool Remove(KeyValuePair<string, string> item)
{
return Remove(item.Key);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>Enumerator to query pairs.</returns>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>Enumerator to query pairs.</returns>
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// query.Add(new KeyValuePair<string, string>("key2", "value2"));
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// query.Add(new KeyValuePair<string, string>("key2", "value2"));
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
+ /// ]]></code></example>
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{
return _query.GetEnumerator();
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{
return _query.GetEnumerator();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator to the query pairs.</returns>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator to the query pairs.</returns>
+ /// <example><code><![CDATA[
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// query.Add(new KeyValuePair<string, string>("key2", "value2"));
/// ResourceQuery query = new ResourceQuery();
/// query.Add(new KeyValuePair<string, string>("key1", "value1"));
/// query.Add(new KeyValuePair<string, string>("key2", "value2"));
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
/// {
/// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value);
/// }
+ /// ]]></code></example>
IEnumerator IEnumerable.GetEnumerator()
{
return _query.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator()
{
return _query.GetEnumerator();
/// <seealso cref="Remove(string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// <seealso cref="Remove(string)"/>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported.</exception>
/// <exception cref="OutOfMemoryException">Thrown when there is not enough memory.</exception>
/// ResourceTypes types = new ResourceTypes();
/// ResourceTypes types = new ResourceTypes();
public ResourceTypes()
{
int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle);
public ResourceTypes()
{
int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle);
/// <param name="types">List of resource types.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
/// <param name="types">List of resource types.</param>
/// <feature>http://tizen.org/feature/iot.ocf</feature>
/// <exception cref="ArgumentException">Thrown when there is an invalid parameter.</exception>
+ /// <example><code><![CDATA[
/// ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
+ /// ]]></code></example>
public ResourceTypes(IEnumerable<string> types)
{
int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle);
public ResourceTypes(IEnumerable<string> types)
{
int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Count of types in the list.</value>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <value>Count of types in the list.</value>
+ /// <example><code><![CDATA[
/// ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// Console.WriteLine("There are {0} items", types.Count);
/// ResourceTypes types = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// Console.WriteLine("There are {0} items", types.Count);
+ /// ]]></code></example>
/// <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="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>
/// ResourceTypes resourceTypes = new ResourceTypes();
/// resourceTypes.Add("org.tizen.light");
/// ResourceTypes resourceTypes = new ResourceTypes();
/// resourceTypes.Add("org.tizen.light");
public void Add(string item)
{
if (IsValid(item))
public void Add(string item)
{
if (IsValid(item))
/// <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="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>
+ /// <example><code><![CDATA[
/// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// resourceTypes.Remove("oic.if.room");
/// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// resourceTypes.Remove("oic.if.room");
+ /// ]]></code></example>
public void Remove(string item)
{
int ret = Interop.IoTConnectivity.Common.ResourceTypes.Remove(_resourceTypeHandle, item);
public void Remove(string item)
{
int ret = Interop.IoTConnectivity.Common.ResourceTypes.Remove(_resourceTypeHandle, item);
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
+ /// <example><code><![CDATA[
/// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// foreach(string item in resourceTypes)
/// {
/// Console.WriteLine("Type : {0}", item);
/// }
/// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// foreach(string item in resourceTypes)
/// {
/// Console.WriteLine("Type : {0}", item);
/// }
+ /// ]]></code></example>
public IEnumerator<string> GetEnumerator()
{
return _resourceTypes.GetEnumerator();
public IEnumerator<string> GetEnumerator()
{
return _resourceTypes.GetEnumerator();
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <returns>The enumerator.</returns>
+ /// <example><code><![CDATA[
/// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// foreach(string item in resourceTypes)
/// {
/// Console.WriteLine("Type : {0}", item);
/// }
/// ResourceTypes resourceTypes = new ResourceTypes(new List<string>() { "org.tizen.light", "oic.if.room" });
/// foreach(string item in resourceTypes)
/// {
/// Console.WriteLine("Type : {0}", item);
/// }
+ /// ]]></code></example>
IEnumerator IEnumerable.GetEnumerator()
{
return _resourceTypes.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator()
{
return _resourceTypes.GetEnumerator();
/// Constructor of Response.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// Constructor of Response.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// Response response = new Response();
/// Response response = new Response();
public Response() { }
/// <summary>
public Response() { }
/// <summary>