I dont know whether its a technical issue with PacketIndicator /
EnergyIndicator interfaces or is there something I am doing wrong. I am
trying the following code to sense the channel before sending my packet. I
want to make sure that each sender reserve the time window before sending
something so as to avoid simultaneous transmissions of frames from 2
different senders ( this is unlike BMAC in which 2 transmitters can send
simultaneously as long as the transmissions dont collide and for that it
uses backoff timer). But unfortunately even after sensing the channel for
100 msec I am still having interventions between different transmissions
even though difference between each back-to-back sending within one
transmission window is from 8-20msec.
here is the my piece of code:
atomic {
for( ccaChecks = 0; ccaChecks < 12000; ccaChecks++) {
if(call PacketIndicator.isReceiving()) {
return FALSE;
}
if(call EnergyIndicator.isReceiving()) {
detects++;
if(detects > MIN_SAMPLES_BEFORE_DETECT) {
return FALSE;
}
}
}
}
12000 equals to 100msec sensing the channel for any potential sender. Can
someone please help me in making the right use of this thing, if there is
any.
BR
Wasif Masood
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help