simulator

package
v0.0.0-...-7a68c68 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Simulator

type Simulator struct {
	State                 uint8               `json:"-"`
	Devices               map[int]*dev.Device `json:"-"`
	ActiveDevices         map[int]int         `json:"-"`
	ActiveGateways        map[int]int         `json:"-"`
	ComponentsInactiveTmp int                 `json:"-"`
	Gateways              map[int]*gw.Gateway `json:"-"`
	Forwarder             f.Forwarder         `json:"-"`
	NextIDDev             int                 `json:"nextIDDev"`
	NextIDGw              int                 `json:"nextIDGw"`
	BridgeAddress         string              `json:"bridgeAddress"`
	Resources             res.Resources       `json:"-"`
}

Simulator is a model

func GetIstance

func GetIstance() *Simulator

func (*Simulator) AddWebSocket

func (s *Simulator) AddWebSocket(WebSocket *socketio.Conn)

func (*Simulator) ChangeLocation

func (s *Simulator) ChangeLocation(l socket.NewLocation) bool

func (*Simulator) ChangePayload

func (s *Simulator) ChangePayload(pl socket.NewPayload) (string, bool)

func (*Simulator) DeleteDevice

func (s *Simulator) DeleteDevice(Id int) bool

func (*Simulator) DeleteGateway

func (s *Simulator) DeleteGateway(Id int) bool

func (*Simulator) GetBridgeAddress

func (s *Simulator) GetBridgeAddress() models.AddressIP

func (*Simulator) GetDevices

func (s *Simulator) GetDevices() []dev.Device

func (*Simulator) GetGateways

func (s *Simulator) GetGateways() []gw.Gateway

func (*Simulator) Print

func (s *Simulator) Print(content string, err error, printType int)

func (*Simulator) Run

func (s *Simulator) Run()

func (*Simulator) SaveBridgeAddress

func (s *Simulator) SaveBridgeAddress(remoteAddr models.AddressIP) error

func (*Simulator) SendMACCommand

func (s *Simulator) SendMACCommand(cid lorawan.CID, data socket.MacCommand)
func (s *Simulator) SendUplink(pl socket.NewPayload)

func (*Simulator) SetDevice

func (s *Simulator) SetDevice(device *dev.Device, update bool) (int, int, error)

func (*Simulator) SetGateway

func (s *Simulator) SetGateway(gateway *gw.Gateway, update bool) (int, int, error)

func (*Simulator) Stop

func (s *Simulator) Stop()

func (*Simulator) ToggleStateDevice

func (s *Simulator) ToggleStateDevice(Id int)

func (*Simulator) ToggleStateGateway

func (s *Simulator) ToggleStateGateway(Id int)

Jump to

Keyboard shortcuts

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