I myself implemented this:
func USBmakebmRequestType(direction:Int, type:Int, recipient:Int) -> UInt8 {
return UInt8((direction & kUSBRqDirnMask) << kUSBRqDirnShift)|UInt8((type & kUSBRqTypeMask) << kUSBRqTypeShift)|UInt8(recipient & kUSBRqRecipientMask)
}
Using:
USBmakebmRequestType(direction: kUSBIn, type: kUSBDevice, recipient: kUSBStandard)
source
share