HI Kevin,
My problem is very simple. How do you package arguments when you call DeviceRequest to set the BaudRate and character formats of the UART?
Basically I am looking for the implementation part of
IOUserUSBSerial::HwProgramUART() function.
In other words, I am looking for an equivalent code of previous version of AppleUSBCDCACMDriver's USBSendSetLineCoding() function:
lineParms->bCharFormat = StopBits - 2;
lineParms->bParityType = TX_Parity - 1;
lineParms->bDataBits = CharLength;
OSWriteLittleInt32(lineParms, dwDTERateOffset, BaudRate);
MER = (IOUSBDevRequest*)IOMalloc(sizeof(IOUSBDevRequest));
if (!MER)
{
XTRACE(this, 0, 0, "USBSendSetLineCoding - allocate MER failed");
return;
}
bzero(MER, sizeof(IOUSBDevRequest));
// now build the Management Element Request
MER->bmRequestType = USBmakebmRequestType(kUSBOut, kUSBClass, kUSBInterface);
MER->bRequest = kUSBSET_LINE_CODING;
MER->wValue = 0;
MER->wIndex = fCommInterfaceNumber;
MER->wLength = lcLen;
MER->pData = lineParms;
fMERCompletionInfo.parameter = MER;
rc = fControlInterface->GetDevice()->DeviceRequest(MER, &fMERCompletionInfo);
This is all I need. How to do this using the latest Driver Kit architecture?
Once again, I am looking for the code snippet of latest USBSerialDriverKit's
IOUserUSBSerial::HwProgramUART()
Thanks.
Topic:
App & System Services
SubTopic:
Drivers
Tags: