|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.sim.radio.Channel
The Channel
class implements a serial channel that represents a communication
channel where bits are sent one by one. The channel allows bits to be written into the channel
at a particular time and represents their serial transmission over time by an array.
The channel is used in simulating radio transmissions; all transmissions write into the channel, and all samples read from the channel.
Field Summary | |
protected long |
bitPeriod
|
protected int |
bits
|
protected boolean[] |
channelValues
|
protected boolean[] |
channelWritten
|
protected long |
globalTime
|
protected boolean |
invert
|
protected long |
period
|
Constructor Summary | |
Channel(int bits,
long period,
boolean invert)
|
Method Summary | |
void |
advance()
The advance() method advances the channel to the next period. |
protected int |
channelOffset(long gtime)
|
boolean |
occupied(long start,
long end)
The occupied() method tests whether this channel has been written to
in the window of time specified. |
int |
read(long time,
int bits)
The read() method reads the value of the channel at the current time, going
back by the number of bits. |
void |
write(int value,
int bits,
long time)
The write() method writes a value into the channel, with the given bit length
at the given global time. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final int bits
protected final long period
protected final long bitPeriod
protected long globalTime
protected final boolean invert
protected final boolean[] channelValues
protected final boolean[] channelWritten
Constructor Detail |
public Channel(int bits, long period, boolean invert)
Method Detail |
public void write(int value, int bits, long time)
write()
method writes a value into the channel, with the given bit length
at the given global time.
value
- the value to write into the channelbits
- the number of bits to writetime
- the global time at which the write takes placepublic void advance()
advance()
method advances the channel to the next period.
public int read(long time, int bits)
read()
method reads the value of the channel at the current time, going
back by the number of bits.
time
- the global time at which to read the channel
public boolean occupied(long start, long end)
occupied()
method tests whether this channel has been written to
in the window of time specified.
start
- the start of the interval to checkend
- the end of the interval to check
protected int channelOffset(long gtime)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |