There are quite a number of things wrong with your sample code,
starting with using a TOS_MsgPtr, which should be set to point
to some TOS_Msg sized block of memory, but isn't... But to
answer the actual question, go count up the number of bytes in the
platform/tmote/AM.h file. ( I think it's in tmote anyway, or you
will have to chase it up the entire chain of MSP platform dirs...)

But the real issue, is if you want to send TOS_Msg's over the UART
you should just use GenericComm with the UART address instead of
BCAST or a specific moteID. You don't say what TOS version you are
using, but I think under T1 with standard tmote boomerang you can
look at how the CountUART demo app works.

Now, if I could just get it to compile myself...
MS

Bhavish Aggarwal wrote:
Hi,

I've been trying to send a TOS_Msg struct over wires between 2 tmote
sky nodes. One thing I am not sure about is what is the size of
TOS_Msg packet that will be transmitted? I will be extremely thankful
for any help on this issue.

To transmit, I am doing the following:

typedef struct{
    uint8_t val;
}datanew;

TOS_MsgPtr msg;

body = (datanew*) msg->data;
body->val = 1;

packet = (uint8_t*) msg;
length = sizeof(msg);

while(length > 0){
      call UartControl.tx(packet[sendCount]);
      while (! call UartControl.isTxEmpty() ) ;
      length--;
      sendCount++;
}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to