As far as I'm aware, that macro isn't available in USBDriverKit. I think the documentation is just a copy-paste from elsewhere. (kernel headers, most likely)
In my code I've simply bitwise or'd (|
) different combinations of the various relevant constants from the header <USBDriverKit/AppleUSBDefinitions.h>
:
enum tIOUSBDeviceRequest
{
// […]
// Pick one each of direction…
kIOUSBDeviceRequestDirectionOut = (kIOUSBDeviceRequestDirectionValueOut << kIOUSBDeviceRequestDirectionPhase),
kIOUSBDeviceRequestDirectionIn = (kIOUSBDeviceRequestDirectionValueIn << kIOUSBDeviceRequestDirectionPhase),
// […]
// …request type…
kIOUSBDeviceRequestTypeStandard = (kIOUSBDeviceRequestTypeValueStandard << kIOUSBDeviceRequestTypePhase),
kIOUSBDeviceRequestTypeClass = (kIOUSBDeviceRequestTypeValueClass << kIOUSBDeviceRequestTypePhase),
kIOUSBDeviceRequestTypeVendor = (kIOUSBDeviceRequestTypeValueVendor << kIOUSBDeviceRequestTypePhase),
// […]
// …and recipient:
kIOUSBDeviceRequestRecipientDevice = (kIOUSBDeviceRequestRecipientValueDevice << kIOUSBDeviceRequestRecipientPhase),
kIOUSBDeviceRequestRecipientInterface = (kIOUSBDeviceRequestRecipientValueInterface << kIOUSBDeviceRequestRecipientPhase),
kIOUSBDeviceRequestRecipientEndpoint = (kIOUSBDeviceRequestRecipientValueEndpoint << kIOUSBDeviceRequestRecipientPhase),
kIOUSBDeviceRequestRecipientOther = (kIOUSBDeviceRequestRecipientValueOther << kIOUSBDeviceRequestRecipientPhase),
}
So, something like:
const uint8_t request_type =
kIOUSBDeviceRequestTypeVendor
| kIOUSBDeviceRequestRecipientDevice
| kIOUSBDeviceRequestDirectionIn;