打印

管道传输方式参数

[复制链接]
584|7
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
栩栩如生|  楼主 | 2016-5-19 19:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
usb上位机的管道传输方式参数在哪里?
沙发
houcs| | 2016-5-19 19:15 | 只看该作者
在哪找不到

使用特权

评论回复
板凳
栩栩如生|  楼主 | 2016-5-19 19:17 | 只看该作者

VOID
UsbSamp_EvtIoRead(
    IN WDFQUEUE         Queue,
    IN WDFREQUEST       Request,
    IN size_t           Length
    )
/*++

Routine Description:

    Called by the framework when it receives Read requests.

Arguments:

    Queue - Default queue handle
    Request - Handle to the read/write request
    Lenght - Length of the data buffer associated with the request.
                 The default property of the queue is to not dispatch
                 zero lenght read & write requests to the driver and
                 complete is with status success. So we will never get
                 a zero length request.

Return Value:


--*/
{
    PFILE_CONTEXT           fileContext = NULL;
    WDFUSBPIPE              pipe;
    WDF_USB_PIPE_INFORMATION   pipeInfo;

    PAGED_CODE();

    //
    // Get the pipe associate with this request.
    //
    fileContext = GetFileContext(WdfRequestGetFileObject(Request));
    pipe = fileContext->Pipe;
    if (pipe == NULL) {
        UsbSamp_DbgPrint(1, ("pipe handle is NULL\n"));
        WdfRequestCompleteWithInformation(Request, STATUS_INVALID_PARAMETER, 0);
        return;
    }
    WDF_USB_PIPE_INFORMATION_INIT(&pipeInfo);
    WdfUsbTargetPipeGetInformation(pipe, &pipeInfo);

    if((WdfUsbPipeTypeBulk == pipeInfo.PipeType) ||
       (WdfUsbPipeTypeInterrupt == pipeInfo.PipeType)) {

        ReadWriteBulkEndPoints(Queue, Request, (ULONG) Length, WdfRequestTypeRead);
        return;

    } else if(WdfUsbPipeTypeIsochronous == pipeInfo.PipeType){

#if !defined(BUFFERED_READ_WRITE) // if doing DIRECT_IO
        ReadWriteIsochEndPoints(Queue, Request, (ULONG) Length, WdfRequestTypeRead);
        return;
#endif

    }

    UsbSamp_DbgPrint(1, ("ISO transfer is not supported for buffered I/O transfer\n"));
    WdfRequestCompleteWithInformation(Request, STATUS_INVALID_DEVICE_REQUEST, 0);

    return;
}

使用特权

评论回复
地板
liuzaiy| | 2016-5-19 19:27 | 只看该作者
程序有什么问题

使用特权

评论回复
5
栩栩如生|  楼主 | 2016-5-19 19:28 | 只看该作者
请问这函数中是怎么识别管道传输和登时传输的,文中我能看得懂。但是在上位机程序中我们调用了readfile,可是readfile没有传递相关的管道信息呀

使用特权

评论回复
6
pangb| | 2016-5-19 19:30 | 只看该作者
至少应该给一个参数说明是用的哪种传输方式和管道,端点

使用特权

评论回复
7
chenjunt| | 2016-5-19 19:31 | 只看该作者
如果你使用的是cypress 的上位机软件开发包,建议可以下载最新cysuite,参考里面的cyAPI文档。希望对你有帮助

使用特权

评论回复
8
栩栩如生|  楼主 | 2016-5-19 19:32 | 只看该作者
嗯,我看下,多谢

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

310

主题

2657

帖子

0

粉丝