[DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_set_checking_interval")]
internal static extern int SetTimeInterval(IntPtr resource, int timeInterval);
-
- [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_device_name")]
- internal static extern int GetDeviceName(IntPtr resource, out IntPtr deviceName);
}
internal static partial class IoTCon
/// <remarks>
/// This API sets the name of the local device (the device calling the API).\n
/// If the device name is set, clients can get the name using <see cref="IoTConnectivityClientManager.StartFindingDeviceInformation()"/>.
- /// Clients can also get the name using <see cref="RemoteResource.DeviceName"/> property.
/// </remarks>
/// <param name="deviceName">The device name</param>
/// <seealso cref="IoTConnectivityClientManager.DeviceInformationFound"/>
/// <seealso cref="IoTConnectivityClientManager.StartFindingDeviceInformation()"/>
/// <seealso cref="DeviceInformationFoundEventArgs"/>
- /// <seealso cref="RemoteResource.DeviceName"/>
/// <code>
/// IoTConnectivityServerManager.SetDeviceName("my-tizen");
/// </code>
public ResourcePolicy Policy { get; private set; }
/// <summary>
- /// The device name of the remote resource
- /// </summary>
- public string DeviceName { get; private set; }
-
- /// <summary>
/// The header options of the resource
/// </summary>
/// <exception cref="NotSupportedException">Thrown when the iotcon is not supported</exception>
Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get remote resource");
throw IoTConnectivityErrorFactory.GetException(ret);
}
-
- /*IntPtr deviceName;
- ret = Interop.IoTConnectivity.Client.RemoteResource.GetDeviceName(_remoteResourceHandle, out deviceName);
- if (ret != (int)IoTConnectivityError.None)
- {
- Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device name of remote resource");
- throw IoTConnectivityErrorFactory.GetException(ret);
- }
- DeviceName = Marshal.PtrToStringAnsi(deviceName);*/
}
private void SetRemoteResource()
Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device id");
throw IoTConnectivityErrorFactory.GetException(ret);
}
- IntPtr deviceName;
- ret = Interop.IoTConnectivity.Client.RemoteResource.GetDeviceName(_remoteResourceHandle, out deviceName);
- if (ret != (int)IoTConnectivityError.None)
- {
- Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device name of remote resource");
- throw IoTConnectivityErrorFactory.GetException(ret);
- }
- DeviceName = Marshal.PtrToStringAnsi(deviceName);
DeviceId = Marshal.PtrToStringAnsi(deviceIdPtr);
HostAddress = Marshal.PtrToStringAnsi(hostAddressPtr);
UriPath = Marshal.PtrToStringAnsi(uriPathPtr);