blob: b28afa825dbad4ce54311e6757b4d96898e0d4c3 [file] [log] [blame]
Chip Boling6e27b352020-02-14 09:10:01 -06001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14/*
15 * NOTE: This file was generated, manual edits will be overwritten!
16 *
17 * Generated by 'goCodeGenerator.py':
18 * https://github.com/cboling/OMCI-parser/README.md
19 */
20
21package generated
22
23import "github.com/deckarep/golang-set"
24
25// OnuPowerSheddingClassID is the 16-bit ID for the OMCI
26// Managed entity ONU power shedding
27const OnuPowerSheddingClassID ClassID = ClassID(133)
28
29var onupowersheddingBME *ManagedEntityDefinition
30
31// OnuPowerShedding (class ID #133)
32// This ME models the ONU's ability to shed services when the ONU goes into battery operation mode
33// after AC power failure. Shedding classes are defined in the following table, which may span
34// multiple circuit pack types. This feature works in conjunction with the power shed override
35// attribute of the circuit pack ME, which can selectively prevent power shedding of priority
36// ports.
37//
38// An ONU that supports power shedding automatically creates an instance of this ME.
39//
40// The following table defines the binding of shedding class and PPTP type. The coding is taken
41// from Table 9.1.5-1. In the case of hybrid circuit pack types, multiple shedding classes may
42// affect a circuit pack if the hardware is capable of partial power shedding.
43//
44// An ONU may choose to model its ports with the port-mapping package of clause 9.1.8, rather than
45// with real or virtual circuit packs. In this case, power shedding pertains to individual PPTPs
46// (listed in column 2 of the table).
47//
48// Relationships
49// One instance of this ME is associated with the ONU ME.
50//
51// Attributes
52// Managed Entity Id
53// Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only
54// one instance, number 0. (R) (mandatory) (2-bytes)
55//
56// Restore Power Timer Reset Interval
57// Restore power timer reset interval: The time delay, in seconds, before resetting the power-
58// shedding timers after full power restoration. Upon ME instantiation, the ONU sets this attribute
59// to 0. (R,-W) (mandatory) (2-bytes)
60//
61// Data Class Shedding Interval
62// Data class shedding interval: (R,-W) (mandatory) (2-bytes)
63//
64// Voice Class Shedding Interval
65// Voice class shedding interval: This attribute only pertains to voice services that terminate on
66// the ONU and are under the management control of the OMCI. (R,-W) (mandatory) (2-bytes)
67//
68// Video Overlay Class Shedding Interval
69// Video overlay class shedding interval: (R,-W) (mandatory) (2-bytes)
70//
71// Video Return Class Shedding Interval
72// Video return class shedding interval: (R,-W) (mandatory) (2-bytes)
73//
74// Digital Subscriber Line Class Shedding Interval
75// Digital subscriber line (DSL) class shedding interval: (R,-W) (mandatory) (2-bytes)
76//
77// Atm Class Shedding Interval
78// ATM class shedding interval: (R,-W) (mandatory) (2-bytes)
79//
80// Ces Class Shedding Interval
81// CES class shedding interval: (R,-W) (mandatory) (2-bytes)
82//
83// Frame Class Shedding Interval
84// Frame class shedding interval: (R,-W) (mandatory) (2-bytes)
85//
86// Sdh_Sonet Class Shedding Interval
87// Sdh-sonet class shedding interval: (R,-W) (mandatory) (2-bytes)
88//
89// Shedding Status
90// The ONU sets each bit to 1 when power shedding is active, and clears it to 0 when the service is
91// restored. (R) (optional) (2-bytes)
92//
93type OnuPowerShedding struct {
94 ManagedEntityDefinition
95 Attributes AttributeValueMap
96}
97
98func init() {
99 onupowersheddingBME = &ManagedEntityDefinition{
100 Name: "OnuPowerShedding",
101 ClassID: 133,
102 MessageTypes: mapset.NewSetWith(
103 Get,
104 Set,
105 ),
106 AllowedAttributeMask: 0xffe0,
107 AttributeDefinitions: AttributeDefinitionMap{
108 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
109 1: Uint16Field("RestorePowerTimerResetInterval", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
110 2: Uint16Field("DataClassSheddingInterval", UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
111 3: Uint16Field("VoiceClassSheddingInterval", UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
112 4: Uint16Field("VideoOverlayClassSheddingInterval", UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4),
113 5: Uint16Field("VideoReturnClassSheddingInterval", UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5),
114 6: Uint16Field("DigitalSubscriberLineClassSheddingInterval", UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
115 7: Uint16Field("AtmClassSheddingInterval", UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
116 8: Uint16Field("CesClassSheddingInterval", UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8),
117 9: Uint16Field("FrameClassSheddingInterval", UnsignedIntegerAttributeType, 0x0080, 0, mapset.NewSetWith(Read, Write), false, false, false, 9),
118 10: Uint16Field("SdhSonetClassSheddingInterval", UnsignedIntegerAttributeType, 0x0040, 0, mapset.NewSetWith(Read, Write), false, false, false, 10),
119 11: Uint16Field("SheddingStatus", UnsignedIntegerAttributeType, 0x0020, 0, mapset.NewSetWith(Read), true, true, false, 11),
120 },
121 Access: CreatedByOnu,
122 Support: UnknownSupport,
123 }
124}
125
126// NewOnuPowerShedding (class ID 133) creates the basic
127// Managed Entity definition that is used to validate an ME of this type that
128// is received from or transmitted to the OMCC.
129func NewOnuPowerShedding(params ...ParamData) (*ManagedEntity, OmciErrors) {
130 return NewManagedEntity(*onupowersheddingBME, params...)
131}