Hi,

I have a weird problem. I am running Tmote Sky with TinyOS 1.x app. I am
transmitting serial data with following function:

<code>
command result_t Comm.transmit(const COMM_Msg msg)
{
TOS_Msg tosMsg;
uint8_t* p;

//Valid msg type if sent by rfm?
if(msg.destAddr != COMM_SERIAL &&
(msg.type != COMM_MSG_TYPE_CONPACKET && msg.type !=
COMM_MSG_TYPE_DATPACKET))
return COMM_E_INVALID_TYPE;

//Valid length?
if(msg.length <= 0 || msg.length > TOSH_DATA_LENGTH)
return COMM_E_INVALID_LENGTH;

//Transmiiting?
if(mSending == TRUE)
return COMM_E_BUSY;

//Block all new transmission while sending
mSending = TRUE;

//Add message type
memcpy(tosMsg.data, &msg.type, sizeof(tMsgType));

//Add message
memcpy(tosMsg.data + sizeof(tMsgType), msg.data, msg.length);

//Add length
tosMsg.length = sizeof(tMsgType) + msg.length;

//Send the message
if(call Send.send(msg.destAddr, tosMsg.length, &tosMsg) != SUCCESS)
{
//Available for others to transmit
mSending = FALSE;

//Didn't succeed to transmit the package
return COMM_E_TRANS_FAILED;
}

return SUCCESS;
}
</code>

Now, this works fine. BUT if i  remove the statement (uint8_t* p) at the
top, i get strange data out. It's not doing anything anyway... Does anyone
know what is wrong???

Thanks

Inderjit
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to