[Tinyos-help] how to use ParameterInit<uint16_t>
Hazem Al- Ojeh
hazem.alojeh at student.adelaide.edu.au
Sun Jun 1 01:28:58 PDT 2008
I also should of added in the question I asked before, that I tried doing the
following:
uses interface Random;
uses interface ParameterInit<uint16_t> as r;
Both of them Are Wired to:
App.Random -> RandomMlcgC;
App.r -> RandomMlcgC;
so my method looks like:
uint16_t generate_random(uint16_t counter){
if(call r.init(counter)==SUCCESS){
rand = call Random.rand16();
}
return rand;
}
Where counter is a value read by sensors, could be the Light, Temp etc...
However I still get similar numbers every time I run this in Tossim, so I am not
sure if I actually used ParameterInit<uint16_t> correctly or if i am calling
Random.rand16() correctly..
Thanks in advance for any help...
More information about the Tinyos-help
mailing list