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 |
| 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 |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [diff] [blame] | 8 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
Andrea Campanella | 7167ebb | 2020-02-24 09:56:38 +0100 | [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 |
| 30 | const ReCommonAmplifierParametersClassID ClassID = ClassID(328) |
| 31 | |
| 32 | var recommonamplifierparametersBME *ManagedEntityDefinition |
| 33 | |
| 34 | // ReCommonAmplifierParameters (class ID #328) |
| 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 |
| 44 | // NOTE - The type of the linked ME can be determined by uniqueness of slot and port. |
| 45 | // |
| 46 | // Gain |
| 47 | // Gain: This attribute reports the current measurement of the OA's gain, in decibels. Its value is |
| 48 | // a 2s complement integer with 0.25-dB granularity, and with a range from -32-dB to 31.5-dB. The |
| 49 | // value 0x7F indicates that the current measured gain is 0, i.e., negative infinity in decibels |
| 50 | // terms. (R) (optional) (1-byte) |
| 51 | // |
| 52 | // Lower Gain Threshold |
| 53 | // Lower gain threshold: This attribute specifies the gain the RE uses to declare the low gain |
| 54 | // alarm. Valid values are 0-dB (coded as 0x00) to 63.5-dB (coded as 0xFE). The default value 0xFF |
| 55 | // selects the RE's internal policy. (R,-W) (optional) (1-byte) |
| 56 | // |
| 57 | // Upper Gain Threshold |
| 58 | // Upper gain threshold: This attribute specifies the gain the RE uses to declare the high gain |
| 59 | // alarm. Valid values are 0-dB (coded as 0x00) to 63.5-dB (coded as 0xFE). The default value 0xFF |
| 60 | // selects the RE's internal policy. (R,-W) (optional) (1-byte) |
| 61 | // |
| 62 | // Target Gain |
| 63 | // Target gain: This attribute specifies the target gain, when the operational mode of the parent |
| 64 | // RE downstream or upstream amplifier is set to constant gain mode. Valid values are 0-dB (coded |
| 65 | // as 0x00) to 63.5-dB (coded as 0xFE). The default value 0xFF selects the RE's internal policy. |
| 66 | // (R,-W) (optional) (1-byte) |
| 67 | // |
| 68 | // Device Temperature |
| 69 | // Device temperature: This attribute reports the temperature in degrees Celcius of the active |
| 70 | // device (SOA or pump) in the OA. Its value is a 2s complement integer with granularity |
| 71 | // 1/256-degree-C. (R) (optional) (2-bytes) |
| 72 | // |
| 73 | // Lower Device Temperature Threshold |
| 74 | // Lower device temperature threshold: This attribute is a 2s complement integer that specifies the |
| 75 | // temperature the RE uses to declare the low temperature alarm. Valid values are -64 to |
| 76 | // +63-degree-C in 0.5-degree-C increments. The default value 0x7F selects the RE's internal |
| 77 | // policy. (R,-W) (optional) (1-byte) |
| 78 | // |
| 79 | // Upper Device Temperature Threshold |
| 80 | // Upper device temperature threshold: This attribute is a 2s complement integer that specifies the |
| 81 | // temperature the RE uses to declare the high temperature alarm. Valid values are -64 to |
| 82 | // +63-degree-C in 0.5-degree-C increments. The default value 0x7F selects the RE's internal |
| 83 | // policy. (R,-W) (optional) (1-byte) |
| 84 | // |
| 85 | // Device Bias Current |
| 86 | // Device bias current: This attribute contains the measured bias current applied to the SOA or |
| 87 | // pump laser. Its value is an unsigned integer with granularity 2-mA. Valid values are 0 to |
| 88 | // 512-mA. (R) (optional) (1-byte) |
| 89 | // |
| 90 | // Amplifier Saturation Output Power |
| 91 | // Amplifier saturation output power: This attribute reports the saturation output power of the |
| 92 | // amplifier as specified by the manufacturer. Its value is an unsigned integer referred to 1-mW |
| 93 | // (i.e., dBm), with 0.1-dB granularity. (R) (optional) (2-bytes) |
| 94 | // |
| 95 | // Amplifier Noise Figure |
| 96 | // Amplifier noise figure: This attribute reports the intrinsic noise figure of the amplifier, as |
| 97 | // specified by the manufacturer. Its value is an unsigned integer with 0.1-dB granularity (R) |
| 98 | // (optional) (1-byte) |
| 99 | // |
| 100 | // Amplifier Saturation Gain |
| 101 | // Amplifier saturation gain: This attribute reports the gain of the amplifier at saturation, as |
| 102 | // specified by the manufacturer. Its value is an unsigned integer with 0.25-dB granularity, and |
| 103 | // with a range from 0 to 63.75-dB. (R) (optional) (1-byte) |
| 104 | // |
| 105 | type ReCommonAmplifierParameters struct { |
| 106 | ManagedEntityDefinition |
| 107 | Attributes AttributeValueMap |
| 108 | } |
| 109 | |
| 110 | func init() { |
| 111 | recommonamplifierparametersBME = &ManagedEntityDefinition{ |
| 112 | Name: "ReCommonAmplifierParameters", |
| 113 | ClassID: 328, |
| 114 | MessageTypes: mapset.NewSetWith( |
| 115 | Get, |
| 116 | Set, |
| 117 | ), |
| 118 | AllowedAttributeMask: 0xffe0, |
| 119 | AttributeDefinitions: AttributeDefinitionMap{ |
| 120 | 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 121 | 1: ByteField("Gain", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read), false, true, false, 1), |
| 122 | 2: ByteField("LowerGainThreshold", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, true, false, 2), |
| 123 | 3: ByteField("UpperGainThreshold", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, true, false, 3), |
| 124 | 4: ByteField("TargetGain", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, true, false, 4), |
| 125 | 5: Uint16Field("DeviceTemperature", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read), false, true, false, 5), |
| 126 | 6: ByteField("LowerDeviceTemperatureThreshold", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, true, false, 6), |
| 127 | 7: ByteField("UpperDeviceTemperatureThreshold", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, true, false, 7), |
| 128 | 8: ByteField("DeviceBiasCurrent", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read), false, true, false, 8), |
| 129 | 9: Uint16Field("AmplifierSaturationOutputPower", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read), false, true, false, 9), |
| 130 | 10: ByteField("AmplifierNoiseFigure", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read), false, true, false, 10), |
| 131 | 11: ByteField("AmplifierSaturationGain", UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read), false, true, false, 11), |
| 132 | }, |
| 133 | Access: CreatedByOnu, |
| 134 | Support: UnknownSupport, |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [diff] [blame] | 135 | Alarms: AlarmMap{ |
| 136 | 0: "Low gain", |
| 137 | 1: "High gain", |
| 138 | 2: "Low temperature", |
| 139 | 3: "High temperature", |
| 140 | 4: "High bias current", |
| 141 | 5: "High temperature shutdown", |
| 142 | 6: "High current shutdown", |
| 143 | }, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 144 | } |
| 145 | } |
| 146 | |
| 147 | // NewReCommonAmplifierParameters (class ID 328) creates the basic |
| 148 | // Managed Entity definition that is used to validate an ME of this type that |
| 149 | // is received from or transmitted to the OMCC. |
| 150 | func NewReCommonAmplifierParameters(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 151 | return NewManagedEntity(*recommonamplifierparametersBME, params...) |
| 152 | } |