Detect if the medium is busy right before sending.

This commit is contained in:
nvt-se 2007-11-12 21:17:47 +00:00
parent f192211444
commit c90a758ac5

View File

@ -420,7 +420,10 @@ PROCESS_THREAD(cc1020_sender_process, ev, data)
// Wait until the receiver is idle.
PROCESS_WAIT_UNTIL(cc1020_rxstate == CC1020_RX_SEARCHING);
// Wait for a short pseudo-random time before sending.
// Wait for the medium to become idle.
while (cc1020_carrier_sense());
// Then wait for a short pseudo-random time before sending.
clock_delay(1 + 10 * (random_rand() & 0xff));
}