blob: 4c065e3d926a8856e909a5dcc5ea47cc598a8dc0 [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// OnuDataClassID is the 16-bit ID for the OMCI
26// Managed entity ONU data
27const OnuDataClassID ClassID = ClassID(2)
28
29var onudataBME *ManagedEntityDefinition
30
31// OnuData (class ID #2)
32// This ME models the MIB itself. Clause I.1.3 explains the use of this ME with respect to MIB
33// synchronization.
34//
35// The ONU automatically creates an instance of this ME, and updates the associated attributes
36// according to data within the ONU itself.
37//
38// Relationships
39// One instance of this ME is contained in an ONU.
40//
41// Attributes
42// Managed Entity Id
43// Managed entity ID: This attribute uniquely identifies each instance of this ME. There is only
44// one instance, number 0. (R) (mandatory) (2-bytes)
45//
46// Mib Data Sync
47// MIB data sync: This attribute is used to check the alignment of the MIB of the ONU with the
48// corresponding MIB in the OLT. MIB data sync relies on this attribute, which is a sequence number
49// that can be checked by the OLT to see if the MIB snapshots for the OLT and ONU match. Refer to
50// clause I.1.2.1 for a detailed description of this attribute. Upon ME instantiation, the ONU sets
51// this attribute to 0. (R,-W) (mandatory) (1-byte)
52//
53type OnuData struct {
54 ManagedEntityDefinition
55 Attributes AttributeValueMap
56}
57
58func init() {
59 onudataBME = &ManagedEntityDefinition{
60 Name: "OnuData",
61 ClassID: 2,
62 MessageTypes: mapset.NewSetWith(
63 Get,
64 GetAllAlarms,
65 GetAllAlarmsNext,
66 MibReset,
67 MibUpload,
68 MibUploadNext,
69 Set,
70 ),
71 AllowedAttributeMask: 0x8000,
72 AttributeDefinitions: AttributeDefinitionMap{
73 0: Uint16Field("ManagedEntityId", PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
74 1: ByteField("MibDataSync", UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
75 },
76 Access: CreatedByOnu,
77 Support: UnknownSupport,
78 }
79}
80
81// NewOnuData (class ID 2) creates the basic
82// Managed Entity definition that is used to validate an ME of this type that
83// is received from or transmitted to the OMCC.
84func NewOnuData(params ...ParamData) (*ManagedEntity, OmciErrors) {
85 return NewManagedEntity(*onudataBME, params...)
86}