}
/// <summary>
- /// Flush all caches.
- /// Frees all data that was in cache and is not currently being used to reduce memory usage. This frees Edje's, Evas' and Eet's cache.
+ /// Use FlushAllCache instead.
+ /// </summary>
+ [Obsolete("use FlushAllCache instead")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void FlushAllCashe()
+ {
+ Interop.Elementary.elm_cache_all_flush();
+ }
+
+ /// <summary>
+ /// Flushes all the cache.
+ /// Frees all data that was in cache and is not currently being used, to reduce memory usage. This frees Edje's, Evas', and Eet's cache.
/// </summary>
/// <since_tizen> preview </since_tizen>
- public static void FlushAllCashe()
+ public static void FlushAllCache()
{
Interop.Elementary.elm_cache_all_flush();
}
}
/// <summary>
- /// USB device.
+ /// USB Device
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public UsbDevice Device { get; }
/// <summary>
- /// Event Type
+ /// Event type.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public HotplugEventType EventType { get; }
}
}
/// into the data buffer.
/// </param>
/// <param name="timeout">
- /// Time (in milliseconds) that this function should wait for before giving up due to no response being
- /// received(for an unlimited timeout 0 value should be used).
+ /// The time (in milliseconds) that this function should wait for, before giving up due to no response being
+ /// received (for an unlimited timeout, 0 value should be used).
/// </param>
- /// <returns>Number of bytes actually transferred.</returns>
- /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <returns>The number of bytes actually transferred.</returns>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
- /// <exception cref="InvalidOperationException">Throws exception if device is disconnected or not opened for operation.</exception>
- /// <exception cref="TimeoutException">Throws exception if transfer timed-out.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <exception cref="InvalidOperationException">Throws an exception if the device is disconnected or not opened for an operation.</exception>
+ /// <exception cref="TimeoutException">Throws an exception if the transfer is timed out.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int Transfer(byte[] buffer, int length, uint timeout)
{
return TransferImpl(buffer, length, timeout);
}
/// <summary>
- /// Checks if device is self-powered in given configuration.
+ /// Checks if the device is self-powered in a given configuration.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public bool IsSelfPowered
{
get
}
/// <summary>
- /// Checks if device in given configuration supports remote wakeup.
+ /// Checks if the device in a given configuration supports remote wakeup.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public bool SupportRemoteWakeup
{
get
}
/// <summary>
- /// Gets maximum power required in given configuration, in mA.
+ /// Gets the maximum power required in a given configuration, in mA.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int MaximumPowerRequired
{
get
}
/// <summary>
- /// Dictionary mapping interfaces Ids to interface instances for given configuration.
+ /// A dictionary for mapping the interface IDs to interface instances for a given configuration.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public IReadOnlyDictionary<int, UsbInterface> Interfaces
{
get
}
/// <summary>
- /// Configuration string.
+ /// The configuration string.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// Throws exception if device is disconnected or not opened for operation or busy as its interfaces are currently claimed.
+ /// </exception>
+ /// <since_tizen> 4 </since_tizen>
public string ConfigurationString
{
get
}
/// <summary>
- /// Set this configuration as active configuration for the device.
+ /// Sets this configuration as an active configuration for the device.
/// </summary>
- /// <exception cref="InvalidOperationException"> Throws exception if device is disconnected or not opened for operation. </exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// Throws an exception if the device is disconnected, or not opened for an operation, or busy as its interfaces are currently claimed.
+ /// </exception>
+ /// <since_tizen> 4 </since_tizen>
public void SetAsActive()
{
ThrowIfDisposed();
private bool disposedValue = false;
/// <summary>
- /// Releases all resources used by the ConnectionProfile.
- /// It should be called after finished using of the object.</summary>
- /// <since_tizen> 5 </since_tizen>
+ /// Releases all the resources used by the ConnectionProfile.
+ /// It should be called after it has finished using the object.</summary>
+ /// <since_tizen> 4 </since_tizen>
- protected virtual void Dispose(bool disposing)
+ internal virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
/// <summary>
/// Finalizes an instance of the UsbConfiguration class.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
++ /// <since_tizen> 4 </since_tizen>
~UsbConfiguration()
{
Dispose(false);
}
/// <summary>
- /// Gets number of this endpoint.
+ /// Gets the number of this endpoint.
/// </summary>
- /// <since_tizen> 5</since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public new int Id
{
get
}
/// <summary>
- /// Gets direction of this endpoint.
+ /// Gets the direction of this endpoint.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public new EndpointDirection Direction
{
get
}
/// <summary>
- /// Gets max packet size of given endpoint.
+ /// Gets the maximum packet size of a given endpoint.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public new int MaxPacketSize
{
get
/// <param name="request">bRequest field for the setup packet.</param>
/// <param name="value">wValue field for the setup packet.</param>
/// <param name="index">wIndex field for the setup packet.</param>
- /// <param name="data">Suitably-sized data buffer for either input or output, (depending on direction bits within bmRequestType).</param>
+ /// <param name="data">Suitably-sized data buffer for either an input or output (depending on the direction bits within a bmRequestType).</param>
/// <param name="length">wLength field for the setup packet. The data buffer should be at least this size.</param>
/// <param name="timeout">
- /// Time (in milliseconds) that this function should wait for, before giving up due to no response being received
- /// (for an unlimited timeout 0 value should be used).
+ /// The time (in milliseconds) that this function should wait for, before giving up due to no response being received
+ /// (for an unlimited timeout, 0 value should be used).
/// </param>
- /// <returns>Transferred Number of transferred bytes.</returns>
+ /// <returns>Transferred number of the transferred bytes.</returns>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
- /// <exception cref="InvalidOperationException">Throws exception if device is disconnected or not opened for operation.</exception>
- /// <exception cref="TimeoutException">Throws exception if transfer timed-out.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <exception cref="InvalidOperationException">Throws an exception if the device is disconnected or not opened for an operation.</exception>
+ /// <exception cref="TimeoutException">Throws an exception if the transfer is timed out.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int Transfer(byte requestType, byte request, ushort value, ushort index, byte[] data, ushort length, uint timeout)
{
_device.ThrowIfDisposed();
/// <summary>
/// Number of the bus, this device is connected to.
/// </summary>
- /// <exception cref="UnauthorizedAccessException">Throws an exception if the user has insufficient permission on the device.</exception>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="UnauthorizedAccessException">Throws exception if user has insufficient permission on device.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public int BusId {
get
{
}
/// <summary>
- /// Address of device on the bus.
+ /// Address of the device on the bus.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int Address
{
get
}
/// <summary>
- /// List of available port numbers from a device.
+ /// List of the available port numbers from the device.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public IEnumerable<int> Ports
{
get
}
/// <summary>
- /// Checks if device is opened.
+ /// Checks if the device is opened.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public bool IsOpened
{
get
}
/// <summary>
- /// Control endpoint (endpoint 0).
+ /// Controls an endpoint (endpoint 0).
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public UsbControlEndpoint ControlEndpoint
{
get
/// <summary>
/// Active configuration for the device.
/// </summary>
- /// <exception cref="InvalidOperationException">Throws an exception if the device is disconnected.</exception>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Throws exception if device is disconnected or not opened for operation. </exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public UsbConfiguration ActiveConfiguration
{
get
}
/// <summary>
- /// Dictionary mapping configuration Ids to configuration instances for this device.
+ /// A dictionary for mapping the configuration IDs to configuration instances for this device.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public IReadOnlyDictionary<int, UsbConfiguration> Configurations
{
get
}
/// <summary>
- /// Device information such as version, class, subclass etc.
+ /// Device information such as version, class, subclass, etc.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public UsbDeviceInformation DeviceInformation
{
get
}
/// <summary>
- /// String associated with device.
+ /// String associated with the device.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="InvalidOperationException"> Throws exception if device is disconnected or not opened for operation. </exception>
+ /// <since_tizen> 4 </since_tizen>
public UsbDeviceStrings Strings
{
get
}
/// <summary>
- /// Opens device, which allows performing operations on it.
+ /// Opens the device, which allows performing operations on it.
/// </summary>
- /// <exception cref="OutOfMemoryException">Throws exception in case of insufficient memory.</exception>
- /// <exception cref="InvalidOperationException">Throws exception if device is disconnected.</exception>
- /// <exception cref="UnauthorizedAccessException">Throws exception if user has insufficient permission on device.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="OutOfMemoryException">Throws an exception in case of insufficient memory.</exception>
+ /// <exception cref="InvalidOperationException">Throws an exception if the device is disconnected.</exception>
+ /// <exception cref="UnauthorizedAccessException">Throws an exception if the user has insufficient permission on the device.</exception>
+ /// <since_tizen> 4 </since_tizen>
public void Open()
{
ThrowIfDisposed();
}
/// <summary>
- /// Closes device for operations.
+ /// Closes the device for operations.
/// </summary>
- /// <exception cref="InvalidOperationException">Throws an exception if the device is not opened for an operation.</exception>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public void Close()
{
ThrowIfDisposed();
private bool disposedValue = false;
/// <summary>
- /// Releases all resources used by the ConnectionProfile.
- /// It should be called after finished using of the object.</summary>
- /// <since_tizen> 5 </since_tizen>
+ /// Releases all the resources used by the ConnectionProfile.
+ /// It should be called after it has finished using the object.</summary>
+ /// <since_tizen> 4 </since_tizen>
- protected virtual void Dispose(bool disposing)
+ internal virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
/// <summary>
/// USB specification release number as binary-coded decimal.
/// </summary>
- /// <exception cref="UnauthorizedAccessException">Throws an exception if the user has insufficient permission on the device.</exception>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="UnauthorizedAccessException">Throws exception if user has insufficient permission on device.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public int UsbVersion
{
get
}
/// <summary>
- /// Gets device class.
+ /// Gets the device class.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int Class
{
get
}
/// <summary>
- /// Gets device sub class.
+ /// Gets the device subclass.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int Subclass
{
get
}
/// <summary>
- /// Gets device protocol.
+ /// Gets the device protocol.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int Protocol
{
get
}
/// <summary>
- /// Gets vendor id.
+ /// Gets the vendor ID.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int VendorId
{
get
}
/// <summary>
- /// Gets product id.
+ /// Gets the product ID.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int ProductId
{
get
}
/// <summary>
- /// Gets device release number in binary-coded decimal.
+ /// Gets the device release number in binary-coded decimal.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int DeviceVersion
{
get
}
/// <summary>
- /// Gets string describing device manufacturer.
+ /// Gets the string describing the device manufacturer.
/// </summary>
- /// <exception cref="InvalidOperationException">Throws an exception if the device is disconnected or not opened for an operation.</exception>
- /// <exception cref="UnauthorizedAccessException">Throws an exception if the user has insufficient permission on the device.</exception>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public string Manufacturer
{
get
}
/// <summary>
- /// Gets product string of device
+ /// Gets the product string of a device.
/// </summary>
- /// <exception cref="InvalidOperationException">Throws an exception if the device is not opened for an operation.</exception>
- /// <exception cref="UnauthorizedAccessException">Throws an exception if the user has insufficient permission on the device.</exception>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public string Product
{
get
}
/// <summary>
- /// Gets serial number of a device.
+ /// Gets the serial number of a device.
/// </summary>
- /// <exception cref="InvalidOperationException">Throws an exception if the device is not opened for an operation.</exception>
- /// <exception cref="UnauthorizedAccessException">Throws an exception if the user has insufficient permission on the device.</exception>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public string Serial
{
get
}
/// <summary>
- /// Gets number of this endpoint.
+ /// Gets the number of this endpoint.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int Id
{
get
}
/// <summary>
- /// Gets direction of this endpoint.
+ /// Gets the direction of this endpoint.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public EndpointDirection Direction
{
get
}
/// <summary>
- /// Gets max packet size of given endpoint.
+ /// Gets the maximum packet size of a given endpoint.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int MaxPacketSize
{
get
}
/// <summary>
- /// Gets number of given interface.
+ /// Gets the number of a given interface.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int Id
{
get
}
/// <summary>
- /// Sets alternative setting. Use index of new alternative setting for given interface.
+ /// Sets an alternative setting. Use the index of a new alternative setting for a given interface.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int AlternateSetting
{
set
}
/// <summary>
- /// Dictionary mapping endpoint Ids to endpoint instances for given interface.
+ /// A dictionary for mapping the endpoint IDs to endpoint instances for a given interface.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public IReadOnlyDictionary<int, UsbEndpoint> Endpoints
{
get
/// <summary>
- /// Gets string describing an interface.
+ /// Gets the string describing an interface.
/// </summary>
- /// <returns></returns>
- /// <since_tizen> 4 </since_tizen>
- public string InterfaceString()
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="InvalidOperationException">
+ /// Throws exception if device is disconnected or not opened for operation.
+ /// </exception>
+ /// <since_tizen> 5 </since_tizen>
+ public string InterfaceString
+ {
+ get
{
ThrowIfDisposed();
+ _parent.ThrowIfDeviceNotOpened();
return Interop.DescriptorString(_handle.GetStr);
}
+ }
/// <summary>
- /// Claims interface on a device. Interface must be claimed first to perform I/O operations.
+ /// Claims the interface on a device. The interface must be claimed first to perform I/O operations.
/// </summary>
- /// <param name="force">Set to true to auto detach kernel driver, false otherwise.</param>
+ /// <param name="force">Set to true to auto detach the kernel driver, false otherwise.</param>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
/// <exception cref="InvalidOperationException">
- /// Throws exception if device is disconnected or not opened for operation or another program or driver has claimed the interface.
- /// Throws an exception if the device is disconnected, or not opened for an operation, or another program or driver has claimed the interface.
++ /// Throws an exception if device is disconnected or not opened for operation or another program or driver has claimed the interface.
/// </exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public void Claim(bool force)
{
ThrowIfDisposed();
/// <summary>
- /// Releases previously claimed interface.
+ /// Releases the previously claimed interface.
/// </summary>
- /// <exception cref="InvalidOperationException">Throws an exception if the device is disconnected or not opened for an operation.</exception>
- /// <exception cref="UnauthorizedAccessException">Throws an exception if the user has insufficient permission on the device.</exception>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Throws exception if device is disconnected or not opened for operation.</exception>
+ /// <exception cref="UnauthorizedAccessException">Throws exception if user has insufficient permission on device.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public void Release()
{
ThrowIfDisposed();
}
/// <summary>
- /// Gets interval for polling endpoint for data transfers, in frame counts (refer to USB protocol specification).
+ /// Gets an interval for polling the endpoint for data transfers, in frame counts (refer to the USB protocol specification).
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public int PollingInterval
{
get
/// into the data buffer.
/// </param>
/// <param name="timeout">
- /// Time (in milliseconds) that this function should wait for before giving up due to no response being
- /// received(for an unlimited timeout 0 value should be used).
+ /// The time (in milliseconds) that this function should wait for, before giving up due to no response being
+ /// received (for an unlimited timeout, 0 value should be used).
/// </param>
- /// <returns>The number of bytes actually transferred.</returns>
- /// <exception cref="InvalidOperationException">Throws an exception if the device is disconnected or not opened for an operation.</exception>
- /// <exception cref="TimeoutException">Throws an exception if the transfer is timed out.</exception>
+ /// <returns>Number of bytes actually transferred.</returns>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Throws exception if device is disconnected or not opened for operation.</exception>
+ /// <exception cref="TimeoutException">Throws exception if transfer timed-out.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public int Transfer(byte[] buffer, int length, uint timeout)
{
return TransferImpl(buffer, length, timeout);
}
/// <summary>
- /// Gets synchronization type of this endpoint.
+ /// Gets the synchronization type of this endpoint.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public SynchronizationType SynchronizationType
{
get
}
/// <summary>
- /// Gets usage type of this endpoint.
+ /// Gets the usage type of this endpoint.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public UsageType UsageType
{
get
namespace Tizen.System.Usb
{
/// <summary>
- /// USB Manager class.
+ /// The USB Manager class.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public class UsbManager : IDisposable
{
- private readonly Interop.UsbContextHandle _context = null;
- private readonly Interop.HostHotplugHandle _hotpluggedHandle = null;
- private List<UsbDevice> _devices = new List<UsbDevice>();
+ // It needs to be static as its destroy function must be called after closing all devices and before application close.
+ // It has to be called to clean the memory used by library.
+ private static readonly Interop.UsbContextHandle _context = null;
+
+ private readonly Interop.HostHotplugHandle _hotpluggedAttachHandle = null;
+ private readonly Interop.HostHotplugHandle _hotpluggedDetachHandle = null;
+
+ static UsbManager()
+ {
+ bool isSupported;
+ Information.TryGetValue("http://tizen.org/feature/usb.host", out isSupported);
+ if (isSupported)
+ {
+ _context = Interop.UsbContextHandle.GetContextHandle();
+ }
+ }
/// <summary>
- /// USB Manager Constructor.
+ /// The USB Manager constructor.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public UsbManager()
{
- _context = new Interop.UsbContextHandle();
- _devices = _context.GetDeviceList().Select(devHandle => new UsbDevice(this, devHandle)).ToList();
- _context.SetHotplugCb(HostHotplugCallback, Interop.HotplugEventType.Any,
- IntPtr.Zero, out _hotpluggedHandle).ThrowIfFailed("Failed to set hot plugged callback");
+ if (_context == null) throw new NotSupportedException("USB host operations are not supported in this device");
+
+ IntPtr hotpluggedAttachHandle, hotpluggedDetachHandle;
+ _context.SetHotplugCb(HostHotplugAttachCallback, Interop.HotplugEventType.Attach,
+ IntPtr.Zero, out hotpluggedAttachHandle).ThrowIfFailed("Failed to set hot plugged callback");
+
+ _context.SetHotplugCb(HostHotplugDetachCallback, Interop.HotplugEventType.Detach,
+ IntPtr.Zero, out hotpluggedDetachHandle).ThrowIfFailed("Failed to set hot plugged callback");
+
+ _hotpluggedAttachHandle = new Interop.HostHotplugHandle(hotpluggedAttachHandle);
+ _hotpluggedDetachHandle = new Interop.HostHotplugHandle(hotpluggedDetachHandle);
}
/// <summary>
- /// This function returns list of USB devices attached to system.
+ /// This function returns a list of USB devices attached to the system.
/// </summary>
- /// <exception cref="NotSupportedException">Throws an exception if the USB host feature is not enabled.</exception>
- /// <exception cref="OutOfMemoryException">Throws an exception in case of insufficient memory.</exception>
- /// <exception cref="UnauthorizedAccessException">Throws an exception if the user has insufficient permission on the device.</exception>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <exception cref="OutOfMemoryException">Throws exception in case of insufficient memory.</exception>
+ /// <exception cref="UnauthorizedAccessException">Throws exception if user has insufficient permission on device.</exception>
- /// <since_tizen> 5 </since_tizen>
+ /// <since_tizen> 4 </since_tizen>
public IEnumerable<UsbDevice> AvailableDevices
{
get
}
/// <summary>
- /// Event handler for events when a USB device is attached or detached.
+ /// An event handler for events when the USB device is attached or detached.
/// </summary>
- /// <since_tizen> 5 </since_tizen>
+ /// <feature>http://tizen.org/feature/usb.host</feature>
+ /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
+ /// <since_tizen> 4 </since_tizen>
public event EventHandler<HotPluggedEventArgs> DeviceHotPlugged;
- internal void HostHotplugCallback(IntPtr devHandle, IntPtr userData)
+ internal void HostHotplugAttachCallback(IntPtr devHandle, IntPtr userData)
{
Interop.HostDeviceHandle handle = new Interop.HostDeviceHandle(devHandle);
- UsbDevice device = _devices.Where(dev => dev._handle == handle).FirstOrDefault();
- if (device == null)
+ UsbDevice device = new UsbDevice(this, handle);
+ if (DeviceHotPlugged != null)
{
- device = new UsbDevice(this, handle);
- _devices.Add(device);
+ DeviceHotPlugged.Invoke(this, new HotPluggedEventArgs(device, HotplugEventType.Attach));
+ }
- if (DeviceHotPlugged != null)
- {
- DeviceHotPlugged.Invoke(this, new HotPluggedEventArgs(device, HotplugEventType.Attach));
- }
+ //AvailableDevices.Remove(device);
+ // do we need to dispose device here ?
}
- else
- {
- if (DeviceHotPlugged != null)
- {
- DeviceHotPlugged.Invoke(this, new HotPluggedEventArgs(device, HotplugEventType.Detach));
- }
- _devices.Remove(device);
- // do we need to dispose device here ?
+ internal void HostHotplugDetachCallback(IntPtr devHandle, IntPtr userData)
+ {
+ Interop.HostDeviceHandle handle = new Interop.HostDeviceHandle(devHandle);
+ UsbDevice device = new UsbDevice(this, handle);
+ if (DeviceHotPlugged != null)
+ {
+ DeviceHotPlugged.Invoke(this, new HotPluggedEventArgs(device, HotplugEventType.Detach));
}
+
+ //AvailableDevices.Remove(device);
+ // do we need to dispose device here ?
}
internal void ThrowIfDisposed()
}
}
- /// <since_tizen> 5 </since_tizen>
+ /// <summary>
+ /// Finalizes an instance of the USB Manager Class.
+ /// </summary>
++ /// <since_tizen> 4 </since_tizen>
~UsbManager()
{
Dispose(false);
/// </privilege>
/// <exception cref="InvalidOperationException">
/// This can occur due to the following reasons:
- /// 1) The application does not have the privilege to call this function
- /// 2) Operation Failed
+ /// 1) The application does not have the privilege to call this function.
+ /// 2) Operation failed.
/// </exception>
/// <since_tizen> 4 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void Create()
{
ErrorCode error = ImeInitialize();
/// </privilege>
/// <exception cref="InvalidOperationException">
/// This can occur due to the following reasons:
- /// 1) The application does not have the privilege to call this function
- /// 2) Operation Failed
+ /// 1) The application does not have the privilege to call this function.
+ /// 2) Operation failed.
/// </exception>
/// <since_tizen> 4 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void Destroy()
{
ErrorCode error = ImeFinalize();