I'm making a a2d sensorboard for my ecosens1 platform, a telosb variant, and
want to put two reads of a MSP430   multichannel a2d into one packet to send 
out.

I had just one task to send a message and now want to break that into two.
The near term method I am looking for is how to use the rmspkt pointer
as global?

Then after that, pkt is already a global...  I'm still confused some about that
line of code defining rmspkt.  Please correct me if this has errors:

As I understand it, rmspkt is pointer of type defined in .h file as struct MoistureSensorsMsg*, and so, when you access the struct elements with rmspkt->adc00, you change data that pkt points to also, right?

So, if rmspkt was global, I could use it in another task... which seems like a good way at the moment...

else should I do another whole line of code such as:
MoistureSensorsMsg* rmspkt2 = (MoistureSensorsMsg*) (call AMSend.getPayload(&pkt, pktlen));

in the MoistureSensorsMsgBank2() task?

=============================
  task void MoistureSensorsMsgBank1()
  {
    //09dec07jg    //cast result of .getPayload to pointer rmspkt.
MoistureSensorsMsg* rmspkt = (MoistureSensorsMsg*) (call AMSend.getPayload(&pkt, pktlen));
    rmspkt->nodeid = TOS_NODEID;
    rmspkt->timestamp = timestamp;
    //assign buffer[] elements to rmspkt  nx_struct elements.
    atomic
    {
      rmspkt->adc00 = buffer[0];
      rmspkt->adc01 = buffer[1];
      rmspkt->adc02 = buffer[2];
      rmspkt->adc03 = buffer[3];
      rmspkt->adc04 = buffer[4];
      rmspkt->adc05 = buffer[5];
    }
    //rmspkt struct is now filled with new bank1 data.
  }


==============================


Thanks,

John Griessen
--
Ecosensory
tinyOS devel on:  ubuntu Linux;   tinyOS v2.0.2;   telosb ecosens1
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to