channel

package
v0.0.0-...-c1c2666 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2015 License: Apache-2.0, LGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Simple SISO Channel interface that creates links and emulates multipath channel between transmitters and receivers Will soon be moved to github.com/wiless/gocomm package

Index

Constants

This section is empty.

Variables

View Source
var BufferStates = [...]string{
	"DataReady",
	"DataSent",
	"DataACKed",
}

Functions

This section is empty.

Types

type BufferState

type BufferState int
const (
	DataReady BufferState = iota
	DataSent
	DataACKed
)

func (BufferState) String

func (b BufferState) String() string

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

func NewWirelessChannel

func NewWirelessChannel(links []cell.LinkMetric) *Channel

func NewWirelessChannelFromFile

func NewWirelessChannelFromFile(file string) *Channel

func (*Channel) AddReceiver

func (c *Channel) AddReceiver(rx cell.Receiver)

AddReceiver adds the receiver rx and assoicates with the rxnodeid from rx.GetID()

func (*Channel) AddTransmiter

func (c *Channel) AddTransmiter(tx cell.Transmitter)

AddTransmitter adds the transmitter tx and assoicates with the txnodeid from tx.GetID()

func (*Channel) CheckReceivers

func (c *Channel) CheckReceivers() bool

CheckTransmitters checks if a Transmitter is set for all the txnodeids set through linkmetrics

func (*Channel) CheckTransmitters

func (c *Channel) CheckTransmitters() bool

CheckTransmitters checks if a Transmitter is set for all the txnodeids set through linkmetrics

func (*Channel) CreateFromFile

func (c *Channel) CreateFromFile(file string)

func (*Channel) GetRxNodeIDs

func (c *Channel) GetRxNodeIDs(sfid int) vlib.VectorI

func (*Channel) GetTxNodeIDs

func (c *Channel) GetTxNodeIDs(sfid int) vlib.VectorI

func (*Channel) Init

func (c *Channel) Init()

/ After loading all links this must be last func to be called before running the channel

func (*Channel) SFN

func (c *Channel) SFN() int

func (*Channel) SFNids

func (c *Channel) SFNids() vlib.VectorI

func (*Channel) Start

func (c *Channel) Start(sfids ...int)

Start triggers all the transmitters and receivers in all the SFN to transmit and receive data

type ReceiverBufferManager

type ReceiverBufferManager struct {
	sync.Mutex
	TxReadyStatus map[int]*Status
	// contains filtered or unexported fields
}

func (*ReceiverBufferManager) Create

func (r *ReceiverBufferManager) Create(rxid int, totalTxIDs int)

func (*ReceiverBufferManager) GetCh

func (*ReceiverBufferManager) ShouldACK

func (r *ReceiverBufferManager) ShouldACK(txid int) bool

func (*ReceiverBufferManager) UpdateCounter

func (r *ReceiverBufferManager) UpdateCounter(txid int)

type RecieverBuffer

type RecieverBuffer struct {
	sync.Mutex

	TotalTx int
	// contains filtered or unexported fields
}

func (*RecieverBuffer) Accumulate

func (r *RecieverBuffer) Accumulate(samples vlib.VectorC)

func (*RecieverBuffer) Write

func (r *RecieverBuffer) Write(obj gocomm.SComplex128AObj)

type SFN

type SFN struct {
	Port2LinkIndex map[int]int // Lookup of the row index for the given receiver-id
	// contains filtered or unexported fields
}

func (*SFN) GetRxNodeIDs

func (s *SFN) GetRxNodeIDs() vlib.VectorI

func (*SFN) GetTxNodeIDs

func (s *SFN) GetTxNodeIDs() vlib.VectorI

func (*SFN) StartBufferManager

func (s *SFN) StartBufferManager()

type Status

type Status struct {
	Total int
	// contains filtered or unexported fields
}

type TransmitterBuffer

type TransmitterBuffer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*TransmitterBuffer) ReadObj

func (*TransmitterBuffer) ReadSamples

func (t *TransmitterBuffer) ReadSamples() vlib.VectorC

func (*TransmitterBuffer) SetState

func (t *TransmitterBuffer) SetState(bf BufferState)

func (*TransmitterBuffer) Update

func (t *TransmitterBuffer) Update()

func (*TransmitterBuffer) WriteObj

func (t *TransmitterBuffer) WriteObj(obj gocomm.SComplex128AObj)

func (*TransmitterBuffer) WriteSamples

func (t *TransmitterBuffer) WriteSamples(v vlib.VectorC)

type TransmitterBufferManager

type TransmitterBufferManager struct {
	// contains filtered or unexported fields
}

func (*TransmitterBufferManager) Get

func (*TransmitterBufferManager) ReadyForNextSlot

func (t *TransmitterBufferManager) ReadyForNextSlot() bool

func (*TransmitterBufferManager) Set

func (*TransmitterBufferManager) Start

func (t *TransmitterBufferManager) Start()

Jump to

Keyboard shortcuts

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