pon

package
v0.0.0-...-4bc4564 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

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

View Source
const DisabledState fsm.State = "disabled"
View Source
const EnabledState fsm.State = "enabled"
View Source
const ImpairedState fsm.State = "impaired"
View Source
const InitialState fsm.State = "initial"
View Source
const StartingState fsm.State = "starting"
View Source
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) AddTimers

func (pon *PON) AddTimers(timer *time.Timer)

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) ID

func (pon *PON) ID() uint

func (*PON) Input

func (pon *PON) Input() chan<- interface{}

Input returns the channel that can receive requests from other objects

func (*PON) IsEnabled

func (pon *PON) IsEnabled() bool

IsEnabled returns the current PON enable state. An enabled PON will process discovered ONUs, receive/transmit OMCI messages.

func (*PON) Lock

func (pon *PON) Lock()

func (*PON) Name

func (pon *PON) Name() string

func (*PON) Parent

func (pon *PON) Parent() interfaces.ICommon

Parent returns the parent object of this PON (no one)

func (*PON) State

func (pon *PON) State() fsm.State

func (*PON) StateTransitionCallback

func (pon *PON) StateTransitionCallback(state fsm.State) error

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

func (*PON) String

func (pon *PON) String() string

Convert type to string

func (*PON) Unlock

func (pon *PON) Unlock()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL