• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1"""CfM USB device constants.
2
3This module contains constants for known USB device specs.
4
5A UsbDeviceSpec instance represents a known USB device and its spec;
6 - VendorID
7 - ProdID
8 - interfaces
9
10This is different from a UsbDevice instance which represents a device actually
11connected to the CfM and found by the usb-device command.
12
13A UsbDevice instance found connected to a CfM is expected to match a known
14UsbDeviceSpec (mapping is done using vid:pid), but due to bugs that might
15not be the case (list of interfaces might be different for example).
16"""
17
18from autotest_lib.client.common_lib.cros.cfm.usb import usb_device_spec
19
20# Cameras
21AVER_CAM520_CAMERA = usb_device_spec.UsbDeviceSpec(
22    vid='2574',
23    pid='0910',
24    product='CAM520',
25    interfaces=['uvcvideo', 'uvcvideo', 'usbhid'],
26)
27
28AVER_VC520_CAMERA = usb_device_spec.UsbDeviceSpec(
29    vid='2574',
30    pid='0901',
31    product='VC520+',
32    interfaces=['uvcvideo', 'uvcvideo', 'snd-usb-audio',
33                'snd-usb-audio', 'snd-usb-audio', 'usbhid'],
34)
35
36HUDDLY_GO = usb_device_spec.UsbDeviceSpec(
37    vid='2bd9',
38    pid='0011',
39    product='Huddly GO',
40    interfaces=['uvcvideo', 'uvcvideo', 'uvcvideo', 'uvcvideo'],
41)
42
43LOGITECH_WEBCAM_C930E = usb_device_spec.UsbDeviceSpec(
44    vid='046d',
45    pid='0843',
46    product='Logitech Webcam C930e',
47    interfaces=['uvcvideo', 'uvcvideo', 'snd-usb-audio', 'snd-usb-audio']
48)
49
50HD_PRO_WEBCAM_C920 = usb_device_spec.UsbDeviceSpec(
51    vid='046d',
52    pid='082d',
53    product='HD Pro Webcam C920',
54    interfaces=['uvcvideo', 'uvcvideo', 'snd-usb-audio', 'snd-usb-audio'],
55)
56
57PTZ_PRO_CAMERA = usb_device_spec.UsbDeviceSpec(
58    vid='046d',
59    pid='0853',
60    product='PTZ Pro Camera',
61    interfaces=['uvcvideo', 'uvcvideo', 'usbhid'],
62)
63
64PTZ_PRO_2_CAMERA = usb_device_spec.UsbDeviceSpec(
65    vid='046d',
66    pid='085f',
67    product='PTZ Pro 2 Camera',
68    interfaces=['uvcvideo', 'uvcvideo', 'usbhid'],
69)
70
71# Devices with Camera and Audio
72
73# Camera in Logitech MeetUp Device
74LOGITECH_MEETUP = usb_device_spec.UsbDeviceSpec(
75    vid='046d',
76    pid='0866',
77    product='Logitech MeetUp',
78    interfaces=['uvcvideo', 'uvcvideo', 'usbhid'],
79)
80
81# Audio peripheral in Logitech MeetUp Device
82LOGITECH_MEETUP_SPEAKERPHONE = usb_device_spec.UsbDeviceSpec(
83    vid='046d',
84    pid='0867',
85    product='Logitech MeetUp Speakerphone',
86    interfaces=['snd-usb-audio', 'snd-usb-audio', 'snd-usb-audio', 'usbhid'],
87)
88
89# Audio peripherals
90ATRUS = usb_device_spec.UsbDeviceSpec(
91    vid='18d1',
92    pid='8001',
93    product='Hangouts Meet speakermic',
94    interfaces=['snd-usb-audio', 'snd-usb-audio', 'snd-usb-audio', 'usbhid'],
95)
96
97JABRA_SPEAK_410 = usb_device_spec.UsbDeviceSpec(
98    vid='0b0e',
99    pid='0412',
100    product='Jabra SPEAK 410',
101    interfaces=['snd-usb-audio', 'snd-usb-audio', 'snd-usb-audio'],
102)
103
104# MiMOs
105MIMO_VUE_HD_DISPLAY = usb_device_spec.UsbDeviceSpec(
106    vid='17e9',
107    pid='016b',
108    product='MIMO VUE HD',
109    interfaces=['udl'],
110)
111
112# The MiMO's firmware is tied to the Chrome OS version. The firmware was updated
113# in Chrome OS 65.0.3319.0. This resulted in the PID being changed from 016b to
114# 416d. The following device is the device with the new PID. We need to support
115# both versions since we want to support tests at the ToT revision running
116# against older Chrome OS versions.
117MIMO_VUE_HD_DISPLAY_PLANKTON = usb_device_spec.UsbDeviceSpec(
118    vid='17e9',
119    pid='416d',
120    product='MIMO VUE HD',
121    interfaces=['udl'],
122)
123
124# Tuple with all known MIMO display specs that we support.
125ALL_MIMO_DISPLAYS = (MIMO_VUE_HD_DISPLAY, MIMO_VUE_HD_DISPLAY_PLANKTON)
126
127MIMO_VUE_HID_TOUCH_CONTROLLER = usb_device_spec.UsbDeviceSpec(
128    vid='266e',
129    pid='0110',
130    product='SiS HID Touch Controller',
131    interfaces=['usbhid'],
132)
133
134# Utility methods
135def get_usb_device_spec(vid_pid):
136  """
137  Look up UsbDeviceSpec based on vid_pid.
138  @return UsbDeviceSpec with matching vid_pid or None if no match.
139  """
140  return usb_device_spec.UsbDeviceSpec.get_usb_device_spec(vid_pid)
141