Hi!
I have a problem with a value I will modify during my alghoritm. I
initialize the value at first of implementation like this: uint16_t
ibit_mask=0xFFFF;

Then, I receive a packet with a new value of ibit_mask and I take that with
this interface:
event TOS_MsgPtr ReceiveIbit.receive(TOS_MsgPtr msg){
   YDataMsg *payload;

   payload = (YDataMsg*)(msg->data);
   atomic ibit_mask = payload->yData.datap2.ibit;

   return msg;
}

I have a Timer of X seconds (is not important) that takes light data on each
timer repetition and send AND with data to ibit_mask, I do that like this:
async event result_t Light.dataReady(uint16_t data) {
   atomic llum=data;
   if (ibit_mask==0){
      atomic pack->xData.datap1.light = llum;
   }
   else{
      atomic pack->xData.datap1.light = llum&ibit_mask;
   }
   post SendData();
   return SUCCESS;
  }

But when I recieve a new ibit_mask, the value not refresh itself. What can I
do?

Thanks in advance,

regards!

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

Reply via email to