2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 namespace Tizen.System.Usb
22 /// USB Interrupt Endpoint class.
24 /// <since_tizen> 4 </since_tizen>
25 public class UsbInterruptEndpoint : UsbEndpoint
27 internal UsbInterruptEndpoint(UsbInterface parent, Interop.UsbEndpointHandle handle) : base(parent, handle)
32 /// Gets interval for polling endpoint for data transfers, in frame counts (refer to USB protocol specification).
34 /// <feature>http://tizen.org/feature/usb.host</feature>
35 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
36 /// <since_tizen> 4 </since_tizen>
37 public int PollingInterval
42 return Interop.NativeGet<int>(_handle.GetInterval);
47 /// Performs a USB transfer on given endpoint. Direction of transfer is determined by the endpoint.
49 /// <param name="buffer">Suitably-sized data buffer for either input or output (depending on endpoint).</param>
50 /// <param name="length">
51 /// For writes, the number of bytes from data to be sent, for reads the maximum number of bytes to receive
52 /// into the data buffer.
54 /// <param name="timeout">
55 /// Time (in milliseconds) that this function should wait for before giving up due to no response being
56 /// received(for an unlimited timeout 0 value should be used).
58 /// <returns>Number of bytes actually transferred.</returns>
59 /// <feature>http://tizen.org/feature/usb.host</feature>
60 /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
61 /// <exception cref="InvalidOperationException">Throws exception if device is disconnected or not opened for operation.</exception>
62 /// <exception cref="TimeoutException">Throws exception if transfer timed-out.</exception>
63 /// <since_tizen> 4 </since_tizen>
64 public int Transfer(byte[] buffer, int length, uint timeout)
66 return TransferImpl(buffer, length, timeout);