Hello all ,

I am having some problems understanding how the OscilloscopeRF works so i
need someone to give me help with these problems...

first of all , in the StdControl.init() method i dont understand what this
line means >>

dbg(DBG_BOOT, "OSCOPE initialized\n");
   return SUCCESS;

Second ,  i don't understand the use of timer ... it is alwayz the case that
in the RF communication modules there exists timer i don't really get the
reason why ?

Third , I don't understand how this works and what is its meaning?  :

------------------------------
---------------------------------------------------------------------------

task void dataTask() {
   struct OscopeMsg *pack;
   atomic {
     pack = (struct OscopeMsg *)msg[currentMsg].data;
     packetReadingNumber = 0;
     pack->lastSampleNumber = readingNumber;
   }

   pack->channel = 1;
   pack->sourceMoteID = TOS_LOCAL_ADDRESS;

   /* Try to send the packet. Note that this will return
    * failure immediately if the packet could not be queued for
    * transmission.
    */
   if (call DataMsg.send(TOS_BCAST_ADDR, sizeof(struct OscopeMsg),
                 &msg[currentMsg]))
     {
   atomic {
     currentMsg ^= 0x1;
   }
   call Leds.yellowToggle();
     }
 }

async event result_t ADC.dataReady(uint16_t data) {
   struct OscopeMsg *pack;
   atomic {
     pack = (struct OscopeMsg *)msg[currentMsg].data;
     pack->data[packetReadingNumber++] = data;
     readingNumber++;
     dbg(DBG_USR1, "data_event\n");
     if (packetReadingNumber == BUFFER_SIZE) {
   post dataTask();
     }
   }
   if (data > 0x0300)
     call Leds.redOn();
   else
     call Leds.redOff();

   return SUCCESS;
 }
-------------------------------------------------------------------------------------


thanks for reading my post , and please help .

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

Reply via email to