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 |
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 | |
| 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 | } |