Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 3 | * Copyright 2020-present Open Networking Foundation |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 4 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 5 | * 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 Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 8 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 10 | * |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 11 | * 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 Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [diff] [blame] | 17 | /* |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 18 | * 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 | |
| 24 | package generated |
| 25 | |
| 26 | import "github.com/deckarep/golang-set" |
| 27 | |
| 28 | // ReCommonAmplifierParametersClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity RE common amplifier parameters |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const ReCommonAmplifierParametersClassID = ClassID(328) // 0x0148 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var recommonamplifierparametersBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // ReCommonAmplifierParameters (Class ID: #328 / 0x0148) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // 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 Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 44 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 48 | // NOTE - The type of the linked ME can be determined by uniqueness of slot and port. |
| 49 | // |
| 50 | // Gain |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 51 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 55 | // |
| 56 | // Lower Gain Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 57 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 60 | // |
| 61 | // Upper Gain Threshold |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 62 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 65 | // |
| 66 | // Target Gain |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 67 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 70 | // (optional) (1-byte) |
| 71 | // |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 72 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 100 | // Amplifier Saturation Gain |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 101 | // 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 104 | // |
| 105 | type ReCommonAmplifierParameters struct { |
| 106 | ManagedEntityDefinition |
| 107 | Attributes AttributeValueMap |
| 108 | } |
| 109 | |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 110 | // Attribute name constants |
| 111 | |
| 112 | const ReCommonAmplifierParameters_Gain = "Gain" |
| 113 | const ReCommonAmplifierParameters_LowerGainThreshold = "LowerGainThreshold" |
| 114 | const ReCommonAmplifierParameters_UpperGainThreshold = "UpperGainThreshold" |
| 115 | const ReCommonAmplifierParameters_TargetGain = "TargetGain" |
| 116 | const ReCommonAmplifierParameters_DeviceTemperature = "DeviceTemperature" |
| 117 | const ReCommonAmplifierParameters_LowerDeviceTemperatureThreshold = "LowerDeviceTemperatureThreshold" |
| 118 | const ReCommonAmplifierParameters_UpperDeviceTemperatureThreshold = "UpperDeviceTemperatureThreshold" |
| 119 | const ReCommonAmplifierParameters_DeviceBiasCurrent = "DeviceBiasCurrent" |
| 120 | const ReCommonAmplifierParameters_AmplifierSaturationOutputPower = "AmplifierSaturationOutputPower" |
| 121 | const ReCommonAmplifierParameters_AmplifierNoiseFigure = "AmplifierNoiseFigure" |
| 122 | const ReCommonAmplifierParameters_AmplifierSaturationGain = "AmplifierSaturationGain" |
| 123 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 124 | func init() { |
| 125 | recommonamplifierparametersBME = &ManagedEntityDefinition{ |
| 126 | Name: "ReCommonAmplifierParameters", |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 127 | ClassID: ReCommonAmplifierParametersClassID, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 128 | MessageTypes: mapset.NewSetWith( |
| 129 | Get, |
| 130 | Set, |
| 131 | ), |
| 132 | AllowedAttributeMask: 0xffe0, |
| 133 | AttributeDefinitions: AttributeDefinitionMap{ |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 134 | 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 146 | }, |
| 147 | Access: CreatedByOnu, |
| 148 | Support: UnknownSupport, |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [diff] [blame] | 149 | 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 Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 158 | } |
| 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. |
| 164 | func NewReCommonAmplifierParameters(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 165 | return NewManagedEntity(*recommonamplifierparametersBME, params...) |
| 166 | } |