aboutsummaryrefslogtreecommitdiff
path: root/server/cros/servo/topology/topology_constants.py
blob: 6702a5ec0a9a595c1fd9fb912bda65d45448ecf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python2
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Constants that will be used as key name in device health profile.
SERVO_TOPOLOGY_LABEL_PREFIX = 'servo_topology'
ST_DEVICE_MAIN = 'main'
ST_DEVICE_CHILDREN = 'children'

# Fields of servo topology item
ST_DEVICE_SERIAL = 'serial'
ST_DEVICE_TYPE = 'type'
ST_DEVICE_PRODUCT = 'sysfs_product'
ST_DEVICE_HUB_PORT = 'usb_hub_port'

ST_CR50_TYPE = 'ccd_cr50'

# Mapping between product names and types.
ST_PRODUCT_TYPES = {
        'Servo V4': 'servo_v4',
        'Servo V4p1': 'servo_v4p1',
        'Cr50': ST_CR50_TYPE,
        'Servo Micro': 'servo_micro',
        'C2D2': 'c2d2',
        'Sweetberry': 'sweetberry'
}

# List unchangeable fields per device.
SERVO_TOPOLOGY_ITEM_COMPARE_FIELDS = (
        ST_DEVICE_SERIAL,
        ST_DEVICE_TYPE,
        ST_DEVICE_PRODUCT,
)