• uvc gadget test


    The function name to use when creating the function directory is "uvc".
    The uvc function provides these attributes in its function directory:

    streaming_interval - interval for polling endpoint for data transfers
    streaming_maxburst - bMaxBurst for super speed companion descriptor
    streaming_maxpacket - maximum packet size this endpoint is capable of
    		      sending or receiving when this configuration is
    		      selected
    

    There are also "control" and "streaming" subdirectories, each of which contain
    a number of their subdirectories. There are some sane defaults provided, but
    the user must provide the following:

    control header - create in control/header, link from control/class/fs
    		and/or control/class/ss
    streaming header - create in streaming/header, link from
    		streaming/class/fs and/or streaming/class/hs and/or
    		streaming/class/ss
    format description - create in streaming/mjpeg and/or
    		streaming/uncompressed
    frame description - create in streaming/mjpeg/<format> and/or in
    		streaming/uncompressed/<format>
    

    Each frame description contains frame interval specification, and each
    such specification consists of a number of lines with an inverval value
    in each line. The rules stated above are best illustrated with an example:

    mkdir functions/uvc.usb0/control/header/h

    cd functions/uvc.usb0/control/

    ln -s header/h class/fs

    ln -s header/h class/ss

    mkdir -p functions/uvc.usb0/streaming/uncompressed/u/360p

    cat < functions/uvc.usb0/streaming/uncompressed/u/360p/dwFrameInterval

    666666
    1000000
    5000000
    EOF

    cd $GADGET_CONFIGFS_ROOT

    mkdir functions/uvc.usb0/streaming/header/h

    cd functions/uvc.usb0/streaming/header/h

    ln -s ../../uncompressed/u

    cd ../../class/fs

    ln -s ../../header/h

    cd ../../class/hs

    ln -s ../../header/h

    cd ../../class/ss

    ln -s ../../header/h

    Testing the UVC function

    device: run the gadget, modprobe vivid

    uvc-gadget -u /dev/video<uvc video node #> -v /dev/video<vivid video node #>

    where uvc-gadget is this program:
    http://git.ideasonboard.org/uvc-gadget.git

    with these patches:
    http://www.spinics.net/lists/linux-usb/msg99220.html

    host: luvcview -f yuv

    1. PRINTER function
      ====================

    The function is provided by usb_f_printer.ko module.

    Function-specific configfs interface

    The function name to use when creating the function directory is "printer".
    The printer function provides these attributes in its function directory:

    pnp_string	- Data to be passed to the host in pnp string
    q_len		- Number of requests per endpoint
    

    Testing the PRINTER function

    The most basic testing:

    device: run the gadget

    ls -l /devices/virtual/usb_printer_gadget/

    一勤天下无难事。
  • 相关阅读:
    Office 2010激活 NO KMS products detected问题
    强制换行/不换行 (兼容IE)
    el-radio再次点击取消选中
    几个 JavaScript 实用小技巧
    微信小程序-点击事件传递参数
    微信小程序-存取本地缓存
    微信小程序-路由方式
    element-ui 表格排序失效
    watch监听(数组或者对象)
    vue 引入 base64或者md5对密码进行加密
  • 原文地址:https://www.cnblogs.com/nowroot/p/14258668.html
Copyright © 2020-2023  润新知