本文整理汇总了C++中HANDLE::tsk_read方法的典型用法代码示例。如果您正苦于以下问题:C++ HANDLE::tsk_read方法的具体用法?C++ HANDLE::tsk_read怎么用?C++ HANDLE::tsk_read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HANDLE
的用法示例。
在下文中一共展示了HANDLE::tsk_read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RequestHandler
void usb_cdc_acm_interface::RequestHandler(const void* drv,
const USBGenericRequest *pRequest, HANDLE hnd)
{
/* Check request code */
switch (pRequest->bRequest)
{
case CDCRequest_SET_LINE_CODING:
TRACE1_USB(" sLineCoding");
if (hnd->tsk_read(&lineCoding, sizeof(lineCoding), USB_SETUP_READ_TOUT)==RES_OK)
{
//read OK
TRACE_USB(" rate=%d", lineCoding.dwDTERate);
set_line_coding(drv);
usb_svc_send_control_status(hnd);
}
break;
case CDCRequest_GET_LINE_CODING:
TRACE1_USB(" gLineCoding");
hnd->tsk_write(&lineCoding, sizeof(lineCoding), USB_SETUP_WRITE_TOUT);
break;
case CDCRequest_SET_CONTROL_LINE_STATE:
{
TRACE_USB("sControlLineState(%02x) ", pRequest->wValue);
bControlLineState = (uint8_t)pRequest->wValue;
set_control_line_state(drv);
usb_svc_send_control_status(hnd);
break;
}
default:
TRACE_USB(" Unknown cdc acm request(%d)", pRequest->bRequest);
usb_svc_stall(hnd);
break;
}
}