[NUI] TCSACR-226 code change (#1032)
[platform/core/csapi/tizenfx.git] / src / Tizen.System.Usb / Usb / UsbBulkEndpoint.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 using System;
18
19 namespace Tizen.System.Usb
20 {
21     /// <summary>
22     /// The USB Bulk Endpoint class.
23     /// </summary>
24     /// <since_tizen> 4 </since_tizen>
25     public class UsbBulkEndpoint : UsbEndpoint
26     {
27         internal UsbBulkEndpoint(UsbInterface parent, Interop.UsbEndpointHandle handle) : base(parent, handle)
28         {
29         }
30
31         /// <summary>
32         /// Performs a USB transfer on a given endpoint. The direction of transfer is determined by the endpoint.
33         /// </summary>
34         /// <param name="buffer">Suitably-sized data buffer for either an input or output (depending on the endpoint).</param>
35         /// <param name="length">
36         /// For writes, the number of bytes from the data to be sent. For reads, the maximum number of bytes to receive
37         /// into the data buffer.
38         /// </param>
39         /// <param name="timeout">
40         /// The time (in milliseconds) that this function should wait for, before giving up due to no response being
41         /// received (for an unlimited timeout, 0 value should be used).
42         /// </param>
43         /// <returns>The number of bytes actually transferred.</returns>
44         /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
45         /// <exception cref="InvalidOperationException">Throws an exception if the device is disconnected or not opened for an operation.</exception>
46         /// <exception cref="TimeoutException">Throws an exception if the transfer is timed out.</exception>
47         /// <since_tizen> 4 </since_tizen>
48         public int Transfer(byte[] buffer, int length, uint timeout)
49         {
50             return TransferImpl(buffer, length, timeout);
51         }
52     }
53 }