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 | // EquipmentExtensionPackageClassID is the 16-bit ID for the OMCI |
| 29 | // Managed entity Equipment extension package |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 30 | const EquipmentExtensionPackageClassID = ClassID(160) // 0x00a0 |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 31 | |
| 32 | var equipmentextensionpackageBME *ManagedEntityDefinition |
| 33 | |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 34 | // EquipmentExtensionPackage (Class ID: #160 / 0x00a0) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 35 | // This ME supports optional extensions to circuit pack MEs. If the circuit pack supports these |
| 36 | // features, the ONU creates and deletes this ME along with its associated real or virtual circuit |
| 37 | // pack. |
| 38 | // |
| 39 | // Relationships |
| 40 | // An equipment extension package may be contained by an ONU-G or cardholder. |
| 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 the ONU-G or cardholder. (R) (mandatory) (2-bytes) |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 46 | // |
| 47 | // Environmental Sense |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 48 | // This attribute provisions an ONU that supports external sense points, e.g., physical security |
| 49 | // detectors at an enclosure. Each pair of bits is defined as follows. |
| 50 | // |
| 51 | // 00 Sense point disabled (default) |
| 52 | // |
| 53 | // 01 Report contact closure |
| 54 | // |
| 55 | // 10 Report contact open |
| 56 | // |
| 57 | // 11 Sense point disabled (same as 00) |
| 58 | // |
| 59 | // If the byte is represented in binary as 0B hhgg ffee ddcc bbaa, bits hh correspond to sense |
| 60 | // point 1, while bits aa correspond to sense point 8. (R,-W) (optional) (2-bytes) |
| 61 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 62 | // NOTE - Some specific sense point applications are already defined on the ONU-G ME. It is the |
| 63 | // vendor's choice how to configure and report sense points that appear both generically and |
| 64 | // specifically. |
| 65 | // |
| 66 | // Contact Closure Output |
Chip Boling | 610117d | 2021-09-09 11:24:34 -0500 | [diff] [blame] | 67 | // This attribute provisions an ONU that supports external contact closure outputs, e.g., sump pump |
| 68 | // or air conditioner activation at an ONU enclosure. A contact point is said to be released when |
| 69 | // it is not energized. Whether this corresponds to an open or a closed electrical circuit depends |
| 70 | // on the ONU's wiring options. Upon ONU initialization, all contact points should go to the |
| 71 | // released state. |
| 72 | // |
| 73 | // If the byte is represented in binary as 0B hhgg ffee ddcc bbaa, bits hh correspond to contact |
| 74 | // output point 1, while bits aa correspond to contact output point 8. |
| 75 | // |
| 76 | // On write, the bits of this attribute have the following meaning. |
| 77 | // |
| 78 | // 0x No change to contact output point state |
| 79 | // |
| 80 | // 10 Release contact output point |
| 81 | // |
| 82 | // 11 Operate contact output point |
| 83 | // |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 84 | // On read, the left bit in each pair should be set to 0 at the ONU and ignored at the OLT. The |
| 85 | // right bit indicates a released output point with 0 and an operated contact point with 1. (R,-W) |
| 86 | // (optional) (2-bytes) |
| 87 | // |
| 88 | type EquipmentExtensionPackage struct { |
| 89 | ManagedEntityDefinition |
| 90 | Attributes AttributeValueMap |
| 91 | } |
| 92 | |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 93 | // Attribute name constants |
| 94 | |
| 95 | const EquipmentExtensionPackage_EnvironmentalSense = "EnvironmentalSense" |
| 96 | const EquipmentExtensionPackage_ContactClosureOutput = "ContactClosureOutput" |
| 97 | |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 98 | func init() { |
| 99 | equipmentextensionpackageBME = &ManagedEntityDefinition{ |
| 100 | Name: "EquipmentExtensionPackage", |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 101 | ClassID: EquipmentExtensionPackageClassID, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 102 | MessageTypes: mapset.NewSetWith( |
| 103 | Get, |
| 104 | Set, |
| 105 | ), |
| 106 | AllowedAttributeMask: 0xc000, |
| 107 | AttributeDefinitions: AttributeDefinitionMap{ |
Chip Boling | 8cdd639 | 2022-01-27 08:43:37 -0600 | [diff] [blame^] | 108 | 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0), |
| 109 | 1: Uint16Field(EquipmentExtensionPackage_EnvironmentalSense, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, true, false, 1), |
| 110 | 2: Uint16Field(EquipmentExtensionPackage_ContactClosureOutput, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, true, false, 2), |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 111 | }, |
| 112 | Access: CreatedByOnu, |
| 113 | Support: UnknownSupport, |
Chip Boling | 34ebcb6 | 2021-02-02 12:13:58 -0600 | [diff] [blame] | 114 | Alarms: AlarmMap{ |
| 115 | 0: "Reserved", |
| 116 | 1: "Sense point 1", |
| 117 | 2: "Sense point 2", |
| 118 | 3: "Sense point 3", |
| 119 | 4: "Sense point 4", |
| 120 | 5: "Sense point 5", |
| 121 | 6: "Sense point 6", |
| 122 | 7: "Sense point 7", |
| 123 | 8: "Sense point 8", |
| 124 | }, |
Chip Boling | 6e27b35 | 2020-02-14 09:10:01 -0600 | [diff] [blame] | 125 | } |
| 126 | } |
| 127 | |
| 128 | // NewEquipmentExtensionPackage (class ID 160) creates the basic |
| 129 | // Managed Entity definition that is used to validate an ME of this type that |
| 130 | // is received from or transmitted to the OMCC. |
| 131 | func NewEquipmentExtensionPackage(params ...ParamData) (*ManagedEntity, OmciErrors) { |
| 132 | return NewManagedEntity(*equipmentextensionpackageBME, params...) |
| 133 | } |