Documentation ¶
Overview ¶
* Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *
Index ¶
- Constants
- func NewPON(ponID uint, c *config.PonConfig, o *config.OnuConfig, maxOnusPerPon uint) interfaces.ICommon
- func StartupGenerator(done <-chan bool, config *config.Config, wg *sync.WaitGroup) (func(map[uint]interfaces.ICommon, *sync.WaitGroup) <-chan interfaces.ICommon, ...)
- type PON
- func (pon *PON) AddTimers(timer *time.Timer)
- func (pon *PON) Configuration() interface{}
- func (pon *PON) GetPonVendorSettings() config.PonVendorInfo
- func (pon *PON) ID() uint
- func (pon *PON) Input() chan<- interface{}
- func (pon *PON) IsEnabled() bool
- func (pon *PON) Lock()
- func (pon *PON) Name() string
- func (pon *PON) Parent() interfaces.ICommon
- func (pon *PON) State() fsm.State
- func (pon *PON) StateTransitionCallback(state fsm.State) error
- func (pon *PON) String() string
- func (pon *PON) Unlock()
Constants ¶
const DisabledState fsm.State = "disabled"
const EnabledState fsm.State = "enabled"
const ImpairedState fsm.State = "impaired"
const InitialState fsm.State = "initial"
const StartingState fsm.State = "starting"
const StoppingState fsm.State = "stopping"
Variables ¶
This section is empty.
Functions ¶
func NewPON ¶
func NewPON(ponID uint, c *config.PonConfig, o *config.OnuConfig, maxOnusPerPon uint) interfaces.ICommon
NewPON creates a new PON object that has ONUs hanging off of it It returns a newly create PON object
func StartupGenerator ¶
func StartupGenerator(done <-chan bool, config *config.Config, wg *sync.WaitGroup) (func(map[uint]interfaces.ICommon, *sync.WaitGroup) <-chan interfaces.ICommon, error)
StartupGenerator returns a generator function that is responsible for PON startup based on the startup pattern requested
Types ¶
type PON ¶
type PON struct { Onus map[uint32]interfaces.ICommon // Operational ONUs on the PON OnusBySN map[string]interfaces.ICommon // Unassigned ONUs on the PON FSM *fsm.Machine // Finite state machine // contains filtered or unexported fields }
PON abstraction and state machine
func (*PON) Configuration ¶
func (pon *PON) Configuration() interface{}
func (*PON) GetPonVendorSettings ¶
func (pon *PON) GetPonVendorSettings() config.PonVendorInfo
GetOnuVendorSettings returns the ONU Vendor Configuration settings for the requested PON. This will be the explicit settings if specified, otherwise the default PON settings are returned.
NOTE: ONU Vendor settings with numerical count take precidence over percentages,
and this function will sort counts first (while preserving order).
func (*PON) Input ¶
func (pon *PON) Input() chan<- interface{}
Input returns the channel that can receive requests from other objects
func (*PON) IsEnabled ¶
IsEnabled returns the current PON enable state. An enabled PON will process discovered ONUs, receive/transmit OMCI messages.
func (*PON) Parent ¶
func (pon *PON) Parent() interfaces.ICommon
Parent returns the parent object of this PON (no one)
func (*PON) StateTransitionCallback ¶
StateTransitionCallback is called after transition to the new state and when the FSM mutex is locked. If synchronous, it will call directly into method. If async, uses a go routine to call the callback