I'm not entirely clear on what you are doing here. Is your Data_Message_PC
encapsulated in TOS_Msg.data ? If not, and you are using java tools
Packetizer.java (which I think MIG generated files depend on) you'll
probably never see it...
I just sent a reply to a message:
"Receiving packets from the base station"
with a couple pointers to info about the message structure.
If you are trying to take a full TOS_Msg off the radio and stuff it
into your Data_Message_PC the message size will be too large and you
will not have the right crc. Perhaps you want to just copy the data
portions from one message to another?
Or are you trying to re-create the function of TOSBase, which sends
messages between the pc-UART-radio?
Also see how demo apps like Oscilloscope build their message packets.
MS
adina wrote:
Hello!
I have a problem with sending some a message over the UART. The message
looks like this:
typedef struct Data_Message_PC
{
uint16_t mote_ID;//the source of the data
uint16_t lastSampleSent;
uint8_t request_ID; //the request id for which this data is for
uint16_t actualData[MAX_DATA];
uint16_t lengthData;
}Data_Message_PC;
I receive a message from a node, that has the length of the actualData of a
length less than MAX_DATA and I need
to send it to the UART, so that a Java application can parse the message
received.
The Java application is using classes generated with MIG, so it always
expects that the actualData received
be of MAX_DATA length.
I have tried to use a for(which is the solution that should have sense), but
it doesn't seem to work.
for (i=0;i<lengthDataReceived;i++) data_pc->data[i] =
dataReceived->data[i];
for (i=lengthDataReceived;i<MAX_DATA;i++) data_pc->data[i] = 0;
If I try to do it like the following, I can see using
net.tinyos.tools.Listen that it has received the message, but this doesn't
work for
me:((
memcpy(data_pc->data,dataReceived->data,sizeof(uint16_t)*lengthDataReceived);
call SendDataToUART.send(TOS_UART_ADDR,
sizeof(uint8_t)*(lengthDataReceived*2+7), &m_msg))
Any help is more than welcome:)
Thanks,
Adina
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help