USBInstrument

public final class USBInstrument : MessageBasedInstrument, InstrumentProtocol

Undocumented

  • Declaration

    Swift

    public var bufferSize: Int
  • Declaration

    Swift

    public var buffer: UnsafeMutableRawBufferPointer
  • Declaration

    Swift

    public var session: Session
  • Declaration

    Swift

    public var identifier: String
  • Declaration

    Swift

    public var timeout: TimeInterval
  • Declaration

    Swift

    public var delegate: InstrumentDelegate?
  • Declaration

    Swift

    public var dispatchQueue: DispatchQueue
  • Undocumented

    Declaration

    Swift

    public init(session: Session, identifier: String)
  • Performs a USB control pipe transfer from the device This operation is intended for people familiar with the USB Protocol and assumes that you will do buffer management yourself

    • Return: The data buffer received from the optional data stage of the control transfer

    Declaration

    Swift

    public func usb_control_in(requestType: Int16, requestId: Int16, requestValue: UInt16, index: UInt16, length: UInt16) throws -> Data

    Parameters

    requestType

    bmRequestType; Bitmap specifying the request type in the USB standard

    requestId

    bRequest of setup stage in the USB standard

    requestValue

    wValue param of setup stage in the USB standard

    index

    wIndex parameter of setup stage in the USB standard (typically index of interface or endpoint)

    length

    wLength parameter of setup stage in the USB standard; also specifies the amount of data elements to receive data from optional data stage of the control transfer

  • Performs a USB control pipe transfer from the device This operation is intended for people familiar with the USB Protocol and assumes that you will do buffer management yourself

    Declaration

    Swift

    public func usb_control_out(requestType: Int16, requestId: Int16, requestValue: UInt16, index: UInt16, length: UInt16) throws -> Data

    Parameters

    requestType

    bmRequestType; Bitmap specifying the request type in the USB standard

    requestId

    bRequest of setup stage in the USB standard

    requestValue

    wValue param of setup stage in the USB standard

    index

    wIndex parameter of setup stage in the USB standard (typically index of interface or endpoint)

    length

    wLength parameter of setup stage in the USB standard; also specifies the size of the data buffer to send from optional data stage of the control transfer

    buffer

    data buffer that sends data from the optional data stage of the control transfer. Ignored if length is 0.

    Return Value

    The data buffer that sends the data from the optional data stage of the control transfer.