Previously, the Cooja mote assumed that its file was always initially empty (file.endptr == 0). Therefore, a file uploaded to a mote's CFS could never be read by the mote, as the mote would prevent reads from going past the EOF (indicated by endptr).
By tracking the file size and making it accessible to Cooja, the correct size of the uploaded file can be reported to the mote and allow it to read the uploaded file.
Refactored RadioMediumObservable to RadioTransmissionObservable because of its function
Added correct RadioMediumObservable and updating in AbstractRadioMedium, DirectedGraphMedium and MRM
Added some documentation
This patch restores the original behaviour of Cooja when
the transmitted packet is correct (which is true in a vast majority
of cases).
In case of a wrong outgoing packet (wrong length, wrong preamble)
the transmission will end when the radio changes its state (which
should always happen after transmitting a packet).
Benchmarks with RPL (33 runs, 50 nodes, 3 hours of simulated time each)
yield the same results (PDR, delay, number of transmitted packets)
as with the unmodified Cooja.
The packet converter used to generate packets of length zero
when it encountered errors during conversion. This caused
exceptions in packet analyzers.
Now the converter returns null in case of error. Appropriate
checks have been added to the code that uses the return value.
Due to errors in mspsim and/or radio drivers, packets of incorrect
length are sometimes transmitted. The length might be larger than
the 127-byte maximum (considered negative in the current code)
or not matching the actual number of transmitted bytes.
This leads to wrong packet delimiting when converting from
the mspsim-level stream of bytes to Cooja-level packets
causing unhandled exceptions that terminate the simulation.
This patch checks the frame preamble (0000007A) and the length field.
If they are wrong, no decoding attempt is done.
The transmitted bytes are still delivered to the receivers untouched.
The connection is terminated when the radio state is changed (which alway
s happens when TX is done).
* Fix CCA detection in Cooja in the case when the receiver swicthes on the right channel during an ongoing transmission. Always add a connection on transmission, even when the channel is not correct. Initially the connection is in a dormant state; this mimics what Cooja is doing when the receiver radio is turned off;
when the receiver is turned on and switched to the right channel, `updateSignalStrengths()` is called, and the connection starts to recieve PHY-level traffic.
* Add "channel" property for DGRM edges.
* Avoid cross-channel interference on DGRM and MRM radio mediums
In the previous implementation a click event was triggered when the
button was pressed.
This implementation allows to set and release buttons independently both
by mouse clicking and by key typing.
SIM_CONTROL_PLGUIN are handled like SIM_PLUGIN, with one exception.
If the simulation is started with -nogui=<simfile> than it is checked
if a controlling plugin is loaded. If not, the simulation terminates
with an error message.