I'm going to cc this back to the help list
where you should send questions...

If you want to use IntToRfm to send RSSI, I guess you would
use the received message strength as the output( value ).

Never use hard coded numbers if you can avoid it. I think
you want to keep the TOS_LOCAL_ADDRESS (which is set to
the install.NN ID number) where it is. TOS_BCAST_ADDR in
the below code is where you are sending messages TO, in
this case everyone. If you want to send() to a specific
mote, then use it's ID value instead of BCAST.

The receiving mote can get the source ID from IntMsg.src.
If you are unclear on how to receive messages look at the
RfmToLeds and SimpleCmd apps.

The comparison you show will tell you if RSSI1 is greater
than RSSI2, but the numbers are sorta advisory...if you've
been following the flurry of strength-to-distance questions
on the list, and looked at some of the ref'ed papers you'll
see that there's a lot of variability when trying to do this.

MS

Tarek Mohamed Salah El-Din Mansour wrote:

Hi Mr. Schippling,

I want to ask you a couple of questions if possible;

-If i the strength in a variable like "RSSI1", which part of the following "IntToRfmM" code should be modified? -If i have a MOTE that i want to send to it and i already gave it a node ID 14 by "make mica2 install.14", should i write "14" instead of "TOS_BCAST_ADDR"? -If i have a MOTE that should receive 3 msgs from 3 different MOTES where "RSSI1" will be the data in this case, how can the MOTE detect the MOTE ID that is sending and extract the data from it? -If after extracting the "RSSI" msg from the 3 MOTES and i want to compare between them, will it be like (if "RSSI1">"RSSI2") or what?
------------------------------------------------------------
command result_t IntOutput.output(uint16_t value)
  {
    IntMsg *message = (IntMsg *)data.data;

    if (!pending)
      {
        pending = TRUE;

        message->val = value;
        atomic {
          message->src = TOS_LOCAL_ADDRESS;
        }
        if (call Send.send(TOS_BCAST_ADDR, sizeof(IntMsg), &data))
          return SUCCESS;

        pending = FALSE;
      }
    return FAIL;
  }

  event result_t Send.sendDone(TOS_MsgPtr msg, result_t success)
  {
    if (pending && msg == &data)
      {
        pending = FALSE;
        signal IntOutput.outputComplete(success);
      }
    return SUCCESS;
  }
---------------------------------------------------------------------------

Best Regards,
Tito

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to