blob: 41b9dd950a2209e6bf03d081c09997dbe3e88d1f [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
Andrea Campanella7167ebb2020-02-24 09:56:38 +01003 * Copyright 2020-present Open Networking Foundation
Chip Boling8cdd6392022-01-27 08:43:37 -06004 *
Chip Boling6e27b352020-02-14 09:10:01 -06005 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
Chip Boling8cdd6392022-01-27 08:43:37 -06008 *
Chip Boling6e27b352020-02-14 09:10:01 -06009 * http://www.apache.org/licenses/LICENSE-2.0
Chip Boling8cdd6392022-01-27 08:43:37 -060010 *
Chip Boling6e27b352020-02-14 09:10:01 -060011 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
Chip Boling34ebcb62021-02-02 12:13:58 -060017/*
Chip Boling6e27b352020-02-14 09:10:01 -060018 * NOTE: This file was generated, manual edits will be overwritten!
19 *
20 * Generated by 'goCodeGenerator.py':
21 * https://github.com/cboling/OMCI-parser/README.md
22 */
23
24package generated
25
26import "github.com/deckarep/golang-set"
27
28// ReCommonAmplifierParametersClassID is the 16-bit ID for the OMCI
29// Managed entity RE common amplifier parameters
Chip Boling610117d2021-09-09 11:24:34 -050030const ReCommonAmplifierParametersClassID = ClassID(328) // 0x0148
Chip Boling6e27b352020-02-14 09:10:01 -060031
32var recommonamplifierparametersBME *ManagedEntityDefinition
33
Chip Boling610117d2021-09-09 11:24:34 -050034// ReCommonAmplifierParameters (Class ID: #328 / 0x0148)
Chip Boling6e27b352020-02-14 09:10:01 -060035// This ME organizes data associated with each OA supported by the RE. The management ONU
36// automatically creates one instance of this ME for each upstream or downstream OA.
37//
38// Relationships
39// An instance of this ME is associated with an instance of the RE downstream amplifier or RE
40// upstream amplifier ME.
41//
42// Attributes
43// Managed Entity Id
Chip Boling610117d2021-09-09 11:24:34 -050044// This attribute uniquely identifies each instance of this ME. Through an identical ID, this ME is
45// implicitly linked to an instance of an upstream or downstream OA. The first byte is the slot ID
46// (defined in clause 9.1.5). The second byte is the port ID. (R)-(mandatory) (2-bytes)
47//
Chip Boling6e27b352020-02-14 09:10:01 -060048// NOTE - The type of the linked ME can be determined by uniqueness of slot and port.
49//
50// Gain
Chip Boling610117d2021-09-09 11:24:34 -050051// This attribute reports the current measurement of the OA's gain, in decibels. Its value is a 2s
52// complement integer with 0.25-dB granularity, and with a range from -32-dB to 31.5-dB. The value
53// 0x7F indicates that the current measured gain is 0, i.e., negative infinity in decibels terms.
54// (R) (optional) (1-byte)
Chip Boling6e27b352020-02-14 09:10:01 -060055//
56// Lower Gain Threshold
Chip Boling610117d2021-09-09 11:24:34 -050057// This attribute specifies the gain the RE uses to declare the low gain alarm. Valid values are
58// 0-dB (coded as 0x00) to 63.5-dB (coded as 0xFE). The default value 0xFF selects the RE's
59// internal policy. (R,-W) (optional) (1-byte)
Chip Boling6e27b352020-02-14 09:10:01 -060060//
61// Upper Gain Threshold
Chip Boling610117d2021-09-09 11:24:34 -050062// This attribute specifies the gain the RE uses to declare the high gain alarm. Valid values are
63// 0-dB (coded as 0x00) to 63.5-dB (coded as 0xFE). The default value 0xFF selects the RE's
64// internal policy. (R,-W) (optional) (1-byte)
Chip Boling6e27b352020-02-14 09:10:01 -060065//
66// Target Gain
Chip Boling610117d2021-09-09 11:24:34 -050067// This attribute specifies the target gain, when the operational mode of the parent RE downstream
68// or upstream amplifier is set to constant gain mode. Valid values are 0-dB (coded as 0x00) to
69// 63.5-dB (coded as 0xFE). The default value 0xFF selects the RE's internal policy. (R,-W)
Chip Boling6e27b352020-02-14 09:10:01 -060070// (optional) (1-byte)
71//
Chip Boling610117d2021-09-09 11:24:34 -050072// Device Temperature
73// This attribute reports the temperature in degrees Celcius of the active device (SOA or pump) in
74// the OA. Its value is a 2s complement integer with granularity 1/256-degree-C. (R) (optional)
75// (2-bytes)
76//
77// Lower Device Temperature Threshold
78// This attribute is a 2s complement integer that specifies the temperature the RE uses to declare
79// the low temperature alarm. Valid values are -64 to +63-degree-C in 0.5-degree-C increments. The
80// default value 0x7F selects the RE's internal policy. (R,-W) (optional) (1-byte)
81//
82// Upper Device Temperature Threshold
83// This attribute is a 2s complement integer that specifies the temperature the RE uses to declare
84// the high temperature alarm. Valid values are -64 to +63-degree-C in 0.5-degree-C increments. The
85// default value 0x7F selects the RE's internal policy. (R,-W) (optional) (1-byte)
86//
87// Device Bias Current
88// This attribute contains the measured bias current applied to the SOA or pump laser. Its value is
89// an unsigned integer with granularity 2-mA. Valid values are 0 to 512-mA. (R) (optional) (1-byte)
90//
91// Amplifier Saturation Output Power
92// This attribute reports the saturation output power of the amplifier as specified by the
93// manufacturer. Its value is an unsigned integer referred to 1-mW (i.e., dBm), with 0.1-dB
94// granularity. (R) (optional) (2-bytes)
95//
96// Amplifier Noise Figure
97// This attribute reports the intrinsic noise figure of the amplifier, as specified by the
98// manufacturer. Its value is an unsigned integer with 0.1-dB granularity (R) (optional) (1-byte)
99//
Chip Boling6e27b352020-02-14 09:10:01 -0600100// Amplifier Saturation Gain
Chip Boling610117d2021-09-09 11:24:34 -0500101// This attribute reports the gain of the amplifier at saturation, as specified by the
102// manufacturer. Its value is an unsigned integer with 0.25-dB granularity, and with a range from 0
103// to 63.75-dB. (R) (optional) (1-byte)
Chip Boling6e27b352020-02-14 09:10:01 -0600104//
105type ReCommonAmplifierParameters struct {
106 ManagedEntityDefinition
107 Attributes AttributeValueMap
108}
109
Chip Boling8cdd6392022-01-27 08:43:37 -0600110// Attribute name constants
111
112const ReCommonAmplifierParameters_Gain = "Gain"
113const ReCommonAmplifierParameters_LowerGainThreshold = "LowerGainThreshold"
114const ReCommonAmplifierParameters_UpperGainThreshold = "UpperGainThreshold"
115const ReCommonAmplifierParameters_TargetGain = "TargetGain"
116const ReCommonAmplifierParameters_DeviceTemperature = "DeviceTemperature"
117const ReCommonAmplifierParameters_LowerDeviceTemperatureThreshold = "LowerDeviceTemperatureThreshold"
118const ReCommonAmplifierParameters_UpperDeviceTemperatureThreshold = "UpperDeviceTemperatureThreshold"
119const ReCommonAmplifierParameters_DeviceBiasCurrent = "DeviceBiasCurrent"
120const ReCommonAmplifierParameters_AmplifierSaturationOutputPower = "AmplifierSaturationOutputPower"
121const ReCommonAmplifierParameters_AmplifierNoiseFigure = "AmplifierNoiseFigure"
122const ReCommonAmplifierParameters_AmplifierSaturationGain = "AmplifierSaturationGain"
123
Chip Boling6e27b352020-02-14 09:10:01 -0600124func init() {
125 recommonamplifierparametersBME = &ManagedEntityDefinition{
126 Name: "ReCommonAmplifierParameters",
Chip Boling8cdd6392022-01-27 08:43:37 -0600127 ClassID: ReCommonAmplifierParametersClassID,
Chip Boling6e27b352020-02-14 09:10:01 -0600128 MessageTypes: mapset.NewSetWith(
129 Get,
130 Set,
131 ),
132 AllowedAttributeMask: 0xffe0,
133 AttributeDefinitions: AttributeDefinitionMap{
Chip Boling8cdd6392022-01-27 08:43:37 -0600134 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
135 1: ByteField(ReCommonAmplifierParameters_Gain, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, true, false, 1),
136 2: ByteField(ReCommonAmplifierParameters_LowerGainThreshold, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, true, false, 2),
137 3: ByteField(ReCommonAmplifierParameters_UpperGainThreshold, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, true, false, 3),
138 4: ByteField(ReCommonAmplifierParameters_TargetGain, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, true, false, 4),
139 5: Uint16Field(ReCommonAmplifierParameters_DeviceTemperature, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, true, false, 5),
140 6: ByteField(ReCommonAmplifierParameters_LowerDeviceTemperatureThreshold, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, true, false, 6),
141 7: ByteField(ReCommonAmplifierParameters_UpperDeviceTemperatureThreshold, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, true, false, 7),
142 8: ByteField(ReCommonAmplifierParameters_DeviceBiasCurrent, UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read), false, true, false, 8),
143 9: Uint16Field(ReCommonAmplifierParameters_AmplifierSaturationOutputPower, UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9),
144 10: ByteField(ReCommonAmplifierParameters_AmplifierNoiseFigure, UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10),
145 11: ByteField(ReCommonAmplifierParameters_AmplifierSaturationGain, UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read), false, true, false, 11),
Chip Boling6e27b352020-02-14 09:10:01 -0600146 },
147 Access: CreatedByOnu,
148 Support: UnknownSupport,
Chip Boling34ebcb62021-02-02 12:13:58 -0600149 Alarms: AlarmMap{
150 0: "Low gain",
151 1: "High gain",
152 2: "Low temperature",
153 3: "High temperature",
154 4: "High bias current",
155 5: "High temperature shutdown",
156 6: "High current shutdown",
157 },
Chip Boling6e27b352020-02-14 09:10:01 -0600158 }
159}
160
161// NewReCommonAmplifierParameters (class ID 328) creates the basic
162// Managed Entity definition that is used to validate an ME of this type that
163// is received from or transmitted to the OMCC.
164func NewReCommonAmplifierParameters(params ...ParamData) (*ManagedEntity, OmciErrors) {
165 return NewManagedEntity(*recommonamplifierparametersBME, params...)
166}