attenuator

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package attenuator controls of the Mini-Circuits RC4DAT programmable attenuator. It provides also a best-effort support for RCDAT, but due to lack the test sample, nothing is guaranteed.

Index

Constants

This section is empty.

Variables

View Source
var HostFixedAttenuations = attData{

	"chromeos1-dev-host4-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 56, 5220: 56, 5765: 56},
		2: {2437: 53, 5220: 59, 5765: 59},
		3: {2437: 57, 5220: 56, 5765: 56}},
	"chromeos1-dev-host15-attenuator": {
		0: {2437: 32, 5220: 36, 5765: 38},
		1: {2437: 35, 5220: 34, 5765: 36},
		2: {2437: 32, 5220: 36, 5765: 38},
		3: {2437: 35, 5220: 34, 5765: 36}},
	"chromeos1-dev-host16-attenuator": {
		0: {2437: 32, 5220: 37, 5765: 39},
		1: {2437: 35, 5220: 34, 5765: 36},
		2: {2437: 32, 5220: 37, 5765: 39},
		3: {2437: 35, 5220: 34, 5765: 36}},
	"chromeos1-dev-host17-attenuator": {
		0: {2437: 33, 5220: 36, 5765: 38},
		1: {2437: 35, 5220: 34, 5765: 36},
		2: {2437: 33, 5220: 36, 5765: 38},
		3: {2437: 35, 5220: 34, 5765: 36}},
	"chromeos1-dev-host18-attenuator": {
		0: {2437: 32, 5220: 36, 5765: 37},
		1: {2437: 35, 5220: 34, 5765: 35},
		2: {2437: 32, 5220: 36, 5765: 37},
		3: {2437: 35, 5220: 34, 5765: 35}},
	"chromeos1-dev-host19-attenuator": {
		0: {2437: 52, 5220: 57, 5765: 60},
		1: {2437: 55, 5220: 54, 5765: 56},
		2: {2437: 52, 5220: 57, 5765: 60},
		3: {2437: 55, 5220: 54, 5765: 55}},
	"chromeos1-dev-host20-attenuator": {
		0: {2437: 53, 5220: 57, 5765: 62},
		1: {2437: 57, 5220: 55, 5765: 55},
		2: {2437: 53, 5220: 57, 5765: 61},
		3: {2437: 57, 5220: 55, 5765: 55}},
	"chromeos1-test-host2-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 58},
		1: {2437: 57, 5220: 57, 5765: 59},
		2: {2437: 53, 5220: 59, 5765: 58},
		3: {2437: 57, 5220: 57, 5765: 59}},

	"chromeos15-row3-rack7-host1-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 56, 5220: 56, 5765: 58},
		2: {2437: 53, 5220: 58, 5765: 60},
		3: {2437: 56, 5220: 56, 5765: 57}},
	"chromeos15-row3-rack7-host2-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 56, 5220: 57, 5765: 58},
		2: {2437: 53, 5220: 58, 5765: 60},
		3: {2437: 56, 5220: 57, 5765: 56}},
	"chromeos15-row3-rack7-host3-attenuator": {
		0: {2437: 53, 5220: 58, 5765: 60},
		1: {2437: 56, 5220: 56, 5765: 56},
		2: {2437: 53, 5220: 58, 5765: 60},
		3: {2437: 56, 5220: 56, 5765: 56}},
	"chromeos15-row3-rack7-host4-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 60},
		1: {2437: 57, 5220: 56, 5765: 58},
		2: {2437: 53, 5220: 59, 5765: 60},
		3: {2437: 57, 5220: 56, 5765: 58}},
	"chromeos15-row3-rack7-host5-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 56, 5220: 56, 5765: 57},
		2: {2437: 52, 5220: 59, 5765: 58},
		3: {2437: 56, 5220: 56, 5765: 57}},
	"chromeos15-row3-rack7-host6-attenuator": {
		0: {2437: 53, 5220: 58, 5765: 59},
		1: {2437: 56, 5220: 57, 5765: 57},
		2: {2437: 52, 5220: 58, 5765: 58},
		3: {2437: 56, 5220: 56, 5765: 56}},

	"chromeos15-row3-rack8-host1-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 58},
		1: {2437: 56, 5220: 57, 5765: 59},
		2: {2437: 52, 5220: 59, 5765: 58},
		3: {2437: 56, 5220: 57, 5765: 59}},
	"chromeos15-row3-rack8-host2-attenuator": {
		0: {2437: 52, 5220: 59, 5765: 59},
		1: {2437: 56, 5220: 56, 5765: 60},
		2: {2437: 52, 5220: 58, 5765: 60},
		3: {2437: 56, 5220: 56, 5765: 59}},
	"chromeos15-row3-rack8-host3-attenuator": {
		0: {2437: 52, 5220: 58, 5765: 59},
		1: {2437: 56, 5220: 56, 5765: 60},
		2: {2437: 52, 5220: 58, 5765: 59},
		3: {2437: 56, 5220: 56, 5765: 57}},
	"chromeos15-row3-rack8-host4-attenuator": {
		0: {2437: 52, 5220: 58, 5765: 60},
		1: {2437: 56, 5220: 56, 5765: 58},
		2: {2437: 52, 5220: 58, 5765: 58},
		3: {2437: 56, 5220: 56, 5765: 56}},
	"chromeos15-row3-rack8-host5-attenuator": {
		0: {2437: 53, 5220: 58, 5765: 58},
		1: {2437: 56, 5220: 56, 5765: 57},
		2: {2437: 53, 5220: 59, 5765: 58},
		3: {2437: 56, 5220: 56, 5765: 60}},
	"chromeos15-row3-rack8-host6-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 56, 5220: 56, 5765: 57},
		2: {2437: 53, 5220: 60, 5765: 59},
		3: {2437: 56, 5220: 58, 5765: 58}},

	"chromeos15-row3-rack9-host1-attenuator": {
		0: {2437: 53, 5220: 60, 5765: 59},
		1: {2437: 57, 5220: 57, 5765: 58},
		2: {2437: 53, 5220: 59, 5765: 60},
		3: {2437: 57, 5220: 57, 5765: 60}},
	"chromeos15-row3-rack9-host2-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 57, 5220: 58, 5765: 60},
		2: {2437: 53, 5220: 58, 5765: 58},
		3: {2437: 57, 5220: 58, 5765: 61}},
	"chromeos15-row3-rack9-host3-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 57, 5220: 58, 5765: 59},
		2: {2437: 53, 5220: 58, 5765: 59},
		3: {2437: 57, 5220: 58, 5765: 60}},
	"chromeos15-row3-rack9-host4-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 57, 5220: 58, 5765: 60},
		2: {2437: 53, 5220: 58, 5765: 59},
		3: {2437: 57, 5220: 57, 5765: 60}},
	"chromeos15-row3-rack9-host5-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 57, 5220: 58, 5765: 59},
		2: {2437: 53, 5220: 58, 5765: 60},
		3: {2437: 57, 5220: 58, 5765: 60}},
	"chromeos15-row3-rack9-host6-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 59},
		1: {2437: 57, 5220: 57, 5765: 60},
		2: {2437: 53, 5220: 59, 5765: 60},
		3: {2437: 57, 5220: 58, 5765: 58}},
	"chromeos15-row3-rack10-host1-attenuator": {
		0: {2437: 52, 5220: 55, 5765: 56},
		1: {2437: 55, 5220: 53, 5765: 57},
		2: {2437: 52, 5220: 55, 5765: 57},
		3: {2437: 55, 5220: 53, 5765: 57}},
	"chromeos15-row3-rack10-host2-attenuator": {
		0: {2437: 52, 5220: 56, 5765: 58},
		1: {2437: 55, 5220: 54, 5765: 58},
		2: {2437: 52, 5220: 56, 5765: 58},
		3: {2437: 55, 5220: 54, 5765: 57}},
	"chromeos15-row3-rack10-host3-attenuator": {
		0: {2437: 52, 5220: 55, 5765: 60},
		1: {2437: 55, 5220: 54, 5765: 59},
		2: {2437: 52, 5220: 55, 5765: 61},
		3: {2437: 55, 5220: 53, 5765: 59}},
	"chromeos15-row3-rack10-host4-attenuator": {
		0: {2437: 51, 5220: 55, 5765: 59},
		1: {2437: 55, 5220: 53, 5765: 58},
		2: {2437: 51, 5220: 54, 5765: 59},
		3: {2437: 55, 5220: 53, 5765: 58}},
	"chromeos15-row3-rack10-host5-attenuator": {
		0: {2437: 51, 5220: 55, 5765: 60},
		1: {2437: 55, 5220: 53, 5765: 58},
		2: {2437: 51, 5220: 55, 5765: 60},
		3: {2437: 55, 5220: 53, 5765: 58}},
	"chromeos15-row3-rack10-host6-attenuator": {
		0: {2437: 52, 5220: 55, 5765: 57},
		1: {2437: 55, 5220: 54, 5765: 59},
		2: {2437: 52, 5220: 55, 5765: 57},
		3: {2437: 55, 5220: 54, 5765: 57}},
	"chromeos15-row3-rack11-host1-attenuator": {
		0: {2437: 53, 5220: 58, 5765: 57},
		1: {2437: 56, 5220: 56, 5765: 58},
		2: {2437: 53, 5220: 58, 5765: 57},
		3: {2437: 56, 5220: 56, 5765: 57}},
	"chromeos15-row3-rack11-host2-attenuator": {
		0: {2437: 53, 5220: 58, 5765: 56},
		1: {2437: 56, 5220: 56, 5765: 58},
		2: {2437: 53, 5220: 59, 5765: 56},
		3: {2437: 56, 5220: 56, 5765: 56}},
	"chromeos15-row3-rack11-host3-attenuator": {
		0: {2437: 52, 5220: 57, 5765: 59},
		1: {2437: 55, 5220: 55, 5765: 54},
		2: {2437: 52, 5220: 57, 5765: 59},
		3: {2437: 55, 5220: 55, 5765: 54}},
	"chromeos15-row3-rack11-host4-attenuator": {
		0: {2437: 52, 5220: 58, 5765: 59},
		1: {2437: 56, 5220: 56, 5765: 55},
		2: {2437: 52, 5220: 57, 5765: 59},
		3: {2437: 56, 5220: 56, 5765: 55}},
	"chromeos15-row3-rack11-host5-attenuator": {
		0: {2437: 53, 5220: 58, 5765: 58},
		1: {2437: 55, 5220: 56, 5765: 55},
		2: {2437: 53, 5220: 58, 5765: 59},
		3: {2437: 56, 5220: 55, 5765: 55}},
	"chromeos15-row3-rack11-host6-attenuator": {
		0: {2437: 52, 5220: 58, 5765: 59},
		1: {2437: 55, 5220: 55, 5765: 54},
		2: {2437: 52, 5220: 57, 5765: 59},
		3: {2437: 55, 5220: 55, 5765: 54}},
	"chromeos15-row3-rack12-host1-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 58},
		1: {2437: 55, 5220: 57, 5765: 55},
		2: {2437: 57, 5220: 59, 5765: 58},
		3: {2437: 55, 5220: 56, 5765: 55}},
	"chromeos15-row3-rack12-host2-attenuator": {
		0: {2437: 52, 5220: 59, 5765: 56},
		1: {2437: 55, 5220: 56, 5765: 55},
		2: {2437: 52, 5220: 59, 5765: 57},
		3: {2437: 55, 5220: 56, 5765: 55}},
	"chromeos15-row3-rack12-host3-attenuator": {
		0: {2437: 52, 5220: 58, 5765: 57},
		1: {2437: 55, 5220: 57, 5765: 55},
		2: {2437: 52, 5220: 59, 5765: 59},
		3: {2437: 55, 5220: 59, 5765: 55}},
	"chromeos15-row3-rack12-host4-attenuator": {
		0: {2437: 52, 5220: 58, 5765: 56},
		1: {2437: 55, 5220: 56, 5765: 55},
		2: {2437: 52, 5220: 58, 5765: 56},
		3: {2437: 55, 5220: 56, 5765: 56}},
	"chromeos15-row3-rack12-host5-attenuator": {
		0: {2437: 53, 5220: 59, 5765: 58},
		1: {2437: 55, 5220: 56, 5765: 55},
		2: {2437: 52, 5220: 59, 5765: 59},
		3: {2437: 55, 5220: 56, 5765: 55}},
	"chromeos15-row3-rack12-host6-attenuator": {
		0: {2437: 52, 5220: 59, 5765: 57},
		1: {2437: 55, 5220: 56, 5765: 55},
		2: {2437: 52, 5220: 58, 5765: 56},
		3: {2437: 55, 5220: 56, 5765: 55}},
	"chromeos15-row3-rack13-host1-attenuator": {
		0: {2437: 59, 5220: 59, 5765: 59},
		1: {2437: 52, 5220: 54, 5765: 54},
		2: {2437: 59, 5220: 59, 5765: 59},
		3: {2437: 52, 5220: 54, 5765: 54}},
	"chromeos15-row3-rack13-host2-attenuator": {
		0: {2437: 64, 5220: 62, 5765: 62},
		1: {2437: 58, 5220: 57, 5765: 57},
		2: {2437: 64, 5220: 62, 5765: 62},
		3: {2437: 58, 5220: 57, 5765: 57}},
	"chromeos15-row3-rack13-host3-attenuator": {
		0: {2437: 60, 5220: 58, 5765: 58},
		1: {2437: 52, 5220: 57, 5765: 57},
		2: {2437: 60, 5220: 58, 5765: 58},
		3: {2437: 52, 5220: 57, 5765: 57}},
	"chromeos15-row3-rack13-host4-attenuator": {
		0: {2437: 52, 5220: 58, 5765: 58},
		1: {2437: 59, 5220: 60, 5765: 60},
		2: {2437: 52, 5220: 58, 5765: 58},
		3: {2437: 59, 5220: 60, 5765: 60}},
	"chromeos15-row3-rack13-host5-attenuator": {
		0: {2437: 58, 5220: 60, 5765: 60},
		1: {2437: 53, 5220: 58, 5765: 58},
		2: {2437: 58, 5220: 60, 5765: 60},
		3: {2437: 53, 5220: 58, 5765: 58}},
	"chromeos15-row3-rack13-host6-attenuator": {
		0: {2437: 52, 5220: 56, 5765: 58},
		1: {2437: 53, 5220: 56, 5765: 57},
		2: {2437: 52, 5220: 56, 5765: 58},
		3: {2437: 53, 5220: 56, 5765: 57}},
	"chromeos15-row3-rack14-host1-attenuator": {
		0: {2437: 53, 5220: 56, 5765: 56},
		1: {2437: 52, 5220: 56, 5765: 56},
		2: {2437: 53, 5220: 56, 5765: 56},
		3: {2437: 52, 5220: 56, 5765: 56}},
	"chromeos15-row3-rack14-host2-attenuator": {
		0: {2437: 59, 5220: 59, 5765: 59},
		1: {2437: 59, 5220: 60, 5765: 60},
		2: {2437: 59, 5220: 59, 5765: 59},
		3: {2437: 59, 5220: 60, 5765: 60}},
	"chromeos15-row3-rack14-host3-attenuator": {
		0: {2437: 52, 5220: 56, 5765: 56},
		1: {2437: 64, 5220: 63, 5765: 63},
		2: {2437: 52, 5220: 56, 5765: 56},
		3: {2437: 64, 5220: 63, 5765: 63}},
	"chromeos15-row3-rack14-host4-attenuator": {
		0: {2437: 52, 5220: 55, 5765: 55},
		1: {2437: 58, 5220: 58, 5765: 58},
		2: {2437: 52, 5220: 55, 5765: 55},
		3: {2437: 58, 5220: 58, 5765: 58}},
	"chromeos15-row3-rack14-host5-attenuator": {
		0: {2437: 57, 5220: 58, 5765: 58},
		1: {2437: 52, 5220: 55, 5765: 55},
		2: {2437: 57, 5220: 58, 5765: 58},
		3: {2437: 52, 5220: 55, 5765: 55}},
	"chromeos15-row3-rack14-host6-attenuator": {
		0: {2437: 57, 5220: 57, 5765: 57},
		1: {2437: 52, 5220: 55, 5765: 55},
		2: {2437: 57, 5220: 57, 5765: 57},
		3: {2437: 52, 5220: 55, 5765: 55}},
}

