USB串行(CDC ACM)设备要求RTS否定

时间:2017-09-01 09:10:12

标签: serial-port usb cdc

我正在使用USB串行(CDC ACM)设备(Astrosys GBA ST2 Bill Validator),但设备不会回答请求,除非RTS信号被否定。

在Windows上,usbser驱动程序将通过发送SetControlLineStateGet/SetLineCoding USB控制请求来配置设备,直到在中断端点上收到SetSerial通知为止。换句话说,它将生成RTS / DTS信号(通过SetControlLineState),直到设备生成通知(在我们的例子中,当RTS线被否定时)。然后将其连接到COM端口,无需进一步配置。

在具有cdc-acm驱动程序的Linux上将设备附加到/dev/ttyACMn,但在发出请求之前需要明确否定RTS行。

通常,设备不会回答任何请求,除非RTS信号被否定,这可以通过USB控制请求或使用串行库来完成。

注意:通过"否定RTS线"我的意思是将RTS设置为0或False,例如port.rts=0使用pySerial

我知道USB虚拟串口不需要实现完整的RS-232规范并回答每个信号,但我不明白为什么RTS信号需要被否定才能让设备回应请求?是否应该使用串行CDC ACM USB设备?或者它是供应商特定的功能?

以下是完整的设备描述符:

Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            2 Communications
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x16f9
  idProduct          0x0003
  bcdDevice           14.06
  iManufacturer           1 Astrosystems
  iProduct                2 GBA ST2
  iSerial                 3 06010010001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           62
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              4 GBA USB Serial Port
      CDC Header:
        bcdCDC               1.20
      CDC ACM:
        bmCapabilities       0x02
          line coding and serial state
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              50
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0
      iInterface              4 GBA USB Serial Port
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0001
  Self Powered

0 个答案:

没有答案