Versions in this module Expand all Collapse all v0 v0.1.1 Jun 7, 2023 v0.1.0 May 4, 2023 Changes in this version + const CollisionDecodeableLevel + const EventCollision + const EventNodeAdded + const EventNodeRemoved + const EventNodeUpdated + const EventPayloadSizeExceeded + const EventReceived + const EventSending + const MaxPacketLen + type Emulator struct + func New(freq float64, gamma float64, refDist float64, kmRange float64, ...) *Emulator + func (emu *Emulator) AddNode(node Node) error + func (emu *Emulator) Clear() + func (emu *Emulator) GetFreq() float64 + func (emu *Emulator) GetGamma() float64 + func (emu *Emulator) GetKMRange() float64 + func (emu *Emulator) GetNode(id string) Node + func (emu *Emulator) GetRefDist() float64 + func (emu *Emulator) GetStartTime() int64 + func (emu *Emulator) HasNode(id string) bool + func (emu *Emulator) NodeIDs() []string + func (emu *Emulator) Nodes() []Node + func (emu *Emulator) RemoveNode(id string) error + func (emu *Emulator) SendMessage(id string, msg []byte) error + func (emu *Emulator) SetIgnoreCollision(state bool) + func (emu *Emulator) SetLogger(logger logr.Logger) + func (emu *Emulator) SetOnEvent(onEvent OnEventFn) + func (emu *Emulator) SetOnReceived(onReceived OnReceivedFn) + func (emu *Emulator) SetSNROffset(value int) + func (emu *Emulator) SetTimeScaling(value int) error + func (emu *Emulator) SetTraceWriter(writer io.Writer) + func (emu *Emulator) UpdateNode(id string, updater func(node *Node) error) error + type Event string + type LogEntry struct + Data any + Event Event + NodeID string + Time time.Time + type Mobility struct + func NewMobility(emu *Emulator, commands []mobility.Command) *Mobility + func (m *Mobility) Done() + func (m *Mobility) GetPause() bool + func (m *Mobility) SetLoop(val bool) *Mobility + func (m *Mobility) SetPause(val bool) + func (m *Mobility) SetTickrate(tickrate float64) *Mobility + func (m *Mobility) SetTimeScaling(value int) error + func (m *Mobility) Start() + func (m *Mobility) Stop() + type Node struct + ID string + Icon string + Meta map[string]interface{} + Online bool + RXSens float64 + SNR int + TXGain float64 + X float64 + Y float64 + Z float64 + func (n Node) DistanceTo(other Node) float64 + func (n Node) LatLng() (float64, float64) + func (n Node) PathLoss(other Node, distanceRef float64, gamma float64, freq float64) float64 + func (n Node) Valid() error + type OnEventFn func(event Event, node Node, data any) + type OnReceivedFn func(node Node, packet RxPacket) + type RxPacket struct + Airtime float64 + Data []byte + RSSI int + RecvTime int64 + SNR int