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).
The implementation of clickButton(), pressButton(), and releaseButton()
can be shared accross the several node-dependent implementations as
they use the node-dependent doPressButton() doReleaseButton() routines.
As every Button has a node-specific implementation part, this should be
the minimal interface to the backend node emulator for pressing and
releasing a button.
Previously getOutputPowerIndicatorMax() returned the fixed value 31.
This is valid for e.g. the mspsim CC2420 radio implementation but not for the CC2520 implementation where the maximum returned value is 9.
Thus to fix transmission range issues (for example for Wismote node) the maxium value provided by the radio implementaiton must be used.
like /tools/mspsim.
This is a very simple modification that affects a very large number of files in Contiki: Cooja,
/platform/cooja, Collect-view, Coffe-manager, and Cooja simulation files (.csc).
I've gone through Contiki to update all references I could find. Nevertheless, this commit will likely
break external dependencies, like saved Cooja simulation files.
se.sics.cooja.GUI -> se.sics.cooja.Cooja
this commit does not contain any functional changes, but may require external scripts to be updated
such as Makefiles.