HostFixedAttenuations is used for mapping fixed line attenuation for a given frequency for each atenuator available in the lab.

Functions

This section is empty.

Types

type Attenuator

type Attenuator struct {
	// contains filtered or unexported fields
}

Attenuator stores properties of a programmable attenuator.

func Open

func Open(ctx context.Context, host string, proxyConn *ssh.Conn) (att *Attenuator, errRet error)

Open access to the attenuator.

func (*Attenuator) Attenuation

func (a *Attenuator) Attenuation(ctx context.Context, channel int) (float64, error)

Attenuation returns attenuation of the particular attenuator channel.

func (*Attenuator) Close

func (a *Attenuator) Close()

Close is used for cleaning up resources.

func (*Attenuator) MaximumAttenuation

func (a *Attenuator) MaximumAttenuation() float64

MaximumAttenuation gets attenuator's maximum attenuation value.

func (*Attenuator) MinTotalAttenuation

func (a *Attenuator) MinTotalAttenuation(channel int) (float64, error)

MinTotalAttenuation returns the minimal attenuation the attenuator can be set for the given channel.

This is obtained by finding the maximum fixed loss of all frequencies the channel has.

func (*Attenuator) SetAttenuation

func (a *Attenuator) SetAttenuation(ctx context.Context, channel int, val float64) error

SetAttenuation sets attenuation on particular channel.

func (*Attenuator) SetTotalAttenuation

func (a *Attenuator) SetTotalAttenuation(ctx context.Context, channel int, attenDb float64, frequencyMhz int) error

SetTotalAttenuation sets attenuation level for the specified frequency on the given channel.

Each channel of the attenuator has different fixed attenuation/loss for different frequency. This function finds out the fixed attenuation of the given frequency and channel and adds a variable attenuation on it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL