Again, I'm a bit unclear on the question....
You send (from PC or mote) a message with the destination mote ID as it's addr.
When you receive it at (any) mote, that addr is read and used to decide if
the message is for that mote.

I think the problem may be that the TOSsers overlaid the UART addr thing
on the moteID in GenericComm. I guess it seemed to be a good idea at the
time, but it actually breaks the advertised wonderful system modularity
(c.f., the differences between apps Oscilloscope and OscilloscopeRF).

The general case is that the message addr is that of the real destination, and
the special case is that GenericComm overlays the UART using a special moteID.
I suppose this is under the assumption that messages to the UART are going to
a host machine that doesn't have a mote ID. On the obverse, one needs a way
to direct messages FROM the host TO specific motes, so again the assumption is
that there is only one UART of interest. In fact there is no reason that
the host side code should imitate GenericComm's foibles.

This leaves a couple problems for GenericComm. First, you can't actually send
inter-mote messages via UART connection because you can't simultaneously address
the UART and the destination mote. And second, you can't implement TOSBase
without digging deeper into the 'protocol' stack because you can't address two
motes (TOSBase and the destination) at the same time...

If you relax your grip on logic,
it all begins to make a certain kind of sense...

Hope this helps
MS


Phani Kumar Arava wrote:
Exactly,

Now my question is why isnt this symmetric? Why should i send TOS_BCAST_ADDR or NODE_ID when i receive the message from the UART ?

Anyone can throw light on the reason ?



