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

Harri Siirtola harri.siirtola at vtt.fi
Mon Sep 26 02:21:59 PDT 2005


Hi Jon,

I noticed you have two return statements in HPLUART.get event. Setting the 
variable "temp" to "value" is never reached. Didn't you get any compiler 
warnings about this?

Regards,

         Harri

At 03:51 PM 9/25/2005 +0930, Jon wrote:
>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();
>     }
>   }
>_______________________________________________
>Tinyos-help mailing list
>Tinyos-help at Millennium.Berkeley.EDU
>https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help



More information about the Tinyos-help mailing list