Hi,

I'm confused with the following code from enqueue_receive_event from UscGainInterfaerenceModelC.nc. The condition at label 1 is understandable. It checks if the power is large enough against the destination noise plus all the other transmissions to the destination. What I don't understand is the condition label 2. Why does it need to compare the power with the max destination noise? What is the variable "receiving" used for?

I have very limited knowledge in the area of radio transmission. I guess I missed some very basic concepts here. Could someone help me out with it?


Regards,
Haibin


    // If I'm off, I never receive the packet, but I need to keep track of
    // it in case I turn on and someone else starts sending me a weaker
    // packet. So I don't set receiving to 1, but I keep track of
    // the signal strength.
    if (!sim_mote_is_on(sim_node())) {
      dbg("Gain", "Lost packet from %i due to %i being off\n", source, sim_node());
      rcv->lost = 1;
    }
    else {
1    if ((sigStr + sim_gain_sensitivity()) >= power) {
         dbg("Gain", "Lost packet from %i due to power being too low (%f >= %f)\n", source, sigStr, power);
         rcv->lost = 1;
      }
      else if (receiving) {
         dbg("Gain", "Lost packet from %i due to being in the midst of a reception.\n", source);
         rcv->lost = 1;
      }
2    if (power >= sim_gain_noise_mean(sim_node()) + sim_gain_noise_range(sim_node())) {
         receiving = 1;
      }
    }

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

Reply via email to