[Tinyos-help] Help with UARTRcvdTask() in TOSBase

Jon jonathan.knoblauch at gmail.com
Sat Sep 24 23:21:08 PDT 2005


Hi,
 I am trying to inject one byte of data into the data field of TOS_Msg using
HPLUART.get and building a packet structure shown below in UARTRcvdTask().
The byte of data is 0xAA so the crc is correct.
 I am using TOSBase as the base station. When i try to inject the packet
from the PC, TOSBase is not recognising it. Does anyone know how I could fix
this? I can send my whole file if needed.
 Thanks,
Jon.
  async event result_t HPLUART.get(uint8_t value)
{
return SUCCESS;
temp = value;
return temp;
}

task void UARTRcvdTask() {
result_t Result;

dbg (DBG_USR1, "TOSBase forwarding UART packet to Radio\n");

/* Builds Packet Structure and gets one byte of data from UART for sending
* back to the base station
*/
gpTxMsg->addr = 0x0000;
gpTxMsg->type = 0x00;
gpTxMsg->group = TOS_AM_GROUP;
gpTxMsg->length = 0x01;
gpTxMsg->data[0] = temp;
Result = call RadioSend.send(gpTxMsg);

if (Result != SUCCESS) {
atomic gfTxFlags = 0;
}
else {
call Leds.redToggle();
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20050925/4ba9f7b6/attachment.htm


More information about the Tinyos-help mailing list