fsm

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FiniteStateMachine

type FiniteStateMachine struct {
	InitState   *string
	States      []State
	Transitions []StateTransition
	// contains filtered or unexported fields
}

func Load

func Load(bytes []byte) (*FiniteStateMachine, error)

func (*FiniteStateMachine) ChangeState

func (fsm *FiniteStateMachine) ChangeState(name string) error

func (*FiniteStateMachine) CurrentState

func (fsm *FiniteStateMachine) CurrentState() *State

func (*FiniteStateMachine) IsAllowed

func (fsm *FiniteStateMachine) IsAllowed(msgType uint32) bool

func (*FiniteStateMachine) MoveToNextState

func (fsm *FiniteStateMachine) MoveToNextState() bool

func (*FiniteStateMachine) OnReceived

func (fsm *FiniteStateMachine) OnReceived(msgType uint32)

type State

type State struct {
	Name             string
	MsgTypeWhitelist string // example: "1, 2-10, 30"
	MsgTypeBlacklist string
	// contains filtered or unexported fields
}

type StateTransition

type StateTransition struct {
	FromState string
	ToState   string
	MsgType   uint32
}

Jump to

Keyboard shortcuts

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