Hi all,
I would like to add some more to my previous question.
My target is to create a module that provides Read interface and give a
randomly generated value when the Read.read() is called. So, I am using
another component(WSN) and have uses Read interface of this to that WSN.
*configuration SensorAppC
{
}
implementation
{
components MainC, SensorC,RandomC ;
SensorC.Boot -> Main.Boot;
SensorC.Random-> RandomC;
}
*
and next is the module,
*generic module SensorC() {*
* uses interface Random;*
* uses interface Boot;*
* provides interface Read<uint8_t>;*
*}*
*implementation {*
* event void Boot.booted(){*
*// float tmp =call Random.rand16();*
*dbg("SensorC", "random number = "); *
* }*
* task void senseResult() {*
* float tmp =call Random.rand16();*
* dbg("SensorC", "random number3 = ",tmp);*
* signal Read.readDone(SUCCESS,10);*
* }*
* command error_t Read.read(){*
* return post senseResult();*
* }*
*}*
When I compile my application by using "make micaz sim" with the above code
it gives the same message that i mentioned earlier mail.
But, if i used *
float tmp =call Random.rand16(); *
in booted method it works fine.
Is this happen because rand16 has defined as sync.
(please ignore my silly coding like,
* signal Read.readDone(SUCCESS,10);
*because i used this value 10 for testing purposes and it should use the
randomly generated number there.)
Any help is acknowledged.
Best Regards!
Lasa
On Fri, Oct 24, 2008 at 4:33 PM, lasanthi Heendaliya <[EMAIL PROTECTED]>wrote:
> Hi,
> I am trying to generate random numbers in T2. I got the error message
> "Random.rand16 not connected " ?
>
> I am using Random interface, RandomC component and
> float random = call Random.rand16(); in order to generate the random
> number.
>
>
> Does anybody have an idea why do I get that message? and what should i do?
>
> Thank in advance.
> Lasa
>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help