blob: 511439bf89afc2cf0cc6b07f1a6d8fd40a8c33fa [file] [log] [blame]
Chip Boling610117d2021-09-09 11:24:34 -05001/*
2 * Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
3 * Copyright 2020-present Open Networking Foundation
Chip Boling8cdd6392022-01-27 08:43:37 -06004 *
Chip Boling610117d2021-09-09 11:24:34 -05005 * 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 Boling8cdd6392022-01-27 08:43:37 -06008 *
Chip Boling610117d2021-09-09 11:24:34 -05009 * http://www.apache.org/licenses/LICENSE-2.0
Chip Boling8cdd6392022-01-27 08:43:37 -060010 *
Chip Boling610117d2021-09-09 11:24:34 -050011 * 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 */
17/*
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
24package generated
25
26import "github.com/deckarep/golang-set"
27
28// TimeStatusMessageClassID is the 16-bit ID for the OMCI
29// Managed entity Time Status Message
30const TimeStatusMessageClassID = ClassID(440) // 0x01b8
31
32var timestatusmessageBME *ManagedEntityDefinition
33
34// TimeStatusMessage (Class ID: #440 / 0x01b8)
35// This ME provides status and characterization information for the time-transmitting node and its
36// grandmaster. An ONU that supports time synchronization automatically creates an instance of this
37// ME. The best practise is to set all the attributes at the same time.
38//
39// Relationships
40// The single instance of this ME is associated with the ONU ME.
41//
42// Attributes
43// Managed Entity Id
44// This attribute uniquely identifies each instance of this ME. There is only one instance, number
45// 0. (R) (mandatory) (2 bytes)
46//
47// Domain Number
48// Using the format of clause 7.1 of [IEEE 1588]. The default value is 0. (R, W) (mandatory) (1
49// byte)
50//
51// Flag Field
52// The field format is given in the table. Value 1 represents "true". (R, W) (mandatory) (1 byte)
53//
54// Currentutcoffset
55// Provides the UTC offset value between the TAI and UTC timescales (UTC Offset-= TAI-- UTC), as
56// specified in clause 7.2.3 of [IEEE 1588]. (R, W) (mandatory) (2 bytes)
57//
58// Priority1
59// As specified in clause 7.6.2.2 of [IEEE 1588]. (R, W) (mandatory) (1 byte)
60//
61// Clockclass
62// Provides the clockClass information denoting the traceability of the time distributed by the
63// grandmaster clock, as specified in clause 7.6.2.4 of [IEEE 1588]. (R, W) (mandatory) (1 byte)
64//
65// Accuracy
66// Indicates the expected accuracy of a clock when it is the grandmaster, as specified in clause
67// 7.6.2.5 of [IEEE 1588]. (R, W) (mandatory) (1 byte)
68//
69// Offsetscaledlogvariance
70// Provides the estimate of the time variance, as specified in clause-7.6.3 of [IEEE 1588]. (R, W)
71// (mandatory) (2 bytes)
72//
73// Priority2
74// As specified in clause 7.6.2.3 of [IEEE 1588]. (R, W) (mandatory) (1 byte)
75//
76// Grandmaster ID: The clockIdentity attribute of the grandmaster, taken from the IEEE EUI64
77// individual assigned numbers. (R, W) (mandatory) (8 bytes)
78//
79// Steps removed: Provides the number of boundary clocks between the local clock and the master.
80// (R, W) (mandatory) (2 bytes)
81//
82// Time source: Indicates the source of time used by the grandmaster clock, as specified in clause
83// 7.6.2.6 of [IEEE 1588]. (R, W) (mandatory) (1 byte)
84//
85type TimeStatusMessage struct {
86 ManagedEntityDefinition
87 Attributes AttributeValueMap
88}
89
Chip Boling8cdd6392022-01-27 08:43:37 -060090// Attribute name constants
91
92const TimeStatusMessage_DomainNumber = "DomainNumber"
93const TimeStatusMessage_FlagField = "FlagField"
94const TimeStatusMessage_Currentutcoffset = "Currentutcoffset"
95const TimeStatusMessage_Priority1 = "Priority1"
96const TimeStatusMessage_Clockclass = "Clockclass"
97const TimeStatusMessage_Accuracy = "Accuracy"
98const TimeStatusMessage_Offsetscaledlogvariance = "Offsetscaledlogvariance"
99const TimeStatusMessage_Priority2 = "Priority2"
100
Chip Boling610117d2021-09-09 11:24:34 -0500101func init() {
102 timestatusmessageBME = &ManagedEntityDefinition{
103 Name: "TimeStatusMessage",
Chip Boling8cdd6392022-01-27 08:43:37 -0600104 ClassID: TimeStatusMessageClassID,
Chip Boling610117d2021-09-09 11:24:34 -0500105 MessageTypes: mapset.NewSetWith(
106 Get,
107 Set,
108 ),
109 AllowedAttributeMask: 0xff00,
110 AttributeDefinitions: AttributeDefinitionMap{
Chip Boling8cdd6392022-01-27 08:43:37 -0600111 0: Uint16Field(ManagedEntityID, PointerAttributeType, 0x0000, 0, mapset.NewSetWith(Read), false, false, false, 0),
112 1: ByteField(TimeStatusMessage_DomainNumber, UnsignedIntegerAttributeType, 0x8000, 0, mapset.NewSetWith(Read, Write), false, false, false, 1),
113 2: ByteField(TimeStatusMessage_FlagField, UnsignedIntegerAttributeType, 0x4000, 0, mapset.NewSetWith(Read, Write), false, false, false, 2),
114 3: Uint16Field(TimeStatusMessage_Currentutcoffset, UnsignedIntegerAttributeType, 0x2000, 0, mapset.NewSetWith(Read, Write), false, false, false, 3),
115 4: ByteField(TimeStatusMessage_Priority1, UnsignedIntegerAttributeType, 0x1000, 0, mapset.NewSetWith(Read, Write), false, false, false, 4),
116 5: ByteField(TimeStatusMessage_Clockclass, UnsignedIntegerAttributeType, 0x0800, 0, mapset.NewSetWith(Read, Write), false, false, false, 5),
117 6: ByteField(TimeStatusMessage_Accuracy, UnsignedIntegerAttributeType, 0x0400, 0, mapset.NewSetWith(Read, Write), false, false, false, 6),
118 7: Uint16Field(TimeStatusMessage_Offsetscaledlogvariance, UnsignedIntegerAttributeType, 0x0200, 0, mapset.NewSetWith(Read, Write), false, false, false, 7),
119 8: ByteField(TimeStatusMessage_Priority2, UnsignedIntegerAttributeType, 0x0100, 0, mapset.NewSetWith(Read, Write), false, false, false, 8),
Chip Boling610117d2021-09-09 11:24:34 -0500120 },
121 Access: CreatedByOnu,
122 Support: UnknownSupport,
123 Alarms: AlarmMap{
124 0: "Clock unlock",
125 1: "ESMC loss",
126 2: "Time unlock",
127 },
128 }
129}
130
131// NewTimeStatusMessage (class ID 440) creates the basic
132// Managed Entity definition that is used to validate an ME of this type that
133// is received from or transmitted to the OMCC.
134func NewTimeStatusMessage(params ...ParamData) (*ManagedEntity, OmciErrors) {
135 return NewManagedEntity(*timestatusmessageBME, params...)
136}