On 11/28/06, *Michael Schippling* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Oh, I think I get it now...

    When sending from the PC, use the destination node ID, or BCAST, as the
    TOS_Msg.addr. It's not symmetric with the GenericComm usage, but since
    there is only one serial port of interest this PC side kludge allows
    you to send to specific destination motes when using TOSBase. Again my
    code has examples of Java code on the host side which may make sense.

    MS

    Phani Kumar Arava wrote:
     > Maybe, I was unclear in my previuos mail. I was trying to send
    messages
     > from the PC to the mote, trying to send commands to the mote, for
     > example LEDS_ON .Similar to SimpleCmd, but just using UART.
     >
     > I was trying to do this, but was not successful, so started
    debuggin and
     > found the same results, the issue here was in AMStandard.nc where
     > UARTRecv.receive was saying
     >
     > event TOS_MsgPtr UARTReceive.receive(TOS_MsgPtr packet) {
     >     // A serial cable is not a shared medium and does not need
    group-id
     >     // filtering
     >     packet->group = TOS_AM_GROUP;
     >     return received(packet);
     >   }
     >
     >
     > and the received function here says.
     >
     >
     > TOS_MsgPtr received(TOS_MsgPtr packet)  __attribute__ ((C,
    spontaneous)) {
     >     uint16_t addr = TOS_LOCAL_ADDRESS;
     >     counter++;
     >     dbg(DBG_AM, "AM_address = %hx, %hhx; counter:%i \n ",
    packet->addr,
     > packet->type, (int)counter);
     >
     >     if (packet->crc == 1 && // Uncomment this line to check crcs
     >         packet->group == TOS_AM_GROUP &&
     >         (packet->addr == TOS_BCAST_ADDR ||
     >          packet->addr == addr))
     >       {
     >
     >         uint8_t type = packet->type;
     >         TOS_MsgPtr tmp;
     >         // Debugging output
     >         dbg(DBG_AM, "Received message:\n\t");
     >         dbgPacket(packet);
     >         dbg(DBG_AM, "AM_type = %d\n", type);
     >
     >         // dispatch message
     >         tmp = signal ReceiveMsg.receive[type](packet);
     >         if (tmp)
     >           packet = tmp;
     >       }
     >     return packet;
     >   }
     >
     >
     > The problem here Iam pointing to is with the UART.Lets say Iam
    sending
     > something into the mote using SerialForwarder,  with TOS_UART_ADDR ,
     > will that raise the signal ReceiveMsg.receive ?
     >
     > I think it will not.
     >
     > So to get my stuff running, I modified the code of receive to be like
     >
     >  event TOS_MsgPtr UARTReceive.receive(TOS_MsgPtr packet) {
     >     uint16_t addr = TOS_LOCAL_ADDRESS;
     >     // A serial cable is not a shared medium and does not need
    group-id
     >     // filtering
     >     packet->group = TOS_AM_GROUP;
     >     packet->addr =TOS_LOCAL_ADDRESS;
     >     return received(packet);
     >   }
     >
     > Now Iam able to receive the commands from the C, But iam not sure
     > whether is the right way the TINYOS people meant it to be like.
     >
     >
     > On 11/28/06, *Michael Schippling* < [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
     > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
     >
     >     This is all T1 stuff...
     >
     >     I'm not entirely clear on what you are doing or asking since the
     >     question is about send and you have some snippets of receive
    code...
     >
     >     In general you can send to the serial port using
    TOS_UART_ADDR ala:
     >          call RStatusMsg.send( TOS_UART_ADDR, sizeof(RoboStatusMsg),
     >     statmsgp );
     >
     >     If you have another mote on the other end of the serial line,
    then you
     >     should be able to get GenericComm messages from radio or uart
    using the
     >     standard message configuration techniques to wire to your
    method, like:
     >          event TOS_MsgPtr RCmdStartMsg.receive(TOS_MsgPtr m) {  }
     >
     >     There are some convoluted comm examples in my code at:
     >           http://www.etantdonnes.com/Motes/robocode.tar.gz
     >
     >     MS
     >
     >     Phani Kumar Arava wrote:
     >      > I was trying to write a Command Interface to my mote. Iam
    not sure
     >      > whether this is a bug, (Or maybe iam using the wrong
    component
     >     for UART
     >      > communication)
     >      >
     >      > But when I send some message to my mote using GenericComm (or
     >     anything
     >      > using AMStandard)
     >      >
     >      > event TOS_MsgPtr UARTReceive.receive(TOS_MsgPtr packet) {
     >      >     // A serial cable is not a shared medium and does not need
     >     group-id
     >      >     // filtering
     >      >     packet->group = TOS_AM_GROUP;
     >      >     return received(packet);
     >      >   }
     >      >
     >      >
     >      > In AMStandard received.
     >      >
     >      >     if (packet->crc == 1 && // Uncomment this line to
    check crcs
     >      >         packet->group == TOS_AM_GROUP &&
     >      >         (packet->addr == TOS_BCAST_ADDR ||
     >      >          packet->addr == addr) )
     >      >
     >      > Isnt this a problem with TOS_UART_ADDR . I mean the
    message that is
     >      > communicated through UART, does not indicate a signal to
    the event
     >      > received. that means if Iam sending anything through UART
    with my
     >      > messages, it doesnt signal anything?
     >      >
     >      > Is that the architecture of TinyOS always meant that the
    packet sent
     >      > through UART always meant to be TOS_LOCAL_ADDR ?
     >      >
     >      >
     >      >
     >      >
     >      >
     >      > --
     >      > Phani Kumar Arava
     >      > Grad Student                                             1560
     >      > Worthington Street
     >      > Department Of Computer Science                Columbus
    Ohio 43201
     >      > 2015 Neil Avenue
     >      > Ohio State University
     >      > Columbus Ohio-43210
     >      >
     >      > Contact: (614)-286-2618
     >      > URL : www.cse.ohio-state.edu/~arava/
    <http://www.cse.ohio-state.edu/~arava/>
     >     <http://www.cse.ohio-state.edu/~arava/>
     >     <http://www.cse.ohio-state.edu/~arava/
    <http://www.cse.ohio-state.edu/~arava/>>
     >      > mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> <mailto:
     >     [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    <mailto:[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>>>,[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
     >     <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
     >      > <mailto:[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>>>,
     >     [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
     >      > <mailto:[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]> <mailto: [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>>>
     >      >
     >      >
     >      >
> ------------------------------------------------------------------------
     >      >
     >      > _______________________________________________
     >      > Tinyos-help mailing list
     >      > [email protected]
    <mailto:[email protected]>
     >     <mailto: [email protected]
    <mailto:[email protected]>>
     >      >
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
    <https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help>
     >
     >
     >
     >
     > --
     > Phani Kumar Arava
     > Grad Student                                             1560
     > Worthington Street
     > Department Of Computer Science                Columbus Ohio 43201
     > 2015 Neil Avenue
     > Ohio State University
     > Columbus Ohio-43210
     >
     > Contact: (614)-286-2618
     > URL : www.cse.ohio-state.edu/~arava/
    <http://www.cse.ohio-state.edu/~arava/> <
    http://www.cse.ohio-state.edu/~arava/>
     > mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
    <mailto:[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>>,[EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
     > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>,
    [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
     > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>




--
Phani Kumar Arava
Grad Student 1560 Worthington Street
Department Of Computer Science                Columbus Ohio 43201
2015 Neil Avenue
Ohio State University
Columbus Ohio-43210

Contact: (614)-286-2618
URL : www.cse.ohio-state.edu/~arava/ <http://www.cse.ohio-state.edu/~arava/>
mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>,[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>, [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to