hi 
can any one help me finding out the problem with this code as am not getting
the data portion its coming to be 0 or 255 but should be received reading
pls suggest
event TOS_MsgPtr ReceiveMsg.receive( TOS_MsgPtr m)
  {
    PongMsg_t* _pongmsg;
    call Leds.redOff();
    _pongmsg = (PongMsg_t*)m->data;
    if( _pongmsg->src != TOS_LOCAL_ADDRESS )
    {
        pongmsg->src = _pongmsg->src;
        call CCControl.SetRFPower(RESOURCE_NONE,m->strength);
        pongmsg->src_rssi = call CCControl.GetRFPower();
        pongmsg->src_lqi = m->lqi;
        pongmsg->dest = TOS_LOCAL_ADDRESS;
        pongmsg->data[0]=m->data[0];
        if(call RadioSend.send(_pongmsg->src, sizeof(PongMsg_t),
p_msg)){call Leds.redOn();}
    }
    else {
        // send to UART
        pongmsg->src = _pongmsg->src;
        call CCControl.SetRFPower(RESOURCE_NONE,m->strength);
        pongmsg->src_rssi = call CCControl.GetRFPower();//_pongmsg->src_rssi
        pongmsg->src_lqi = _pongmsg->src_lqi;
        pongmsg->dest = _pongmsg->dest;
        pongmsg->dest_rssi = m->strength;
        pongmsg->dest_lqi = m->lqi;//TOS_UART_ADDR*/
        pongmsg->data[0]=m->data[0];
        if(call RadioSend.send(59, sizeof(PongMsg_t), p_msg)){call
Leds.redOn();}
    }
    return m;
  }

suggestion and guidance are welcomed
-- 
View this message in context: 
http://www.nabble.com/receive-function-code-tp25251883p25251883.html
Sent from the TinyOS - Help mailing list archive at Nabble.com.

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to