Documentation ¶
Overview ¶
Package cswitch ... Copyright 2021 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. The Thunderbolt Quality Center (TQC) API is which exposes a REST API for automating Thunderbolt test cases. Package cswitch provides utilities to interact with cswitch to perform hotplug-unplug and device enumeration. The CSwitch contains 4 connectors. Only 1 connector at any given time is enabled. An additional virtual connector, referred to as '0', is used in order to simulate disconnection. CSwitch using FTDI controller.
Index ¶
- func CloseSession(ctx context.Context, sessionID, domain string) error
- func CreateSession(ctx context.Context, domain string) (string, error)
- func Generation(ctx context.Context, port string) (string, error)
- func IsDeviceEnumerated(ctx context.Context, device, port string) (bool, error)
- func NvmVersion(ctx context.Context, port string) (string, error)
- func RxSpeed(ctx context.Context, port string) (string, error)
- func ToggleCSwitchPort(ctx context.Context, sessionID, toggle, domain string) error
- func TxSpeed(ctx context.Context, port string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseSession ¶
CloseSession closes the created session and on success it returns nil. If it fails it will return the respective error. domain holds the local host ip with port number ex: domain = "localhost:9000"
func CreateSession ¶
CreateSession Creates session id for controlling cswitch operations and on success it will return session id. If it fails it will return the respective error. domain holds the local host IP with port number ex: domain = "localhost:9000"
func Generation ¶
Generation returns the generation of the TBT device connected to the DUT. port holds the TBT port id in DUT.
func IsDeviceEnumerated ¶
IsDeviceEnumerated validates device enumeration in DUT. device holds the device name of connected TBT device. port holds the TBT port id in DUT.
func NvmVersion ¶
NvmVersion returns the NVM version of the TBT device connected to the DUT. port holds the TBT port id in DUT.
func ToggleCSwitchPort ¶
ToggleCSwitchPort enable/disable cswitch port with given parameters session id, toggle, domain ip. sessionID holds session id created by CreateSession function. domain holds the local host ip with port number ex: domain = "localhost:9000".
Types ¶
This section is empty.